/* ============================================================
   Casa Olivo 1033 — Sistema Visual
   ============================================================ */

:root {
  /* Base */
  --bg: #faf8f4;
  --bg-alt: #f3efe7;
  --ink: #1a1a1a;
  --ink-soft: #4a4a4a;
  --ink-mute: #8a8480;
  --line: rgba(26, 26, 26, 0.14);
  --line-soft: rgba(26, 26, 26, 0.08);

  /* Marca */
  --dark: #222222;
  --gold: #d0aa67;
  --gold-soft: #e3c794;

  /* Temáticas */
  --garden: #516948;
  --cucina: #9e5130;
  --sunset: #c65333;

  /* Tipografia */
  --serif: "Cormorant Garamond", "Cormorant", Georgia, serif;
  --sans: "Jost", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", monospace;

  /* Métrica */
  --container: 1320px;
  --gutter: clamp(20px, 4vw, 56px);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--sans);
  font-weight: 300;
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; transition: opacity .25s ease, color .25s ease; }
a:hover { opacity: .65; }
button { font: inherit; cursor: pointer; border: 0; background: none; color: inherit; }

/* ============================================================
   Tipografia
   ============================================================ */
.serif { font-family: var(--serif); font-weight: 300; letter-spacing: -0.01em; }
.sans  { font-family: var(--sans); }
.mono  { font-family: var(--mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; }

h1, h2, h3, h4 { font-family: var(--serif); font-weight: 300; line-height: 1.08; letter-spacing: -0.015em; text-wrap: balance; }
h1 { font-size: clamp(48px, 7vw, 112px); }
h2 { font-size: clamp(36px, 4.6vw, 72px); }
h3 { font-size: clamp(26px, 2.6vw, 40px); }
h4 { font-size: clamp(20px, 1.6vw, 26px); }

.eyebrow {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--ink-mute);
}

p { text-wrap: pretty; max-width: 62ch; }
.lead { font-size: clamp(17px, 1.3vw, 21px); line-height: 1.55; color: var(--ink-soft); font-weight: 300; }

/* ============================================================
   Layout
   ============================================================ */
.wrap { max-width: var(--container); margin: 0 auto; padding: 0 var(--gutter); }
.wrap-narrow { max-width: 880px; margin: 0 auto; padding: 0 var(--gutter); }
section { padding: clamp(80px, 10vw, 160px) 0; }

.divider { height: 1px; background: var(--line); width: 100%; }
.hairline { border: 0; border-top: 1px solid var(--line); margin: 0; }

/* ============================================================
   Header / Nav
   ============================================================ */
.site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  padding: 22px var(--gutter);
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  background: rgba(250, 248, 244, 0.85);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line-soft);
  transition: background .3s ease, border-color .3s ease;
}
.site-header.dark {
  background: rgba(34, 34, 34, 0.85);
  border-bottom-color: rgba(255,255,255,0.1);
  color: #f4f1ec;
}
.site-header.dark .nav-link { color: #f4f1ec; }
.site-header.dark .logo-text { color: #f4f1ec; }

.nav-left, .nav-right { display: flex; gap: 32px; }
.nav-right { justify-content: flex-end; }
.nav-link {
  font-size: 12px; letter-spacing: 0.18em; text-transform: uppercase; font-weight: 400;
  position: relative;
}
.nav-link::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -4px;
  height: 1px; background: currentColor; transform: scaleX(0); transform-origin: left;
  transition: transform .3s ease;
}
.nav-link:hover { opacity: 1; }
.nav-link:hover::after, .nav-link.active::after { transform: scaleX(1); }

.logo {
  display: flex; align-items: center; gap: 12px;
  text-align: center;
}
.logo-mark {
  width: 38px; height: 38px;
  border: 1px solid var(--ink);
  border-radius: 50%;
  display: grid; place-items: center;
  font-family: var(--serif); font-size: 14px; letter-spacing: 0.04em;
}
.site-header.dark .logo-mark { border-color: #f4f1ec; }
.logo-text {
  font-family: var(--serif); font-size: 18px; letter-spacing: 0.18em;
  text-transform: uppercase;
}

/* Image-based logo — drop /images/logo-dark.png (use over light bg) and /images/logo-light.png (over dark bg) to activate */
.logo-img { height: 44px; width: auto; display: block; }
.logo-img.is-light { display: none; }
.site-header.dark .logo-img.is-dark { display: none; }
.site-header.dark .logo-img.is-light { display: block; }
.logo:has(.logo-img) .logo-mark,
.logo:has(.logo-img) .logo-text { display: none; }

/* Mobile nav toggle */
.nav-toggle { display: none; }
.mobile-menu { display: none; }
@media (max-width: 880px) {
  .site-header { grid-template-columns: 1fr auto 1fr; padding: 16px var(--gutter); }
  .nav-left, .nav-right { display: none; }
  .nav-toggle { display: flex; flex-direction: column; gap: 5px; }
  .nav-toggle span { width: 24px; height: 1px; background: currentColor; transition: transform .3s ease, opacity .3s; }
  .nav-toggle.is-open span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
  .nav-toggle.is-open span:nth-child(2) { opacity: 0; }
  .nav-toggle.is-open span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
  .nav-left { grid-column: 1; justify-content: flex-start; }
  .nav-right { grid-column: 3; }
  .mobile-menu {
    display: grid;
    position: fixed; inset: 0;
    background: #1a1a1a; /* fundo escuro sólido — garante contraste com o texto claro */
    color: #f4f1ec;
    z-index: 49;
    place-items: center; padding: 80px var(--gutter);
    transform: translateY(-100%); transition: transform .4s ease;
  }
  .mobile-menu.is-open { transform: translateY(0); }
  .mobile-menu ul { list-style: none; display: grid; gap: 28px; text-align: center; }
  .mobile-menu a {
    font-family: var(--serif);
    font-size: 32px;
    color: #f4f1ec; /* texto claro explícito — não depende de herança */
  }
  /* Quando o menu está aberto, o hambúrguer e o logo precisam ficar visíveis
     sobre o fundo escuro do menu, mesmo que a página esteja em modo claro. */
  body.menu-open .site-header { background: transparent; border-bottom-color: transparent; color: #f4f1ec; }
  body.menu-open .site-header .nav-toggle { color: #f4f1ec; }
  body.menu-open .site-header .logo-mark { border-color: #f4f1ec; color: #f4f1ec; }
  body.menu-open .site-header .logo-text { color: #f4f1ec; }
  body.menu-open .site-header .logo-img.is-dark { display: none; }
  body.menu-open .site-header .logo-img.is-light { display: block; }
}

/* ============================================================
   Tratamento global dos heros com imagem de fundo escura
   ============================================================
   Qualquer <section data-header-dark> que tenha um .img-slot ou .hero-bg
   recebe: aspect-ratio: auto (preenche o hero em telas verticais),
   leve desfoque + escurecimento na foto (melhor legibilidade do texto,
   suaviza imagens de baixa resolução) — sem mexer nos gradientes
   tematizados de cada página. */
[data-header-dark] .img-slot,
[data-header-dark] .hero-bg > .img-slot,
[data-header-dark] .hero-media > .img-slot,
[data-header-dark] .page-hero-bg > .img-slot {
  aspect-ratio: auto;
}
[data-header-dark] .img-slot > img {
  /* Sem desfoque — apenas escurece a imagem para o texto branco respirar.
     O gradiente em cada hero faz o resto. */
  filter: brightness(0.7);
  /* Reset do z-index para que os gradientes ::after dos heros fiquem POR CIMA.
     A regra base do .img-slot img usa z-index:1 (pra cobrir o placeholder
     listrado), mas aqui a imagem já carregou e o que precisamos é o gradiente
     visível. */
  z-index: 0;
}

/* Garante que QUALQUER gradiente de overlay em hero fique acima da imagem
   E abaixo do conteúdo de texto. Cobre cucina-hero, wb-hero, garden-hero,
   sunset-hero, hero-media e page-hero-bg sem mexer em cada arquivo. */
[data-header-dark] .img-slot::after,
[data-header-dark] .hero-bg::after,
[data-header-dark] .hero-media::after,
[data-header-dark] .page-hero-bg::after {
  z-index: 1;
}

/* Gradiente preto pesado UNIFICADO para todos os heros de página interna.
   Usa !important porque cada sub-página (cucina, wb, garden, sunset)
   define seu próprio gradiente colorido suave inline, que carrega DEPOIS
   deste arquivo. Com !important garantimos legibilidade consistente. */
[data-header-dark] .img-slot::after,
[data-header-dark] .hero-bg::after,
[data-header-dark] .page-hero-bg::after {
  content: "" !important;
  /* display:block !important é necessário porque a regra
     .img-slot.has-image::after esconde o placeholder do nome do arquivo
     quando a imagem carrega — sem isso, o gradiente é escondido junto. */
  display: block !important;
  position: absolute !important;
  inset: 0 !important;
  background:
    linear-gradient(0deg,
      rgba(0,0,0,0.95) 0%,
      rgba(0,0,0,0.85) 18%,
      rgba(0,0,0,0.65) 40%,
      rgba(0,0,0,0.38) 62%,
      rgba(0,0,0,0.15) 85%,
      rgba(0,0,0,0.0) 100%),
    linear-gradient(90deg, rgba(0,0,0,0.4) 0%, rgba(0,0,0,0) 55%) !important;
  pointer-events: none !important;
}

/* ============================================================
   Hero — ajuste mobile (evita zoom excessivo na imagem)
   ============================================================
   Em portrait, com min-height:100vh e foto landscape, o object-fit:cover
   amplia ~4×. Reduzimos a altura e usamos object-position para mostrar a
   parte mais relevante (terço superior — onde costuma estar o horizonte). */
@media (max-width: 700px) {
  /* Hero mais baixo no mobile: viewport vertical + foto landscape causa
     zoom excessivo no object-fit:cover. Reduzir altura mostra mais da foto
     com menos crop. !important para vencer as alturas inline de cada hero. */
  .hero,
  .cucina-hero,
  .wb-hero,
  .garden-hero,
  .sunset-hero { min-height: 62vh !important; }

  .page-hero.has-media { min-height: 56vh !important; }

  [data-header-dark] .img-slot > img,
  .hero-media .img-slot img,
  .page-hero .page-hero-bg .img-slot img {
    object-position: center 35%;
  }

  /* Reforça o gradiente em mobile — telas pequenas têm menos área pra
     o degradê absorver a foto. */
  .hero-media::after,
  .page-hero .page-hero-bg::after {
    background:
      linear-gradient(0deg,
        rgba(0,0,0,0.95) 0%,
        rgba(0,0,0,0.9) 30%,
        rgba(0,0,0,0.7) 55%,
        rgba(0,0,0,0.4) 80%,
        rgba(0,0,0,0.15) 100%);
  }
}

/* No hero principal da home, garantimos também um gradiente preto
   adicional para destacar o título (somado ao .hero-media::after). */
.hero {
  min-height: 100vh; padding: 0 var(--gutter); padding-top: 120px;
  display: grid; align-items: end;
  position: relative; overflow: hidden;
}
.hero-media {
  position: absolute; inset: 0; z-index: 0;
}
/* Força o slot a preencher o hero — sobrescreve aspect-ratio do .img-slot que
   estava deixando a imagem 16:10 e curta no topo em telas verticais (mobile). */
.hero-media > .img-slot {
  position: absolute; inset: 0;
  aspect-ratio: auto;
  width: 100%; height: 100%;
}
.hero-media .img-slot img {
  width: 100%; height: 100%;
  object-fit: cover;
  /* sem desfoque — apenas leve escurecimento para que o gradiente faça
     o trabalho pesado de contraste */
  filter: brightness(0.78);
}
.hero-media::after {
  content: ""; position: absolute; inset: 0;
  /* z-index acima da imagem (que está em z-index:1 pela regra base do
     .img-slot img) — SEM isso o gradiente fica atrás da foto e não aparece. */
  z-index: 2;
  /* Gradiente preto pesado partindo de baixo (onde o texto vive) e
     subindo até quase transparente no topo. Camada lateral suave para
     amarrar a borda esquerda do título. */
  background:
    linear-gradient(0deg,
      rgba(0,0,0,0.95) 0%,
      rgba(0,0,0,0.88) 18%,
      rgba(0,0,0,0.72) 38%,
      rgba(0,0,0,0.45) 60%,
      rgba(0,0,0,0.20) 82%,
      rgba(0,0,0,0.05) 100%),
    linear-gradient(90deg, rgba(0,0,0,0.45) 0%, rgba(0,0,0,0) 55%);
}
.hero-content {
  position: relative; z-index: 3; /* acima do gradiente */
  padding-bottom: clamp(60px, 8vw, 120px);
  color: #f4f1ec;
  max-width: var(--container); margin: 0 auto; width: 100%;
}
.hero h1 {
  font-size: clamp(56px, 9vw, 140px);
  line-height: 0.96;
  font-weight: 200;
}
.hero .eyebrow { color: rgba(244, 241, 236, 0.8); margin-bottom: 28px; }
.hero p { color: rgba(244, 241, 236, 0.85); margin-top: 32px; max-width: 540px; }

/* ============================================================
   Buttons & CTAs
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; gap: 14px;
  padding: 18px 32px;
  border: 1px solid currentColor;
  font-size: 11px; letter-spacing: 0.24em; text-transform: uppercase; font-weight: 400;
  transition: background .25s ease, color .25s ease;
  position: relative;
}
.btn::after { content: "→"; font-size: 14px; }
.btn:hover { background: currentColor; opacity: 1; }
.btn:hover, .btn:hover::after { color: var(--bg); }
.btn-light { color: #f4f1ec; }
.btn-light:hover { color: var(--ink); }
.btn-dark { color: var(--ink); }
.btn-gold { color: var(--gold); border-color: var(--gold); }

.link-inline {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 12px; letter-spacing: 0.2em; text-transform: uppercase;
  border-bottom: 1px solid currentColor;
  padding-bottom: 4px;
}
.link-inline::after { content: "→"; }

/* ============================================================
   Image Placeholders (named — replace files in /images/)
   ============================================================ */
.img-slot {
  position: relative;
  background: var(--bg-alt);
  overflow: hidden;
  display: block;
  aspect-ratio: 16 / 10;
}
.img-slot::before {
  content: ""; position: absolute; inset: 0;
  background-image: repeating-linear-gradient(
    135deg,
    transparent 0 12px,
    rgba(26,26,26,0.04) 12px 13px
  );
}
.img-slot[data-name]::after {
  content: attr(data-name);
  position: absolute; left: 16px; bottom: 14px;
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.16em;
  color: var(--ink-mute);
  padding: 4px 8px; background: rgba(250, 248, 244, 0.7);
  border: 1px solid var(--line-soft);
}
.img-slot.dark { background: #2a2a2a; }
.img-slot.dark::before { background-image: repeating-linear-gradient(135deg, transparent 0 12px, rgba(255,255,255,0.04) 12px 13px); }
.img-slot.dark::after { color: rgba(255,255,255,0.5); background: rgba(0,0,0,0.4); border-color: rgba(255,255,255,0.1); }
.img-slot img {
  width: 100%; height: 100%; object-fit: cover; position: relative; z-index: 1;
}
.img-slot img:not([src]), .img-slot img[src=""] { display: none; }

/* Quando a imagem carrega com sucesso, esconde o padrão tracejado e o
   rótulo com o nome do arquivo — eram apenas placeholders. */
.img-slot.has-image::before,
.img-slot.has-image::after { content: none; display: none; }
.bottle-slot.has-image::before,
.bottle-slot.has-image::after { content: none; display: none; }

/* Bottle slot — for transparent PNGs */
.bottle-slot {
  position: relative;
  display: grid; place-items: center;
  aspect-ratio: 3 / 5;
}
.bottle-slot::before {
  content: ""; position: absolute; inset: 0;
  background-image: repeating-linear-gradient(180deg, transparent 0 14px, rgba(26,26,26,0.035) 14px 15px);
}
.bottle-slot[data-name]::after {
  content: attr(data-name);
  position: absolute; bottom: 12px; left: 50%; transform: translateX(-50%);
  font-family: var(--mono); font-size: 9px; letter-spacing: 0.14em;
  color: var(--ink-mute);
}
.bottle-slot img { max-height: 100%; width: auto; object-fit: contain; position: relative; z-index: 1; }

/* ============================================================
   Cards / Sections shared
   ============================================================ */
.tag-row {
  display: flex; gap: 32px; align-items: center;
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.18em; color: var(--ink-mute);
}
.tag-row > * { display: inline-flex; align-items: center; gap: 8px; }
.tag-row .dot { width: 4px; height: 4px; border-radius: 50%; background: currentColor; }

.spec-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 48px 64px;
  border-top: 1px solid var(--line); padding-top: 56px;
}
.spec-grid > div { border-bottom: 1px solid var(--line); padding-bottom: 24px; }
.spec-grid .label {
  font-size: 11px; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--ink-mute); margin-bottom: 10px;
}
.spec-grid .value { font-family: var(--serif); font-size: clamp(20px, 1.6vw, 26px); font-weight: 300; }
@media (max-width: 700px) {
  .spec-grid { grid-template-columns: 1fr; gap: 28px; padding-top: 40px; }
}

/* ============================================================
   Footer
   ============================================================ */
.site-footer {
  background: var(--dark);
  color: #d8d3cc;
  padding: 96px var(--gutter) 36px;
  font-size: 13px;
}
.site-footer .wrap { padding: 0; }
.footer-grid {
  display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 48px;
  padding-bottom: 72px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.footer-brand .logo-mark { border-color: var(--gold); color: var(--gold); }
.footer-brand .logo-text { color: var(--gold); }
.footer-brand p { color: rgba(216, 211, 204, 0.7); margin-top: 24px; max-width: 32ch; }
.footer-col h5 {
  font-family: var(--sans); font-size: 11px; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--gold); margin-bottom: 24px; font-weight: 400;
}
.footer-col ul { list-style: none; display: grid; gap: 12px; }
.footer-col a { color: rgba(216, 211, 204, 0.85); font-weight: 300; }
.footer-bottom {
  display: flex; justify-content: space-between; align-items: center;
  padding-top: 36px; color: rgba(216, 211, 204, 0.5); font-size: 11px;
  letter-spacing: 0.16em; text-transform: uppercase;
}
@media (max-width: 880px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-bottom { flex-direction: column; gap: 16px; }
}

/* ============================================================
   Themed pages
   ============================================================ */
.theme-dark { background: var(--dark); color: #f4f1ec; }
.theme-dark .lead { color: rgba(244, 241, 236, 0.7); }
.theme-dark .eyebrow { color: rgba(244, 241, 236, 0.6); }
.theme-dark .divider, .theme-dark .hairline { background: rgba(255,255,255,0.12); border-color: rgba(255,255,255,0.12); }
.theme-dark .spec-grid { border-top-color: rgba(255,255,255,0.18); }
.theme-dark .spec-grid > div { border-bottom-color: rgba(255,255,255,0.12); }
.theme-dark .spec-grid .label { color: rgba(244, 241, 236, 0.55); }
.theme-dark .img-slot { background: #2e2e2e; }
.theme-dark .img-slot::before { background-image: repeating-linear-gradient(135deg, transparent 0 12px, rgba(255,255,255,0.04) 12px 13px); }
.theme-dark .img-slot::after { color: rgba(255,255,255,0.5); background: rgba(0,0,0,0.4); }

.theme-garden { --accent: var(--garden); }
.theme-cucina { --accent: var(--cucina); }
.theme-sunset { --accent: var(--sunset); }
.theme-gold   { --accent: var(--gold);   }

.accent-band {
  background: var(--accent, var(--gold));
  color: #f4f1ec;
  padding: clamp(60px, 8vw, 120px) 0;
}
.accent-band .eyebrow { color: rgba(244, 241, 236, 0.7); }

/* ============================================================
   Page Hero (sub-pages, less tall)
   ============================================================ */
.page-hero {
  padding: clamp(160px, 18vw, 240px) var(--gutter) clamp(60px, 8vw, 120px);
  position: relative;
}
.page-hero .eyebrow { margin-bottom: 24px; }
.page-hero h1 { max-width: 18ch; }
.page-hero p { margin-top: 28px; max-width: 56ch; }
.page-hero.has-media {
  min-height: 78vh; display: grid; align-items: end; overflow: hidden;
  color: #f4f1ec;
}
.page-hero.has-media .page-hero-content { position: relative; z-index: 2; }
.page-hero.has-media .eyebrow { color: rgba(244, 241, 236, 0.75); }
.page-hero .page-hero-bg { position: absolute; inset: 0; z-index: 0; }
.page-hero .page-hero-bg::after {
  content: ""; position: absolute; inset: 0;
  /* acima da imagem (z-index:1 pelo .img-slot img) */
  z-index: 2;
  /* Gradiente preto pesado a partir da base, igual ao hero principal */
  background:
    linear-gradient(0deg,
      rgba(0,0,0,0.92) 0%,
      rgba(0,0,0,0.82) 20%,
      rgba(0,0,0,0.6) 42%,
      rgba(0,0,0,0.3) 65%,
      rgba(0,0,0,0.08) 100%),
    linear-gradient(90deg, rgba(0,0,0,0.4) 0%, rgba(0,0,0,0) 55%);
}
/* preenche todo o page-hero e aplica leve desfoque na foto de fundo */
.page-hero .page-hero-bg > .img-slot {
  position: absolute; inset: 0;
  aspect-ratio: auto;
  width: 100%; height: 100%;
}
.page-hero .page-hero-bg .img-slot img {
  width: 100%; height: 100%;
  object-fit: cover;
  filter: brightness(0.78);
}

/* ============================================================
   Forms
   ============================================================ */
.form-field {
  display: grid; gap: 8px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}
.form-field label {
  font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--ink-mute);
}
.form-field input, .form-field textarea, .form-field select {
  border: 0; background: transparent; padding: 4px 0;
  font: inherit; font-size: 17px; color: var(--ink);
  font-family: var(--serif); font-weight: 300;
}
.form-field input:focus, .form-field textarea:focus { outline: 0; }

/* ============================================================
   Utilities
   ============================================================ */
.center { text-align: center; }
.muted { color: var(--ink-mute); }
.gold { color: var(--gold); }
.uppercase { text-transform: uppercase; letter-spacing: 0.2em; font-size: 11px; }

/* Reveal on scroll */
[data-reveal] { opacity: 0; transform: translateY(24px); transition: opacity 1s ease, transform 1s ease; }
[data-reveal].is-in { opacity: 1; transform: translateY(0); }

/* Prevent body scroll when mobile menu open */
body.menu-open { overflow: hidden; }
