/* ==========================================================================
   Festival Fogo e Sal — Estilos do site
   Convertido do WordPress/Elementor original para HTML, CSS e JS puros.
   Tecnologias: CSS Cascade Layers, Nesting, <dialog>. Sem framework nem dependência externa.
   ========================================================================== */

@layer reset, tokens, base, layout, components, sections, pages, utilities;

/* ------------------------------------------------------------- Fontes (auto-hospedadas) */
@font-face {
  font-family: "Poppins";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/poppins-400-latin.woff2?v=20261020175432") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Poppins";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/poppins-400-latin-ext.woff2?v=20261020175432") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Poppins";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../fonts/poppins-600-latin.woff2?v=20261020175432") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Poppins";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../fonts/poppins-600-latin-ext.woff2?v=20261020175432") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Poppins";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../fonts/poppins-700-latin.woff2?v=20261020175432") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Poppins";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../fonts/poppins-700-latin-ext.woff2?v=20261020175432") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Poppins";
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url("../fonts/poppins-800-latin.woff2?v=20261020175432") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Poppins";
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url("../fonts/poppins-800-latin-ext.woff2?v=20261020175432") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Roboto";
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url("../fonts/roboto-latin.woff2?v=20261020175432") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Roboto";
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url("../fonts/roboto-latin-ext.woff2?v=20261020175432") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ------------------------------------------------------------- Tokens */
@layer tokens {
  :root {
    --vinho: #711b29;
    --vinho-escuro: #561420;
    --vinho-claro: #8e2637;
    --rosa: #ffb5b5;
    --amarelo: #ffc72c;
    --preto: #000;
    --grafite: #2a2a2a;
    --grafite-claro: #363636;
    --cinza: #cecece;
    --branco: #fff;

    --fonte-titulo: "Poppins", system-ui, sans-serif;
    --fonte-texto: "Roboto", system-ui, sans-serif;

    --largura: 1140px;
    --raio: 6px;
    --sombra: 0 10px 30px rgb(0 0 0 / .35);
    --transicao: .25s ease;
  }
}

/* ------------------------------------------------------------- Reset */
@layer reset {
  *, *::before, *::after { box-sizing: border-box; }
  * { margin: 0; }
  html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
  img, picture, svg, video, iframe { display: block; max-width: 100%; }
  img { height: auto; }
  input, button, select { font: inherit; color: inherit; }
  button { cursor: pointer; }
  ul[role="list"] { list-style: none; padding: 0; }
  @media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    /* As esteiras (.esteira > ul) continuam rodando: o cliente quer o movimento automático */
    *:not(.esteira > ul), *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  }
}

/* ------------------------------------------------------------- Base */
@layer base {
  body {
    font-family: var(--fonte-texto);
    font-size: 1rem;
    line-height: 1.5;
    color: var(--preto);
    background: var(--branco);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
  }
  main { flex: 1; }
  h1, h2, h3 { font-family: var(--fonte-titulo); line-height: 1.2; }
  a { color: inherit; }
  :focus-visible { outline: 3px solid var(--amarelo); outline-offset: 3px; }
  .sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
  }
  .skip-link {
    position: absolute; left: 1rem; top: -4rem; z-index: 100;
    background: var(--amarelo); color: var(--preto); padding: .6rem 1rem;
    font-weight: 600; border-radius: var(--raio); text-decoration: none;
  }
  .skip-link:focus { top: 1rem; }
}

/* ------------------------------------------------------------- Layout */
@layer layout {
  .container { width: min(100% - 2rem, var(--largura)); margin-inline: auto; }

  /* Faixa vinho com o título de cada seção (padrão do site original) */
  .faixa {
    background: var(--vinho);
    color: var(--branco);
    text-align: center;
    padding: .55rem 1rem;
    font-family: var(--fonte-titulo);
    font-weight: 700;
    font-size: clamp(1.25rem, 3vw, 1.6rem);
    text-transform: uppercase;
    letter-spacing: .01em;
  }

  .rodape {
    background: var(--vinho);
    color: var(--branco);
    padding: 3rem 1rem 1.5rem;
    text-align: center;

    & .rodape__logo { width: 170px; margin: -1.5rem auto 0; }
    & nav ul { display: flex; flex-wrap: wrap; justify-content: center; gap: .5rem 1.75rem; margin-bottom: 1.5rem; }
    & nav a { text-decoration: none; font-family: var(--fonte-titulo); font-weight: 600; font-size: .95rem; }
    & nav a:hover, & nav a[aria-current="page"] { text-decoration: underline; text-underline-offset: 4px; }
    & small { display: block; opacity: .8; font-size: .8rem; }
  }
  .rodape--preto { background: var(--preto); }
}

/* ------------------------------------------------------------- Componentes */
@layer components {
  .btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .6rem;
    background: var(--vinho); color: var(--branco);
    font-family: var(--fonte-titulo); font-weight: 600; font-size: .9rem;
    text-transform: uppercase; text-decoration: none;
    padding: .8rem 2.1rem; border: 0; border-radius: var(--raio);
    transition: background var(--transicao), transform var(--transicao);
    &:hover { background: var(--vinho-claro); transform: translateY(-2px); }
    & svg { width: 1.4em; height: 1.4em; flex: none; }
  }
  .btn--escuro { background: var(--grafite-claro); text-transform: none; font-family: var(--fonte-texto); font-weight: 500; font-size: 1rem; padding: 1.1rem 1.8rem; }
  .btn--escuro:hover { background: var(--vinho); }

  /* Fotos clicáveis que abrem o visualizador */
  .foto-btn {
    display: block; width: 100%; padding: 0; border: 0; background: var(--grafite);
    overflow: hidden; position: relative;
    & picture { display: block; height: 100%; }
    & img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease, filter var(--transicao); }
    &:hover img, &:focus-visible img { transform: scale(1.06); filter: brightness(1.1); }
  }

  /* Visualizador de fotos (<dialog>) */
  .visualizador {
    width: 100vw; height: 100dvh; max-width: none; max-height: none;
    padding: 0; border: 0; background: rgb(0 0 0 / .94); color: var(--branco);
    &::backdrop { background: rgb(0 0 0 / .8); }
    &[open] { display: grid; grid-template: 1fr auto / auto 1fr auto; align-items: center; }
    & figure { grid-area: 1 / 1 / 2 / 4; display: grid; place-items: center; height: 100%; padding: 3.5rem 4rem 1rem; }
    & img { max-height: calc(100dvh - 7rem); width: auto; object-fit: contain; border-radius: 2px; }
    & .visualizador__legenda { grid-area: 2 / 1 / 3 / 4; text-align: center; padding: .5rem 1rem 1rem; font-size: .9rem; opacity: .85; }
  }
  .visualizador__btn {
    position: relative; z-index: 2;
    width: 3rem; height: 3rem; display: grid; place-items: center;
    background: rgb(255 255 255 / .12); border: 0; border-radius: 50%; color: var(--branco);
    transition: background var(--transicao);
    &:hover { background: var(--vinho); }
    & svg { width: 1.5rem; height: 1.5rem; }
  }
  .visualizador__ant { grid-area: 1 / 1; margin-left: 1rem; }
  .visualizador__prox { grid-area: 1 / 3; margin-right: 1rem; }
  .visualizador__fechar { position: absolute; top: 1rem; right: 1rem; }
  @media (max-width: 600px) {
    .visualizador figure { padding: 4rem .5rem 1rem; }
    .visualizador__ant, .visualizador__prox { align-self: end; margin-bottom: -3.25rem; }
  }

  /* Faixa animada horizontal (fotos e parceiros). O conteúdo é duplicado pelo JS
     para o laço ficar contínuo; a cópia é aria-hidden. */
  .esteira {
    overflow: hidden;
    mask-image: linear-gradient(90deg, transparent, #000 4%, #000 96%, transparent);
    & ul { display: flex; width: max-content; gap: var(--esteira-gap, 0); animation: esteira var(--esteira-tempo, 60s) linear infinite; padding: 0; list-style: none; }
    &:hover ul, &:focus-within ul { animation-play-state: paused; }
  }
  @keyframes esteira { to { transform: translateX(calc(-50% - var(--esteira-gap, 0px) / 2)); } }
}

/* ------------------------------------------------------------- Seções */
@layer sections {
  /* ===== Página inicial: fotos do evento ===== */
  .fotos-topo {
    background: var(--preto); color: var(--branco);
    padding: 2.5rem 0 3rem;
    & .container { display: grid; grid-template-columns: 1fr 1fr; align-items: center; gap: 2rem; }
    /* Logo no canto superior esquerdo */
    & picture { width: min(260px, 70%); justify-self: start; align-self: start; }
    & .fotos-topo__logo { width: 100%; }
    & h1 { font-size: clamp(1.3rem, 2.6vw, 1.75rem); font-weight: 600; max-width: 34ch; margin-bottom: 1.5rem; }
  }
  .fotos-esteira {
    background: var(--preto);
    --esteira-tempo: 240s;
    & li { width: clamp(220px, 20vw, 290px); aspect-ratio: 3 / 2; }
    & .foto-btn { height: 100%; }
  }
  .fotos-destaques {
    background: var(--preto); padding: 0 0 3rem;
    & h2 { color: var(--branco); font-size: 1.2rem; font-weight: 600; text-align: center; padding: 2.5rem 1rem 1.25rem; }
    & ul { display: grid; grid-template-columns: repeat(5, 1fr); gap: 0; padding: 0; list-style: none; }
    & li { aspect-ratio: 3 / 2; }
    & li.alta { aspect-ratio: auto; grid-row: span 2; }
    & .foto-btn { height: 100%; }
  }

  /* ===== Festival ===== */
  .ingresso-topo {
    background: var(--vinho); color: var(--branco);
    position: relative; padding: 1.1rem 0 1.6rem;
    & .container { display: flex; align-items: center; justify-content: space-between; gap: 1rem 2rem; flex-wrap: wrap; }
    & h2 { font-size: clamp(1.2rem, 2.4vw, 1.6rem); font-weight: 600; }
    &::after { /* pincelada branca (shape divider "wave-brush" do original) */
      content: ""; position: absolute; inset: auto 0 -1px; height: 14px;
      background: var(--branco);
      clip-path: polygon(0 70%, 6% 40%, 14% 65%, 22% 35%, 31% 60%, 40% 30%, 50% 62%, 58% 38%, 67% 66%, 76% 34%, 85% 58%, 93% 36%, 100% 60%, 100% 100%, 0 100%);
    }
  }
  .contagem {
    display: grid; grid-template-columns: repeat(4, 5.5rem); text-align: center; padding: 0; list-style: none;
    & strong { display: block; color: var(--amarelo); font-family: var(--fonte-titulo); font-size: 1.7rem; font-weight: 400; line-height: 1; font-variant-numeric: tabular-nums; }
    & span { font-size: .85rem; }
  }
  .apresentacao {
    padding: 2.5rem 0 3.5rem; overflow-x: clip;
    & .container { display: grid; grid-template-columns: 1fr 1.15fr; align-items: center; gap: 2rem; }
    & .apresentacao__logo { position: relative; justify-self: center; width: min(300px, 80%); }
    & .apresentacao__logo .decoracao { display: none; }
    & h1 { font-size: clamp(1.3rem, 2.4vw, 1.75rem); font-weight: 600; margin-bottom: 1.5rem; }
  }
  .numeros {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-bottom: 1.6rem; padding: 0; list-style: none; text-align: center;
    & strong { display: block; font-family: var(--fonte-titulo); font-size: clamp(1.8rem, 3vw, 2.3rem); font-weight: 600; line-height: 1.2; }
    & span { font-family: var(--fonte-titulo); font-size: .8rem; }
  }
  .programacao {
    background: var(--preto); color: var(--branco); padding: 3.5rem 0;
    & .container { display: grid; grid-template-columns: 1fr 1.2fr; align-items: center; gap: 2rem; }
    & .digitando { font-family: var(--fonte-titulo); font-size: clamp(1.3rem, 2.6vw, 1.7rem); font-weight: 600; }
    & .digitando__texto { display: block; color: var(--rosa); min-height: 1.3em; }
    & .digitando__texto::after { content: ""; display: inline-block; width: 3px; height: 1em; margin-left: 3px; vertical-align: -.1em; background: currentColor; animation: cursor 1s steps(1) infinite; }
    & ul { display: grid; grid-template-columns: repeat(4, 1fr); gap: .75rem; padding: 0; list-style: none; }
    & .foto-btn { aspect-ratio: 1; border-radius: 50%; }
    & .foto-btn picture { height: 100%; }
  }
  @keyframes cursor { 50% { opacity: 0; } }
  .bandas {
    padding: 1.5rem 0 0; overflow: hidden;
    & .container { display: grid; grid-template-columns: 1fr 1fr; align-items: center; gap: 2rem; }
    & .bandas__foto { width: min(100%, 460px); justify-self: center; }
    & .bandas__logo { width: min(100%, 300px); justify-self: center; }
  }
  .parceiros {
    padding: 1.5rem 0;
    --esteira-gap: 2.5rem; --esteira-tempo: 70s;
    & li { width: 130px; height: 80px; display: grid; place-items: center; }
    & img { max-height: 80px; width: auto; object-fit: contain; }
  }
  .local {
    padding: 2.5rem 0 0; text-align: center;
    & dl { font-family: var(--fonte-titulo); font-weight: 700; font-size: .95rem; text-transform: uppercase; line-height: 1.35; margin-bottom: 2rem; }
    & dd { margin: 0; }
    & dt + dd + dt { margin-top: 1rem; }
    & .local__endereco { text-transform: none; }
    & iframe { width: 100%; height: 360px; border: 0; }
  }

  /* ===== Catálogo ===== */
  .catalogo-topo {
    position: relative; overflow: hidden; background: var(--preto); color: var(--branco);
    padding: 3.5rem 0;
    & .container { position: relative; z-index: 1; display: flex; align-items: center; gap: 1.5rem; }
    & .catalogo-topo__logo { width: 110px; }
    & h1 { font-size: clamp(1.4rem, 3vw, 2rem); font-weight: 800; }
  }
  .slideshow {
    position: absolute; inset: 0; margin: 0; padding: 0; list-style: none;
    & li { position: absolute; inset: 0; opacity: 0; transition: opacity 1s ease; }
    & li.ativo { opacity: 1; }
    & img { width: 100%; height: 100%; object-fit: cover; }
    &::after { content: ""; position: absolute; inset: 0; background: rgb(0 0 0 / .55); }
  }
  .catalogo {
    background: var(--preto); color: var(--branco); padding: 1.5rem 0 3.5rem;
  }
  .catalogo__filtros {
    display: flex; flex-wrap: wrap; justify-content: center; gap: .6rem; margin-bottom: 2rem;
    & select, & input {
      background: var(--branco); color: var(--preto); border: 1px solid var(--cinza);
      border-radius: var(--raio); padding: .55rem .8rem; font-size: .9rem;
    }
    & select { min-width: 190px; }
    & input { width: min(100%, 320px); }
  }
  .catalogo__status { text-align: center; color: var(--cinza); font-size: .9rem; margin-bottom: 1.25rem; }
  .catalogo__grade {
    display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 1.5rem 1rem; padding: 0; list-style: none;
  }
  .produto {
    display: flex; flex-direction: column; min-width: 0; overflow-wrap: anywhere;
    /* Fotos recortadas dos cartões da Frical: fundo próprio, proporção paisagem */
    & .produto__foto { aspect-ratio: 480 / 294; display: grid; place-items: center; background: #000; overflow: hidden; }
    & .produto__foto img { width: 100%; height: 100%; object-fit: contain; }
    & .produto__info { flex: 1; background: var(--grafite); padding: .8rem .9rem 1rem; border-radius: 2px; }
    & h2 { font-size: 1rem; font-weight: 600; margin-bottom: .2rem; }
    & .produto__desc { font-size: .78rem; font-weight: 500; margin-bottom: .55rem; }
    & dl { font-size: .74rem; color: var(--cinza); display: grid; grid-template-columns: auto 1fr; gap: 0 .35rem; }
    & dt::after { content: ":"; }
    & dd { margin: 0; }
  }
  .catalogo__vazio { text-align: center; color: var(--cinza); padding: 2rem 0; }

  /* ===== 404 ===== */
  .erro {
    background: var(--preto); color: var(--branco); text-align: center;
    display: grid; place-items: center; padding: 4rem 1rem;
    & img { width: 220px; margin: 0 auto 1.5rem; }
    & p { max-width: 42ch; margin: 0 auto 1.5rem; color: var(--cinza); }
    & .erro__codigo { color: var(--rosa); font-family: var(--fonte-titulo); font-weight: 600; margin-bottom: .25rem; }
    & h1 { font-size: clamp(1.5rem, 4vw, 2.2rem); margin-bottom: 1rem; }
  }
}

/* ------------------------------------------------------------- Responsivo */
@layer pages {
  @media (max-width: 1024px) {
    .catalogo__grade { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .fotos-destaques ul { grid-template-columns: repeat(3, 1fr); }
    .programacao ul { grid-template-columns: repeat(4, 1fr); }
  }
  @media (max-width: 800px) {
    .fotos-topo .container, .apresentacao .container, .programacao .container, .bandas .container { grid-template-columns: 1fr; text-align: center; }
    .fotos-topo picture { justify-self: center; }
    .fotos-topo h1 { margin-inline: auto; }
    .ingresso-topo .container { justify-content: center; text-align: center; }
    .contagem { grid-template-columns: repeat(4, 4.3rem); }
    .numeros { grid-template-columns: repeat(2, 1fr); }
    /* No celular o original mostrava o espeto e a picanha em volta do logo */
    .apresentacao .apresentacao__logo { width: min(320px, 90%); }
    .apresentacao .apresentacao__logo .decoracao { display: block; position: absolute; width: 38%; pointer-events: none; }
    .apresentacao .decoracao--espeto { top: -6%; left: -22%; transform: rotate(-10deg); }
    .apresentacao .decoracao--picanha { bottom: 8%; right: -20%; }
    .programacao ul { grid-template-columns: repeat(2, 1fr); gap: .5rem; }
    .programacao .foto-btn { border-radius: var(--raio); aspect-ratio: 4 / 3; }
    .bandas .bandas__logo { order: -1; }
    .catalogo__grade { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .catalogo-topo .container { justify-content: center; }
  }
  @media (max-width: 560px) {
    .fotos-destaques ul { grid-template-columns: repeat(2, 1fr); }
    .catalogo__grade { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem .6rem; }
    .produto dl { grid-template-columns: 1fr; }
    .produto dd + dt { margin-top: .2rem; }
    .catalogo-topo .container { flex-direction: column; text-align: center; gap: .5rem; }
    .local iframe { height: 300px; }
  }
}
