/* ==========================================================================
   Ferholix — base styles (brand tokens, reset, shared header + footer).
   Phase 1: chrome only. Page-body styles arrive with their own phases.
   Mobile-first; checked at 375px and 390px.
   ========================================================================== */

:root {
    /* Brand tokens — CLAUDE.md §Brand tokens */
    --ink:        #0B0B0A;   /* page background */
    --ink-2:      #151412;   /* card/section background */
    --gold:       #D9A84A;   /* primary accent */
    --gold-dim:   #C99A3D;   /* secondary accent / hover */
    --cream:      #F4F1EA;   /* primary text */
    --cream-dim:  #B9B4A6;   /* secondary text */

    --font-display: "Fraunces", Georgia, "Times New Roman", serif;
    --font-body:    "Manrope", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;

    --header-h: 96px;
    --wrap:     1200px;
    --radius:   10px;
    --ease:     cubic-bezier(.4, 0, .2, 1);
}

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

html { scroll-behavior: smooth; }

body {
    margin: 0;
    background: var(--ink);
    color: var(--cream);
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

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

a { color: inherit; text-decoration: none; }

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

:focus-visible {
    outline: 2px solid var(--gold);
    outline-offset: 2px;
    border-radius: 3px;
}

/* Skip link — visible only when focused */
.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    z-index: 1000;
    background: var(--gold);
    color: var(--ink);
    padding: .6rem 1rem;
    font-weight: 600;
}
.skip-link:focus {
    left: 1rem;
    top: 1rem;
}

/* --------------------------------------------------------------- Button -- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .4em;
    padding: .7rem 1.25rem;
    border-radius: 999px;
    font-weight: 600;
    font-size: .95rem;
    letter-spacing: .01em;
    cursor: pointer;
    border: 1px solid transparent;
    transition: background-color .2s var(--ease), color .2s var(--ease),
                border-color .2s var(--ease), transform .1s var(--ease);
}
.btn--gold {
    background: var(--gold);
    color: var(--ink);
}
.btn--gold:hover { background: var(--gold-dim); }
.btn--gold:active { transform: translateY(1px); }

/* ================================================================ HEADER == */
.site-header {
    position: fixed;
    inset: 0 0 auto 0;
    z-index: 100;
    height: var(--header-h);
    display: flex;
    align-items: center;
    transition: background-color .3s var(--ease), border-color .3s var(--ease),
                backdrop-filter .3s var(--ease);
    background: transparent;
    border-bottom: 1px solid transparent;
}
/* Faint top scrim so cream logo/nav/hamburger stay legible over a bright hero
   photo while the header is transparent; fades out once it goes solid. */
.site-header::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(to bottom, rgba(11, 11, 10, .55), rgba(11, 11, 10, 0));
    transition: opacity .3s var(--ease);
}
.site-header.scrolled::before,
.site-header[data-transparent="false"]::before { opacity: 0; }
.site-header__inner { position: relative; z-index: 1; }
/* Solid state — set by JS on scroll, and always-on when the page opts out of a
   transparent-over-hero header via data-transparent="false". */
.site-header.scrolled,
.site-header[data-transparent="false"] {
    background: rgba(11, 11, 10, .92);
    -webkit-backdrop-filter: saturate(140%) blur(10px);
    backdrop-filter: saturate(140%) blur(10px);
    border-bottom-color: rgba(217, 168, 74, .18);
}

.site-header__inner {
    width: min(var(--wrap), 100%);
    margin-inline: auto;
    padding-inline: clamp(1rem, 4vw, 2rem);
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Brand ------------------------------------------------------------------- */
.brand {
    display: inline-flex;
    align-items: center;
    margin-right: auto; /* pushes nav + cta to the right */
}
.brand__logo {
    height: 68px;
    width: auto;
    display: block;
    object-fit: contain; /* transparent horizontal lockup — never crop */
}

/* Desktop nav ------------------------------------------------------------- */
.nav__list {
    display: flex;
    align-items: center;
    gap: clamp(.75rem, 1.6vw, 1.5rem);
    list-style: none;
    margin: 0;
    padding: 0;
}
.nav__link {
    position: relative;
    color: var(--cream-dim);
    font-weight: 500;
    font-size: .95rem;
    padding: .35rem 0;
    transition: color .2s var(--ease);
}
.nav__link:hover { color: var(--cream); }
.nav__link.active { color: var(--gold); }
.nav__link.active::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -2px;
    width: 100%;
    height: 2px;
    background: var(--gold);
    border-radius: 2px;
}

.nav__cta { margin-left: .5rem; }

/* Dropdown nav item (Services) — desktop. Opens on hover + keyboard focus. */
.nav__item--dropdown { position: relative; }
.nav__item--dropdown > .nav__link { display: inline-flex; align-items: center; gap: .28rem; }
.nav__caret { transition: transform .2s var(--ease); margin-top: 1px; }
/* invisible hover bridge so the pointer can cross the gap to the submenu */
.nav__item--dropdown::after { content: ""; position: absolute; top: 100%; left: -.5rem; right: -.5rem; height: 16px; }
.nav__submenu {
    position: absolute; top: calc(100% + 12px); left: 50%; transform: translateX(-50%) translateY(6px);
    min-width: 230px; margin: 0; padding: .45rem; list-style: none;
    background: rgba(21, 20, 18, .98); border: 1px solid rgba(217, 168, 74, .2);
    border-radius: 12px; box-shadow: 0 24px 60px rgba(0, 0, 0, .5);
    -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
    opacity: 0; visibility: hidden; z-index: 120;
    transition: opacity .2s var(--ease), transform .2s var(--ease), visibility .2s var(--ease);
}
.nav__item--dropdown:hover .nav__submenu,
.nav__item--dropdown:focus-within .nav__submenu {
    opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0);
}
.nav__item--dropdown:hover .nav__caret,
.nav__item--dropdown:focus-within .nav__caret { transform: rotate(180deg); }
.nav__submenu-link {
    display: block; padding: .6rem .8rem; border-radius: 8px;
    color: var(--cream-dim); font-size: .95rem; font-weight: 500; white-space: nowrap;
    transition: background-color .15s var(--ease), color .15s var(--ease);
}
.nav__submenu-link:hover { background: rgba(217, 168, 74, .12); color: var(--gold); }

/* Hamburger --------------------------------------------------------------- */
.nav-toggle {
    display: none; /* shown at mobile breakpoint */
    background: transparent;
    border: 0;
    color: var(--cream);
    padding: .3rem;
    cursor: pointer;
    line-height: 0;
}

/* ================================================================ DRAWER == */
.drawer-backdrop {
    position: fixed;
    inset: 0;
    z-index: 110;
    background: rgba(0, 0, 0, .55);
    opacity: 0;
    transition: opacity .25s var(--ease);
}
.drawer-backdrop.is-open { opacity: 1; }

.drawer {
    position: fixed;
    top: 0;
    right: 0;
    z-index: 120;
    height: 100dvh;
    width: min(84vw, 340px);
    background: var(--ink-2);
    border-left: 1px solid rgba(217, 168, 74, .18);
    transform: translateX(100%);
    transition: transform .28s var(--ease);
    display: flex;
    flex-direction: column;
    padding: 1rem 1.25rem 2rem;
    overflow-y: auto;
}
.drawer.is-open { transform: translateX(0); }

.drawer__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}
.drawer__title {
    font-family: var(--font-display);
    font-size: 1.1rem;
    color: var(--cream-dim);
}
.drawer__close {
    background: transparent;
    border: 0;
    color: var(--cream);
    padding: .3rem;
    cursor: pointer;
    line-height: 0;
}
.drawer__list {
    list-style: none;
    margin: 0 0 1.25rem;
    padding: 0;
    display: flex;
    flex-direction: column;
}
.drawer__link {
    display: block;
    padding: .85rem .25rem;
    font-size: 1.05rem;
    font-weight: 500;
    color: var(--cream);
    border-bottom: 1px solid rgba(255, 255, 255, .06);
}
.drawer__link.active { color: var(--gold); }
/* Drawer submenu (Services) — mobile expandable group */
.drawer__group { display: flex; align-items: center; border-bottom: 1px solid rgba(255,255,255,.06); }
.drawer__group .drawer__link { flex: 1; border-bottom: 0; }
.drawer__submenu-toggle {
    background: transparent; border: 0; color: var(--cream-dim); cursor: pointer;
    padding: .5rem; display: grid; place-items: center; line-height: 0;
}
.drawer__submenu-toggle svg { transition: transform .2s var(--ease); }
.drawer__submenu-toggle[aria-expanded="true"] svg { transform: rotate(180deg); }
.drawer__submenu { list-style: none; margin: 0; padding: .25rem 0 .5rem 1rem; }
.drawer__submenu[hidden] { display: none; }
.drawer__sublink { display: block; padding: .6rem .25rem; color: var(--cream-dim); font-size: .98rem; border-bottom: 1px solid rgba(255,255,255,.04); }
.drawer__sublink:last-child { border-bottom: 0; }
.drawer__sublink:hover { color: var(--gold); }
.drawer__cta { width: 100%; }

/* ================================================================ FOOTER == */
.site-footer {
    background: var(--ink-2);
    border-top: 1px solid rgba(217, 168, 74, .16);
    color: var(--cream-dim);
    margin-top: 4rem;
}
.site-footer__inner {
    width: min(var(--wrap), 100%);
    margin-inline: auto;
    padding: 3rem clamp(1rem, 4vw, 2rem) 2rem;
    display: grid;
    gap: 2.5rem;
    grid-template-columns: 1fr;
}
.brand--footer { margin-right: 0; margin-bottom: 1rem; }
.brand--footer .brand__logo { height: 80px; }
.site-footer__blurb {
    max-width: 32ch;
    margin: 0 0 1.25rem;
    font-size: .95rem;
}

.social {
    display: flex;
    gap: .75rem;
    list-style: none;
    margin: 0;
    padding: 0;
}
.social__link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, .12);
    color: var(--cream-dim);
    transition: color .2s var(--ease), border-color .2s var(--ease);
}
.social__link:hover {
    color: var(--gold);
    border-color: var(--gold);
}

.site-footer__cols {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.75rem;
}
.footer-col__title {
    font-family: var(--font-body);
    font-size: .8rem;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--gold);
    margin: 0 0 .85rem;
}
.footer-col ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: .55rem;
}
.footer-col a {
    font-size: .95rem;
    color: var(--cream-dim);
    transition: color .2s var(--ease);
}
.footer-col a:hover { color: var(--cream); }

.site-footer__contact { font-size: .95rem; }
.site-footer__addr { margin: 0 0 .35rem; color: var(--cream); }
.site-footer__contact a:hover { color: var(--gold); }

.site-footer__bar {
    border-top: 1px solid rgba(255, 255, 255, .07);
    text-align: center;
    font-size: .85rem;
    padding: 1.25rem 1rem;
}
.site-footer__bar p { margin: 0; }

/* ==================================================== SHARED UTILITIES == */
/* Layout/typography helpers + the listing card, used across every page. */
.wrap { width: min(var(--wrap), 100%); margin-inline: auto; padding-inline: clamp(1rem, 4vw, 2rem); }

.section { padding: clamp(3rem, 7vw, 5.5rem) 0; }
.section--alt { background: var(--ink-2); }

.section__head { max-width: 60ch; margin: 0 auto clamp(1.75rem, 4vw, 2.75rem); text-align: center; }
.section__title { font-size: clamp(1.6rem, 4.2vw, 2.5rem); }
.section__sub { color: var(--cream-dim); margin: 0; font-size: 1.02rem; }

.eyebrow {
    display: inline-flex; align-items: center; gap: .45rem;
    color: var(--gold); font-weight: 600; font-size: .82rem;
    letter-spacing: .12em; text-transform: uppercase; margin: 0 0 .75rem;
}
.eyebrow--light { color: var(--cream); }
.eyebrow svg { color: var(--gold); }

.btn--ghost {
    background: transparent; color: var(--cream);
    border-color: rgba(244, 241, 234, .28);
}
.btn--ghost:hover { border-color: var(--gold); color: var(--gold); }
.btn--lg { padding: .95rem 1.9rem; font-size: 1.05rem; }

/* Branded gradient placeholders (stand in for not-yet-sourced imagery). */
.ph-concierge { background: linear-gradient(135deg, #1a1712 0%, #2b2419 45%, #4a3c20 100%); }
.ph-designs   { background: linear-gradient(135deg, #14140f 0%, #23241a 45%, #3f4327 100%); }
.ph-homes     { background: linear-gradient(135deg, #151412 0%, #26221c 50%, #4a3a22 100%); }

/* Listing card — shared by the home preview and fhhomes/rooms.php. */
.listing-card {
    background: var(--ink-2); border: 1px solid rgba(244,241,234,.08);
    border-radius: var(--radius); overflow: hidden;
}
.section--alt .listing-card { background: var(--ink); }
.listing-card__media { position: relative; display: block; aspect-ratio: 3 / 2; }
.listing-card__media img { width: 100%; height: 100%; object-fit: cover; }
.listing-card__rate {
    position: absolute; left: .85rem; bottom: .85rem;
    background: rgba(11,11,10,.82); color: var(--cream);
    padding: .35rem .7rem; border-radius: 999px; font-weight: 700; font-size: 1rem;
}
.listing-card__rate small { font-weight: 500; color: var(--cream-dim); }
.listing-card__body { padding: 1.25rem; }
.listing-card__title { font-size: 1.3rem; margin: 0 0 .3rem; }
.listing-card__loc { display: flex; align-items: center; gap: .35rem; color: var(--cream-dim); margin: 0 0 .9rem; font-size: .95rem; }
.listing-card__specs {
    list-style: none; margin: 0 0 1.1rem; padding: 0;
    display: flex; gap: 1rem; flex-wrap: wrap; color: var(--cream-dim); font-size: .92rem;
}
.listing-card__specs li { display: inline-flex; align-items: center; gap: .35rem; }
.listing-card__specs svg { color: var(--gold); }
.listing-card__cta { width: 100%; }

/* Amenity chip — shared by the home amenities strip and the listing page.
   Default sits on the ink page background (listing); inside a section--alt
   (home strip) it darkens to keep contrast against the ink-2 section. */
.amenity {
    display: flex; align-items: center; gap: .75rem;
    background: var(--ink-2); border: 1px solid rgba(244,241,234,.08);
    border-radius: var(--radius); padding: 1rem 1.1rem; font-weight: 500;
}
.section--alt .amenity { background: var(--ink); }
.amenity__icon { display: inline-grid; place-items: center; color: var(--gold); flex: none; }

/* Pillar cards — shared by home, about, and services. Background flips by
   context so cards stay legible on both the ink page and an ink-2 section. */
.pillars__grid { display: grid; grid-template-columns: 1fr; gap: 1.25rem; }
.pillar {
    display: block; background: var(--ink-2); border: 1px solid rgba(244,241,234,.08);
    border-radius: var(--radius); padding: 1.75rem;
    transition: border-color .2s var(--ease), transform .2s var(--ease);
}
.section--alt .pillar { background: var(--ink); }
a.pillar:hover { border-color: rgba(217,168,74,.5); transform: translateY(-3px); }
.pillar__icon {
    display: inline-grid; place-items: center; width: 52px; height: 52px;
    border-radius: 12px; color: var(--gold);
    background: rgba(217,168,74,.12); margin-bottom: 1rem;
}
.pillar__title { font-size: 1.35rem; margin: 0 0 .5rem; }
.pillar__text { color: var(--cream-dim); margin: 0 0 1rem; }
.pillar__link { display: inline-flex; align-items: center; gap: .4rem; color: var(--gold); font-weight: 600; font-size: .95rem; }
@media (min-width: 780px) { .pillars__grid { grid-template-columns: repeat(3, 1fr); } }

/* Closing CTA band — shared by the home and concierge pages. */
.cta-band {
    text-align: center; padding: clamp(3.5rem, 8vw, 6rem) 0;
    background: radial-gradient(120% 140% at 50% 0%, rgba(217,168,74,.18) 0%, rgba(11,11,10,0) 60%), var(--ink-2);
}
.cta-band__title { font-size: clamp(1.8rem, 5vw, 3rem); margin: 0 0 .5rem; }
.cta-band__sub { color: var(--cream-dim); margin: 0 0 1.75rem; font-size: 1.1rem; }

/* Not-found block — shared by listing.php and homedesigns/category.php. */
.listing-missing { padding-top: calc(var(--header-h) + 4rem); text-align: center; }
.listing-missing__inner { max-width: 46ch; margin-inline: auto; }
.listing-missing__title { font-size: clamp(1.6rem, 4.5vw, 2.4rem); margin: 0 0 .75rem; }
.listing-missing__text { color: var(--cream-dim); margin: 0 0 1.75rem; }

/* Interior page-header band — cleared below the fixed solid header. Shared by
   fhhomes/rooms.php, concierge/contact.php, and other interior pages. */
.rooms-head {
    padding: calc(var(--header-h) + clamp(2rem, 6vw, 3.5rem)) 0 clamp(1.5rem, 4vw, 2.5rem);
    background:
        radial-gradient(120% 160% at 80% -20%, rgba(217, 168, 74, .14) 0%, rgba(11, 11, 10, 0) 55%),
        var(--ink-2);
    border-bottom: 1px solid rgba(244, 241, 234, .07);
}
.rooms-head__inner { max-width: 60ch; }
.rooms-head__title { font-size: clamp(2rem, 6vw, 3.25rem); margin: 0 0 .6rem; }
.rooms-head__sub { color: var(--cream-dim); font-size: 1.08rem; margin: 0 0 1rem; }
.rooms-head__count {
    display: inline-block; margin: 0;
    color: var(--gold); font-weight: 600; font-size: .9rem;
    letter-spacing: .04em;
}

/* Forms — shared enquiry/contact form component. */
.form { display: grid; gap: 1.1rem; }
.form__row { display: grid; gap: 1.1rem; }
@media (min-width: 620px) { .form__row { grid-template-columns: 1fr 1fr; } }
.field { display: grid; gap: .4rem; }
.field > label { font-size: .9rem; font-weight: 600; color: var(--cream); }
.field .req { color: var(--gold); }
.field input,
.field select,
.field textarea {
    width: 100%; font: inherit; color: var(--cream);
    background: var(--ink); border: 1px solid rgba(244,241,234,.16);
    border-radius: 10px; padding: .75rem .9rem;
    transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.field textarea { min-height: 130px; resize: vertical; }
.field input::placeholder,
.field textarea::placeholder { color: var(--cream-dim); opacity: .7; }
.field input:focus,
.field select:focus,
.field textarea:focus {
    outline: none; border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(217,168,74,.2);
}
.field--error input,
.field--error select,
.field--error textarea { border-color: #d9534f; }
.field__error { color: #e78b87; font-size: .82rem; }
/* honeypot: hidden from real users */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-note { color: var(--cream-dim); font-size: .85rem; margin: 0; }
.form-alert {
    background: rgba(217,83,79,.12); border: 1px solid rgba(217,83,79,.4);
    color: #f0b3b1; border-radius: 10px; padding: .8rem 1rem; font-size: .9rem;
}
.form-success {
    display: flex; gap: .9rem; align-items: flex-start;
    background: var(--ink-2); border: 1px solid rgba(217,168,74,.3);
    border-radius: var(--radius); padding: 1.5rem;
}
.form-success svg { color: var(--gold); flex: none; margin-top: .15rem; }
.form-success h3 { margin: 0 0 .35rem; font-size: 1.3rem; }
.form-success p { margin: 0; color: var(--cream-dim); }

/* Contact/enquiry two-column layout — shared by every section's contact page. */
.contact-wrap { max-width: 1040px; }
.contact-grid { display: grid; grid-template-columns: 1fr; gap: 2.5rem; }
.contact-intro .section__title { text-align: left; }
.contact-points {
    list-style: none; margin: 1.5rem 0 0; padding: 0; display: grid; gap: .85rem;
}
.contact-points li { display: flex; align-items: center; gap: .6rem; color: var(--cream); }
.contact-points svg { color: var(--gold); flex: none; }
@media (min-width: 860px) {
    .contact-grid { grid-template-columns: 0.85fr 1.15fr; gap: 3.5rem; align-items: start; }
}

/* ============================================================ RESPONSIVE == */

/* Desktop / tablet layout */
@media (min-width: 860px) {
    .site-footer__inner {
        grid-template-columns: 1.4fr 2fr 1fr;
        align-items: start;
    }
    .site-footer__cols { grid-template-columns: repeat(4, 1fr); }
}

/* Mobile: hide desktop nav + CTA, show hamburger */
@media (max-width: 859px) {
    .nav,
    .nav__cta { display: none; }
    .nav-toggle { display: inline-flex; }
}

/* Respect reduced-motion preferences */
@media (prefers-reduced-motion: reduce) {
    * { transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
