/*
  VOICE   carinhoso, pessoal, feito para crescer com ela
  IDEA    o álbum de família que vira caderno de uma pré-adolescente
  PICTURE a foto principal emoldurada de um jeito próprio em cada visual
  COLOUR  Jardim: rosa + sálvia · Caderno: papel + caneta azul + fita amarela · Moderno: azul elétrico + amarelo + coral
  TYPE    DM Serif Display / Caveat / Space Grotesk nos títulos; Nunito / Inter no texto
*/
:root { color-scheme: light; }
[hidden] { display: none !important; }
*, *::before, *::after { box-sizing: border-box; min-width: 0; }
html { scroll-padding-top: 80px; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 17px/1.6 var(--body); overflow-x: clip; }
img { max-width: 100%; display: block; }
a { color: var(--accent); }
button { font: inherit; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }

/* ---------- visuais ---------- */
body[data-visual="jardim"] {
  --bg: #fff6f7; --surface: #ffffff; --ink: #3b2432; --muted: #7b5d6c; --line: #f0d3dc;
  --accent: #c8416d; --accent-ink: #fff; --support: #dfeadf; --support-ink: #36523f; --sharp: #c8416d;
  --display: "DM Serif Display", Georgia, serif; --body: "Nunito", system-ui, sans-serif;
  --radius: 22px; --border: 1px solid var(--line); --shadow: 0 14px 40px -20px rgb(120 40 70 / .35);
  --t-weight: 400;
}
body[data-visual="caderno"] {
  --bg: #f4efe4; --surface: #fffdf8; --ink: #27231f; --muted: #6a6158; --line: #ded4c2;
  --accent: #2856c9; --accent-ink: #fff; --support: #ffd84d; --support-ink: #3a2f00; --sharp: #e2553f;
  --display: "Caveat", "Comic Sans MS", cursive; --body: "Nunito", system-ui, sans-serif;
  --radius: 6px; --border: 1px solid var(--line); --shadow: 0 10px 24px -14px rgb(60 40 10 / .45);
  --t-weight: 700;
  background-image: radial-gradient(rgb(40 86 201 / .14) 1.2px, transparent 1.3px);
  background-size: 22px 22px;
}
body[data-visual="moderno"] {
  --bg: #ffffff; --surface: #ffffff; --ink: #111114; --muted: #4c4c57; --line: #111114;
  --accent: #2d55ff; --accent-ink: #fff; --support: #ffe45c; --support-ink: #111114; --sharp: #ff6a55;
  --display: "Space Grotesk", system-ui, sans-serif; --body: "Inter", system-ui, sans-serif;
  --radius: 16px; --border: 2px solid var(--ink); --shadow: 5px 5px 0 var(--ink);
  --t-weight: 700;
}

/* ---------- estrutura ---------- */
.skip { position: absolute; left: -999px; }
.skip:focus { left: 12px; top: 12px; z-index: 99; background: var(--surface); padding: 8px 12px; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 max(4vw, 16px); }
.band { padding: clamp(36px, 5vw, 72px) 0; }
.top { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(8px); border-bottom: var(--border); }
.top-in { max-width: 1180px; margin: 0 auto; padding: 10px max(4vw, 16px); display: flex; align-items: center; gap: 16px; }
.logo { font: var(--t-weight) 30px/1 var(--display); color: var(--ink); text-decoration: none; margin-right: auto; }
body[data-visual="caderno"] .logo { font-size: 38px; color: var(--accent); }
nav { display: flex; gap: 4px; flex-wrap: wrap; }
nav a { color: var(--ink); text-decoration: none; padding: 10px 12px; border-radius: 999px; font-weight: 600; font-size: 15px; }
nav a:hover { background: var(--support); color: var(--support-ink); }
nav a[aria-current="page"] { background: var(--accent); color: var(--accent-ink); }
body[data-visual="moderno"] nav a[aria-current="page"] { box-shadow: 3px 3px 0 var(--ink); }
.menu-btn { display: none; min-height: 44px; padding: 0 16px; border: var(--border); border-color: var(--ink); background: var(--surface); color: var(--ink); border-radius: 999px; font-weight: 700; }
@media (max-width: 860px) {
  .menu-btn { display: block; }
  nav { display: none; position: absolute; left: 0; right: 0; top: 100%; background: var(--bg); border-bottom: var(--border); flex-direction: column; padding: 8px max(4vw, 16px) 16px; }
  nav.open { display: flex; }
  nav a { padding: 12px 14px; font-size: 17px; }
}
.foot { border-top: var(--border); margin-top: 40px; }
.foot-in { max-width: 1180px; margin: 0 auto; padding: 24px max(4vw, 16px) 90px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 15px; }
.foot-links { display: flex; gap: 18px; }
.loading { padding: 80px 20px; text-align: center; color: var(--muted); }

/* ---------- tipografia ---------- */
h1, h2, h3 { font-family: var(--display); font-weight: var(--t-weight); line-height: 1.08; text-wrap: balance; margin: 0 0 .4em; }
h1 { font-size: clamp(40px, 6vw, 68px); }
h2 { font-size: clamp(30px, 3.6vw, 42px); }
h3 { font-size: 24px; }
body[data-visual="caderno"] h1 { font-size: clamp(52px, 8vw, 92px); }
body[data-visual="caderno"] h2 { font-size: clamp(40px, 5vw, 56px); }
body[data-visual="caderno"] h3 { font-size: 32px; }
body[data-visual="moderno"] h1 { letter-spacing: -0.02em; }
.lead { font-size: clamp(18px, 2vw, 21px); color: var(--muted); max-width: 34em; }
.prose { max-width: 680px; }
.prose p { margin: 0 0 1em; }
.muted { color: var(--muted); }
.sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.sec-head a { font-weight: 700; }

/* ---------- botões ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 22px; border-radius: 999px; font-weight: 800; text-decoration: none; border: 0; cursor: pointer; background: var(--accent); color: var(--accent-ink); }
.btn.alt { background: var(--support); color: var(--support-ink); }
body[data-visual="moderno"] .btn { border: var(--border); box-shadow: 3px 3px 0 var(--ink); border-radius: 12px; }
body[data-visual="moderno"] .btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
body[data-visual="caderno"] .btn { border-radius: 4px; }
.btns { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }

/* ---------- capa ---------- */
.hero { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: clamp(24px, 5vw, 72px); align-items: center; padding-block: clamp(28px, 5vw, 72px); }
.hero-pic { width: 100%; max-width: 440px; justify-self: center; }
.hero-pic { position: relative; }
.hero-pic img, .hero-pic svg { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; }
body[data-visual="jardim"] .hero-pic img, body[data-visual="jardim"] .hero-pic svg { border-radius: 999px 999px 28px 28px; box-shadow: var(--shadow); }
body[data-visual="jardim"] .hero-pic::before { content: ""; position: absolute; inset: 18px -18px -18px 18px; border-radius: 999px 999px 28px 28px; background: var(--support); z-index: -1; }
body[data-visual="caderno"] .hero-pic { background: #fff; padding: 14px 14px 64px; box-shadow: var(--shadow); transform: rotate(2.2deg); }
body[data-visual="caderno"] .hero-pic::after { content: attr(data-cap); position: absolute; left: 0; right: 0; bottom: 12px; text-align: center; font: 700 30px/1 var(--display); color: var(--ink); }
body[data-visual="caderno"] .hero-pic::before { content: ""; position: absolute; top: -16px; left: 50%; width: 130px; height: 34px; margin-left: -65px; background: rgb(255 216 77 / .85); transform: rotate(-4deg); z-index: 1; }
body[data-visual="moderno"] .hero-wrap { background: var(--accent); color: #fff; border-bottom: var(--border); }
body[data-visual="moderno"] .hero-wrap .lead { color: #e6ebff; }
body[data-visual="moderno"] .hero-wrap .btn.alt { background: var(--support); }
body[data-visual="moderno"] .hero-pic img, body[data-visual="moderno"] .hero-pic svg { border: 3px solid var(--ink); border-radius: 28px; box-shadow: 10px 10px 0 var(--ink); }
body[data-visual="moderno"] .hero-pic::after { content: "oi!"; position: absolute; right: -10px; top: 18px; background: var(--support); color: var(--ink); border: 2px solid var(--ink); border-radius: 999px; padding: 8px 16px; font: 700 20px var(--display); transform: rotate(8deg); }
.hello { font-weight: 800; color: var(--accent); margin-bottom: 8px; }
body[data-visual="moderno"] .hello { color: var(--support); }
@media (max-width: 760px) {
  .hero { grid-template-columns: 1fr; }
  .hero-pic { max-width: 380px; margin: 0 auto; order: -1; width: 86%; }
}

/* ---------- cartões ---------- */
.grid { display: grid; gap: 20px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); }
.card { background: var(--surface); border: var(--border); border-radius: var(--radius); overflow: hidden; text-decoration: none; color: inherit; display: flex; flex-direction: column; transition: transform .2s; }
.card:hover { transform: translateY(-3px); }
body[data-visual="moderno"] .card { box-shadow: var(--shadow); }
body[data-visual="jardim"] .card { box-shadow: var(--shadow); border: 0; }
body[data-visual="caderno"] .card { padding: 10px 10px 4px; border-radius: 3px; box-shadow: var(--shadow); border: 0; }
body[data-visual="caderno"] .card:nth-child(odd) { transform: rotate(-1.2deg); }
body[data-visual="caderno"] .card:nth-child(even) { transform: rotate(1deg); }
body[data-visual="caderno"] .card:hover { transform: rotate(0) translateY(-3px); }
.card .thumb { aspect-ratio: 4 / 3; width: 100%; object-fit: cover; background: var(--support); }
.card .body { padding: 14px 16px 18px; }
.card h3 { margin: 0 0 4px; }
.card .meta { font-size: 14px; color: var(--muted); }

/* ---------- linha do tempo ---------- */
.year { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 20px; padding: 18px 0; border-top: var(--border); }
.year > h2 { margin: 0; color: var(--accent); }
.tl { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.tl li { display: grid; grid-template-columns: 70px minmax(0, 1fr); gap: 14px; align-items: start; }
.tl .when { font-size: 14px; color: var(--muted); padding-top: 3px; white-space: nowrap; }
.tl .what { background: var(--surface); border: var(--border); border-radius: var(--radius); padding: 12px 16px; }
.tl .marco .what { background: transparent; border: 0; padding: 0 0 0 16px; border-left: 3px solid var(--support); border-radius: 0; }
body[data-visual="moderno"] .tl .what { box-shadow: 3px 3px 0 var(--ink); }
.tl .what b { display: block; }
.tl a.what { text-decoration: none; color: inherit; }
@media (max-width: 600px) { .year { grid-template-columns: 1fr; gap: 8px; } }

/* ---------- álbum ---------- */
.photos { columns: 3 220px; column-gap: 14px; }
.photos button { all: unset; display: block; margin: 0 0 14px; break-inside: avoid; cursor: zoom-in; width: 100%; }
.photos img { width: 100%; height: auto; border-radius: calc(var(--radius) * .6); }
body[data-visual="caderno"] .photos button { background: #fff; padding: 8px 8px 26px; box-shadow: var(--shadow); }
body[data-visual="caderno"] .photos img { border-radius: 0; }
body[data-visual="moderno"] .photos img { border: 2px solid var(--ink); }
.photos button:focus-visible { outline: 3px solid var(--accent); }
.photos small { display: block; font-size: 14px; color: var(--muted); padding-top: 4px; }

dialog#lightbox { border: 0; padding: 0; max-width: 100vw; max-height: 100vh; width: 100vw; height: 100vh; background: rgb(10 8 12 / .94); color: #fff; }
dialog#lightbox figure { margin: 0; height: 100%; display: grid; place-items: center; padding: 56px 64px; }
dialog#lightbox img { max-height: calc(100vh - 140px); max-width: 100%; object-fit: contain; border-radius: 6px; }
dialog#lightbox figcaption { text-align: center; margin-top: 10px; }
.lb-btn { position: absolute; width: 48px; height: 48px; border-radius: 50%; border: 0; background: rgb(255 255 255 / .14); color: #fff; font-size: 30px; cursor: pointer; }
.lb-prev { left: 10px; top: 50%; margin-top: -24px; } .lb-next { right: 10px; top: 50%; margin-top: -24px; } .lb-close { right: 10px; top: 10px; }
@media (max-width: 600px) { dialog#lightbox figure { padding: 56px 8px; } .lb-prev, .lb-next { top: auto; bottom: 12px; } }

/* ---------- família ---------- */
.gen { margin-bottom: 34px; }
.gen h2 { font-size: clamp(26px, 3vw, 34px); }
.gen-row { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); }
.side { background: var(--surface); border: var(--border); border-radius: var(--radius); padding: 16px; }
body[data-visual="moderno"] .side { box-shadow: var(--shadow); }
.gen .side h3 { font-size: 18px; font-family: var(--body); font-weight: 800; color: var(--muted); margin-bottom: 12px; }
.people { display: flex; flex-wrap: wrap; gap: 16px; }
.person { width: 118px; text-align: center; font-size: 15px; }
.person img, .person .ph { width: 118px; height: 140px; object-fit: cover; border-radius: calc(var(--radius) * .6); background: var(--support); }
body[data-visual="jardim"] .person img, body[data-visual="jardim"] .person .ph { border-radius: 999px 999px 14px 14px; }
body[data-visual="moderno"] .person img, body[data-visual="moderno"] .person .ph { border: 2px solid var(--ink); }
.person b { display: block; margin-top: 6px; line-height: 1.25; }
.person span { color: var(--muted); font-size: 14px; }
.me-row { display: flex; justify-content: center; }
.me-row .person { width: 160px; } .me-row .person img, .me-row .person .ph { width: 160px; height: 190px; }

/* ---------- comentários ---------- */
.comments { margin-top: 40px; max-width: 720px; }
.cform { display: grid; gap: 12px; background: var(--surface); border: var(--border); border-radius: var(--radius); padding: 20px; }
body[data-visual="moderno"] .cform { box-shadow: var(--shadow); }
.cform label { display: grid; gap: 6px; font-weight: 700; font-size: 15px; }
.cform input, .cform textarea { font: 16px var(--body); padding: 12px 14px; border-radius: 10px; border: 1.5px solid var(--line); background: #fff; color: var(--ink); }
body[data-visual="moderno"] .cform input, body[data-visual="moderno"] .cform textarea { border: 2px solid var(--ink); }
.cform textarea { min-height: 110px; resize: vertical; }
.hp { position: absolute; left: -9999px; }
.notice { padding: 12px 16px; border-radius: 10px; background: var(--support); color: var(--support-ink); font-weight: 700; }
.notice.bad { background: #ffe0dc; color: #7a1a10; }
.clist { list-style: none; padding: 0; margin: 24px 0 0; display: grid; gap: 14px; }
.clist li { background: var(--surface); border: var(--border); border-radius: var(--radius); padding: 14px 18px; }
body[data-visual="caderno"] .clist li { background: #fffbd9; border: 0; box-shadow: var(--shadow); border-radius: 2px; }
body[data-visual="caderno"] .clist li:nth-child(odd) { transform: rotate(-.6deg); }
.clist b { display: block; } .clist time { font-size: 13px; color: var(--muted); }
.clist p { margin: 6px 0 0; white-space: pre-line; }

/* ---------- sobre ---------- */
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 340px); gap: clamp(24px, 5vw, 64px); align-items: start; }
.split .pic img, .split .pic svg { width: 100%; aspect-ratio: 4/5; object-fit: cover; border-radius: var(--radius); box-shadow: var(--shadow); }
body[data-visual="moderno"] .split .pic img, body[data-visual="moderno"] .split .pic svg { border: 2px solid var(--ink); }
@media (max-width: 760px) { .split { grid-template-columns: 1fr; } .split .pic { max-width: 320px; } }
.quote { font: var(--t-weight) clamp(24px, 3vw, 34px)/1.25 var(--display); padding: 26px 28px; background: var(--support); color: var(--support-ink); border-radius: var(--radius); margin: 32px 0 0; }
body[data-visual="moderno"] .quote { border: var(--border); box-shadow: var(--shadow); }
.hearts { color: var(--accent); letter-spacing: .4em; text-align: center; font-size: 14px; opacity: .6; margin: 8px 0 0; }
body:not([data-visual="jardim"]) .hearts { display: none; }

/* ---------- seletor de visual (prévia) ---------- */
.picker { position: fixed; left: 50%; bottom: 14px; transform: translateX(-50%); z-index: 50; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: center; background: #111; color: #fff; padding: 8px 10px 8px 16px; border-radius: 999px; box-shadow: 0 10px 30px rgb(0 0 0 / .3); font: 600 14px system-ui, sans-serif; max-width: calc(100vw - 20px); }
.picker button { min-height: 40px; padding: 0 14px; border-radius: 999px; border: 0; background: #2b2b30; color: #fff; cursor: pointer; font-weight: 700; }
.picker button[aria-pressed="true"] { background: #fff; color: #111; }

@media (max-width: 600px) { .picker { flex-wrap: nowrap; width: max-content; gap: 4px; padding: 6px; font-size: 12px; bottom: 10px; } .picker span { display: none; } .picker button { min-height: 38px; padding: 0 12px; } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
