/* =========================================================
   Neoro — Instituto do Cérebro e Coluna
   style.css compartilhado (todas as páginas)
   Base 8: todo espaçamento, raio e tamanho de bloco é múltiplo de 8px.
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Philosopher:ital,wght@0,400;0,700;1,400&family=Rubik:wght@300;400;500;600&display=swap');

@view-transition { navigation: auto; }

:root {
  /* Cores — dourado do logo como destaque (substituir pelos valores do brandguide) */
  --bg: #2F2820;
  --bg-alt: #362E25;
  --bg-raised: #3A3128;
  --text: #F1ECE3;
  --text-dim: #B3AA9C;
  --text-faint: #8C8274;
  --accent: #CAA962;
  --accent-soft: rgba(202, 169, 98, 0.14);
  --line: rgba(237, 237, 232, 0.13);
  --line-strong: rgba(237, 237, 232, 0.30);

  /* Tipografia */
  --f-display: 'Philosopher', Georgia, serif;
  --f-body: 'Rubik', system-ui, -apple-system, sans-serif;

  /* Base 8 */
  --s1: 8px;   --s2: 16px;  --s3: 24px;  --s4: 32px;
  --s5: 40px;  --s6: 48px;  --s8: 64px;  --s10: 80px;
  --s12: 96px; --s16: 128px; --s20: 160px;

  --radius: 8px;
  --gap: 8px;             /* espaçamento entre colunas de imagens */
  --wrap: 48px;           /* margem lateral desktop */
  --section: var(--s16);  /* respiro vertical entre seções (desktop = 2x mobile) */
  --header-h: 88px;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: var(--header-h); -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--f-body);
  font-size: 16px;
  font-weight: 300;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
img, video, iframe { display: block; max-width: 100%; }
img { border-radius: var(--radius); }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
ul { list-style: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 4px; }

.wrap { padding-left: var(--wrap); padding-right: var(--wrap); max-width: 1536px; margin: 0 auto; }
.section { padding-top: var(--section); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Tipografia ---------- */
h1, h2, h3, .display { font-family: var(--f-display); font-weight: 400; line-height: 1.08; letter-spacing: -0.01em; color: var(--accent); }
/* Títulos em Philosopher sempre no dourado da identidade */
.doctor__name, .event__name, .social-row__name, .footer__unit strong { color: var(--accent); }
.page-title { font-size: clamp(2.5rem, 5.5vw, 4.5rem); }
.label {
  font-family: var(--f-body);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-faint);
}
.dim { color: var(--text-dim); }

/* ---------- Cabeçalho de seção (40/60) ---------- */
.sec-head {
  display: grid;
  grid-template-columns: 2fr 3fr;
  gap: var(--s4);
  align-items: end;
  padding-bottom: var(--s5);
  margin-bottom: var(--s5);
  border-bottom: 1px solid var(--line);
}
.sec-head h2 { font-size: clamp(2rem, 3.4vw, 3rem); }
.sec-head p { color: var(--text-dim); max-width: 56ch; font-size: 16px; }
.sec-head .label { display: block; margin-bottom: var(--s2); }
.sec-head__aside { display: flex; justify-content: space-between; align-items: end; gap: var(--s3); flex-wrap: wrap; }

/* ---------- Links e botões ---------- */
.ghost-link {
  display: inline-flex; align-items: center; gap: var(--s1);
  font-size: 14px; font-weight: 400; color: var(--text-dim);
  border-bottom: 1px solid var(--line-strong);
  padding-bottom: 2px;
  transition: color .2s, border-color .2s;
}
.ghost-link:hover { color: var(--accent); border-color: var(--accent); }
.ghost-link .arrow { transition: transform .2s; }
.ghost-link:hover .arrow { transform: translateX(4px); }

.btn-pill {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s1);
  height: var(--s6);
  padding: 0 var(--s3);
  border-radius: 999px;
  border: 1px solid var(--accent);
  color: var(--accent);
  font-size: 15px; font-weight: 400;
  white-space: nowrap;
  transition: background .2s, color .2s;
}
.btn-pill:hover { background: var(--accent); color: var(--bg); }
.btn-pill--sm { height: 40px; padding: 0 var(--s2); font-size: 14px; }

/* ---------- Mídia / placeholders ---------- */
.media {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--bg-raised);
}
.media::before {           /* ícone de imagem do placeholder */
  content: "";
  position: absolute; inset: 0;
  background: center / 40px no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238C8274' stroke-width='1.2'%3E%3Crect x='3' y='3' width='18' height='18' rx='2'/%3E%3Ccircle cx='8.5' cy='8.5' r='1.5'/%3E%3Cpath d='M21 15l-5-5L5 21'/%3E%3C/svg%3E");
  opacity: .8;
}
.media > img, .media > iframe {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; border-radius: var(--radius);
}
.media > img.is-missing { display: none; }
.r-9x16 { aspect-ratio: 9 / 16; }
.r-4x5  { aspect-ratio: 4 / 5; }
.r-16x9 { aspect-ratio: 16 / 9; }

/* ---------- Topbar + Header ---------- */
#site-header { min-height: var(--header-h); }
.topbar {
  border-bottom: 1px solid var(--line);
  font-size: 13px; color: var(--text-dim);
}
.topbar .wrap { display: flex; justify-content: space-between; align-items: center; height: 40px; gap: var(--s3); }
.topbar__units { display: flex; gap: var(--s4); }
.topbar a:hover { color: var(--accent); }
.topbar__units span { color: var(--accent); margin-right: var(--s1); }

.header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(47, 40, 32, .9);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
}
.header .wrap { display: flex; align-items: center; justify-content: space-between; height: var(--header-h); gap: var(--s4); }
.logo img { height: var(--s6); width: auto; border-radius: 0; }

.nav { display: flex; align-items: center; gap: var(--s4); }
.nav__list { display: flex; gap: var(--s4); }
.nav__item { position: relative; }
.nav__link {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 15px; font-weight: 400; color: var(--text-dim);
  padding: var(--s1) 0;
  transition: color .2s;
}
.nav__link:hover, .nav__item:focus-within > .nav__link { color: var(--accent); }
.nav__caret { width: 8px; height: 8px; border-right: 1px solid currentColor; border-bottom: 1px solid currentColor; transform: rotate(45deg) translateY(-2px); margin-left: 4px; }
.nav__sub {
  position: absolute; top: 100%; left: calc(var(--s2) * -1);
  min-width: 264px;
  padding: var(--s1);
  background: var(--bg-alt);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  opacity: 0; visibility: hidden; transform: translateY(8px);
  transition: opacity .2s, transform .2s, visibility .2s;
}
.nav__item:hover > .nav__sub, .nav__item:focus-within > .nav__sub { opacity: 1; visibility: visible; transform: none; }
.nav__item:last-child .nav__sub { left: auto; right: calc(var(--s2) * -1); }  /* não estourar a tela */
.nav__sub a { display: block; padding: var(--s1) var(--s2); border-radius: var(--radius); font-size: 14px; color: var(--text-dim); }
.nav__sub a:hover { background: var(--bg-raised); color: var(--accent); }

.header__actions { display: flex; align-items: center; gap: var(--s2); }
.lang {
  font-size: 12px; font-weight: 500; letter-spacing: .12em; color: var(--text-faint);
  height: 40px; padding: 0 var(--s1);
}
.lang b { color: var(--text); font-weight: 500; }
.lang:hover { color: var(--accent); }

.burger { display: none; width: var(--s5); height: var(--s5); position: relative; }
.burger span { position: absolute; left: 8px; right: 8px; height: 1px; background: var(--text); transition: transform .25s, top .25s; }
.burger span:nth-child(1) { top: 16px; }
.burger span:nth-child(2) { top: 24px; }
.menu-open .burger span:nth-child(1) { top: 20px; transform: rotate(45deg); }
.menu-open .burger span:nth-child(2) { top: 20px; transform: rotate(-45deg); }

/* ---------- CTA band ---------- */
.cta-band {
  display: grid; grid-template-columns: 3fr 2fr; gap: var(--s4);
  align-items: end;
  padding: var(--s10) 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.cta-band h2 { font-size: clamp(2.5rem, 5vw, 4.5rem); }
.cta-band h2 em { font-style: italic; }
.cta-band__side { display: flex; flex-direction: column; gap: var(--s3); align-items: flex-start; }
.cta-band__side p { color: var(--text-dim); max-width: 40ch; }

/* ---------- Rodapé ---------- */
.footer { padding: var(--s12) 0 var(--s4); margin-top: var(--section); border-top: 1px solid var(--line); }
.footer__grid { display: grid; grid-template-columns: 2fr 1.5fr 1.5fr 1fr; gap: var(--s5); }
.footer__brand img { height: var(--s12); width: auto; border-radius: 0; margin-bottom: var(--s3); }
.footer__brand p { color: var(--text-dim); font-size: 14px; max-width: 36ch; }
.footer h3 { font-family: var(--f-body); font-size: 12px; font-weight: 500; letter-spacing: .16em; text-transform: uppercase; color: var(--text-faint); margin-bottom: var(--s2); }
.footer__unit { font-size: 14px; color: var(--text-dim); display: grid; gap: 4px; }
.footer__unit strong { font-family: var(--f-display); font-weight: 400; font-size: 24px; margin-bottom: var(--s1); }
.footer__unit a:hover, .footer__list a:hover { color: var(--accent); }
.footer__list { display: grid; gap: var(--s1); font-size: 14px; color: var(--text-dim); }
.footer__bottom {
  display: flex; justify-content: space-between; gap: var(--s3); flex-wrap: wrap;
  margin-top: var(--s10); padding-top: var(--s3);
  border-top: 1px solid var(--line);
  font-size: 12px; color: var(--text-faint);
}

/* ---------- Linha de listagem genérica (post-row / agenda) ---------- */
.row-link { border-top: 1px solid var(--line); transition: border-color .2s, background .2s; }
.row-link:last-child { border-bottom: 1px solid var(--line); }
.sec-head + * > .row-link:first-child { border-top: 0; }   /* evita linha dupla sob o cabeçalho */
.row-link:hover { border-color: var(--accent); }
.row-link:hover + .row-link { border-top-color: var(--accent); }

/* ---------- Estados de lista vazia / carregando ---------- */
.list-status { color: var(--text-faint); font-size: 14px; padding: var(--s3) 0; }

/* ---------- Redes sociais (partial do rodapé) ---------- */
.social-list { display: grid; }
.social-row {
  display: grid; grid-template-columns: 2fr 3fr auto; align-items: center; gap: var(--s4);
  padding: var(--s3) 0;
  border-top: 1px solid var(--line);
  transition: border-color .2s, color .2s;
}
.social-list li:last-child .social-row { border-bottom: 1px solid var(--line); }
.social-list li:first-child .social-row { border-top: 0; padding-top: 0; }
.social-row__name { font-family: var(--f-display); font-size: clamp(2rem, 4vw, 3.5rem); line-height: 1.1; transition: color .2s; }
.social-row__handle { color: var(--text-dim); font-size: 16px; }
.social-row__arrow { font-size: 24px; color: var(--text-faint); transition: transform .2s, color .2s; }
.social-row:hover { border-color: var(--accent); }
.social-list li:hover + li .social-row { border-top-color: var(--accent); }
.social-row:hover .social-row__name { color: var(--text); }
.social-row:hover .social-row__arrow { color: var(--accent); }
.social-row:hover .social-row__arrow { transform: translate(4px, -4px); }
@media (max-width: 600px) {
  .social-row { grid-template-columns: 1fr auto; gap: 4px var(--s2); }
  .social-row__handle { grid-row: 2; font-size: 14px; }
  .social-row__arrow { grid-row: 1 / 3; grid-column: 2; }
}

/* ---------- Cards de post (home + /blog/) ---------- */
.posts { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--gap); row-gap: var(--s5); }
.post-card .media { margin-bottom: var(--s2); }
.post-card .media img { transition: transform .5s ease; }
.post-card:hover .media img { transform: scale(1.03); }
.post-card__tag { font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--text-faint); display: block; margin-bottom: var(--s1); }
.post-card h3 { font-family: var(--f-display); font-weight: 400; font-size: 22px; line-height: 1.2; transition: color .2s; }
.post-card:hover h3 { color: var(--text); }
@media (max-width: 900px) { .posts { grid-template-columns: repeat(2, 1fr); } }

/* ---------- Responsividade ---------- */
@media (max-width: 900px) {
  :root { --header-h: 72px; }
  .logo img { height: 40px; }
  .burger { display: block; }
  .header .btn-pill { display: none; }
  .nav {
    position: fixed; inset: var(--header-h) 0 0 0;
    background: var(--bg);
    flex-direction: column; align-items: stretch; gap: 0;
    padding: var(--s4) var(--s3) var(--s6);
    overflow-y: auto;
    opacity: 0; visibility: hidden;
    transition: opacity .25s, visibility .25s;
  }
  .menu-open .nav { opacity: 1; visibility: visible; }
  .menu-open { overflow: hidden; }
  .nav__list { flex-direction: column; gap: 0; }
  .nav__item { border-bottom: 1px solid var(--line); }
  .nav__link { font-family: var(--f-display); font-size: 32px; color: var(--text); padding: var(--s2) 0; width: 100%; justify-content: space-between; }
  .nav__sub {
    position: static; opacity: 1; visibility: visible; transform: none;
    background: none; border: 0; padding: 0 0 var(--s2);
    display: none;
  }
  .nav__item.is-open > .nav__sub { display: block; }
  .nav__item:hover > .nav__sub { display: none; }
  .nav__item.is-open:hover > .nav__sub { display: block; }
  .nav__sub a { padding: var(--s1) 0; font-size: 16px; }
  .nav .btn-pill--mobile { display: inline-flex; margin-top: var(--s4); align-self: flex-start; }
  .footer__grid { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 901px) { .btn-pill--mobile { display: none; } }

@media (max-width: 800px) {
  .topbar { display: none; }
  .sec-head, .cta-band { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  :root { --section: var(--s8); }
}
@media (max-width: 600px) {
  :root { --wrap: 24px; }
  .footer__grid { grid-template-columns: 1fr; }
}
