/* ─────────────────────────────────────────────────────────────────────────
   Borogodó — Editorial Landing
   Stylesheet único. Tokens em :root, depois seções (header, hero, cats,
   footer). Não mexa nas cores/tipografia sem alinhar com brand-system.
   ───────────────────────────────────────────────────────────────────── */

:root {
    --olive: #3f412e;
    --olive-deep: #2e3022;
    --gold: #c8a15a;
    --gold-soft: #d4b06b;
    --ivory: #f3eee6;
    --white: #faf8f4;
    --beige: #d8c4b7;
    --sand: #cbb9a8;
    --serif: "Cormorant Garamond", Georgia, serif;
    --sans: "Inter", Helvetica, Arial, sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}
html,
body {
    background: var(--white);
    color: var(--olive-deep);
    font-family: var(--sans);
    font-weight: 300;
    -webkit-font-smoothing: antialiased;
}
html {
    scroll-behavior: smooth;
}
img {
    display: block;
    max-width: 100%;
}
a {
    color: inherit;
    text-decoration: none;
}
button {
    font: inherit;
    color: inherit;
    background: none;
    border: 0;
    cursor: pointer;
}

/* ── Paper grain (over dark surfaces) ─────────────────────────────────── */
.grain {
    position: relative;
    isolation: isolate;
}
.grain::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    mix-blend-mode: overlay;
    opacity: 0.32;
    z-index: 1;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 0.5 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}
.grain > * {
    position: relative;
    z-index: 2;
}

/* ── Header (olive) ───────────────────────────────────────────────────── */
.header {
    background: var(--olive);
    color: var(--ivory);
    padding-bottom: 40px;
    position: relative;
    z-index: 60;
}
.top-bar {
    max-width: 1680px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 22px 56px 18px;
    border-bottom: 1px solid rgba(200, 161, 90, 0.18);
}
.brand {
    display: flex;
    align-items: center;
    gap: 4px;
}
.brand img {
    height: 40px;
    width: auto;
    display: block;
    object-fit: contain;
}
.brand .wordmark {
    font-family: var(--serif);
    font-weight: 400;
    font-size: 22px;
    letter-spacing: 0.42em;
    color: var(--gold);
}
nav.primary {
    display: flex;
    align-items: center;
    gap: 42px;
}
nav.primary a {
    font-family: var(--sans);
    font-size: 11.5px;
    font-weight: 400;
    letter-spacing: 0.32em;
    text-transform: uppercase;
    color: var(--ivory);
    opacity: 0.86;
    position: relative;
    padding: 6px 0;
    transition:
        opacity 0.3s,
        color 0.3s;
}
nav.primary a::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 1px;
    background: var(--gold);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.5s cubic-bezier(0.2, 0.7, 0.2, 1);
}
nav.primary a:hover {
    color: var(--gold);
    opacity: 1;
}
nav.primary a:hover::after {
    transform: scaleX(1);
}
nav.primary .pill {
    border: 1px solid rgba(200, 161, 90, 0.5);
    padding: 9px 22px;
    border-radius: 999px;
    letter-spacing: 0.34em;
}
nav.primary .pill::after {
    display: none;
}
nav.primary .pill:hover {
    border-color: var(--gold);
    background: rgba(200, 161, 90, 0.08);
}

/* hamburger toggle (hidden on desktop) */
.nav-toggle {
    display: none;
    background: none; border: 0; padding: 8px;
    cursor: pointer;
}
/* Quando o drawer está aberto, o X (que é a mesma nav-toggle) precisa ficar
   ACIMA do drawer (z-index 70) — senão fica "escondido" atrás dele e o
   usuário não consegue fechar pelo X. */
.header[data-nav-open="true"] .nav-toggle {
    position: relative;
    z-index: 80;
}
/* mobile drawer backdrop */
.nav-backdrop {
    display: none;
    position: fixed; inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 65;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.header[data-nav-open="true"] .nav-backdrop {
    display: block;
    opacity: 1;
}
.nav-toggle span {
    display: block;
    width: 22px; height: 1.5px;
    background: var(--ivory);
    margin: 5px 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
}
.header[data-nav-open="true"] .nav-toggle span:nth-child(1) {
    transform: translateY(6.5px) rotate(45deg);
}
.header[data-nav-open="true"] .nav-toggle span:nth-child(2) { opacity: 0; }
.header[data-nav-open="true"] .nav-toggle span:nth-child(3) {
    transform: translateY(-6.5px) rotate(-45deg);
}

/* ── Mega-menu (Collections / About hover) ─────────────────────────── */
.nav-group { position: relative; display: inline-block; }
/* trigger button styled to match nav.primary a */
.nav-trigger {
    font-family: var(--sans);
    font-size: 11.5px;
    font-weight: 400;
    letter-spacing: 0.32em;
    text-transform: uppercase;
    color: var(--ivory);
    opacity: 0.86;
    background: none;
    border: 0;
    padding: 6px 0;
    position: relative;
    cursor: pointer;
    transition: opacity 0.3s, color 0.3s;
}
.nav-trigger::after {
    content: ""; position: absolute;
    left: 0; right: 0; bottom: 0; height: 1px;
    background: var(--gold);
    transform: scaleX(0); transform-origin: left;
    transition: transform 0.5s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.nav-caret {
    display: none;  /* desktop hides the chevron — hover is the affordance */
    margin-left: 6px;
    font-size: 9px;
    transition: transform 0.3s ease;
}
@media (hover: none) {
    .nav-caret { display: inline-block; }
}
.nav-group[data-open="true"] .nav-caret { transform: rotate(180deg); }
@media (hover: hover) {
    .nav-group:hover .nav-trigger,
    .nav-group:focus-within .nav-trigger { color: var(--gold); opacity: 1; }
    .nav-group:hover .nav-trigger::after,
    .nav-group:focus-within .nav-trigger::after { transform: scaleX(1); }
}
.nav-group[data-open="true"] .nav-trigger { color: var(--gold); opacity: 1; }
.nav-group[data-open="true"] .nav-trigger::after { transform: scaleX(1); }
.mega-menu {
    position: absolute;
    top: calc(100% + 18px);
    left: 50%;
    transform: translateX(-50%) translateY(-6px);
    z-index: 50;
    min-width: 460px;
    background: var(--olive);
    border: 1px solid rgba(200, 161, 90, 0.25);
    padding: 28px 32px;
    opacity: 0; visibility: hidden;
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0s linear 0.25s;
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.25);
}
@media (hover: hover) {
    .nav-group:hover .mega-menu,
    .nav-group:focus-within .mega-menu {
        opacity: 1; visibility: visible;
        transform: translateX(-50%) translateY(0);
        transition: opacity 0.25s ease, transform 0.25s ease, visibility 0s linear 0s;
    }
}
/* Tap-to-open (works on any device, desktop or touch). */
.nav-group[data-open="true"] .mega-menu {
    opacity: 1; visibility: visible;
    transform: translateX(-50%) translateY(0);
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0s linear 0s;
}
/* invisible bridge so the menu doesn't close between trigger and panel */
.mega-menu::before {
    content: ""; position: absolute; left: 0; right: 0;
    top: -18px; height: 18px;
}
.mega-inner {
    display: grid;
    grid-template-columns: 1fr 160px;
    gap: 32px;
}
.mega-label {
    font-family: var(--sans);
    font-size: 9.5px; letter-spacing: 0.5em; text-transform: uppercase;
    color: var(--gold);
    margin-bottom: 14px;
    border-bottom: 1px solid rgba(200, 161, 90, 0.2);
    padding-bottom: 10px;
}
.mega-list {
    list-style: none;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px 24px;
}
.mega-list a {
    display: grid;
    grid-template-columns: 26px 1fr auto;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    position: relative;
    color: var(--ivory);
    opacity: 0.86;
    font-family: var(--sans);
    font-size: 11.5px;
    letter-spacing: 0.32em;
    text-transform: uppercase;
    transition: color 0.3s, opacity 0.3s;
}
/* gold underline on hover, same as nav.primary a::after */
.mega-list a::after {
    content: "";
    position: absolute;
    left: 0; right: 0; bottom: 0;
    height: 1px;
    background: var(--gold);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.5s cubic-bezier(0.2, 0.7, 0.2, 1);
    display: block;
}
.mega-list a:hover { color: var(--gold); opacity: 1; }
.mega-list a:hover::after { transform: scaleX(1); }
.mega-num {
    font-family: var(--serif);
    font-style: italic;
    font-size: 12px;
    letter-spacing: 0;
    color: rgba(243, 238, 230, 0.5);
}
.mega-name { font-size: 11.5px; }
.mega-count {
    font-family: var(--sans);
    font-size: 9.5px; letter-spacing: 0.3em;
    color: rgba(243, 238, 230, 0.4);
    text-transform: uppercase;
}
.mega-cta {
    display: flex; flex-direction: column;
    border-left: 1px solid rgba(200, 161, 90, 0.2);
    padding-left: 24px;
}
.mega-all {
    font-family: var(--serif);
    font-style: italic;
    font-size: 16px;
    color: var(--gold);
    padding: 8px 0;
    transition: color 0.25s, transform 0.25s;
}
.mega-all::after { display: none; }
.mega-all:hover { color: var(--gold-soft); transform: translateX(2px); }

@media (max-width: 900px) {
    .mega-menu { min-width: 320px; padding: 20px; }
    .mega-inner { grid-template-columns: 1fr; gap: 18px; }
    .mega-list { grid-template-columns: 1fr; }
    .mega-cta { border-left: 0; border-top: 1px solid rgba(200, 161, 90, 0.2); padding-left: 0; padding-top: 18px; }
}

/* About-specific mega menu — narrower, simple list (matches Collections style) */
.mega-menu--about { min-width: 260px; padding: 20px 24px; }
.mega-about-list {
    list-style: none;
    display: flex; flex-direction: column;
}
.mega-about-list a {
    position: relative;
    display: block;
    padding: 12px 0;
    color: var(--ivory);
    opacity: 0.86;
    font-family: var(--sans);
    font-size: 11.5px;
    letter-spacing: 0.32em;
    text-transform: uppercase;
    transition: color 0.3s, opacity 0.3s;
}
.mega-about-list a::after {
    content: "";
    position: absolute;
    left: 0; right: 0; bottom: 0;
    height: 1px;
    background: var(--gold);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.5s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.mega-about-list a:hover { color: var(--gold); opacity: 1; }
.mega-about-list a:hover::after { transform: scaleX(1); }
.mega-blurb { display: none; }

/* Definition row */
.header-def {
    max-width: 1680px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 220px 1.5fr 1fr;
    gap: 56px;
    align-items: start;
    padding: 48px 56px 24px;
}
.header-def .logo-stack {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 14px;
}
.header-def .logo-stack .logo-mark {
    width: 56px;
    height: auto;
    flex: 0 0 auto;
}
.header-def .logo-stack .logo-wordmark {
    width: 170px;
    height: auto;
}
.def-headword {
    font-family: var(--serif);
    font-style: italic;
    color: var(--gold);
    font-size: 28px;
    font-weight: 400;
}
.def-meta {
    font-family: var(--serif);
    font-size: 13px;
    color: rgba(243, 238, 230, 0.7);
    letter-spacing: 0.04em;
    margin: 4px 0 14px;
}
.def-meta em {
    font-style: italic;
    margin-left: 8px;
    color: rgba(243, 238, 230, 0.55);
}
.def-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
    font-family: var(--serif);
    font-size: 15.5px;
    line-height: 1.55;
    color: rgba(243, 238, 230, 0.86);
    counter-reset: d;
}
.def-list li {
    display: grid;
    grid-template-columns: 18px 1fr;
    gap: 6px;
}
.def-list li::before {
    content: counter(d) ".";
    counter-increment: d;
    color: var(--gold);
    font-style: italic;
    font-size: 13px;
}
.editor-note-label {
    color: rgba(243, 238, 230, 0.55);
}
.editor-note-body {
    font-family: var(--serif);
    font-style: italic;
    color: rgba(243, 238, 230, 0.7);
    font-size: 15px;
    line-height: 1.65;
    max-width: 38ch;
}
.header-tagline {
    font-family: var(--sans);
    font-size: 10.5px;
    letter-spacing: 0.5em;
    text-transform: uppercase;
    color: var(--gold);
    opacity: 0.85;
    margin-top: 18px;
}

/* ── Placeholder tag (used by ph1..ph4 mock images) ───────────────────── */
.ph-tag {
    position: absolute;
    left: 50%; top: 50%;
    transform: translate(-50%, -50%);
    font-family: "SF Mono", "Roboto Mono", ui-monospace, monospace;
    font-size: 10.5px;
    letter-spacing: 0.34em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.34);
    border: 1px solid rgba(255, 255, 255, 0.18);
    padding: 8px 16px;
    border-radius: 2px;
    background: rgba(0, 0, 0, 0.18);
    white-space: nowrap;
}
.ph-tag.tag-light {
    color: rgba(46, 48, 34, 0.45);
    border-color: rgba(46, 48, 34, 0.18);
    background: rgba(255, 255, 255, 0.18);
}

/* ── Categories (landing) ─────────────────────────────────────────────── */
/* The landing page is the 4 tiles, full-bleed, filling the viewport
   minus the top-bar. No section header, no scroll. */
.cats-landing {
    /* top-bar (~74px) is the only thing above */
    height: calc(100vh - 74px);
    min-height: 520px;
    background: var(--olive-deep);
}
.cats-landing .cats-grid {
    height: 100%;
    grid-template-columns: repeat(4, 1fr);
    gap: 0;
}
.cats-landing .cat {
    aspect-ratio: auto;
    height: 100%;
}
@media (max-width: 900px) {
    .cats-landing { height: auto; }
    .cats-landing .cats-grid { grid-template-columns: 1fr 1fr; }
    .cats-landing .cat { height: 50vh; }
}

.section-eyebrow {
    font-family: var(--sans);
    font-size: 10.5px;
    letter-spacing: 0.5em;
    text-transform: uppercase;
    color: var(--gold);
    display: inline-flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 24px;
}
.section-eyebrow .num {
    font-family: var(--serif);
    font-style: italic;
    font-size: 13px;
    letter-spacing: 0;
    color: var(--olive);
}
.section-eyebrow .bar {
    width: 48px;
    height: 1px;
    background: var(--gold);
    opacity: 0.55;
}

.cats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 28px;
}
.cat {
    position: relative;
    aspect-ratio: 3/4;
    overflow: hidden;
    cursor: pointer;
}
.cat .ph-base {
    position: absolute;
    inset: 0;
    transition: transform 1.4s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.cat:hover .ph-base {
    transform: scale(1.04);
}
.cat::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(
        180deg,
        transparent 50%,
        rgba(35, 37, 26, 0.55) 100%
    );
    z-index: 1;
}
.cat-meta {
    position: absolute;
    left: 24px;
    right: 24px;
    bottom: 24px;
    z-index: 2;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    color: var(--ivory);
}
.cat-meta .lhs {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.cat-num {
    font-family: var(--sans);
    font-size: 10px;
    letter-spacing: 0.4em;
    color: var(--gold);
}
.cat-name {
    font-family: var(--serif);
    font-size: 30px;
    font-weight: 400;
    color: var(--ivory);
}
.cat-name em {
    font-style: italic;
    color: var(--gold-soft);
}
.cat-arrow {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 1px solid rgba(243, 238, 230, 0.55);
    display: grid;
    place-items: center;
    color: var(--ivory);
    transition: all 0.35s ease;
}
.cat:hover .cat-arrow {
    background: var(--gold);
    border-color: var(--gold);
    color: var(--olive-deep);
}
.cat-arrow svg {
    width: 13px;
    height: 13px;
}

/* Foto real sobre o placeholder — usado quando o look/categoria tem imagem.
   A div mantém .ph1..ph4 como fallback caso a imagem demore a carregar.
   Usa !important para vencer regras genéricas em img (ex.: max-width:100%
   global + height:auto natural) que estavam achatando a foto em viewports
   estreitos. */
.has-img { overflow: hidden; }
.has-img > .ph-img,
img.ph-img {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    object-fit: cover !important;
    object-position: center !important;
    display: block !important;
    z-index: 0;
}
.has-img > .ph-tag { position: relative; z-index: 1; }

/* Striped placeholders — substituir por foto real em produção */
.ph1 {
    background:
        repeating-linear-gradient(
            135deg,
            rgba(255, 255, 255, 0.04) 0 2px,
            transparent 2px 14px
        ),
        linear-gradient(160deg, #4a4d36, #2e3022);
}
.ph2 {
    background:
        repeating-linear-gradient(
            45deg,
            rgba(0, 0, 0, 0.06) 0 2px,
            transparent 2px 14px
        ),
        linear-gradient(160deg, #dccbbb, #b9a594);
}
.ph3 {
    background:
        repeating-linear-gradient(
            110deg,
            rgba(0, 0, 0, 0.05) 0 2px,
            transparent 2px 12px
        ),
        linear-gradient(140deg, #cbb9a8, #a18a78);
}
.ph4 {
    background:
        repeating-linear-gradient(
            95deg,
            rgba(255, 255, 255, 0.025) 0 2px,
            transparent 2px 14px
        ),
        linear-gradient(160deg, #3a3c2a, #23251a);
}

/* ── Story carousel (used on /about and /about/social-projects) ──────── */
.story-carousel {
    position: relative;
    background: var(--olive-deep);
    overflow: hidden;
    line-height: 0;
}
.story-track {
    position: relative;
    aspect-ratio: 1822 / 880;  /* matches borogodo-oxford.png proportions */
    width: 100%;
}
.story-carousel--inline {
    max-width: 1680px;
    margin: 0 auto 80px;
}
.story-slide {
    position: absolute; inset: 0;
    opacity: 0; visibility: hidden;
    transition: opacity 0.9s ease, visibility 0s linear 0.9s;
}
.story-slide.is-active {
    opacity: 1; visibility: visible;
    transition: opacity 0.9s ease, visibility 0s linear 0s;
    z-index: 1;
}
.story-slide img {
    display: block; width: 100%; height: 100%;
    object-fit: cover; max-width: none;
}
.story-ph {
    position: absolute; inset: 0;
}
.story-arrow {
    position: absolute; top: 50%; transform: translateY(-50%);
    z-index: 5;
    width: 48px; height: 48px; border-radius: 50%;
    border: 1px solid rgba(243, 238, 230, 0.35);
    background: rgba(35, 37, 26, 0.35);
    color: var(--ivory);
    font-family: var(--serif); font-size: 28px; line-height: 1;
    display: grid; place-items: center;
    cursor: pointer; transition: all 0.3s ease;
}
.story-arrow:hover {
    background: var(--gold); border-color: var(--gold); color: var(--olive-deep);
}
.story-arrow.prev { left: 32px; }
.story-arrow.next { right: 32px; }
.story-dots {
    position: absolute; bottom: 24px; left: 50%; transform: translateX(-50%);
    z-index: 5; display: flex; gap: 10px;
}
.story-dot {
    width: 28px; height: 2px; padding: 0; border: 0;
    background: rgba(243, 238, 230, 0.32);
    cursor: pointer; transition: background 0.3s;
}
.story-dot.is-active { background: var(--gold); }
.story-dot:hover { background: var(--gold-soft); }

/* ── Social projects page ────────────────────────────────────────────── */
.social-page {
    padding: 80px 56px 0;
    background: var(--white);
    color: var(--olive-deep);
}
.social-head {
    max-width: 1680px; margin: 0 auto 48px;
    text-align: center;
}
.social-title {
    font-family: var(--serif); font-weight: 300;
    font-size: clamp(48px, 6vw, 88px); line-height: 1;
    color: var(--olive-deep); margin-bottom: 18px;
}
.social-title em { font-style: italic; color: var(--gold); }
.social-lead {
    font-family: var(--serif); font-style: italic;
    font-size: 17px; color: #5a5c45; max-width: 50ch;
    margin: 0 auto;
}

/* ── Collections page (all categories index) ─────────────────────────── */
.collections-page {
    padding: 80px 56px 120px;
    background: var(--white);
    color: var(--olive-deep);
}
.collections-head {
    max-width: 1680px; margin: 0 auto 56px;
    text-align: center;
}
.collections-head .section-eyebrow { justify-content: center; }
.collections-title {
    font-family: var(--serif); font-weight: 300;
    font-size: clamp(48px, 6vw, 88px); line-height: 1;
    color: var(--olive-deep); margin-bottom: 18px;
}
.collections-title em { font-style: italic; color: var(--gold); }
.collections-lead {
    font-family: var(--serif); font-style: italic;
    font-size: 17px; color: #5a5c45; max-width: 50ch;
    margin: 0 auto;
}
.collections-layout {
    max-width: 1680px; margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 240px;
    gap: 56px;
    align-items: start;
}
.collections-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}
.collection-tile { aspect-ratio: 4/5; }

.collections-rail {
    position: sticky; top: 92px;
    border-left: 1px solid rgba(46, 48, 34, 0.12);
    padding: 4px 0 4px 24px;
}
.rail-label {
    font-family: var(--sans);
    font-size: 10px; letter-spacing: 0.5em; text-transform: uppercase;
    color: var(--gold); margin-bottom: 18px;
}
.collections-rail ul { list-style: none; display: flex; flex-direction: column; gap: 14px; }
.collections-rail a {
    display: grid;
    grid-template-columns: 32px 1fr auto;
    align-items: baseline;
    gap: 12px;
    font-family: var(--serif);
    color: var(--olive-deep);
    padding: 6px 0;
    border-bottom: 1px solid transparent;
    transition: color 0.3s, border-color 0.3s;
}
.collections-rail a:hover {
    color: var(--gold);
    border-bottom-color: rgba(200, 161, 90, 0.35);
}
.rail-num {
    font-family: var(--sans); font-size: 10px;
    letter-spacing: 0.3em; color: rgba(46, 48, 34, 0.45);
}
.rail-name { font-size: 18px; font-style: italic; }
.rail-count {
    font-family: var(--sans); font-size: 10px;
    letter-spacing: 0.3em; color: rgba(46, 48, 34, 0.4);
}

@media (max-width: 1100px) {
    .collections-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 900px) {
    .collections-layout { grid-template-columns: 1fr; }
    .collections-rail {
        position: static; border-left: 0;
        border-top: 1px solid rgba(46, 48, 34, 0.12);
        padding: 24px 0 0;
    }
}

/* ── Category page (vote grid) ────────────────────────────────────────── */
.category-page {
    padding: 80px 56px 120px;
    background: var(--white);
    color: var(--olive-deep);
}
.category-head {
    max-width: 1680px; margin: 0 auto 56px;
    text-align: center;
}
.category-head .section-eyebrow { justify-content: center; }
.category-back {
    display: inline-block;
    font-family: var(--sans);
    font-size: 11px; letter-spacing: 0.4em; text-transform: uppercase;
    color: rgba(46, 48, 34, 0.55);
    margin-bottom: 32px;
    transition: color 0.3s;
}
.category-back:hover { color: var(--gold); }
.category-title {
    font-family: var(--serif); font-weight: 300;
    font-size: clamp(48px, 6vw, 88px); line-height: 1;
    color: var(--olive-deep); margin-bottom: 18px;
}
.category-title em { font-style: italic; color: var(--gold); }
.category-lead {
    font-family: var(--serif); font-style: italic;
    font-size: 17px; color: #5a5c45; max-width: 50ch;
    margin: 0 auto;
}

.items-grid {
    max-width: 1680px; margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 32px 24px;
}
@media (max-width: 1100px) { .items-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 700px)  { .items-grid { grid-template-columns: repeat(2, 1fr); } }

.item {
    position: relative;
    display: flex; flex-direction: column; gap: 12px;
}
.item-card {
    position: relative;
    aspect-ratio: 3/4;
    overflow: hidden;
    background: var(--olive-deep);
}
.item-img-link { display: block; height: 100%; }
.item-carousel { position: absolute; inset: 0; }
.item-slide {
    position: absolute; inset: 0;
    opacity: 0; visibility: hidden;
    transition: opacity 0.5s ease;
}
.item-slide.is-active { opacity: 1; visibility: visible; z-index: 1; }

.item-arrow {
    position: absolute; top: 50%; transform: translateY(-50%);
    z-index: 4;
    width: 36px; height: 36px; border-radius: 50%;
    border: 0;
    background: rgba(255, 255, 255, 0.85);
    color: var(--olive-deep);
    font-family: var(--serif); font-size: 22px; line-height: 1;
    display: grid; place-items: center;
    cursor: pointer;
    opacity: 0; transition: opacity 0.3s ease, background 0.25s, transform 0.25s;
}
.item-card:hover .item-arrow { opacity: 1; }
.item-arrow:hover { background: var(--gold); color: var(--white); }
.item-arrow.prev { left: 12px; }
.item-arrow.next { right: 12px; }

.item-dots {
    position: absolute; bottom: 12px; left: 50%; transform: translateX(-50%);
    z-index: 4; display: flex; gap: 6px;
}
.item-dot {
    width: 18px; height: 2px;
    background: rgba(255, 255, 255, 0.4);
    transition: background 0.3s;
}
.item-dot.is-active { background: var(--gold); }

.item-meta {
    display: flex; flex-direction: column; gap: 4px;
    padding: 0 4px;
}
.item-id {
    font-family: var(--sans);
    font-size: 10px; letter-spacing: 0.4em; text-transform: uppercase;
    color: rgba(46, 48, 34, 0.45);
}
.item-name {
    font-family: var(--serif);
    font-size: 18px; color: var(--olive-deep);
}

/* ── Look (product detail) page ──────────────────────────────────────── */
.look-page {
    padding: 56px 56px 120px;
    background: var(--white);
    color: var(--olive-deep);
    max-width: 1680px; margin: 0 auto;
}
.look-back {
    display: inline-block;
    font-family: var(--sans); font-size: 11px;
    letter-spacing: 0.4em; text-transform: uppercase;
    color: rgba(46, 48, 34, 0.55);
    margin-bottom: 32px;
    transition: color 0.3s;
}
.look-back:hover { color: var(--gold); }

.look-layout {
    display: grid;
    grid-template-columns: 320px 1fr 96px;
    gap: 56px;
    align-items: start;
}

.look-info {
    position: sticky; top: 92px;
    display: flex; flex-direction: column;
}
.look-info .section-eyebrow { margin-bottom: 18px; }
.look-title {
    font-family: var(--serif); font-weight: 300;
    font-size: 56px; line-height: 1; color: var(--olive-deep);
    margin-bottom: 6px;
}
.look-id {
    font-family: var(--sans); font-size: 10px;
    letter-spacing: 0.4em; text-transform: uppercase;
    color: rgba(46, 48, 34, 0.45); margin-bottom: 28px;
}
.look-description {
    font-family: var(--serif); font-style: italic;
    font-size: 16px; line-height: 1.65;
    color: #5a5c45;
    margin-bottom: 32px;
}
.look-block { margin-bottom: 24px; }
.look-block-label {
    font-family: var(--sans); font-size: 10px;
    letter-spacing: 0.4em; text-transform: uppercase;
    color: var(--gold); margin-bottom: 10px;
}
.look-composition {
    list-style: none;
    font-family: var(--serif); font-size: 15px;
    color: var(--olive-deep);
    display: flex; flex-direction: column; gap: 4px;
}
.look-care {
    font-family: var(--serif); font-size: 15px;
    line-height: 1.55; color: var(--olive-deep);
}

.look-vote {
    align-self: flex-start;
    margin-top: 12px;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 16px 24px;
    background: transparent;
    color: var(--olive-deep);
    border: 1px solid rgba(46, 48, 34, 0.3);
    border-radius: 0;
    font-family: var(--sans);
    font-size: 11px;
    letter-spacing: 0.4em;
    text-transform: uppercase;
    cursor: pointer;
    transition: color 0.3s ease, border-color 0.3s ease,
                background 0.3s ease;
}
.look-vote svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    fill: none;
    transition: fill 0.3s ease;
}
.look-vote:hover {
    border-color: var(--gold);
    color: var(--gold);
}
.look-vote.is-voted {
    background: var(--gold);
    border-color: var(--gold);
    color: var(--white);
}
.look-vote.is-voted svg {
    fill: currentColor;
}

.look-stage {
    position: relative;
    aspect-ratio: 3/4;
    overflow: hidden;
    background: var(--olive-deep);
}
.look-stage-img {
    position: absolute; inset: 0;
    opacity: 0; visibility: hidden;
    transition: opacity 0.5s ease;
}
.look-stage-img.is-active { opacity: 1; visibility: visible; z-index: 1; }

.look-thumbs {
    display: flex; flex-direction: column; gap: 12px;
    max-height: calc(100vh - 140px);
    overflow-y: auto;
    padding-right: 4px;
}
.look-thumb {
    position: relative;
    aspect-ratio: 3/4;
    width: 100%;
    border: 1px solid transparent;
    cursor: pointer; padding: 0;
    transition: border-color 0.25s ease, opacity 0.25s ease;
    opacity: 0.6;
}
.look-thumb:hover { opacity: 1; }
.look-thumb.is-active {
    border-color: var(--gold);
    opacity: 1;
}

@media (max-width: 1100px) {
    .look-layout { grid-template-columns: 1fr; }
    .look-info { position: static; }
    .look-thumbs {
        flex-direction: row; max-height: none;
        overflow-x: auto; padding: 0 0 8px;
    }
    .look-thumb { width: 80px; flex: 0 0 80px; }
}

.heart {
    position: absolute;
    top: 14px; right: 14px;
    z-index: 3;
    width: 42px; height: 42px;
    border-radius: 50%;
    border: 0;
    background: rgba(255, 255, 255, 0.9);
    color: var(--olive-deep);
    display: grid; place-items: center;
    cursor: pointer;
    transition: transform 0.25s ease, background 0.25s ease, color 0.25s ease;
    backdrop-filter: blur(2px);
}
.heart:hover { transform: scale(1.08); }
.heart svg { width: 20px; height: 20px; }
.heart.is-voted {
    background: var(--gold);
    color: var(--white);
}
.heart.is-voted svg path { fill: currentColor; }

/* ── Footer ───────────────────────────────────────────────────────────── */
footer {
    background: var(--olive);
    color: var(--ivory);
    padding: 56px 56px 32px;
}
.foot-inner {
    max-width: 1680px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 32px;
    border-top: 1px solid rgba(200, 161, 90, 0.18);
    padding-top: 32px;
}
.foot-brand {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--gold);
    font-family: var(--serif);
    letter-spacing: 0.42em;
    font-size: 18px;
    justify-self: start;
}
.foot-brand img {
    height: 32px;
    width: auto;
    display: block;
}
.foot-social {
    display: flex;
    gap: 18px;
    justify-self: center;
}
.foot-social-link {
    width: 36px; height: 36px;
    display: grid; place-items: center;
    border-radius: 50%;
    color: rgba(243, 238, 230, 0.7);
    border: 1px solid rgba(200, 161, 90, 0.25);
    transition: color 0.3s, border-color 0.3s, background 0.3s;
}
.foot-social-link svg { width: 18px; height: 18px; }
.foot-social-link:hover {
    color: var(--gold);
    border-color: var(--gold);
    background: rgba(200, 161, 90, 0.08);
}
.foot-rights {
    justify-self: end;
    font-family: var(--sans);
    font-size: 10.5px;
    letter-spacing: 0.32em;
    text-transform: uppercase;
    color: rgba(243, 238, 230, 0.45);
}

@media (max-width: 700px) {
    footer { padding: 40px 18px 28px; }
    .foot-inner {
        grid-template-columns: 1fr;
        justify-items: center;
        gap: 24px;
        text-align: center;
    }
    .foot-brand, .foot-social, .foot-rights { justify-self: center; }
}

/* ─────────────────────────────────────────────────────────────────────────
   Responsive — tablet (≤900px) and phone (≤700px)
   ───────────────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
    .top-bar { padding: 16px 24px; }
    .header { padding-bottom: 24px; }
    .category-page,
    .collections-page,
    .look-page,
    .editorial,
    .social-page { padding-left: 24px; padding-right: 24px; }
    footer { padding: 48px 24px 24px; }
    .foot-inner { flex-direction: column; gap: 18px; align-items: flex-start; }
    .foot-links { flex-wrap: wrap; gap: 18px; }
}

@media (max-width: 700px) {
    /* compact top-bar + hamburger drawer */
    /* IMPORTANTE: zerar z-index da top-bar pra ela NÃO criar um stacking
       context próprio. Senão a nav.primary (z-index 70) fica presa dentro
       da top-bar (z-index 2 da regra .grain > *), e o .nav-backdrop
       (z-index 65 no contexto do header) paint POR CIMA do drawer —
       resultado: cliques nos links do drawer caem no backdrop, fecham
       o drawer, e nada navega. Com z-index: auto, top-bar deixa de ser
       stacking context e a nav.primary promove pro contexto do header. */
    .top-bar { padding: 14px 18px; z-index: auto; }
    .brand .wordmark { font-size: 18px; letter-spacing: 0.34em; }
    .brand img { height: 32px; }

    .nav-toggle { display: block; }

    nav.primary {
        position: fixed;
        top: 0; right: 0;
        width: min(82vw, 360px);
        height: 100vh;
        z-index: 70;
        background: var(--olive-deep);
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: 88px 32px 32px;
        transform: translateX(100%);
        transition: transform 0.35s cubic-bezier(0.2, 0.7, 0.2, 1);
        overflow-y: auto;
        /* Drawer fechado: bloqueia taps fantasma (alguns browsers mobile
           deixam o elemento fora-de-tela receber clique se z-index alto). */
        pointer-events: none;
    }
    .header[data-nav-open="true"] nav.primary {
        pointer-events: auto;
    }
    /* Garante que cada link/botão dentro do drawer aceita tap sem delay
       no iOS Safari. */
    nav.primary a,
    nav.primary button,
    nav.primary .mega-menu a {
        touch-action: manipulation;
        -webkit-tap-highlight-color: rgba(200, 161, 90, 0.2);
    }
    .header[data-nav-open="true"] nav.primary { transform: translateX(0); }

    nav.primary > a,
    nav.primary .nav-group { width: 100%; }
    nav.primary > a,
    nav.primary .nav-trigger {
        width: 100%; text-align: left;
        padding: 16px 0;
        border-bottom: 1px solid rgba(200, 161, 90, 0.12);
    }
    nav.primary .nav-trigger { font-size: 11.5px; }
    nav.primary .pill {
        margin-top: 18px;
        align-self: flex-start;
    }

    /* mega-menu becomes inline accordion in the drawer */
    .mega-menu {
        display: none;            /* hard-hide closed state */
        position: static;
        transform: none;
        opacity: 1; visibility: visible;
        min-width: 0; width: 100%;
        background: transparent;
        border: 0; box-shadow: none;
        padding: 8px 0 16px;
    }
    .nav-group[data-open="true"] .mega-menu { display: block; }
    .mega-menu::before { display: none; }
    .mega-inner { grid-template-columns: 1fr; gap: 16px; }
    .mega-list { grid-template-columns: 1fr; gap: 0; }
    .mega-list a { padding: 12px 0; }
    .mega-cta { border-left: 0; padding-left: 0; padding-top: 12px;
                border-top: 1px solid rgba(200, 161, 90, 0.18); }

    /* category landing tiles */
    .cats-landing { height: auto; min-height: 0; }
    .cats-landing .cats-grid { grid-template-columns: 1fr; }
    .cats-landing .cat { height: auto; aspect-ratio: 4/3; }

    /* category page */
    .category-head { margin-bottom: 32px; }
    .category-title { font-size: 44px; }
    .category-page { padding-top: 48px; padding-bottom: 64px; }

    /* collections page */
    .collections-page { padding-top: 48px; padding-bottom: 64px; }
    .collections-title { font-size: 44px; }
    .collections-grid { gap: 16px; }

    /* look page */
    .look-page { padding: 32px 18px 64px; }
    .look-title { font-size: 40px; }

    /* social */
    .social-page { padding: 48px 18px 0; }
    .social-title { font-size: 40px; }

    /* about hero — keep full width */
    .story-arrow.prev { left: 12px; }
    .story-arrow.next { right: 12px; }
    .story-arrow { width: 36px; height: 36px; font-size: 22px; }
}

/* ── Auth (login pill / user pill) ─────────────────────────────────────── */

/* Forms que envolvem botões de voto ficam transparentes pra não quebrar layout. */
.heart-form, .look-vote-form { display: contents; }

.user-pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 4px 12px 4px 4px;
  border-radius: 999px;
  border: 1px solid rgba(200, 161, 90, 0.3);
  background: rgba(255, 255, 255, 0.04);
  font-size: 12px;
  letter-spacing: 0.04em;
}
.user-pill .user-avatar {
  width: 22px; height: 22px;
  border-radius: 999px;
  object-fit: cover;
  flex: 0 0 auto;
}
.user-pill .user-name {
  max-width: 110px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.user-pill .user-logout {
  margin-left: 4px;
  padding-left: 8px;
  border-left: 1px solid rgba(200, 161, 90, 0.25);
  color: inherit;
  opacity: 0.7;
  text-decoration: none;
  font-size: 11px;
}
.user-pill .user-logout:hover { opacity: 1; }

/* ── Auth / Login page ────────────────────────────────────────────────── */

.auth-page {
  min-height: calc(100vh - 200px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 80px 32px;
}
.auth-card {
  max-width: 560px;
  width: 100%;
  text-align: left;
}
.auth-title {
  font-family: var(--serif, "Cormorant Garamond", "Times New Roman", serif);
  font-size: 64px;
  line-height: 1.05;
  letter-spacing: -0.01em;
  margin: 16px 0 24px;
  font-weight: 400;
}
.auth-title em { font-style: italic; }
.auth-lead {
  font-size: 16px;
  line-height: 1.65;
  opacity: 0.85;
  max-width: 46ch;
  margin: 0 0 36px;
}
.auth-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
  max-width: 360px;
}
.auth-btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 10px;
  padding: 14px 22px;
  border-radius: 999px;
  font-size: 14px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  text-decoration: none;
  transition: transform 0.15s ease, opacity 0.15s ease;
}
.auth-btn:hover { transform: translateY(-1px); }
.auth-btn--google {
  background: #fff;
  color: #1a1a1a;
  border: 1px solid rgba(255,255,255,0.15);
}
.auth-btn--google:hover { opacity: 0.92; }
.auth-btn--primary {
  background: rgba(200, 161, 90, 0.95);
  color: #1a1a1a;
}
.auth-btn--ghost {
  border: 1px solid rgba(200, 161, 90, 0.4);
  color: inherit;
}
.auth-g { width: 18px; height: 18px; }
.auth-fine {
  font-size: 11px;
  letter-spacing: 0.04em;
  opacity: 0.55;
  max-width: 46ch;
  margin-top: 16px;
}

/* ── Header: user dropdown ────────────────────────────────────────────── */

.user-group { position: relative; }
.user-trigger {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 4px 10px 4px 4px;
  border-radius: 999px;
  border: 1px solid rgba(200, 161, 90, 0.3);
  background: rgba(255, 255, 255, 0.04);
  color: inherit;
  font-size: 12px;
  letter-spacing: 0.04em;
  cursor: pointer;
}
.user-trigger:hover { background: rgba(255, 255, 255, 0.08); }
.user-avatar {
  width: 22px; height: 22px;
  border-radius: 999px;
  object-fit: cover;
  flex: 0 0 auto;
}
.user-avatar--initial {
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(200, 161, 90, 0.25);
  font-size: 11px;
  font-weight: 600;
}
.user-name {
  max-width: 110px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.mega-menu--user {
  right: 0;
  left: auto;
  min-width: 240px;
}
.user-menu-list {
  list-style: none;
  margin: 0; padding: 8px;
}
.user-menu-list li a {
  display: block;
  padding: 10px 14px;
  border-radius: 8px;
  text-decoration: none;
  color: inherit;
  font-size: 13px;
  letter-spacing: 0.03em;
}
.user-menu-list li a:hover { background: rgba(200, 161, 90, 0.12); }
.user-menu-meta {
  padding: 10px 14px 12px;
}
.user-menu-label {
  display: block;
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0.55;
}
.user-menu-email {
  display: block;
  font-size: 13px;
  margin-top: 2px;
  word-break: break-all;
}
.user-menu-sep {
  height: 1px;
  background: rgba(200, 161, 90, 0.18);
  margin: 6px 8px;
}
.user-menu-danger { color: #d8755e !important; }
