/* =========================================================
   Diário TDAH — folha de estilos
   Paleta: índigo (tinta), violeta (ação), manteiga (destaque),
   com fundos lilás claros. Tipografia: Bricolage Grotesque
   (títulos) + Atkinson Hyperlegible (texto, feita para leitura fácil).
   ========================================================= */

:root {
  --ink: #241b57;
  --violet: #5b45e0;
  --violet-dark: #4632c4;
  --butter: #ffe27a;
  --paper: #fbfaff;
  --lilac: #ece8ff;
  --lilac-2: #ddd5ff;
  --mint: #c4ebdc;
  --peach: #ffd6c7;
  --text: #1e1a3d;
  --muted: #57527d;
  --line: #dcd6f5;
  --line-strong: #c3bae8;

  --font-display: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --font-body: "Atkinson Hyperlegible", "Segoe UI", system-ui, sans-serif;

  --radius-lg: 20px;
  --radius-md: 12px;
  --radius-pill: 999px;

  --header-h: 72px;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 1rem);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.125rem;
  line-height: 1.65;
  color: var(--text);
  background: var(--paper);
}

img { max-width: 100%; display: block; }

[hidden] { display: none !important; }

h1, h2, h3 {
  font-family: var(--font-display);
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin: 0;
  text-wrap: balance;
}

h2 { font-size: clamp(2rem, 4.2vw, 3rem); font-weight: 800; }
h3 { font-size: 1.5rem; font-weight: 700; }

p { margin: 0 0 1em; }

a { color: var(--violet-dark); }

:focus-visible {
  outline: 3px solid var(--violet);
  outline-offset: 3px;
  border-radius: 4px;
}

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  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(--ink);
  color: #fff;
  padding: .75rem 1.25rem;
  border-radius: var(--radius-md);
  transition: top .2s;
}
.skip-link:focus { top: 1rem; }

.wrap {
  width: min(1160px, 100% - 2.5rem);
  margin-inline: auto;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
  }
}

/* ---------- Botões e links ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: .75rem 1.6rem;
  border: 2px solid transparent;
  border-radius: var(--radius-pill);
  font: 700 1rem/1.2 var(--font-body);
  text-decoration: none;
  cursor: pointer;
  transition: background-color .2s, color .2s, border-color .2s;
}
.btn:disabled { opacity: .6; cursor: progress; }

.btn--primary { background: var(--violet); color: #fff; }
.btn--primary:hover { background: var(--violet-dark); }

.btn--ghost { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn--ghost:hover { background: var(--ink); color: #fff; }

.text-link {
  color: var(--violet-dark);
  font-weight: 700;
  text-underline-offset: .2em;
  text-decoration-thickness: 2px;
}
.text-link:hover { color: var(--ink); }

/* ---------- Cabeçalho ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(251, 250, 255, .94);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.site-header__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-h);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: .65rem;
  color: var(--violet);
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.3rem;
  letter-spacing: -0.02em;
}
.brand span { color: var(--ink); }

.nav ul {
  display: flex;
  gap: 1.75rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav a {
  display: inline-block;
  padding: .35rem 0;
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
  font-size: 1rem;
  border-bottom: 2px solid transparent;
  transition: border-color .2s;
}
.nav a:hover { border-bottom-color: var(--line-strong); }
.nav a.is-active { border-bottom-color: var(--violet); }

.nav-toggle {
  display: none;
  width: 48px; height: 48px;
  border: 0;
  border-radius: var(--radius-md);
  background: transparent;
  cursor: pointer;
  position: relative;
}
.nav-toggle__bars,
.nav-toggle__bars::before,
.nav-toggle__bars::after {
  content: "";
  position: absolute;
  left: 12px;
  width: 24px; height: 3px;
  border-radius: 2px;
  background: var(--ink);
  transition: transform .2s, top .2s, background-color .2s;
}
.nav-toggle__bars { top: 22px; }
.nav-toggle__bars::before { left: 0; top: -8px; }
.nav-toggle__bars::after  { left: 0; top: 8px; }

.nav-toggle[aria-expanded="true"] .nav-toggle__bars { background: transparent; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars::before { top: 0; transform: rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars::after  { top: 0; transform: rotate(-45deg); }

@media (max-width: 860px) {
  .nav-toggle { display: block; }
  .nav {
    display: none;
    position: absolute;
    left: 0; right: 0;
    top: 100%;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
    padding: .5rem 1.25rem 1.25rem;
  }
  .nav.is-open { display: block; }
  .nav ul { flex-direction: column; gap: 0; }
  .nav a {
    display: block;
    padding: .9rem 0;
    border-bottom: 1px solid var(--line);
    font-size: 1.1rem;
  }
  .nav a.is-active { border-bottom-color: var(--violet); }
}

/* ---------- Hero: o teto de quadradinhos ---------- */
.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: min(86vh, 780px);
  background: var(--ink);
  color: #fff;
}

.hero__tiles {
  position: absolute;
  inset: 0;
  z-index: -1;
  display: grid;
  grid-template-columns: repeat(var(--cols, 20), var(--tile, 72px));
  grid-auto-rows: var(--tile, 72px);
  pointer-events: none;
}

.tile {
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .07);
  background-color: transparent;
  transition: background-color 1.6s ease-out;
}
.tile.is-counted { background-color: rgba(255, 226, 122, .09); }
.tile.is-lit {
  background-color: rgba(255, 226, 122, .35);
  transition-duration: 0s;
}

.hero__inner {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-block: clamp(3rem, 8vw, 6rem) 2rem;
}

.hero h1 {
  font-size: clamp(2.5rem, 6.4vw, 5.25rem);
  font-weight: 800;
  line-height: 1.02;
  letter-spacing: -0.035em;
  max-width: 15ch;
}

.hero__lead {
  margin-top: 1.5rem;
  max-width: 34rem;
  font-size: clamp(1.15rem, 2vw, 1.4rem);
  line-height: 1.5;
  color: #e6e2ff;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: .875rem;
  margin-top: 2rem;
}

.hero .btn--primary { background: var(--butter); color: var(--ink); }
.hero .btn--primary:hover { background: #fff1b3; }
.hero .btn--ghost { color: #fff; border-color: rgba(255, 255, 255, .55); }
.hero .btn--ghost:hover { background: rgba(255, 255, 255, .14); color: #fff; }
.hero :focus-visible { outline-color: var(--butter); }

.hero__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .75rem 1.5rem;
  padding-bottom: 1.75rem;
}
.hero__foot p { margin: 0; }

.tile-counter {
  padding: .45rem 1rem;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, .1);
  font-size: 1rem;
  font-variant-numeric: tabular-nums;
}
.tile-counter strong { color: var(--butter); }

.tile-hint {
  max-width: 44ch;
  font-size: .95rem;
  line-height: 1.45;
  color: #cfc9f5;
}

/* ---------- Seções ---------- */
.section { padding-block: clamp(4rem, 9vw, 7rem); }
.section--tint { background: var(--lilac); }

.section__head { max-width: 42rem; margin-bottom: 2.5rem; }
.section__lead {
  margin: .9rem 0 0;
  font-size: 1.2rem;
  color: var(--muted);
}

.split {
  display: grid;
  gap: 2rem 4rem;
  grid-template-columns: minmax(0, 1fr);
}
@media (min-width: 900px) {
  .split { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }
  .split--sticky .split__aside {
    position: sticky;
    top: calc(var(--header-h) + 2rem);
    align-self: start;
  }
}

/* Sobre */
.about__text {
  font-size: clamp(1.25rem, 2.2vw, 1.55rem);
  line-height: 1.5;
}
.about__sign { margin-top: 1.5rem; }

/* Jornada */
.prose p { max-width: 62ch; margin-bottom: 1.25em; }

.dialogue {
  margin: 1.75rem 0;
  padding: 1.25rem 1.5rem;
  max-width: 46ch;
  background: #fff;
  border-left: 6px solid var(--violet);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
}
.dialogue p {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -0.01em;
}

/* ---------- Blog ---------- */
.blog-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.5rem;
  margin-bottom: 2rem;
}

.search input {
  width: min(100%, 320px);
  min-height: 48px;
  padding: 0 1.25rem;
  border: 2px solid var(--line-strong);
  border-radius: var(--radius-pill);
  background: #fff;
  color: var(--text);
  font: inherit;
  font-size: 1rem;
}
.search input:focus { border-color: var(--violet); }

.chips { display: flex; flex-wrap: wrap; gap: .5rem; }
.chip {
  min-height: 44px;
  padding: 0 1.1rem;
  border: 2px solid var(--line-strong);
  border-radius: var(--radius-pill);
  background: #fff;
  color: var(--text);
  font: 700 .95rem/1 var(--font-body);
  cursor: pointer;
  transition: background-color .2s, color .2s, border-color .2s;
}
.chip:hover { border-color: var(--ink); }
.chip[aria-pressed="true"] {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}

.post-grid {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: minmax(0, 1fr);
}
@media (min-width: 640px) {
  .post-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .post--featured { grid-column: span 2; flex-direction: row; }
  .post--featured .post__cover { flex: 1 1 50%; aspect-ratio: auto; min-height: 100%; }
  .post--featured .post__body { flex: 1 1 50%; justify-content: center; padding: 2rem; }
  .post--featured .post__title { font-size: clamp(1.6rem, 2.6vw, 2rem); }
}
@media (min-width: 1000px) {
  .post-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.post {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  transition: border-color .2s;
}
.post:hover { border-color: var(--violet); }
.post:has(.post__link:focus-visible) {
  outline: 3px solid var(--violet);
  outline-offset: 3px;
}

.post__cover {
  --c: var(--lilac-2);
  position: relative;
  display: flex;
  align-items: flex-end;
  aspect-ratio: 16 / 9;
  padding: 1rem;
  background-color: var(--c);
  background-image:
    linear-gradient(rgba(36, 27, 87, .09) 1px, transparent 1px),
    linear-gradient(90deg, rgba(36, 27, 87, .09) 1px, transparent 1px);
  background-size: 32px 32px;
}
.post__cover--entender    { --c: var(--lilac-2); }
.post__cover--diagnostico { --c: var(--butter); }
.post__cover--medicacao   { --c: var(--mint); }
.post__cover--rotina      { --c: var(--peach); }

.post__cover img {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}

.post__tag {
  position: relative;
  padding: .25rem .75rem;
  border-radius: var(--radius-pill);
  background: #fff;
  color: var(--ink);
  font-size: .85rem;
  font-weight: 700;
}

.post__body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: .75rem;
  padding: 1.25rem 1.5rem 1.5rem;
}

.post__title {
  font-size: 1.3rem;
  line-height: 1.2;
}
.post__link { color: var(--ink); text-decoration: none; }
.post__link:focus-visible { outline: none; }
.post__link::after { content: ""; position: absolute; inset: 0; }

.post__desc {
  margin: 0;
  font-size: 1rem;
  line-height: 1.5;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post__meta {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: auto;
  padding-top: .75rem;
  font-size: .9rem;
  color: var(--muted);
}

.blog-empty { font-size: 1.15rem; color: var(--muted); }

.blog-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  margin-top: 2.5rem;
}
.blog-status { margin: 0; color: var(--muted); font-size: .95rem; }

/* ---------- Dicas ---------- */
.tips { max-width: 900px; }
.tip {
  display: grid;
  gap: .5rem 2rem;
  padding: 1.75rem 0;
  border-top: 1px solid var(--line-strong);
}
.tip:last-child { border-bottom: 1px solid var(--line-strong); }
.tip h3 { font-size: 1.6rem; }
.tip p { max-width: 52ch; margin-bottom: .5em; }
@media (min-width: 760px) {
  .tip { grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); }
}

/* ---------- FAQ ---------- */
.faq { max-width: 820px; border-top: 1px solid var(--line-strong); }
.faq details { border-bottom: 1px solid var(--line-strong); }

.faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem 0;
  cursor: pointer;
  list-style: none;
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.01em;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  flex: none;
  font-size: 1.9rem;
  line-height: 1;
  color: var(--violet);
  transition: transform .2s;
}
.faq details[open] summary::after { transform: rotate(45deg); }

.faq__answer { max-width: 62ch; padding: 0 0 1.5rem; }

.timeline {
  margin: 1.5rem 0 0;
  padding: 0;
  list-style: none;
  border-left: 2px solid var(--line-strong);
}
.timeline li { position: relative; padding: 0 0 1.5rem 1.75rem; }
.timeline li::before {
  content: "";
  position: absolute;
  left: -8px; top: .4rem;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--violet);
  border: 3px solid var(--paper);
}
.timeline__year {
  display: block;
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--violet-dark);
}
.timeline__title { margin: 0 0 .25em; font-weight: 700; }
.timeline li p:last-child { margin-bottom: 0; }

/* ---------- Newsletter e contato ---------- */
.newsletter { margin-top: 1.75rem; max-width: 30rem; }
.newsletter__row { display: flex; flex-wrap: wrap; gap: .75rem; }
.newsletter__row input { flex: 1 1 14rem; }

.contact-links { margin-top: 2rem; }

.panel {
  padding: clamp(1.5rem, 4vw, 2.25rem);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}
.panel h3 { margin-bottom: 1.5rem; }

.field { display: grid; gap: .4rem; margin-bottom: 1.1rem; }
.field label { font-weight: 700; font-size: 1rem; }
.field__opt { font-weight: 400; color: var(--muted); }

.field input,
.field textarea {
  width: 100%;
  padding: .8rem 1rem;
  border: 2px solid var(--line-strong);
  border-radius: var(--radius-md);
  background: #fff;
  color: var(--text);
  font: inherit;
  font-size: 1rem;
}
.field textarea { resize: vertical; min-height: 8rem; }
.field input:focus,
.field textarea:focus { border-color: var(--violet); }
.field [aria-invalid="true"] { border-color: #b3261e; }

.field__error { margin: 0; font-size: .95rem; color: #a11d16; }

.form__status { margin: 1rem 0 0; font-weight: 700; min-height: 1.5em; }
.form__status.is-ok { color: #0d6b4d; }
.form__status.is-error { color: #a11d16; }

/* ---------- Rodapé ---------- */
.site-footer {
  padding-block: 3.5rem 2rem;
  background: var(--ink);
  color: #d9d4f7;
  font-size: 1rem;
}
.site-footer a { color: #fff; text-underline-offset: .2em; }
.site-footer :focus-visible { outline-color: var(--butter); }

.site-footer__grid {
  display: grid;
  gap: 2rem;
  grid-template-columns: minmax(0, 1fr);
}
@media (min-width: 760px) {
  .site-footer__grid { grid-template-columns: 2fr 1.5fr 1.5fr; }
}
.site-footer__brand {
  margin-bottom: .5rem;
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 800;
  color: #fff;
}
.site-footer ul { margin: 0; padding: 0; list-style: none; }
.site-footer li { margin-bottom: .4rem; }
.site-footer p { margin-bottom: .5em; }

.site-footer__legal {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, .18);
  font-size: .9rem;
  color: #b9b2e8;
}
.site-footer__legal p { max-width: 70ch; }
