/* =========================================================================
   The Switch Off Retreat — stylesheet
   Design direction (BUILD-SPEC Section 2): calm, warm, natural materials,
   muted earth/mountain palette matching TANA's wood aesthetic. Not a
   generic wellness-template look. System font stack only — no external
   font requests, which also keeps this GDPR/revDSG-clean (no third-party
   asset loads before consent).
   ========================================================================= */

:root {
    /* Palette — warm linen background, moss green primary, terracotta accent */
    --bg:          #FAF6EE;
    --bg-alt:      #F1E8D8;
    --bg-card:     #FFFFFF;
    --ink:         #2E2A24;
    --ink-muted:   #6E6459;
    --line:        #E4D9C3;
    --sage:        #5F6E52;
    --sage-dark:   #46523C;
    --sage-tint:   #E7ECDF;
    --clay:        #B06B42;
    --clay-dark:   #8C5330;
    --clay-tint:   #F3E4D6;
    --white:       #FFFFFF;

    --font-display: Georgia, 'Iowan Old Style', 'Palatino Linotype', 'Times New Roman', serif;
    --font-body: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;

    --radius-sm: 6px;
    --radius-md: 14px;
    --radius-lg: 28px;

    --space-1: 0.5rem;
    --space-2: 1rem;
    --space-3: 1.5rem;
    --space-4: 2.5rem;
    --space-5: 4rem;
    --space-6: 6rem;

    --shadow-card: 0 10px 30px -14px rgba(46, 42, 36, 0.25);
    --max-width: 1120px;
}

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

html { scroll-behavior: smooth; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--font-body);
    font-size: 17px;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

h1, h2, h3, h4 {
    font-family: var(--font-display);
    font-weight: 400;
    line-height: 1.15;
    margin: 0 0 var(--space-2);
    color: var(--ink);
}

h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); letter-spacing: 0.02em; }
h2 { font-size: clamp(1.6rem, 3.2vw, 2.3rem); }
h3 { font-size: 1.3rem; }

p { margin: 0 0 var(--space-2); }

a { color: var(--clay-dark); text-decoration-thickness: 1px; }
a:hover { color: var(--clay); }

.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--space-3);
}

.eyebrow {
    display: inline-block;
    font-family: var(--font-body);
    font-size: 0.78rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--sage-dark);
    margin-bottom: var(--space-1);
}

.section {
    padding: var(--space-6) 0;
}

.section--alt { background: var(--bg-alt); }

.section-head {
    max-width: 640px;
    margin: 0 0 var(--space-4);
}

.section-head--center { margin-left: auto; margin-right: auto; text-align: center; }

.lede {
    font-size: 1.15rem;
    color: var(--ink-muted);
}

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

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5em;
    padding: 0.9em 1.9em;
    border-radius: 999px;
    border: 1px solid transparent;
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.btn:hover { transform: translateY(-1px); }

.btn--primary {
    background: var(--clay);
    color: var(--white);
    box-shadow: var(--shadow-card);
}
.btn--primary:hover { background: var(--clay-dark); color: var(--white); }

.btn--outline {
    background: transparent;
    border-color: var(--ink);
    color: var(--ink);
}
.btn--outline:hover { background: var(--ink); color: var(--bg); }

.btn--block { width: 100%; }

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

.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    background: rgba(250, 246, 238, 0.92);
    backdrop-filter: saturate(140%) blur(6px);
    border-bottom: 1px solid var(--line);
}

.site-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: var(--space-2);
    padding-bottom: var(--space-2);
}

.site-header__mark {
    font-family: var(--font-display);
    font-size: 1.05rem;
    letter-spacing: 0.06em;
    color: var(--ink);
    text-decoration: none;
}

/* ---------- hero ---------- */

.hero {
    position: relative;
    overflow: hidden;
    padding: var(--space-6) 0 var(--space-5);
    text-align: center;
    background:
        radial-gradient(circle at 15% 20%, var(--sage-tint) 0%, transparent 45%),
        radial-gradient(circle at 85% 10%, var(--clay-tint) 0%, transparent 40%),
        var(--bg);
}

/* Compound selector (.img-frame.hero__bg, not just .hero__bg) is required
   here — .img-frame's own `position: relative` is defined later in this
   file at equal specificity, and would otherwise win by source order,
   silently breaking the whole overlay (this WAS a live bug: the photo
   rendered in normal flow at full height with the text pushed below it
   instead of overlaid on top — see hero fix note 2026-08-17). */
.img-frame.hero__bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    background: none; /* no sage placeholder tint behind the hero — the section's own gradient shows through until a photo loads */
}

/* No hero-location.jpg yet -> stay invisible so the original gradient hero
   design shows through untouched, instead of a placeholder swatch. */
.hero__bg.img-missing { display: none; }

.hero__overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
    background: linear-gradient(180deg, rgba(46, 42, 36, 0.35) 0%, rgba(46, 42, 36, 0.55) 100%);
}
.hero__bg.img-missing ~ .hero__overlay { display: none; }

.hero__content {
    position: relative;
    z-index: 2;
}

.hero__bg:not(.img-missing) ~ .hero__content h1,
.hero__bg:not(.img-missing) ~ .hero__content .hero__tagline {
    color: #fff;
}

.hero__tagline {
    font-size: clamp(1.1rem, 2.4vw, 1.4rem);
    color: var(--ink-muted);
    margin-bottom: var(--space-4);
}

.hero__mountains {
    display: block;
    margin: var(--space-4) auto 0;
    max-width: 640px;
    color: var(--sage);
    opacity: 0.55;
}
.hero__bg:not(.img-missing) ~ .hero__content .hero__mountains { display: none; }

/* ---------- pillars ---------- */

.pillars-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: var(--space-3);
}

.pillar-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-card);
}

.pillar-card__image {
    aspect-ratio: 4 / 3;
    background: var(--sage-tint);
}

.pillar-card__body { padding: var(--space-3); }

/* ---------- image placeholder handling ---------- */
/* Real photos are dropped in by filename per the BUILD-SPEC; until then,
   img.onerror (see main.js) swaps in this soft placeholder so a missing
   file never shows a broken-image icon. */

.img-frame { position: relative; background: var(--sage-tint); overflow: hidden; }
.img-frame img { width: 100%; height: 100%; object-fit: cover; }
.img-frame.img-missing img { display: none; }
.img-frame.img-missing::after {
    content: attr(data-placeholder-label);
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: var(--space-2);
    font-family: var(--font-display);
    font-style: italic;
    color: var(--sage-dark);
    background:
        repeating-linear-gradient(135deg, var(--sage-tint), var(--sage-tint) 12px, var(--bg-alt) 12px, var(--bg-alt) 24px);
}

/* ---------- location ---------- */

.getting-there {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: var(--space-3);
    margin-top: var(--space-3);
}

.getting-there__card {
    background: var(--bg-card);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    padding: var(--space-3);
}

/* Masonry-style via CSS columns, not a fixed grid with object-fit:cover —
   the old fixed-aspect grid cropped most of every photo regardless of
   whether it was portrait or landscape (real complaint, 2026-08-17: "most
   of the pictures is not being seen here"). Each image now keeps its own
   natural aspect ratio and just flows into balanced columns. */
.gallery {
    column-count: 3;
    column-gap: var(--space-1);
    margin-top: var(--space-4);
}
.gallery .img-frame {
    break-inside: avoid;
    margin-bottom: var(--space-1);
    border-radius: var(--radius-md);
    aspect-ratio: auto;
}
.gallery .img-frame img {
    width: 100%;
    height: auto;
    object-fit: unset;
    display: block;
}
.gallery .img-frame.img-missing {
    aspect-ratio: 4 / 3; /* only the missing-photo placeholder needs a fixed ratio */
}
@media (max-width: 720px) {
    .gallery { column-count: 2; }
}

/* ---------- hosts ---------- */

.hosts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: var(--space-3);
}

.host-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: var(--space-3);
    text-align: center;
    box-shadow: var(--shadow-card);
}

.host-card__image {
    width: 132px;
    height: 132px;
    border-radius: 50%;
    margin: 0 auto var(--space-2);
}

.host-card__role {
    color: var(--sage-dark);
    font-size: 0.92rem;
    margin-bottom: var(--space-2);
}

.social-links {
    display: flex;
    justify-content: center;
    gap: var(--space-2);
    margin-top: var(--space-2);
}
.social-links a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--sage-tint);
    color: var(--sage-dark);
}
.social-links a:hover { background: var(--sage); color: var(--white); }

/* ---------- accommodation / pricing ---------- */

.pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: var(--space-3);
}

.price-card {
    background: var(--bg-card);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    padding: var(--space-3);
    overflow: hidden;
}

.price-card__image {
    aspect-ratio: 4 / 3;
    margin: calc(var(--space-3) * -1) calc(var(--space-3) * -1) var(--space-2);
    background: var(--sage-tint);
}

.availability-note {
    margin: 0.3em 0 0.6em;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--sage-dark);
}
.availability-note--sold-out { color: var(--clay-dark); }

.price-card__meta {
    color: var(--ink-muted);
    font-size: 0.95rem;
    margin-bottom: var(--space-2);
}

.price-row {
    display: flex;
    justify-content: space-between;
    padding: 0.6em 0;
    border-top: 1px solid var(--line);
}
.price-row:first-of-type { border-top: none; }

.price-row__amount { font-family: var(--font-display); font-size: 1.15rem; }

.capacity-note {
    margin-top: var(--space-3);
    color: var(--ink-muted);
    font-size: 0.95rem;
}

/* ---------- cancellation policy ---------- */

.policy-list {
    list-style: none;
    padding: 0;
    margin: var(--space-2) 0;
}
.policy-list li {
    padding: 0.7em 0 0.7em 1.9em;
    position: relative;
    border-top: 1px solid var(--line);
}
.policy-list li:first-child { border-top: none; }
.policy-list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 1.15em;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--clay);
}
.policy-footnote { color: var(--ink-muted); font-size: 0.92rem; }

/* ---------- booking form ---------- */

.hp-field {
    position: absolute;
    left: -9999px;
    top: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.booking-panel {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: var(--space-4);
    box-shadow: var(--shadow-card);
    max-width: 720px;
    margin: 0 auto;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-2) var(--space-3);
}
.form-grid .field--full { grid-column: 1 / -1; }
@media (max-width: 640px) {
    .form-grid { grid-template-columns: 1fr; }
}

.field label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.4em;
    color: var(--ink);
}

.field input[type="text"],
.field input[type="email"],
.field input[type="tel"],
.field select,
.field textarea {
    width: 100%;
    padding: 0.75em 0.9em;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--bg);
    font-family: var(--font-body);
    font-size: 1rem;
    color: var(--ink);
}
.field input:focus, .field select:focus, .field textarea:focus {
    outline: none;
    border-color: var(--sage);
    box-shadow: 0 0 0 3px var(--sage-tint);
}
.field input.is-invalid {
    border-color: var(--clay-dark);
    background: var(--clay-tint);
}
.field-error {
    margin: 0.35em 0 0;
    font-size: 0.82rem;
    color: var(--clay-dark);
}

.pill-choice {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6em;
}
.pill-choice label {
    display: inline-flex;
    align-items: center;
    padding: 0.55em 1.1em;
    border-radius: 999px;
    border: 1px solid var(--line);
    font-size: 0.92rem;
    font-weight: 600;
    cursor: pointer;
    background: var(--bg);
}
.pill-choice input { position: absolute; opacity: 0; pointer-events: none; }
.pill-choice input:checked + span { color: var(--white); }
.pill-choice label:has(input:checked) {
    background: var(--sage);
    border-color: var(--sage);
    color: var(--white);
}
.pill-choice label.is-disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.consent-row {
    display: flex;
    align-items: flex-start;
    gap: 0.6em;
    font-size: 0.92rem;
    color: var(--ink-muted);
}
.consent-row input { margin-top: 0.3em; }

.form-message {
    border-radius: var(--radius-sm);
    padding: 0.9em 1.1em;
    margin-bottom: var(--space-2);
    font-size: 0.95rem;
}
.form-message--error { background: #F6E4DD; color: #7A2E17; }
.form-message--success { background: var(--sage-tint); color: var(--sage-dark); }

/* ---------- payment section ---------- */

.payment-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: var(--space-2);
    margin-top: var(--space-3);
}
.payment-card {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    padding: var(--space-2);
    text-align: center;
    background: var(--bg-card);
}
.payment-card img { margin: 0 auto var(--space-1); max-width: 140px; }
/* Card titles can wrap to 1 or 2 lines depending on price length — push
   the button to the same baseline across all cards regardless. */
.payment-card p { flex: 0 0 auto; }
.payment-card > a { margin-top: auto; align-self: center; }

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

.site-footer {
    background: var(--sage-dark);
    color: #EFEAE0;
    padding: var(--space-5) 0 var(--space-3);
}
.site-footer a { color: #EFEAE0; }
.site-footer a:hover { color: var(--clay-tint); }

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-3);
    margin-bottom: var(--space-4);
}

.footer-legal {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    padding-top: var(--space-2);
    border-top: 1px solid rgba(239, 234, 224, 0.2);
    font-size: 0.85rem;
    color: #C9C1B3;
}

.partners-row {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    align-items: center;
}
.partners-row img { height: 32px; width: auto; filter: grayscale(1) brightness(1.6); }

/* ---------- admin ---------- */

.admin-shell { max-width: 1100px; margin: 0 auto; padding: var(--space-4) var(--space-3); }
.admin-shell__header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-2) var(--space-4);
    margin-bottom: 1.5em;
}
.admin-shell__header h1 {
    font-size: 1.5rem; /* this is an internal tool, not the marketing hero — no need for hero-sized type */
    margin: 0;
}
.admin-table { width: 100%; border-collapse: collapse; font-size: 0.92rem; background: var(--bg-card); }
.admin-table th, .admin-table td { text-align: left; padding: 0.6em 0.8em; border-bottom: 1px solid var(--line); }
.admin-table th { background: var(--bg-alt); }
.status-pill { display: inline-block; padding: 0.2em 0.7em; border-radius: 999px; font-size: 0.8rem; font-weight: 600; }
.status-pending { background: var(--clay-tint); color: var(--clay-dark); }
.status-paid { background: var(--sage); color: var(--white); }
.status-cancelled { background: #E7E2DA; color: var(--ink-muted); }
.admin-login { max-width: 380px; margin: 10vh auto; padding: var(--space-4); background: var(--bg-card); border-radius: var(--radius-lg); box-shadow: var(--shadow-card); }
