/* ==========================================================================
   BASE & LAYOUT GLOBAL - ACONTECE LGBTI+
   Ordem explícita das camadas CSS para evitar colisões entre módulos
   ========================================================================== */
@layer base, home, pages, saudefloripa, consent;

@layer base {
  :root {
    color-scheme: light;
    --bg: #fbfaf9;
    --card: #ffffff;
    --bd: #ebd6e4;
    --hv: #f9e7f1;
    --tx: #2a1b33;
    --mu: #5e5368;
    --pk: #d6197a;
    --ye: #facc15;
    --yt: #8a5a00;
    box-sizing: border-box;
    padding-top: env(safe-area-inset-top, 0px);
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }
  *,
  *::before,
  *::after {
    box-sizing: inherit;
  }
  html {
    scroll-padding-top: calc(72px + env(safe-area-inset-top, 0px));
  }
  @media (prefers-reduced-motion: no-preference) {
    html {
      scroll-behavior: smooth;
    }
  }
  body {
    margin: 0;
    background: var(--bg);
    color: var(--tx);
    font: 400 16px/1.6 Inter, system-ui, -apple-system, sans-serif;
    overflow-x: clip;
  }
  a {
    color: inherit;
    text-decoration: none;
  }
  img {
    height: auto;
  }
  .w {
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 20px;
  }

  /* Utilitários de acessibilidade */
  .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: fixed;
    left: 16px;
    top: -100px;
    z-index: 100;
    background: var(--ye);
    color: #1d0f26;
    font-weight: 800;
    padding: 10px 18px;
    border-radius: 99px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    transition: top 0.15s;
  }
  .skip-link:focus {
    top: 12px;
  }

  /* Cabeçalho principal */
  header {
    position: sticky;
    top: env(safe-area-inset-top, 0px);
    z-index: 20;
    background: rgba(251, 250, 249, 0.94);
    border-bottom: 1px solid var(--bd);
  }
  body.pdoe header {
    background: rgba(255, 247, 251, 0.92);
  }
  #hd::after {
    content: "";
    display: block;
    height: 4px;
    background: linear-gradient(
      90deg,
      #e40303,
      #ff8c00,
      #ffed00,
      #008026,
      #24408e,
      #732982
    );
  }
  .nav {
    display: flex;
    align-items: center;
    gap: 16px;
    height: 60px;
    position: static;
  }
  .logo {
    display: flex;
    align-items: center;
  }
  .logo img {
    height: 54px;
    width: auto;
    display: block;
    mix-blend-mode: multiply;
  }
  .burger {
    display: none;
    margin-left: auto;
    background: var(--card);
    border: 1px solid var(--bd);
    color: var(--tx);
    border-radius: 10px;
    width: 44px;
    height: 40px;
    font-size: 20px;
    cursor: pointer;
  }
  nav > ul {
    display: flex;
    gap: 2px;
    list-style: none;
    margin: 0;
    padding: 0;
    flex: 1;
  }
  nav li {
    position: relative;
    margin: 0;
  }
  nav > ul > li {
    display: flex;
    align-items: center;
    height: 60px;
  }
  nav a {
    display: block;
    padding: 7px 11px;
    border-radius: 99px;
    color: var(--mu);
    font-size: 14px;
    white-space: nowrap;
  }
  nav a:hover,
  nav a.on,
  nav li:focus-within > a {
    color: var(--tx);
    background: var(--hv);
  }
  nav .caret {
    font-size: 10px;
    margin-left: 5px;
    opacity: 0.7;
  }
  nav .sm {
    display: none;
    position: absolute;
    top: calc(100% - 6px);
    left: 0;
    min-width: 270px;
    list-style: none;
    margin: 0;
    padding: 8px;
    background: #fff;
    border: 1px solid var(--bd);
    border-radius: 16px;
    box-shadow: 0 14px 40px #4a1a3a33;
  }
  nav li:hover > .sm,
  nav li:focus-within > .sm {
    display: block;
  }
  nav .sm a {
    border-radius: 10px;
    padding: 9px 12px;
    white-space: normal;
  }
  nav .sm a:hover {
    background: var(--hv);
  }
  nav > ul > li.dn {
    margin-left: auto;
  }
  nav a.don,
  nav a.don:hover,
  nav a.don.on {
    background: var(--ye);
    color: #09090b;
    font-weight: 700;
  }

  /* Botões e inputs */
  .btn {
    display: inline-block;
    padding: 9px 16px;
    border-radius: 99px;
    font-weight: 600;
    font-size: 14px;
    border: 1px solid var(--bd);
    background: var(--card);
    cursor: pointer;
    color: var(--tx);
    font-family: inherit;
    transition: transform 0.15s, border-color 0.15s, background-color 0.15s;
  }
  .btn:hover {
    border-color: var(--pk);
  }
  .btn.p {
    background: var(--pk);
    border-color: var(--pk);
    color: #fff;
  }
  .btn.y {
    background: var(--ye);
    border-color: var(--ye);
    color: #09090b;
  }
  .btn:focus-visible,
  a:focus-visible,
  input:focus-visible,
  textarea:focus-visible,
  summary:focus-visible,
  button:focus-visible {
    outline: 3px solid var(--ye);
    outline-offset: 2px;
  }

  /* Estrutura de páginas */
  main:focus {
    outline: none;
  }
  .page {
    display: none;
    padding: 48px 0 40px;
  }
  .page.on {
    display: block;
  }
  .page > h2 {
    margin-top: 64px;
  }
  h1 {
    font-size: clamp(32px, 6vw, 60px);
    line-height: 1.05;
    letter-spacing: -0.03em;
    margin: 0 0 16px;
  }
  h2 {
    font-size: 28px;
    letter-spacing: -0.02em;
    margin: 48px 0 16px;
  }
  h3 {
    margin: 0 0 6px;
    font-size: 18px;
  }
  p {
    color: var(--mu);
    margin: 0 0 12px;
  }
  .lead {
    color: var(--tx);
    font-size: 18px;
    line-height: 1.55;
  }
  .tag {
    display: inline-block;
    font-size: 12px;
    font-weight: 700;
    color: var(--yt);
    border: 1px solid var(--bd);
    border-radius: 99px;
    padding: 3px 10px;
    margin-bottom: 14px;
  }
  .gr {
    background: linear-gradient(
      90deg,
      #e0368a,
      #e8761a,
      #b88a00,
      #0e9f88,
      #3f6fe0,
      #8e44d6
    );
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
  }

  /* Cards, hero e componentes base */
  .c {
    background: var(--card);
    border: 1px solid var(--bd);
    border-radius: 22px;
    padding: 22px;
    box-shadow: 0 1px 3px #4a1a3a14;
    transition: border-color 0.2s;
  }
  .c:hover {
    border-color: var(--pk);
  }
  .hero {
    display: grid;
    gap: 32px;
    grid-template-columns: 1.2fr 1fr;
    align-items: center;
  }
  .vid {
    aspect-ratio: 16/9;
    border-radius: 16px;
    border: 1px dashed var(--bd);
    background: linear-gradient(135deg, #f3e8f2, #fce4ef);
    display: grid;
    place-items: center;
    color: var(--mu);
    font-size: 14px;
  }
  .row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 20px;
  }
  .badge {
    border-left: 3px solid var(--ye);
  }
  .src {
    font-size: 12px;
    color: var(--mu);
  }
  input,
  textarea {
    width: 100%;
    background: var(--card);
    border: 1px solid var(--bd);
    border-radius: 10px;
    color: var(--tx);
    padding: 10px 12px;
    font: inherit;
    margin-bottom: 10px;
  }
  .field-err {
    color: #b91c1c;
    font-size: 13px;
    font-weight: 600;
    margin: -4px 0 8px;
  }

  /* Controles de doação e Pix */
  .opts {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    margin: 10px 0 14px;
  }
  .opts .btn.sel {
    background: var(--pk);
    border-color: var(--pk);
    color: #fff;
  }
  .big {
    width: 100%;
    padding: 14px;
    font-size: 16px;
  }
  .imp {
    color: var(--yt);
    font-size: 14px;
    min-height: 44px;
    margin: 4px 0 10px;
  }
  details {
    border-bottom: 1px solid var(--bd);
    padding: 12px 0;
  }
  summary {
    cursor: pointer;
    font-weight: 600;
  }
  details p {
    margin: 8px 0 0;
  }
  .pix {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
  }
  .pix code {
    background: #fff;
    border: 1px solid var(--bd);
    border-radius: 8px;
    padding: 8px 10px;
    font-size: 13px;
    color: var(--yt);
  }

  /* Rede e social */
  .rede {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
    margin: 20px 0;
  }
  .rede a {
    transition: transform 0.2s, border-color 0.2s;
    /* background: var(--card); */
    /* border: 1px solid var(--bd); */
    border-radius: 99px;
    padding: 14px 26px;
    font-weight: 700;
    font-size: 18px;
  }
  .rede a:hover {
    border-color: var(--pk);
    transform: translateY(-2px);
  }
  .soc {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
  }
  .soc a {
    margin: 0;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: var(--hv);
    color: var(--pk);
    transition: background 0.2s, color 0.2s, transform 0.2s;
  }
  .soc a:hover {
    background: var(--pk);
    color: #fff;
    transform: translateY(-3px);
  }

  /* Botões flutuantes */
  .fdon {
    position: fixed;
    right: 14px;
    bottom: calc(14px + env(safe-area-inset-bottom, 0px));
    z-index: 30;
    box-shadow: 0 6px 24px #4a1a3a40;
    transition: opacity 0.2s, transform 0.2s, visibility 0.2s;
  }
  .fdon.hide-near-footer,
  body.pdoe .fdon {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(8px);
  }
  .totop {
    position: fixed;
    right: 14px;
    bottom: calc(68px + env(safe-area-inset-bottom, 0px));
    z-index: 30;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid var(--bd);
    background: var(--card);
    color: var(--tx);
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 6px 24px #4a1a3a40;
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: opacity 0.2s, transform 0.2s, visibility 0.2s;
  }
  .totop.show {
    opacity: 1;
    visibility: visible;
    transform: none;
  }
  .totop:hover {
    border-color: var(--pk);
  }
  body.pdoe .totop {
    bottom: calc(14px + env(safe-area-inset-bottom, 0px));
  }

  /* Fotos */
  .ph {
    width: 100%;
    display: block;
    border-radius: 22px;
    object-fit: cover;
    border: 1px solid var(--bd);
  }
  .ban2 {
    aspect-ratio: 16/6;
    margin: 8px 0 8px;
    object-position: center 40%;
  }
  .sub {
    scroll-margin-top: 84px;
  }

  @media (max-width: 760px) {
    .hero {
      grid-template-columns: 1fr;
    }
    .ban2 {
      aspect-ratio: 16/9;
    }
  }
  @media (max-width: 980px) {
    .burger {
      display: block;
    }
    nav {
      display: none;
      position: absolute;
      left: 0;
      right: 0;
      top: 60px;
      background: #fbfaf9;
      border-bottom: 1px solid var(--bd);
      max-height: calc(100vh - 70px);
      max-height: calc(100dvh - 70px);
      overflow-y: auto;
      padding: 8px 20px 20px;
    }
    body.pdoe nav {
      background: #fff7fb;
    }
    header.open nav {
      display: block;
    }
    nav > ul {
      flex-direction: column;
      gap: 0;
    }
    nav > ul > li {
      display: block;
      height: auto;
      margin: 0 !important;
    }
    nav a {
      font-size: 16px;
      padding: 11px 12px;
      border-radius: 10px;
      white-space: normal;
    }
    nav .sm {
      display: block;
      position: static;
      border: 0;
      box-shadow: none;
      background: none;
      padding: 0 0 6px 14px;
      min-width: 0;
    }
    nav .sm a {
      font-size: 15px;
      padding: 8px 12px;
    }
    nav .caret {
      display: none;
    }
    nav a.don {
      text-align: center;
      margin-top: 10px;
    }
  }
}
