/* =======================================================================
   site.css — shared/common styles used across EVERY page.
   Loaded once by layouts/main.php. Individual views (home.php, about.php,
   books.php, etc.) should only contain styles for elements unique to that
   page — the homepage's <style> block has been cleaned up accordingly.
   ======================================================================= */

:root{
    --cream:#FBF6F1;
    --ink:#4B4038;
    --ink-soft:#7A6E63;
    --rose:#E8B9BE;
    --rose-deep:#C98A93;
    --sage:#b2ca9f;
    --sage-deep:#87A177;
    --green-deep:#14532d;
    --gold:#D9B98A;
    --blush:#F6E4E2;
    --sand:#EFE6D8;
    --white:#ffffff;
    --line:rgba(75,64,56,.14);
    --header-h:88px;
    --header-h-scrolled:64px;
}

/* ---------------- Background / text / border utility classes ---------------- */
.bg-cream{ background-color:var(--cream) !important; }
.bg-rose{ background-color:var(--rose) !important; }
.bg-rose-deep{ background-color:var(--rose-deep) !important; }
.bg-sage{ background-color:var(--sage) !important; }
.bg-sage-deep{ background-color:var(--sage-deep) !important; }
.bg-gold{ background-color:var(--gold) !important; }
.bg-blush{ background-color:var(--blush) !important; }
.bg-sand{ background-color:var(--sand) !important; }

.text-ink{ color:var(--ink) !important; }
.text-ink-soft{ color:var(--ink-soft) !important; }
.text-rose{ color:var(--rose) !important; }
.text-rose-deep{ color:var(--rose-deep) !important; }
.text-sage{ color:var(--sage) !important; }
.text-sage-deep{ color:var(--sage-deep) !important; }
.text-gold{ color:var(--gold) !important; }
.text-white{ color:var(--white) !important; }
.text-cream{ color:var(--cream) !important; }

.border-theme{ border-color:var(--line) !important; }
.border-rose{ border-color:var(--rose) !important; }
.border-sage{ border-color:var(--sage) !important; }
.border-gold{ border-color:var(--gold) !important; }

/* ---------------- Reset / base ---------------- */
*{box-sizing:border-box;margin:0;padding:0;}
html{scroll-behavior:smooth;}
body{
    background:var(--cream);
    color:var(--ink);
    font-family:'Jost',sans-serif;
    font-weight:400;
    font-size:17px;
    line-height:1.75;
    -webkit-font-smoothing:antialiased;
}
h1,h2,h3,.serif{font-family:'Cormorant Garamond',serif;font-weight:500;}
a{color:inherit;text-decoration:none;}
img{max-width:100%;display:block;}
.wrap{max-width:1240px;margin:0 auto;padding:0 40px;}
.eyebrow{
    font-size:12.5px;
    letter-spacing:.28em;
    text-transform:uppercase;
    color:var(--ink-soft);
}
/* Narrower side padding on small phones so content isn't overly squeezed
   (this used to be inconsistently overridden per-page — now it's one rule
   that applies everywhere). */
@media (max-width:480px){
    .wrap{ padding:0 20px; }
}
@media (prefers-reduced-motion: reduce){*{animation:none !important;transition:none !important;}}

/* ---------------- Header ---------------- */
header{
    position:fixed; top:0; left:0; right:0; z-index:50;
    height:var(--header-h);
    display:flex;
    align-items:center;
    box-shadow:0 1px 0 var(--line);
    transition:height .35s ease, box-shadow .35s ease;
}
header.scrolled{
    height:var(--header-h-scrolled);
    box-shadow:0 1px 0 var(--line), 0 6px 18px -10px rgba(75,64,56,.25);
}
header .wrap{
    width:100%;
    display:grid;
    grid-template-columns:1fr auto 1fr;
    align-items:center;
    gap:40px;
}
.brand{
    grid-column:2;
    font-family:'Cormorant Garamond',serif;
    font-style:italic;
    font-weight:500;
    font-size:26px;
    color:var(--ink);
    text-align:center;
    white-space:nowrap;
}
.brand-logo{display:inline-flex; align-items:center;}
.brand-logo img{
    height:58px!important;
    width:auto;
    transition:height .35s ease;
}
header.scrolled .brand-logo img{height:40px!important;}
.nav-side{list-style:none;display:flex;gap:44px; align-items:center;}
.nav-left{grid-column:1; justify-content:flex-end;}
.nav-right{grid-column:3; justify-content:flex-start;}
.nav-side a{
    font-size:14.5px;
    letter-spacing:.2em;
    text-transform:uppercase;
    color:var(--ink);
    padding-bottom:5px;
    border-bottom:1px solid transparent;
    transition:border-color .2s ease;
    white-space:nowrap;
}
.nav-side a.active{
    border-color: currentColor; /* or whatever "current page" style you actually want */
}
.nav-toggle{
    display:none;
    grid-column:3;
    justify-self:end;
    background:none;border:0;font-size:22px;color:var(--ink);cursor:pointer;
}

/* Transparent header — used on the homepage hero. header.php's JS already
   sets data-transparent="1" and swaps the logo image; this is the missing
   piece that makes the bar itself see-through and the text/icons white
   until the visitor scrolls (header.scrolled) or opens the mobile menu.
   NOTE: this is the ONLY place transparent-header behaviour is defined —
   the homepage no longer keeps its own competing copy of this. */
header[data-transparent="1"]:not(.scrolled):not(.nav-open){
    background:transparent;
    box-shadow:none;
}
header[data-transparent="1"]:not(.scrolled):not(.nav-open) .brand,
header[data-transparent="1"]:not(.scrolled):not(.nav-open) .nav-side a,
header[data-transparent="1"]:not(.scrolled):not(.nav-open) .nav-toggle,
header[data-transparent="1"]:not(.scrolled):not(.nav-open) .cart-link,
header[data-transparent="1"]:not(.scrolled):not(.nav-open) .profile-link{
    color:#fff;
}
header[data-transparent="1"]:not(.scrolled):not(.nav-open) .cart-link svg,
header[data-transparent="1"]:not(.scrolled):not(.nav-open) .profile-link svg{
    stroke:#fff;
}

/* Mobile nav — this rule existed on about.php but was MISSING on books.php,
   which is why the hamburger menu likely didn't behave on that page. It now
   applies everywhere since it lives here. */
@media (max-width:820px){
    header .wrap{grid-template-columns:auto 1fr auto;}
    .brand{grid-column:2;}
    .nav-side{display:none;}
    .nav-toggle{display:block;}
    

    header.nav-open{ height:auto; }
    header.nav-open .wrap{
        display:flex;
        flex-direction:column;
        align-items:center;
        position:absolute;
        top:0; left:0; right:0;
        background:var(--cream);
        padding:20px 20px 30px;
        box-shadow:0 16px 30px -14px rgba(75,64,56,.35);
        gap: 1px!important;
    }

    header.nav-open .brand{ order:-1; margin-bottom:14px; }
    header.nav-open .nav-toggle{ position:absolute; top:22px; right:20px; }
    header.nav-open .nav-side{
        display:flex;
        flex-direction:column;
        align-items:center;
        width:100%;
        gap:0;
    }
    header.nav-open .nav-side a{
        display:block;
        width:100%;
        padding:14px 0;
        text-align:center;
    }
    /* Short centered divider between each primary link — but not right
       before the account/cart row, which gets its own full-width divider
       via .nav-actions' border-top instead. */
    header.nav-open .nav-side > li:not(.nav-actions):not(:has(+ .nav-actions))::after{
        content:"";
        display:block;
        width:36px;
        height:1px;
        background:var(--line);
        margin:0 auto;
    }
    header.nav-open .nav-left,
    header.nav-open .nav-right{ grid-column:unset; }

    /* Account + Cart row */
    header.nav-open .nav-side li.nav-actions{
        display:flex;
        flex-direction:row;
        justify-content:center;
        align-items:flex-start;
        gap:28px;
        width:100%;
        margin-top:22px;
        padding-top:22px;
        border-top:1px solid var(--line);
    }
    header.nav-open .nav-actions .profile-link,
    header.nav-open .nav-actions .cart-link{
        display:flex;
        flex-direction:column;
        align-items:center;
        gap:10px;
        width:auto;
        padding:0;
    }
    header.nav-open .nav-actions-divider{
        display:block;
        width:1px;
        height:54px;
        background:var(--line);
        align-self:center;
    }
    header.nav-open .nav-icon-circle{
        position:relative;
        width:54px; height:54px;
        border-radius:50%;
        background:var(--sand);
        display:inline-flex;
        align-items:center;
        justify-content:center;
    }
    header.nav-open .nav-icon-circle svg{
        width:22px; height:22px;
        stroke:var(--ink);
        fill:none;
        stroke-width:1.6;
    }
    header.nav-open .nav-icon-circle .avatar-initial{
        width:100%; height:100%;
        border:0;
    }
    header.nav-open .nav-icon-label{
        display:block;
        font-size:11px;
        letter-spacing:.18em;
        text-transform:uppercase;
        color:var(--ink-soft);
    }
    header.nav-open .cart-count{
        top:-4px; right:-4px;
    }
}

/* Desktop: keep Account + Cart visually inline exactly as before — the
   divider/labels/circle background only switch on inside the mobile
   nav-open menu above. */
.nav-actions{
    display:inline-flex;
    align-items:center;
    gap:44px;
}
.nav-actions-divider{ display:none; }
.nav-icon-label{ display:none; }
.nav-icon-circle{
    display:inline-flex;
    align-items:center;
    justify-content:center;
}

.cart-link{
    position:relative;
    display:inline-flex;
    align-items:center;
    gap:6px;
}
.cart-link svg{
    width:19px; height:19px;
    stroke:var(--ink);
    fill:none;
    stroke-width:1.6;
}
.cart-count{
    position:absolute;
    top:-9px; right:-13px;
    min-width:16px; height:16px;
    border-radius:50%;
    background:#425048;
    color:#fff;
    font-size:10px;
    line-height:16px;
    text-align:center;
    padding:0 1px;
    font-family:'Jost',sans-serif;
    letter-spacing:0;
}
.profile-link{
    display:inline-flex;
    align-items:center;
}
.profile-link svg{
    width:20px; height:20px;
    stroke:var(--ink);
    fill:none;
    stroke-width:1.6;
}

/* Profile initial avatar + dropdown (was inline in partials/header.php) */
.profile-link .avatar-initial{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    box-sizing:border-box;
    width:30px;
    height:30px;
    border:1.5px solid currentColor;
    border-radius:50%;
    font-family:'Jost',sans-serif;
    font-size:14px;
    font-weight:500;
    line-height:1;
    letter-spacing:0;
    text-transform:uppercase;
    color:inherit;
}
.profile-menu{ position:relative; }
.profile-dropdown{
    position:absolute;
    top:calc(100% + 14px);
    right:-6px;
    z-index:1000;
    min-width:210px;
    padding:6px 0;
    background:#FFFDFA;
    border:1px solid rgba(75,64,56,.14);
    box-shadow:0 18px 40px -18px rgba(75,64,56,.45);
    text-align:left;
}
.profile-dropdown[hidden]{ display:none; }
#siteHeader .profile-dropdown .pd-who{
    margin:0;
    padding:10px 18px 12px;
    border-bottom:1px solid rgba(75,64,56,.14);
    font-family:'Jost',sans-serif;
    font-size:13.5px;
    letter-spacing:0;
    text-transform:none;
    color:#7A6E63;
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
}
#siteHeader .profile-dropdown a{
    display:block;
    margin:0;
    padding:11px 18px;
    font-family:'Jost',sans-serif;
    font-size:12.5px;
    letter-spacing:.16em;
    text-transform:uppercase;
    text-decoration:none;
    background:none;
    border:0;
    color:#4B4038 !important;
}
#siteHeader .profile-dropdown a:hover,
#siteHeader .profile-dropdown a:focus-visible{
    background:rgba(178,202,159,.25);
    color:#324029 !important;
}
#siteHeader .profile-dropdown a:focus-visible{
    outline:2px solid #C98A93;
    outline-offset:-2px;
}
#siteHeader .profile-dropdown a::before,
#siteHeader .profile-dropdown a::after{ display:none !important; }

/* Small screens: keep the dropdown from overflowing off the right edge */
@media (max-width:480px){
    .profile-dropdown{
        right:auto;
        left:50%;
        transform:translateX(-50%);
        min-width:min(240px, 86vw);
    }
}

/* ---------------- Buttons ---------------- */
.btn{
    display:inline-block;
    padding:15px 36px;
    font-size:12.5px;
    letter-spacing:.2em;
    text-transform:uppercase;
    border:1px solid currentColor;
    transition:background .25s ease, color .25s ease;
    cursor:pointer;
    background:none;
}
.btn-light{color:#fff;}
.btn-light:hover{background:#fff; color:var(--ink);}
.btn-dark{color:var(--ink); border-color:var(--ink);}
.btn-dark:hover{background:var(--ink); color:var(--cream);}
.btn-sm{padding:11px 26px; font-size:11.5px;}

/* ---------------- Footer ---------------- */
footer{
    background:var(--sage);
    color:#3E4A34;
    position:relative;
    overflow:hidden;
}
.footer-inner{
    position:relative;
    padding:110px 0 50px;
}
.footer-cta{
    text-align:center;
    max-width:560px;
    margin:0 auto 90px;
}
.footer-cta .eyebrow{color:rgba(62,74,52,.75);}
.footer-cta h2{
    margin-top:16px;
    font-size:clamp(30px,3.8vw,42px);
    font-style:italic;
    color:#324029;
}
.footer-cta p{
    margin-top:16px;
    color:rgba(62,74,52,.8);
    font-size:17px;
}
.footer-form{
    margin-top:34px;
    display:flex;
    justify-content:center;
    gap:0;
    max-width:420px;
    margin-left:auto;
    margin-right:auto;
    border-bottom:1px solid rgba(62,74,52,.45);
}
.footer-form input{
    flex:1;
    background:none;
    border:0;
    padding:12px 6px;
    font-family:'Jost',sans-serif;
    font-size:14.5px;
    color:#324029;
}
.footer-form input::placeholder{color:rgba(62,74,52,.55);}
.footer-form button{
    background:none;
    border:0;
    font-size:12px;
    letter-spacing:.2em;
    text-transform:uppercase;
    color:#324029;
    cursor:pointer;
    margin-left: 10px;
}
.footer-cols{
    display:grid;
    grid-template-columns:2fr .8fr .8fr .8fr;
    gap:40px;
    padding-top:70px;
    border-top:1px solid rgba(62,74,52,.25);
}
.footer-cols .brand{
    color:#324029;
    font-size:24px;
}
.footer-cols .tagline{
    margin-top:14px;
    font-size:15px;
    color:rgba(62,74,52,.75);
    max-width:50ch!important;
}
footer h4{
    font-family:'Jost',sans-serif;
    font-weight:500;
    font-size:12px;
    letter-spacing:.2em;
    text-transform:uppercase;
    margin-bottom:18px;
    color:rgba(62,74,52,.6);
}
footer ul{list-style:none;}
footer li{margin-bottom:11px;}
footer a.flink{
    font-size:15.5px;
    color:#324029;
    border-bottom:1px solid transparent;
}
footer a.flink:hover{border-color:#324029;}
.footer-bottom{
    display:flex;
    justify-content:space-between;
    align-items:center;
    margin-top:60px;
    padding-top:26px;
    border-top:1px solid rgba(62,74,52,.25);
    font-size:12.5px;
    color:rgba(62,74,52,.65);
    flex-wrap:wrap;
    gap:14px;
}
.footer-bottom .socials{display:flex; gap:20px;}
.footer-bottom .socials a{color:rgba(62,74,52,.75);}
.footer-bottom .socials a:hover{color:#324029;}
.footer-legal{
    display:flex;
    gap:22px;
    flex-wrap:wrap;
}
.footer-legal a{
    font-size:12.5px;
    color:rgba(62,74,52,.65);
    border-bottom:1px solid transparent;
}
.footer-legal a:hover{color:#324029; border-color:#324029;}
.leaf-motif{
    position:absolute;
    bottom:-40px; right:-40px;
    width:260px; height:260px;
    opacity:.25;
    pointer-events:none;
}
@media (max-width:900px){
    .footer-cols{grid-template-columns:1fr 1fr; gap:40px 24px;}
    .footer-bottom{flex-direction:column; align-items:flex-start;}
}
@media (max-width:560px){
    .footer-cols{grid-template-columns:1fr; gap:36px;}
    .footer-inner{ padding:80px 0 40px; }
}

/* ---------------- Floating contact icons ---------------- */
.floating-contact{
    position:fixed;
    right:26px;
    bottom:26px;
    z-index:60;
    display:flex;
    flex-direction:column;
    align-items:center;
    gap:14px;
}
.floating-contact a{
    width:56px; height:56px;
    border-radius:50%;
    display:flex;
    align-items:center;
    justify-content:center;
    box-shadow:0 10px 26px -8px rgba(75,64,56,.45);
    transition:transform .25s ease, box-shadow .25s ease;
    position:relative;
}
.floating-contact a:hover{
    transform:translateY(-3px) scale(1.05);
    box-shadow:0 14px 30px -8px rgba(75,64,56,.55);
}
.floating-contact a svg{
    width:26px; height:26px;
}
.fc-whatsapp{ background:#25D366; }
.fc-whatsapp svg{ fill:#fff; }
.fc-message{ background:var(--ink); }
.fc-message svg{ stroke:var(--cream); fill:none; stroke-width:1.7; }
.fc-tooltip{
    position:absolute;
    right:68px;
    top:50%;
    transform:translateY(-50%);
    background:var(--ink);
    color:var(--cream);
    font-size:12px;
    letter-spacing:.05em;
    padding:7px 12px;
    border-radius:4px;
    white-space:nowrap;
    opacity:0;
    pointer-events:none;
    transition:opacity .2s ease;
}
.floating-contact a:hover .fc-tooltip{opacity:1;}
@media (max-width:600px){
    .floating-contact{ right:16px; bottom:105px!important; gap:12px; }
    .floating-contact a{ width:50px; height:50px; }
    .fc-tooltip{ display:none; }
}

/* =======================================================================
   Shared shop / cart / checkout / account styles.
   Used by books.php (bulk/signed note), cart.php, checkout.php, account.php.
   Kept here — not page-specific — since the class names (cart-table,
   order-summary, pay-methods, etc.) are reused across the whole shop flow.
   ======================================================================= */
.shop-page{ padding:150px 0 90px; background:var(--cream); min-height:60vh; }
.shop-page h1{ font-family:'Cormorant Garamond',serif; font-size:clamp(2rem,4vw,2.9rem); margin:6px 0 30px; }
.shop-narrow{ max-width:640px; }
.flash-bar{ font-family:'Jost',sans-serif; font-size:.9rem; text-align:center; padding:12px 20px;
    background:#EDE4DA; color:#3E4A34; }
.flash-bar.error{ background:#F5E2DE; color:#9b3b2f; }

.cart-table{ width:100%; border-collapse:collapse; font-family:'Jost',sans-serif; font-weight:300; }
.cart-table th{ text-align:left; font-weight:500; font-size:.75rem; letter-spacing:.12em;
    text-transform:uppercase; padding:0 0 14px; border-bottom:1px solid #DCCFC2; }
.cart-table td{ padding:20px 0; border-bottom:1px solid #E6DAD0; vertical-align:middle; }
.cart-table td.num, .cart-table th.num{ text-align:right; }
.cart-item{ display:flex; gap:18px; align-items:center; }
.cart-item img{ width:62px; border-radius:3px; }
.cart-item strong{ font-weight:500; display:block; }
.cart-item span{ font-size:.82rem; opacity:.7; }
.cart-table input[type=number]{ width:68px; padding:9px 10px; border:1px solid #DCCFC2;
    border-radius:3px; font-family:'Jost',sans-serif; background:#fff; }
.cart-remove{ background:none; border:0; cursor:pointer; font-family:'Jost',sans-serif;
    font-size:.82rem; text-decoration:underline; color:#9b3b2f; padding:0; }
.cart-summary{ margin-top:34px; display:flex; justify-content:flex-end; }
.cart-summary-inner{ min-width:300px; font-family:'Jost',sans-serif; }
.cart-summary-row{ display:flex; justify-content:space-between; padding:9px 0; font-weight:300; }
.cart-summary-row.total{ border-top:1px solid #DCCFC2; margin-top:10px; padding-top:16px;
    font-family:'Cormorant Garamond',serif; font-size:1.5rem; }
.cart-actions{ display:flex; gap:14px; justify-content:flex-end; margin-top:24px; flex-wrap:wrap; }

.form-grid{ display:grid; grid-template-columns:1fr 1fr; gap:18px; }
.form-grid .full{ grid-column:1 / -1; }
.fld label{ display:block; font-family:'Jost',sans-serif; font-size:.78rem; letter-spacing:.1em;
    text-transform:uppercase; margin-bottom:7px; }
.fld input, .fld select, .fld textarea{
    width:100%; padding:13px 14px; border:1px solid #DCCFC2; border-radius:3px;
    font-family:'Jost',sans-serif; font-weight:300; background:#fff; }
.fld.has-error input, .fld.has-error select, .fld.has-error textarea{ border-color:#9b3b2f; }
.fld .err{ display:block; color:#9b3b2f; font-family:'Jost',sans-serif; font-size:.78rem; margin-top:6px; }
.pay-methods{ display:flex; gap:14px; flex-wrap:wrap; margin:10px 0 26px; }
.pay-methods label{ display:flex; align-items:center; gap:9px; padding:14px 18px; cursor:pointer;
    border:1px solid #DCCFC2; border-radius:3px; background:#fff; font-family:'Jost',sans-serif; }
.order-summary{ background:#fff; border:1px solid #E6DAD0; border-radius:4px; padding:26px 28px;
    font-family:'Jost',sans-serif; font-weight:300; }
.empty-note{ font-family:'Jost',sans-serif; font-weight:300; }
@media (max-width:760px){
    .form-grid{ grid-template-columns:1fr; }
    .cart-table thead{ display:none; }
    .cart-table td{ display:block; border:0; padding:6px 0; text-align:left !important; }
    .cart-table tr{ display:block; border-bottom:1px solid #E6DAD0; padding:18px 0; }
    .shop-page{ padding:120px 0 60px; }
    .cart-summary{ justify-content:stretch; }
    .cart-summary-inner{ min-width:0; width:100%; }
    .cart-actions{ justify-content:stretch; }
    .cart-actions .btn{ flex:1; text-align:center; }
}