/*
 * EduQuest site styles (Calm explorer, issue 10).
 * One cached file. Colours, type and spacing live in the tokens below, so a change there reaches every page.
 * Sections: tokens, fonts, base, buttons, header, footer, content pages, cookie banner, form messages, print.
 */

/* ---------------------------------------------------------------- tokens */

:root {
    --ink: #17302e;
    --ink-rgb: 23, 48, 46; /* --ink as numbers, for see-through shades */
    --white-rgb: 255, 255, 255;
    --teal: #1f5f5b;
    --sand: #f4ede2;
    --sand-2: #e9dfcf;
    --line: #d9cdb9;
    --accent: #9a4724; /* passes AA contrast on sand and white */
    --muted: #5b6b69;
    --white: #fff;
    --footer-text: #cfd9d7;

    --font-heading: Fraunces, Georgia, serif;
    --font-body: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;

    --radius: 22px;
    --radius-small: 12px;
    --radius-medium: 16px;
    --wrap: 1180px;
    --gutter: 16px;
    --header-space: 96px; /* the sticky header plus breathing room, for things that stick below it */
    --section: clamp(56px, 9vw, 96px);
}

/* ---------------------------------------------------------------- fonts (self-hosted, Latin subset, OFL) */

@font-face {
    font-family: Fraunces;
    font-style: normal;
    font-weight: 400 600;
    font-display: swap;
    src: url(../fonts/fraunces-latin.woff2) format("woff2");
}

@font-face {
    font-family: Inter;
    font-style: normal;
    font-weight: 400 600;
    font-display: swap;
    src: url(../fonts/inter-latin.woff2) format("woff2");
}

/* ---------------------------------------------------------------- base */

*, *::before, *::after { box-sizing: border-box; }

body {
    margin: 0;
    font: 16px/1.65 var(--font-body);
    color: var(--ink);
    background: var(--sand);
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
a:focus-visible, button:focus-visible, summary:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }

h1, h2, h3, h4 {
    font-family: var(--font-heading);
    font-weight: 600;
    line-height: 1.1;
    margin: 0 0 .5em;
}

.wrap { width: min(var(--wrap), 100% - 2 * var(--gutter)); margin-inline: auto; }

.eyebrow {
    text-transform: uppercase;
    letter-spacing: .18em;
    font-size: .78rem;
    font-weight: 600;
    color: var(--accent);
}

/* Read by screen readers, not shown */
.screen-reader-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.skip-link { position: absolute; left: -9999px; top: 8px; z-index: 20; background: var(--white); padding: 8px 16px; border-radius: var(--radius-small); }
.skip-link:focus { left: 8px; }

/* ---------------------------------------------------------------- buttons */

.btn {
    display: inline-block;
    padding: .85em 1.6em;
    border: 0;
    border-radius: 999px;
    font: 600 1rem/1.2 var(--font-body);
    text-decoration: none;
    cursor: pointer;
}
.btn-primary { background: var(--teal); color: var(--white); }
.btn-light { background: var(--white); color: var(--ink); }
.btn-outline { background: transparent; color: var(--ink); border: 1px solid var(--line); }

/* ---------------------------------------------------------------- header */

.site-header {
    position: sticky;
    top: 0;
    z-index: 10;
    background: var(--sand);
    border-bottom: 1px solid var(--line);
}
.site-header .wrap { display: flex; align-items: center; gap: 16px; padding: 14px 0; }
.site-header .logo { margin-right: auto; }
.site-header .logo img { width: auto; height: 44px; }
.site-nav { display: flex; align-items: center; gap: 28px; font-weight: 500; }
.site-nav a { text-decoration: none; }
.site-nav a:hover { color: var(--teal); }

.menu-toggle { display: none; }

@media (max-width: 760px) {
    .menu-toggle {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        padding: 10px 14px;
        border: 1px solid var(--line);
        border-radius: 999px;
        background: var(--white);
        font: 600 .95rem var(--font-body);
        color: var(--ink);
        cursor: pointer;
    }
    .menu-toggle-bars, .menu-toggle-bars::before, .menu-toggle-bars::after {
        display: block;
        width: 16px;
        height: 2px;
        background: currentColor;
        position: relative;
    }
    .menu-toggle-bars::before, .menu-toggle-bars::after { content: ""; position: absolute; left: 0; }
    .menu-toggle-bars::before { top: -5px; }
    .menu-toggle-bars::after { top: 5px; }

    .js .site-nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: 8px var(--gutter) 20px;
        background: var(--sand);
        border-bottom: 1px solid var(--line);
    }
    .site-nav a { padding: 12px 0; border-bottom: 1px solid var(--sand-2); }
    .site-nav .btn { margin-top: 12px; text-align: center; border-bottom: 0; }
    .js .site-header.is-open .site-nav { display: flex; }
    .js .site-header--over-photo .site-nav a { color: var(--ink); }
    .js .site-header--over-photo .site-nav .btn { background: var(--teal); color: var(--white); }
    /* Before site.js runs (or without JavaScript) the links wrap under the logo instead */
    .no-js .menu-toggle { display: none; }
    .no-js .site-header .wrap { flex-wrap: wrap; }
    .no-js .site-nav { flex-wrap: wrap; gap: 4px 20px; }
}

/* Homepage: the header sits over the photo and scrolls away with it */
.site-header--over-photo { position: absolute; inset: 0 0 auto; background: transparent; border-bottom: 0; color: var(--white); }
.site-header--over-photo .site-nav .btn { background: var(--white); color: var(--ink); }
/* Desktop only: on a phone a tapped link keeps its hover colour, which would vanish on the light menu panel */
@media (min-width: 761px) {
    .site-header--over-photo .site-nav a:not(.btn):hover { color: var(--sand-2); }
}

/* ---------------------------------------------------------------- footer */

.site-footer {
    background: var(--ink);
    color: var(--footer-text);
    padding: 64px 0 24px;
    margin-top: var(--section);
}
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 32px; }
.site-footer h2 { color: var(--white); font-size: 1.1rem; margin: 0 0 12px; }
.site-footer ul { list-style: none; padding: 0; margin: 0; line-height: 2; }
.site-footer a { text-decoration: none; }
.site-footer a:hover { color: var(--white); text-decoration: underline; }
.site-footer .logo { width: 120px; height: auto; margin-bottom: 16px; }
.copyright { font-size: .85rem; opacity: .7; margin: 40px auto 0; }

/* The cookie settings link is a button so it works without a URL */
.link-button { background: none; border: 0; padding: 0; font: inherit; color: inherit; cursor: pointer; }
.link-button:hover { color: var(--white); text-decoration: underline; }

@media (max-width: 760px) {
    .footer-grid { grid-template-columns: 1fr; }
}

/* ---------------------------------------------------------------- content pages (Terms, Privacy, 404) */

.page-body { padding-top: 64px; }
.page-body .wrap { max-width: 760px; }
.page-body h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); }
.page-body h2 { font-size: 1.6rem; margin-top: 1.6em; }
.page-body h3 { font-size: 1.25rem; margin-top: 1.4em; }

/* ---------------------------------------------------------------- cookie banner */

.privacy-footer {
    position: fixed;
    left: var(--gutter);
    right: var(--gutter);
    bottom: var(--gutter);
    z-index: 30;
    max-width: 720px;
    margin-inline: auto;
    padding: 20px 24px;
    background: var(--ink);
    color: var(--white);
    border-radius: var(--radius);
    box-shadow: 0 20px 50px -20px rgba(0, 0, 0, .5);
}
.privacy-content { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; }
.privacy-content > div:first-child { flex: 1 1 320px; font-size: .95rem; }
.privacy-content a { font-weight: 600; }
.privacy-buttons { display: flex; gap: 10px; }
.privacy-buttons .btn { padding: .7em 1.4em; }

/* ---------------------------------------------------------------- form messages (after a contact form submission) */

.success-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    z-index: 40;
    width: min(440px, 100% - 2 * var(--gutter));
    transform: translate(-50%, -50%);
    padding: 28px;
    background: var(--white);
    border-top: 6px solid var(--teal);
    border-radius: var(--radius);
    box-shadow: 0 30px 60px -20px rgba(var(--ink-rgb), .45);
    opacity: 0;
    visibility: hidden;
    transition: opacity .3s, visibility .3s;
}
.success-popup.error-popup { border-top-color: var(--accent); }
.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 35;
    background: rgba(var(--ink-rgb), .45);
    opacity: 0;
    visibility: hidden;
    transition: opacity .3s, visibility .3s;
}
.success-popup.show, .modal-backdrop.show { opacity: 1; visibility: visible; }

.contact-success { margin-top: 16px; padding: 16px 20px; border-radius: var(--radius-small); background: var(--white); border-left: 4px solid var(--teal); }
.contact-success.contact-error { border-left-color: var(--accent); }

/* ---------------------------------------------------------------- trip page */

.trip-hero {
    position: relative;
    display: grid;
    align-items: end;
    /* Capped so a smaller photo (London's is 850px wide) does not blow up into a blur */
    min-height: min(68vh, 560px);
    max-height: 640px;
    color: var(--white);
    overflow: hidden;
    background: var(--ink);
}
.trip-hero img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.trip-hero::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(var(--ink-rgb), .15), rgba(var(--ink-rgb), .65));
}
.trip-hero-text { position: relative; z-index: 1; padding: 120px 0 48px; }
.trip-hero h1 { font-size: clamp(2.4rem, 6vw, 4.4rem); font-weight: 400; margin-bottom: .2em; }
.trip-hero p { margin: 0; font-size: 1.1rem; }
.trip-hero .eyebrow { color: var(--white); margin-bottom: 12px; }

.trip-layout {
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: 56px;
    align-items: start;
    padding: var(--section) 0;
}
.trip-content h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); margin-top: 48px; }
.lead { font-family: var(--font-heading); font-size: clamp(1.1rem, 2vw, 1.3rem); line-height: 1.55; margin-top: 0; }

.gallery { display: grid; grid-template-columns: 2fr 1fr 1fr; grid-auto-rows: 200px; gap: 12px; margin: 32px 0; }
.gallery img { width: 100%; height: 100%; object-fit: cover; border-radius: var(--radius-medium); }
.gallery img:first-child { grid-row: span 2; }
.gallery--4 img:last-child { grid-column: span 2; }
.gallery--3 { grid-template-columns: 2fr 1fr; }
.gallery--2 { grid-template-columns: 1fr 1fr; grid-auto-rows: 280px; }
.gallery--2 img:first-child, .gallery--1 img { grid-row: auto; }
.gallery--1 { grid-template-columns: 1fr; grid-auto-rows: 360px; }

.highlights { counter-reset: highlight; list-style: none; padding: 0; margin: 0; }
.highlights li {
    counter-increment: highlight;
    display: grid;
    grid-template-columns: 56px 1fr;
    gap: 12px;
    padding: 20px 0;
    border-top: 1px solid var(--line);
}
.highlights li::before { content: counter(highlight, decimal-leading-zero); font-family: var(--font-heading); font-size: 1.6rem; color: var(--accent); }
.highlights b { display: block; font-size: 1.05rem; }

.ticks { list-style: none; padding: 0; columns: 2; gap: 24px; }
.ticks li { position: relative; padding: 6px 0 6px 28px; break-inside: avoid; }
.ticks li::before { content: "✓"; position: absolute; left: 0; color: var(--teal); font-weight: 700; }
.plain-list { padding-left: 1.1em; }

.reviews { margin-top: 48px; }
.reviews figure { background: var(--white); border-radius: var(--radius-medium); padding: 24px; margin: 0 0 16px; }
.reviews blockquote { margin: 0 0 10px; font-family: var(--font-heading); font-size: 1.1rem; }
.reviews figcaption { color: var(--accent); font-size: .9rem; }

.book-card {
    position: sticky;
    top: var(--header-space);
    background: var(--white);
    border-radius: var(--radius);
    padding: 28px;
    box-shadow: 0 20px 50px -30px rgba(var(--ink-rgb), .35);
}
.price { font-family: var(--font-heading); font-size: 1.9rem; color: var(--teal); margin: 0; }
.price small { font-family: var(--font-body); font-size: .85rem; color: var(--muted); }
.price-note { font-size: .85rem; color: var(--muted); margin: 4px 0 0; }
.book-card dl { margin: 20px 0; }
.book-card dl div { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--sand-2); }
.book-card dt { color: var(--muted); }
.book-card dd { margin: 0; text-align: right; font-weight: 500; }
.book-actions { display: grid; gap: 10px; }
.book-actions .btn { text-align: center; }

.trip-pricebar { display: none; }

@media (max-width: 960px) {
    .trip-layout { grid-template-columns: 1fr; gap: 40px; padding-top: 32px; }
    .book-card { position: static; }
    .trip-pricebar {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 16px;
        padding: 20px 0;
        border-bottom: 1px solid var(--line);
    }
    .trip-pricebar .price { font-size: 1.5rem; }
    .trip-pricebar .btn { white-space: nowrap; }
    .gallery, .gallery--3 { grid-template-columns: 1fr 1fr; grid-auto-rows: 160px; }
    .gallery img:first-child { grid-column: span 2; grid-row: auto; }
    .gallery--4 img:last-child { grid-column: auto; }
    .gallery--4 img:nth-child(2) { grid-column: span 2; }
    .ticks { columns: 1; }
}

/* ---------------------------------------------------------------- trip list (trip list page and homepage) */

.page-intro { padding: var(--section) 0 8px; }
.page-intro h1 { font-size: clamp(2.4rem, 5vw, 3.6rem); }
.page-intro p { color: var(--muted); max-width: 560px; margin: 0; font-size: 1.1rem; }
.trip-rows { padding-bottom: var(--section); }
.trip-rows > h2 { font-size: clamp(2rem, 4vw, 3rem); padding-top: var(--section); }

.trip-row {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 48px;
    align-items: center;
    padding: 40px 0;
    border-top: 1px solid var(--line);
}
.trip-row:nth-of-type(even) .trip-photo { order: 2; }
.trip-photo { display: block; border-radius: var(--radius); overflow: hidden; aspect-ratio: 4 / 3; }
.trip-photo img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s; }
.trip-row:hover .trip-photo img { transform: scale(1.03); }
.trip-row h2, .trip-row h3 { font-size: clamp(1.8rem, 3vw, 2.6rem); margin-bottom: .3em; }
.trip-row h2 a, .trip-row h3 a { text-decoration: none; }
.trip-row .meta { color: var(--muted); font-size: .92rem; }
.trip-row .price-note { margin-bottom: 20px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 12px; }
.tag { font-size: .78rem; font-weight: 600; background: var(--sand-2); border-radius: 999px; padding: .25em .8em; }

@media (max-width: 860px) {
    .trip-row { grid-template-columns: 1fr; gap: 20px; }
    .trip-row:nth-of-type(even) .trip-photo { order: 0; }
}

/* ---------------------------------------------------------------- homepage */

.home-hero {
    position: relative;
    display: grid;
    place-items: center;
    min-height: min(92vh, 860px);
    text-align: center;
    color: var(--white);
    overflow: hidden;
    background: var(--ink);
}
.home-hero img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.home-hero::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(var(--ink-rgb), .6), rgba(var(--ink-rgb), .3) 40%, rgba(var(--ink-rgb), .6));
}
.home-hero-text { position: relative; z-index: 1; padding: 120px var(--gutter) 64px; max-width: 840px; }
.home-hero .eyebrow { color: var(--white); margin-bottom: 16px; }
.home-hero h1 { font-size: clamp(2.4rem, 6vw, 4.6rem); font-weight: 400; }
.home-hero-text > p:not(.eyebrow) { font-size: 1.15rem; max-width: 620px; margin: 0 auto 28px; }
.chips {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    max-width: 720px;
    margin: auto;
    padding: 10px;
    border-radius: var(--radius);
    background: rgba(var(--white-rgb), .92);
}
.chips a { padding: .5em 1em; border-radius: 999px; background: var(--sand); color: var(--ink); text-decoration: none; font-size: .92rem; font-weight: 500; }
.chips a:hover { background: var(--teal); color: var(--white); }

.home-section { padding-top: var(--section); }
.home-section h2, .audience h2 { font-size: clamp(2rem, 4vw, 3rem); }
.home-intro { display: grid; grid-template-columns: 1.2fr 1fr; gap: 64px; align-items: center; }
.home-intro .eyebrow, .audience .eyebrow { margin-bottom: 12px; }
.facts {
    display: grid;
    gap: 1px;
    margin: 0;
    background: var(--line);
    border: 1px solid var(--line);
    border-radius: var(--radius-medium);
    overflow: hidden;
}
.facts div { display: flex; align-items: baseline; gap: 16px; background: var(--sand); padding: 18px 22px; }
.facts dt { flex: 0 0 auto; font-family: var(--font-heading); font-size: 1.9rem; font-weight: 600; color: var(--teal); line-height: 1.2; }
.facts dd { margin: 0; font-size: .9rem; color: var(--muted); }

.home-audiences { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.audience { background: var(--white); border-radius: var(--radius); padding: 40px; scroll-margin-top: var(--header-space); }
.audience .ticks { columns: 1; margin-bottom: 24px; }

.faq details { border-top: 1px solid var(--line); padding: 18px 0; }
.faq details:last-child { border-bottom: 1px solid var(--line); }
.faq summary { font-family: var(--font-heading); font-size: 1.25rem; cursor: pointer; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+" / ""; color: var(--teal); }
.faq details[open] summary::after { content: "–" / ""; }
.faq details p { margin: .6em 0 0; color: var(--muted); max-width: 760px; }
#faq, #trips { scroll-margin-top: var(--header-space); }

.cta-band {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 48px;
    align-items: center;
    padding: 56px;
    border-radius: var(--radius);
    background: var(--teal);
    color: var(--white);
}
.cta-band h2 { font-size: clamp(2rem, 4vw, 3rem); }
.cta-band .contact-form { background: var(--white); color: var(--ink); }

@media (max-width: 860px) {
    .home-intro, .home-audiences, .cta-band { grid-template-columns: 1fr; gap: 32px; }
    .audience { padding: 28px; }
    .cta-band { padding: 32px 20px; }
}

/* ---------------------------------------------------------------- contact form (homepage and contact page) */

.contact-form { display: grid; gap: 16px; padding: 28px; border-radius: var(--radius); }
.contact-form .form-group { display: grid; gap: 6px; }
.contact-form label { font-weight: 500; font-size: .92rem; }
.contact-form input, .contact-form select, .contact-form textarea {
    font: inherit;
    padding: .8em 1em;
    border: 1px solid var(--line);
    border-radius: var(--radius-small);
    background: var(--sand);
    color: var(--ink);
}
.contact-form .btn { justify-self: start; }
.contact-form .field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.contact-form .form-note { margin: 0; font-size: .85rem; color: var(--muted); }

.contact-page {
    display: grid;
    grid-template-columns: 1fr 1.1fr;
    gap: 64px;
    align-items: start;
    padding: var(--section) 0;
}
.contact-page h1 { font-size: clamp(2.4rem, 5vw, 3.8rem); margin-top: 12px; }
.contact-page .contact-form { background: var(--white); padding: 36px; }
.contact-page .contact-success { margin: 0 0 16px; }

.not-found { padding-bottom: var(--section); }
.not-found .actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }

@media (max-width: 860px) {
    .contact-page { grid-template-columns: 1fr; gap: 32px; }
    .contact-page .contact-form { padding: 24px; }
    .contact-form .field-row { grid-template-columns: 1fr; }
}

/* ---------------------------------------------------------------- print */

@media print {
    .site-header, .site-footer, .privacy-footer, .success-popup, .modal-backdrop { display: none !important; }
    body { background: var(--white); }
    /* A trip prints as a handout: facts, highlights, includes, what to bring */
    .trip-hero { min-height: 0; color: var(--ink); background: none; }
    .trip-hero img, .trip-hero::after, .gallery, .reviews, .trip-pricebar, .trip-page .btn { display: none !important; }
    .trip-hero-text { padding: 0; }
    .trip-layout { grid-template-columns: 1fr; padding: 16px 0; }
    .book-card { position: static; box-shadow: none; padding: 0; order: -1; }
}
