/* ==========================================================================
   Residencial da Terceira Idade — folha de estilo única
   Tokens e componentes conforme o handoff de design.
   ========================================================================== */

:root {
  /* Cores */
  --navy:        #1c3a5c;
  --navy-hover:  #254a72;
  --navy-deep-1: #16324f;
  --navy-deep-2: #0f2338;
  --bg:          #f6f7f5;
  --bg-muted:    #eef1ef;
  --surface:     #ffffff;
  --text:        #1c2b38;
  --muted:       #5a6a78;
  --border:      #e1e5e3;
  --accent:      #c9622a;
  /* Versão escurecida do accent para TEXTO sobre fundo claro (WCAG AA 4,9:1) */
  --accent-texto: #b4551f;
  /* E a versão clareada, para texto laranja sobre o azul escuro (5,2:1) */
  --accent-claro: #e58f57;

  /* Placeholder de foto (listras) — some sozinho quando --photo é definido */
  --stripes: repeating-linear-gradient(45deg, #dde3e1, #dde3e1 8px, #eef2f0 8px, #eef2f0 16px);

  /* Tipografia */
  /* As variáveis --fonte-* vêm do next/font (auto-hospedado, sem requisição
     a terceiros bloqueando a renderização). As famílias seguintes são o
     fallback enquanto a fonte carrega. */
  --font-head: var(--fonte-titulo), Georgia, 'Times New Roman', serif;
  --font-body: var(--fonte-corpo), 'Segoe UI', system-ui, -apple-system, sans-serif;

  /* Raio */
  --r-card: 10px;
  --r-icon: 14px;
  --r-btn:  6px;

  /* Layout */
  --maxw: 1200px;
  --pad-section: clamp(36px, 6vw, 64px);
  --pad-inline: 24px;
}

/* --------------------------------------------------------------------------
   Base
   -------------------------------------------------------------------------- */

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

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

a { color: var(--navy); text-decoration: none; }
a:hover { color: var(--accent-texto); }

h1, h2, h3 { font-family: var(--font-head); color: var(--navy); margin: 0; }
h1 { font-weight: 600; }
em { font-style: italic; }

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

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  background: var(--navy);
  color: #fff;
  padding: 12px 18px;
  font-weight: 600;
}
.skip:focus { left: 8px; top: 8px; color: #fff; }

.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding-left: var(--pad-inline);
  padding-right: var(--pad-inline);
  width: 100%;
}
.wrap--narrow { max-width: 1000px; }

.section { padding: var(--pad-section) 0; }
.section--muted { background: var(--bg-muted); }
.section--dots {
  background-image: radial-gradient(circle at 20% 30%, rgba(28, 58, 92, .05) 0, rgba(28, 58, 92, .05) 2px, transparent 2px);
  background-size: 36px 36px;
}
.section--navy {
  background: linear-gradient(160deg, var(--navy-deep-1), var(--navy-deep-2));
  color: #fff;
}
.section--navy h2 { color: #fff; }

.section__title {
  text-align: center;
  font-style: italic;
  font-size: clamp(22px, 3vw, 30px);
  margin: 0 0 32px;
}
.section__title--upright { font-style: normal; }

.lead { color: var(--muted); font-size: 15px; line-height: 1.7; }

/* --------------------------------------------------------------------------
   Botões
   -------------------------------------------------------------------------- */

.btn {
  display: inline-block;
  border: none;
  border-radius: var(--r-btn);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 15px;
  line-height: 1.2;
  padding: 16px 30px;
  cursor: pointer;
  text-align: center;
  transition: background-color .18s ease, color .18s ease;
}
.btn--primary { background: var(--navy); color: #fff; }
.btn--primary:hover { background: var(--navy-hover); color: #fff; }

.btn--light { background: #fff; color: var(--navy); padding: 14px 24px; font-size: 14px; }
.btn--light:hover { background: var(--bg-muted); color: var(--navy); }

.btn--sm { padding: 14px 24px; font-size: 14px; }
.btn--block { display: block; width: 100%; max-width: 280px; }

.btn-link {
  background: none;
  border: none;
  padding: 0;
  color: var(--navy);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  align-self: flex-start;
}
.btn-link:hover { color: var(--accent-texto); }

/* --------------------------------------------------------------------------
   Cabeçalho e navegação
   -------------------------------------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  padding-top: 14px;
  padding-bottom: 14px;
  gap: 12px;
}

.brand { display: flex; align-items: center; gap: 10px; }
.brand:hover { color: var(--navy); }
.brand__mark { width: 30px; height: 30px; flex: 0 0 auto; }
.brand__name {
  font-family: var(--font-head);
  color: var(--navy);
  line-height: 1.15;
  text-align: left;
}
.brand__name small { display: block; font-size: 13px; }
.brand__name strong { display: block; font-size: 17px; font-weight: 700; }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  padding: 8px;
  cursor: pointer;
}
.nav-toggle span { display: block; width: 24px; height: 2px; background: var(--navy); }

.nav { display: flex; gap: clamp(16px, 3vw, 36px); }
.nav a {
  font-size: 15px;
  font-weight: 600;
  color: var(--navy);
  padding: 6px 0;
}
.nav a:hover { color: var(--accent-texto); }
.nav a[aria-current="page"] { color: var(--accent-texto); }

@media (max-width: 899px) {
  .nav-toggle { display: flex; }
  .nav {
    display: none;
    order: 3;
    /* As margens negativas puxam o painel para as bordas da tela; a largura
       precisa crescer o mesmo tanto, senão ele para antes do lado direito. */
    width: calc(100% + var(--pad-inline) * 2);
    flex-direction: column;
    gap: 0;
    border-top: 1px solid var(--border);
    margin: 8px calc(var(--pad-inline) * -1) -14px;
    padding: 8px var(--pad-inline) 12px;
  }
  .site-header.is-open .nav { display: flex; }
  .nav a { padding: 12px 0; border-bottom: 1px solid #eef1ef; font-size: 16px; }
  .nav a:last-child { border-bottom: none; }
}

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */

.hero {
  position: relative;
  display: flex;
  align-items: center;
  background-image: var(--photo, var(--stripes));
  background-size: cover;
  background-position: center;
  height: clamp(280px, 42vw, 400px);
}
.hero--home { height: clamp(420px, 70vw, 560px); align-items: flex-end; }
.hero--short { height: clamp(280px, 40vw, 380px); }

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(10, 20, 32, .6), rgba(10, 20, 32, .1));
}
.hero--home::before {
  background: linear-gradient(0deg, rgba(10, 20, 32, .75) 10%, rgba(10, 20, 32, .15) 60%);
}

.hero__inner { position: relative; }
.hero--home .hero__inner { padding-bottom: 44px; }
.hero--center { text-align: center; }

.hero h1 {
  color: #fff;
  font-size: clamp(30px, 4.6vw, 44px);
  line-height: 1.2;
  margin: 0;
}
.hero--home h1 {
  font-weight: 500;
  font-style: italic;
  font-size: clamp(30px, 5.2vw, 50px);
  line-height: 1.18;
  max-width: 640px;
  margin: 0 0 26px;
}
.hero__title--italic { font-style: italic; }
.hero__text {
  color: #eef1ef;
  font-size: 15px;
  line-height: 1.6;
  max-width: 460px;
  margin: 14px 0 0;
}

/* Faixa com foto de fundo e texto (ex.: "Viver na Serra") */
.band {
  position: relative;
  background-image: var(--photo, var(--stripes));
  background-size: cover;
  background-position: center;
  padding: clamp(40px, 7vw, 80px) 0;
  color: #fff;
}
.band::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(10, 20, 32, .6), rgba(10, 20, 32, .2));
}
.band__inner { position: relative; }
.band h2 {
  color: #fff;
  font-style: italic;
  font-size: clamp(24px, 3.4vw, 34px);
  margin: 0 0 18px;
}
.band p {
  color: #e7ecef;
  font-size: 16px;
  line-height: 1.7;
  max-width: 520px;
  margin: 0 0 10px;
}
.band p:last-of-type { margin-bottom: 26px; }

/* Legenda do placeholder de foto — remover ao inserir a foto real */
.ph-note {
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 11px;
  letter-spacing: .05em;
  color: rgba(255, 255, 255, .6);
  display: block;
  margin-bottom: 12px;
}

/* --------------------------------------------------------------------------
   Grids e cards
   -------------------------------------------------------------------------- */

.grid { display: grid; gap: 20px; }
.grid--features { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.grid--cards    { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.grid--tiles    { grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 16px; }
.grid--rooms    { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px; }
.grid--photos   { grid-template-columns: repeat(2, 1fr); gap: 10px; }

.split {
  display: flex;
  flex-wrap: wrap;
  gap: 32px;
  align-items: center;
}
.split--reverse { flex-wrap: wrap-reverse; }
.split--wide { gap: 40px; }
.split__col { flex: 1 1 320px; min-width: 280px; }
.split__label { flex: 0 0 220px; }

.feature {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
}
.feature__label { font-size: 14px; font-weight: 600; color: var(--navy); }
.feature__label--sm { font-size: 13px; }

.icon-tile {
  width: 56px;
  height: 56px;
  background: var(--navy);
  border-radius: var(--r-icon);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  flex: 0 0 auto;
}
.icon-tile svg { width: 26px; height: 26px; }
.icon-tile--lg { width: 64px; height: 64px; }
.icon-tile--lg svg { width: 30px; height: 30px; }
.icon-tile--card { width: 52px; height: 52px; border-radius: 12px; }
.icon-tile--light { background: #fff; color: var(--navy); width: 48px; height: 48px; border-radius: 10px; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  padding: 26px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.card__title {
  font-family: var(--font-head);
  font-style: italic;
  color: var(--navy);
  font-size: 20px;
}
.card__text { font-size: 14px; color: var(--muted); line-height: 1.55; }

.card--ghost {
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(255, 255, 255, .15);
  padding: 24px;
  gap: 10px;
}
.card--ghost .card__title { color: #fff; font-size: 17px; }
.card--ghost .card__title span {
  display: block;
  font-style: normal;
  font-family: var(--font-body);
  font-size: 15px;
}
.card--ghost .card__text { color: #c9d3da; font-size: 13.5px; line-height: 1.6; }

/* Ambientes (página Estrutura) */
.room {
  border-radius: var(--r-card);
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
}
.room__label {
  padding: 14px;
  text-align: center;
  font-weight: 700;
  color: var(--navy);
  font-size: 15px;
}
.pill {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 20px 24px;
  text-align: center;
  font-weight: 700;
  color: var(--navy);
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
}

/* --------------------------------------------------------------------------
   Placeholders de foto e mapa
   -------------------------------------------------------------------------- */

/* Para inserir a foto real:  style="--photo:url('assets/img/nome.jpg')"
   e apagar o <span class="photo__note"> de dentro.                     */
.photo {
  margin: 0;
  border-radius: 8px;
  overflow: hidden;
  background-image: var(--photo, var(--stripes));
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
  aspect-ratio: 4 / 3;
}
.photo--card { border-radius: 0; }
.photo--lg { border-radius: var(--r-card); }
.photo__note {
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 10px;
  color: var(--muted);
  text-align: center;
}

.map {
  border: 0;
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: var(--r-card);
  display: block;
}

/* Vídeo incorporado (YouTube), sempre 16:9 */
.video {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--r-card);
  overflow: hidden;
  background: #000;
  margin: 0 0 28px;
}
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }


/* --------------------------------------------------------------------------
   Blocos de texto editorial
   -------------------------------------------------------------------------- */

.title-block {
  font-size: clamp(26px, 3.6vw, 38px);
  line-height: 1.15;
  margin: 0;
}
.title-inline { font-size: clamp(22px, 3vw, 30px); margin: 0 0 14px; }

.pending {
  font-style: italic;
  color: #8b98a1;
  font-size: 15px;
  line-height: 1.75;
  border-left: 3px solid #dde3e1;
  padding-left: 16px;
  margin: 0;
}

.quote {
  font-family: var(--font-head);
  color: #fff;
  font-size: clamp(20px, 3.4vw, 30px);
  line-height: 1.5;
  max-width: 720px;
  margin: 0 auto;
}

.address {
  color: var(--navy);
  font-size: 14.5px;
  line-height: 1.6;
  font-weight: 600;
  margin: 0 0 22px;
}

/* Níveis de cuidado — blocos alternados */
.levels { display: flex; flex-direction: column; gap: 56px; }
.level { display: flex; flex-wrap: wrap; gap: 28px; align-items: center; }
.level__col { flex: 1 1 260px; min-width: 240px; }
.level h3 {
  font-style: italic;
  font-size: 24px;
  margin: 16px 0 10px;
}
.level h3 span { display: block; font-style: normal; font-size: 20px; }
.level p { color: var(--muted); font-size: 15px; line-height: 1.65; margin: 0; }

/* --------------------------------------------------------------------------
   Formulário de contato
   -------------------------------------------------------------------------- */

.form { display: flex; flex-direction: column; gap: 14px; }
.form__field { display: flex; flex-direction: column; gap: 6px; }
.form label { font-size: 13px; font-weight: 600; color: var(--navy); }
.form input,
.form textarea {
  padding: 16px;
  border: 1px solid #dde3e1;
  border-radius: var(--r-btn);
  background: #fafbfa;
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--text);
  width: 100%;
}
.form textarea { resize: vertical; }
.form input[aria-invalid="true"],
.form textarea[aria-invalid="true"] { border-color: var(--accent); }
.form__error { color: var(--accent-texto); font-size: 12.5px; }
.form__error:empty { display: none; }
.form .btn { margin-top: 6px; padding: 16px; font-weight: 700; }

.form__status {
  font-size: 14px;
  line-height: 1.6;
  color: var(--navy);
  background: var(--bg-muted);
  border-radius: var(--r-btn);
  padding: 14px 16px;
}
.form__status:empty { display: none; }

.info-list { display: flex; flex-direction: column; gap: 22px; margin: 0; }
.info-list dt { font-weight: 700; color: var(--navy); font-size: 15px; margin-bottom: 4px; }
.info-list dd { color: var(--muted); font-size: 14px; line-height: 1.6; margin: 0; }

.contact-aside {
  flex: 1 1 260px;
  min-width: 240px;
  border-left: 1px solid var(--border);
  padding-left: 40px;
}
@media (max-width: 767px) {
  .contact-aside { border-left: none; padding-left: 0; }
}

/* --------------------------------------------------------------------------
   Rodapé
   -------------------------------------------------------------------------- */

.site-footer {
  background: linear-gradient(160deg, var(--navy-deep-1), var(--navy-deep-2));
  padding: var(--pad-section) 0 30px;
  color: #fff;
}
.footer__cols {
  display: flex;
  flex-wrap: wrap;
  gap: 36px;
  justify-content: space-between;
}
.footer__col { display: flex; flex-direction: column; gap: 10px; }
.site-footer a { color: #fff; font-weight: 600; font-size: 14px; }
.site-footer a:hover { color: var(--accent-claro); }
.site-footer .brand__name { color: #fff; }

.social { display: flex; gap: 10px; margin-top: 4px; }
.social a {
  width: 32px;
  height: 32px;
  background: #fff;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--navy-deep-1);
}
.social a:hover { background: var(--bg-muted); color: var(--navy-deep-1); }
.social svg { width: 17px; height: 17px; }

.footer__bottom {
  max-width: var(--maxw);
  margin: 26px auto 0;
  padding: 20px var(--pad-inline) 0;
  border-top: 1px solid rgba(255, 255, 255, .15);
  text-align: center;
  color: rgba(255, 255, 255, .6);
  font-size: 12.5px;
}

.footer__bottom p { margin: 0; }
.footer__bottom p + p { margin-top: 6px; }
.footer__credito { font-size: 11.5px; opacity: .85; }
.site-footer .footer__credito a { font-weight: 600; font-size: inherit; color: var(--accent-claro); text-decoration: underline; text-underline-offset: 2px; padding: 0; }
.site-footer .footer__credito a:hover { color: #fff; }

/* Botão flutuante de WhatsApp */
.whatsapp-fab {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 60;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: #25d366;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 18px rgba(10, 20, 32, .25);
}
.whatsapp-fab:hover { background: #1fb757; color: #fff; }
.whatsapp-fab svg { width: 28px; height: 28px; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}

/* --------------------------------------------------------------------------
   Conteúdo vindo do editor de texto rico do painel
   -------------------------------------------------------------------------- */

.rich > :first-child { margin-top: 0; }
.rich > :last-child { margin-bottom: 0; }
.rich p { margin: 0 0 14px; }
.rich ul, .rich ol { margin: 0 0 14px; padding-left: 22px; }
.rich li { margin-bottom: 6px; }
.rich a { text-decoration: underline; }
.rich h2, .rich h3 { margin: 24px 0 10px; }

/* Estados do formulário de contato */
.form__status--erro { background: #fdeee6; color: #8a3c12; }

/* Foto real dentro do espaço de imagem (substitui o padrão listrado) */
.photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo:has(img) { padding: 0; }

/* --------------------------------------------------------------------------
   Foto de fundo dos banners como <img> (LCP e texto alternativo)
   -------------------------------------------------------------------------- */

.hero__img,
.band__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}

.hero::before,
.band::before { z-index: 1; }

.hero__inner,
.band__inner { z-index: 2; }

/* Trilha de navegação */
.trilha {
  font-size: 13.5px;
  color: var(--muted);
  padding: 14px 0 0;
}
.trilha ol {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 0;
}
.trilha li { display: flex; align-items: center; gap: 8px; }
.trilha li + li::before { content: "›"; color: #a8b4bd; }
.trilha a { color: var(--muted); }
.trilha a:hover { color: var(--accent-texto); }
.trilha [aria-current="page"] { color: var(--navy); font-weight: 600; }

/* Página 404 */
.erro-404 {
  text-align: center;
  padding: clamp(60px, 12vw, 120px) 24px;
}
.erro-404 h1 { font-size: clamp(28px, 5vw, 44px); font-style: italic; margin-bottom: 14px; }
.erro-404 p { color: var(--muted); font-size: 16px; max-width: 460px; margin: 0 auto 28px; }
.erro-404 .links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}

/* --------------------------------------------------------------------------
   Acessibilidade: contraste e área de toque
   -------------------------------------------------------------------------- */

/* #8b98a1 sobre o fundo claro dava 2,6:1 — abaixo do mínimo 4,5:1 da WCAG AA */
.pending { color: var(--muted); }

/* Links do rodapé e "Saiba mais": área de toque maior no celular */
.footer__col { gap: 0; }
.site-footer a:not(.social a) { padding: 9px 0; }
.social { margin-top: 6px; }
.btn-link { padding: 6px 0; }

/* Cabeçalho lido por leitores de tela, sem ocupar espaço na tela.
   Usado onde a seção existe visualmente mas o design não previu um título. */
.apenas-leitor {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ==========================================================================
   Ajustes de celular
   ========================================================================== */

@media (max-width: 768px) {
  /* O Safari do iPhone dá zoom sozinho ao focar um campo com fonte menor
     que 16px — a página salta e a pessoa precisa voltar com os dedos.
     Subir para 16px no celular elimina o salto. */
  .form input,
  .form textarea {
    font-size: 16px;
  }

  /* Alvos de toque: o público aqui inclui gente de mais idade, muitas vezes
     com o celular na mão e pouca firmeza. Abaixo de ~44px o erro de toque
     cresce rápido. */
  .nav-toggle {
    min-width: 48px;
    min-height: 48px;
    justify-content: center;
    align-items: center;
  }

  .brand {
    padding: 5px 0;
  }

  .btn-link {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }

  .social a {
    width: 44px;
    height: 44px;
  }
  .social svg {
    width: 20px;
    height: 20px;
  }

  /* O botão flutuante do WhatsApp fica sobre o conteúdo; um respiro no fim
     da página evita que ele cubra o último link do rodapé. */
  .footer__bottom {
    padding-bottom: 56px;
  }
}

/* --------------------------------------------------------------------------
   Logo do cabeçalho (imagem). No rodapé continua a marca em SVG + texto.
   -------------------------------------------------------------------------- */
.brand__logo {
  display: block;
  width: 225px;
  height: auto;
}
@media (max-width: 700px) {
  .brand__logo { width: 175px; }
}
