/* ============================================================
   Família Costa Barros — folha de estilo do site
   Conceito: a árvore como um livro de família encadernado.
   Ver novo-site/README.md para o racional de design.
   ============================================================ */

:root {
  --wine-900: #230b13;
  --wine-800: #34101c;
  --wine-700: #4a1626;
  --wine-600: #63202f;
  --brass: #b6903f;
  --brass-light: #e0c07f;
  --brass-dim: #8a6b31;
  --paper: #ece3d0;
  --paper-raised: #f5eedd;
  --paper-deep: #dbcda9;
  --ink: #2a2019;
  --ink-soft: #5b4d3d;
  --ink-faint: #8a7c68;
  --rule: #c6b78d;
  --ok: #4b6b3f;
  --danger: #8c3b2e;
}

* { box-sizing: border-box; }

html { background: var(--wine-900); }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Optima, Candara, "Noto Sans", "Segoe UI", ui-sans-serif, sans-serif;
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .display {
  font-family: Iowan, "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, ui-serif, serif;
  font-weight: 400;
  color: var(--ink);
  text-wrap: balance;
}

.mono { font-family: ui-monospace, "Cascadia Mono", "SF Mono", Consolas, "Liberation Mono", monospace; letter-spacing: 0.02em; }

a { color: inherit; }
img, svg { max-width: 100%; display: block; }

.wrap { max-width: 1040px; margin: 0 auto; padding: 0 clamp(20px, 5vw, 56px); }

/* ================= COVER / HERO (só na home) ================= */
.cover {
  position: relative;
  background: radial-gradient(140% 90% at 50% -10%, var(--wine-600) 0%, var(--wine-700) 42%, var(--wine-800) 78%, var(--wine-900) 100%);
  color: var(--paper-raised);
  padding: clamp(44px, 7vh, 74px) 0 clamp(40px, 6vh, 58px);
  overflow: hidden;
  isolation: isolate;
}
.cover::before {
  content: ""; position: absolute; inset: 0; opacity: 0.5;
  background-image:
    repeating-linear-gradient(115deg, rgba(0,0,0,0.09) 0 1px, transparent 1px 3px),
    repeating-linear-gradient(25deg, rgba(0,0,0,0.07) 0 1px, transparent 1px 4px);
  mix-blend-mode: multiply; pointer-events: none;
}
.cover::after {
  content: ""; position: absolute; inset: 0;
  box-shadow: inset 0 0 140px 40px rgba(10,3,6,0.65); pointer-events: none;
}
.corner { position: absolute; width: 58px; height: 58px; opacity: 0.55; z-index: 1; }
.corner svg { width: 100%; height: 100%; }
.corner.tl { top: 22px; left: 22px; }
.corner.tr { top: 22px; right: 22px; transform: scaleX(-1); }
.corner.bl { bottom: 22px; left: 22px; transform: scaleY(-1); }
.corner.br { bottom: 22px; right: 22px; transform: scale(-1,-1); }
.cover-inner { position: relative; z-index: 2; text-align: center; }

.hero-photo {
  width: 116px; height: 116px; margin: 0 auto 18px; border-radius: 50%; position: relative;
  background: linear-gradient(160deg, #d8cba4, #c3b28a 55%, #ab9a70);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 0 4px var(--wine-800), 0 0 0 5px var(--brass-dim), 0 10px 26px -10px rgba(0,0,0,0.55);
}
.hero-photo img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.hero-photo svg { width: 44%; opacity: 0.75; }
.hero-photo-caption { font-size: 11px; font-style: italic; color: var(--brass-light); opacity: 0.65; margin: 0 0 22px; }

.cover h1 {
  font-family: Georgia, "Iowan Old Style", Palatino, ui-serif, serif;
  font-style: italic; font-size: clamp(32px, 5.4vw, 54px); line-height: 1.05; margin: 0 0 10px;
  color: var(--brass-light);
  background: linear-gradient(180deg, #f3dfab 0%, var(--brass) 55%, #8a6b31 100%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 1px 0 rgba(0,0,0,0.4)); letter-spacing: 0.005em;
}
.cover .kicker { font-family: Optima, "Segoe UI", sans-serif; text-transform: uppercase; font-size: 12px; letter-spacing: 0.28em; color: var(--brass-light); opacity: 0.85; margin: 0 0 14px; }
.cover .tagline { max-width: 42ch; margin: 0 auto 28px; color: #e8d9c4; font-size: 16px; opacity: 0.9; }
.cover-actions { display: flex; justify-content: center; gap: 14px; flex-wrap: wrap; }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: Optima, "Segoe UI", sans-serif; font-size: 14.5px; letter-spacing: 0.03em;
  padding: 12px 26px; border-radius: 2px; text-decoration: none; cursor: pointer;
  border: 1px solid transparent; transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:focus-visible { outline: 2px solid var(--brass-light); outline-offset: 3px; }
.btn-gold { background: linear-gradient(180deg, var(--brass-light), var(--brass)); color: var(--wine-900); font-weight: 600; box-shadow: 0 1px 0 rgba(255,255,255,0.4) inset, 0 6px 16px rgba(0,0,0,0.35); }
.btn-gold:hover { background: linear-gradient(180deg, #edd6a0, #c49f4d); }
.btn-ghost { color: var(--paper-raised); border-color: rgba(224,192,127,0.5); }
.btn-ghost:hover { border-color: var(--brass-light); background: rgba(224,192,127,0.08); }
.btn-outline { color: var(--wine-700); border-color: var(--rule); background: var(--paper-raised); }
.btn-outline:hover { border-color: var(--brass-dim); }
.btn-danger { color: #fff; background: var(--danger); }
.btn-small { padding: 7px 14px; font-size: 13px; }

.page-edge { height: 22px; background: var(--paper); position: relative; }
.page-edge::before { content: ""; position: absolute; inset: -1px 0 auto 0; height: 22px; background: linear-gradient(180deg, rgba(0,0,0,0.28), transparent); }

/* ================= SITE BAR (páginas internas) ================= */
.site-bar { background: var(--wine-800); border-bottom: 3px solid var(--brass-dim); }
.site-bar .wrap { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding-top: 14px; padding-bottom: 14px; flex-wrap: wrap; }
.site-wordmark { font-family: Georgia, "Iowan Old Style", Palatino, ui-serif, serif; font-style: italic; font-size: 19px; color: var(--brass-light); text-decoration: none; white-space: nowrap; }
.site-bar-search { display: flex; flex: 1; max-width: 360px; border: 1px solid rgba(224,192,127,0.4); border-radius: 100px; overflow: hidden; }
.site-bar-search input { flex: 1; border: none; background: rgba(255,255,255,0.06); color: var(--paper-raised); padding: 8px 16px; font: inherit; font-size: 13.5px; }
.site-bar-search input::placeholder { color: #cbb693; opacity: 0.7; }
.site-bar-search button { border: none; background: none; color: var(--brass-light); padding: 0 16px; cursor: pointer; font-size: 13px; }
.site-bar-links { display: flex; gap: 14px; font-size: 13px; }
.site-bar-links a { color: var(--brass-light); text-decoration: none; }
.site-bar-links a:hover { text-decoration: underline; }

/* ================= SEÇÕES GERAIS ================= */
section { padding: clamp(38px, 6vw, 64px) 0; }
main.page section:first-child { padding-top: clamp(20px, 3vw, 32px); }

.index-card { background: var(--paper-raised); border: 1px solid var(--rule); border-radius: 3px; box-shadow: 0 1px 0 rgba(255,255,255,0.6) inset, 0 10px 26px -14px rgba(42,32,25,0.35); position: relative; }
.index-card::before { content: ""; position: absolute; left: 0; right: 0; top: 40px; border-top: 1px dashed var(--rule); }

.search-card { padding: 30px clamp(22px, 4vw, 44px) 32px; margin-top: -78px; position: relative; z-index: 3; }
.search-card .label { font-family: Optima, "Segoe UI", sans-serif; text-transform: uppercase; font-size: 11.5px; letter-spacing: 0.18em; color: var(--brass-dim); margin: 0 0 16px; }
.search-grid { display: grid; grid-template-columns: 1fr 1fr auto; gap: 16px; align-items: end; }
@media (max-width: 640px) { .search-grid { grid-template-columns: 1fr; } }

.field label { display: block; font-size: 12.5px; color: var(--ink-soft); margin-bottom: 6px; }
.field input[type="text"], .field select, .field textarea {
  width: 100%; font: inherit; font-size: 16px; padding: 10px 12px;
  border: 1px solid var(--rule); border-radius: 2px; background: #fffdf8; color: var(--ink);
}
.field input:focus-visible, .field select:focus-visible, .field textarea:focus-visible { outline: 2px solid var(--brass-dim); outline-offset: 1px; }
.field { margin-bottom: 16px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 560px) { .field-row { grid-template-columns: 1fr; } }

.search-submit, button.search-submit {
  font-family: Optima, "Segoe UI", sans-serif; font-size: 14.5px; letter-spacing: 0.03em;
  padding: 11px 24px; background: var(--wine-700); color: var(--paper-raised);
  border: none; border-radius: 2px; cursor: pointer; white-space: nowrap;
}
.search-submit:hover { background: var(--wine-800); }

.search-foot { margin-top: 16px; font-size: 13.5px; color: var(--ink-soft); display: flex; gap: 18px; flex-wrap: wrap; }
.search-foot a { text-decoration: underline; text-decoration-color: var(--rule); text-underline-offset: 3px; }
.search-foot a:hover { text-decoration-color: var(--brass-dim); }

.quickstart { margin-top: 18px; padding-top: 16px; border-top: 1px dashed var(--rule); display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 13px; color: var(--ink-faint); }
.chip { font-size: 13px; padding: 5px 13px; border: 1px solid var(--rule); border-radius: 100px; text-decoration: none; color: var(--wine-700); background: #fffdf8; transition: border-color 0.14s ease, background 0.14s ease; display: inline-block; }
.chip:hover { border-color: var(--brass-dim); background: var(--paper-deep); }

.eyebrow { font-family: Optima, "Segoe UI", sans-serif; text-transform: uppercase; font-size: 12px; letter-spacing: 0.2em; color: var(--brass-dim); margin: 0 0 10px; }
hr.rule { border: none; border-top: 1px solid var(--rule); margin: 40px 0; }

/* ================= ÁRVORE (abas + cartões) ================= */
.tree-section h2 { font-size: 26px; margin: 0 0 8px; }
.tree-section .lede { color: var(--ink-soft); max-width: 62ch; margin: 0 0 22px; font-size: 14.5px; }

.tree-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--rule); margin-bottom: 22px; flex-wrap: wrap; }
.tree-tab { font-family: Optima, "Segoe UI", sans-serif; font-size: 13.5px; padding: 9px 4px; margin-right: 20px; background: none; border: none; border-bottom: 2px solid transparent; color: var(--ink-faint); cursor: pointer; text-decoration: none; }
.tree-tab[aria-selected="true"] { color: var(--wine-700); border-bottom-color: var(--brass); font-weight: 600; }
.tree-tab:focus-visible { outline: 2px solid var(--brass-dim); outline-offset: 2px; }
.tree-panel[hidden] { display: none; }

.tree-card {
  position: relative; background: var(--paper-raised); border: 1px solid var(--rule); border-radius: 3px;
  padding: 12px 16px 12px 40px; display: inline-block; min-width: 200px;
  box-shadow: 0 6px 16px -12px rgba(42,32,25,0.4);
}
.gen-badge {
  position: absolute; left: -12px; top: 11px; width: 24px; height: 24px; border-radius: 50%;
  background: var(--wine-700); color: var(--paper-raised); font-family: ui-monospace, Consolas, monospace;
  font-size: 10.5px; display: flex; align-items: center; justify-content: center; box-shadow: 0 0 0 3px var(--paper);
}
.tree-card.focus .gen-badge { background: var(--brass); color: var(--wine-900); }
.tree-card.focus { border-color: var(--brass); background: #fbf4e2; }
.tree-card.empty { border-style: dashed; color: var(--ink-faint); }
.tree-card .rel { font-family: Optima, "Segoe UI", sans-serif; text-transform: uppercase; font-size: 10px; letter-spacing: 0.12em; color: var(--brass-dim); margin: 0 0 3px; }
.tree-card .name { font-family: Georgia, "Iowan Old Style", Palatino, ui-serif, serif; font-style: italic; font-size: 16.5px; margin: 0 0 4px; }
.tree-card .fact { font-size: 12px; color: var(--ink-faint); margin: 0; }
.tree-card a.view-link { display: inline-block; margin-top: 6px; font-size: 12px; text-decoration: underline; text-decoration-color: var(--rule); text-underline-offset: 3px; }
.tree-card a.view-link:hover { text-decoration-color: var(--brass-dim); }

/* listas indentadas de ascendentes/descendentes reais (podem ramificar) */
.gen-list { list-style: none; margin: 0; padding: 0; }
.gen-list .gen-list { margin: 10px 0 6px 26px; padding-left: 18px; border-left: 1px dashed var(--rule); }
.gen-item { margin-bottom: 10px; }
.tree-more { margin: 10px 0 0 26px; }
.tree-more button, .tree-more a.btn-small { font-family: Optima, "Segoe UI", sans-serif; font-size: 13px; padding: 8px 16px; background: none; border: 1px dashed var(--brass-dim); border-radius: 100px; color: var(--wine-700); cursor: pointer; text-decoration: none; display: inline-block; }
.tree-more button:hover, .tree-more a.btn-small:hover { background: var(--paper-deep); }

.tree-legend { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 20px; font-size: 12px; color: var(--ink-faint); }
.tree-legend span { display: inline-flex; align-items: center; gap: 6px; }
.tree-legend .swatch { width: 16px; height: 2px; background: var(--brass-dim); }
.tree-legend .swatch.dash { background: repeating-linear-gradient(90deg, var(--rule) 0 4px, transparent 4px 8px); }

.tree-aside { background: var(--paper-deep); border: 1px solid var(--rule); border-radius: 3px; padding: 20px 22px; }
.tree-aside h3 { font-size: 15px; font-style: italic; margin: 0 0 10px; color: var(--wine-700); }
.tree-aside ul { margin: 0; padding-left: 18px; font-size: 13.5px; color: var(--ink-soft); }
.tree-aside li { margin-bottom: 8px; }

.tree-layout { display: grid; grid-template-columns: minmax(0,1fr) 280px; gap: 30px; align-items: start; }
@media (max-width: 780px) { .tree-layout { grid-template-columns: 1fr; } }

/* ================= DIAGRAMA DE PEDIGREE (caixas) ================= */
.pedigree {
  display: grid;
  grid-template-columns: repeat(8, 108px);
  grid-template-rows: auto 22px auto 22px auto 22px auto;
  gap: 0 6px;
  min-width: 900px;
}
.ped-box {
  align-self: center;
  background: var(--paper-raised);
  border: 1px solid var(--rule);
  border-radius: 3px;
  padding: 8px 10px;
  text-align: center;
  box-shadow: 0 4px 10px -8px rgba(42,32,25,0.5);
}
.ped-box.empty { border-style: dashed; background: transparent; box-shadow: none; }
.ped-box.focus { border-color: var(--brass); background: #fbf4e2; }
.ped-box .rel { font-family: Optima, "Segoe UI", sans-serif; text-transform: uppercase; font-size: 9px; letter-spacing: 0.08em; color: var(--brass-dim); margin: 0 0 3px; }
.ped-box .name { font-family: Georgia, "Iowan Old Style", Palatino, ui-serif, serif; font-style: italic; font-size: 12.5px; line-height: 1.25; margin: 0; }
.ped-box.empty .name { color: var(--ink-faint); font-style: normal; font-size: 11px; }
.ped-box a.view-link { display: inline-block; margin-top: 4px; font-size: 10.5px; text-decoration: underline; text-decoration-color: var(--rule); }

.ped-bracket { position: relative; border-top: 2px solid var(--brass-dim); align-self: start; height: 100%; margin: 0 14px; }
.ped-bracket::after { content: ""; position: absolute; left: 50%; top: 0; width: 2px; height: 100%; background: var(--brass-dim); transform: translateX(-50%); }

/* ---------- botão flutuante + modal do diagrama ---------- */
.fab {
  position: fixed; right: 22px; bottom: 22px; z-index: 40;
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 20px 14px 16px; border-radius: 100px; border: none; cursor: pointer;
  background: linear-gradient(180deg, var(--brass-light), var(--brass)); color: var(--wine-900);
  font-family: Optima, "Segoe UI", sans-serif; font-size: 14px; font-weight: 600;
  box-shadow: 0 10px 24px -6px rgba(35,11,19,0.55), 0 1px 0 rgba(255,255,255,0.4) inset;
  transition: transform 0.15s ease;
}
.fab:hover { transform: translateY(-2px); }
.fab:focus-visible { outline: 2px solid var(--wine-700); outline-offset: 3px; }
.fab svg { width: 20px; height: 20px; flex: none; }
.fab .pulse {
  position: absolute; inset: -4px; border-radius: 100px; border: 1.5px solid var(--brass-light);
  opacity: 0; animation: fabpulse 2.6s ease-out infinite;
}
@keyframes fabpulse {
  0% { opacity: 0.55; transform: scale(0.94); }
  70% { opacity: 0; transform: scale(1.08); }
  100% { opacity: 0; transform: scale(1.08); }
}

.ped-overlay {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(20, 7, 12, 0.72);
  display: flex; align-items: center; justify-content: center; padding: 24px;
  opacity: 0; pointer-events: none; transition: opacity 0.2s ease;
}
.ped-overlay.open { opacity: 1; pointer-events: auto; }
.ped-modal {
  background: var(--paper); border: 1px solid var(--rule); border-radius: 6px;
  max-width: 960px; width: 100%; max-height: 88vh; overflow: auto;
  box-shadow: 0 30px 60px -12px rgba(0,0,0,0.5);
  transform: translateY(14px) scale(0.98); transition: transform 0.2s ease;
}
.ped-overlay.open .ped-modal { transform: translateY(0) scale(1); }
.ped-modal-head {
  position: sticky; top: 0; z-index: 2;
  display: flex; justify-content: space-between; align-items: flex-start; gap: 16px;
  padding: 20px clamp(18px,4vw,32px) 14px; background: var(--paper); border-bottom: 1px solid var(--rule);
}
.ped-modal-head h2 { font-size: 20px; font-style: italic; margin: 0 0 4px; }
.ped-modal-head p { margin: 0; font-size: 13px; color: var(--ink-soft); }
.ped-close {
  flex: none; width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--rule);
  background: var(--paper-raised); color: var(--ink-soft); cursor: pointer; font-size: 16px; line-height: 1;
}
.ped-close:hover { border-color: var(--brass-dim); color: var(--wine-700); }
.ped-modal-body { padding: 22px clamp(18px,4vw,32px) 30px; overflow-x: auto; }

@media (prefers-reduced-motion: reduce) {
  .fab, .ped-overlay, .ped-modal { transition: none; }
  .fab .pulse { animation: none; }
}

/* ================= BUSCA / RESULTADOS / SOBRENOMES ================= */
.results-table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.results-table th { text-align: left; font-family: Optima, "Segoe UI", sans-serif; text-transform: uppercase; font-size: 11px; letter-spacing: 0.1em; color: var(--brass-dim); padding: 8px 10px; border-bottom: 1px solid var(--rule); }
.results-table td { padding: 10px; border-bottom: 1px solid var(--rule); }
.results-table tr:hover td { background: var(--paper-raised); }
.results-table a { text-decoration: underline; text-decoration-color: var(--rule); }

.surname-grid { display: flex; flex-wrap: wrap; gap: 8px; }

/* ================= FICHA DE PESSOA ================= */
.breadcrumb { font-size: 12.5px; color: var(--ink-faint); margin: 20px 0 22px; }
.breadcrumb a { text-decoration: underline; text-decoration-color: var(--rule); text-underline-offset: 2px; }
.breadcrumb .sep { margin: 0 6px; opacity: 0.6; }

.person-hero { margin-bottom: 30px; }
.person-id { font-size: 11px; color: var(--ink-faint); margin: 0 0 6px; }
.person-hero h1 { font-family: Georgia, "Iowan Old Style", Palatino, ui-serif, serif; font-style: italic; color: var(--wine-700); font-size: clamp(28px, 4.6vw, 42px); margin: 0 0 10px; }
.person-vitals { font-size: 14.5px; color: var(--ink-soft); margin: 0 0 16px; }
.person-vitals .unset { color: var(--ink-faint); font-style: italic; }
.person-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.person-layout { display: grid; grid-template-columns: minmax(0,1fr) 280px; gap: 36px; align-items: start; }
@media (max-width: 780px) { .person-layout { grid-template-columns: 1fr; } }

.person-main .block { margin-bottom: 40px; }
.person-main h2 { font-size: 13px; text-transform: uppercase; letter-spacing: 0.14em; font-family: Optima, "Segoe UI", sans-serif; font-style: normal; color: var(--brass-dim); margin: 0 0 16px; }

.relations-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 500px) { .relations-grid { grid-template-columns: 1fr; } }

.person-note { font-size: 15px; color: var(--ink); max-width: 62ch; white-space: pre-line; }
.person-note .src { display: block; margin-top: 8px; font-size: 13px; color: var(--ink-faint); }

.person-photo { aspect-ratio: 3/4; background: linear-gradient(160deg, #d8cba4, #c3b28a 55%, #ab9a70); border: 6px solid var(--paper-raised); outline: 1px solid var(--rule); box-shadow: 0 10px 22px -12px rgba(42,32,25,0.45); display: flex; align-items: center; justify-content: center; margin-bottom: 8px; overflow: hidden; }
.person-photo img { width: 100%; height: 100%; object-fit: cover; }
.person-photo svg { width: 40%; opacity: 0.6; }
.side-photo-caption { font-size: 12px; color: var(--ink-faint); font-style: italic; text-align: center; margin: 0 0 24px; }

.side-panel { margin-bottom: 26px; }
.side-panel h3 { font-size: 13px; text-transform: uppercase; letter-spacing: 0.12em; font-family: Optima, "Segoe UI", sans-serif; font-style: normal; color: var(--brass-dim); margin: 0 0 12px; }
.fact-row { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--rule); font-size: 13px; }
.fact-row dt { color: var(--ink-faint); }
.fact-row dd { margin: 0; color: var(--ink); text-align: right; }
.fact-row dd.unset { color: var(--ink-faint); font-style: italic; }
dl.facts { margin: 0; }

.related-list { list-style: none; margin: 0; padding: 0; font-size: 13.5px; }
.related-list li { padding: 7px 0; border-bottom: 1px solid var(--rule); }
.related-list a { text-decoration: underline; text-decoration-color: var(--rule); text-underline-offset: 2px; }
.related-list .rel-tag { display: block; font-size: 11px; color: var(--ink-faint); text-transform: uppercase; letter-spacing: 0.08em; }

/* ================= DESTAQUES DA FAMÍLIA (home) ================= */
.featured-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 22px; margin-top: 4px; }
.featured-card { background: var(--paper-raised); border: 1px solid var(--rule); border-radius: 4px; padding: 22px 20px; text-align: center; box-shadow: 0 6px 16px -12px rgba(42,32,25,0.4); }
.featured-photo { width: 84px; height: 84px; margin: 0 auto 14px; border-radius: 50%; overflow: hidden; background: linear-gradient(160deg, #d8cba4, #c3b28a 55%, #ab9a70); border: 3px solid var(--paper); box-shadow: 0 0 0 1px var(--rule); display: flex; align-items: center; justify-content: center; }
.featured-photo img { width: 100%; height: 100%; object-fit: cover; }
.featured-photo svg { width: 46%; opacity: 0.7; }
.featured-name { font-family: Georgia, "Iowan Old Style", Palatino, ui-serif, serif; font-style: italic; font-size: 17px; margin: 0 0 3px; color: var(--wine-700); }
.featured-role { font-family: Optima, "Segoe UI", sans-serif; text-transform: uppercase; font-size: 10.5px; letter-spacing: 0.12em; color: var(--brass-dim); margin: 0 0 12px; }
.featured-bio { font-size: 13.5px; color: var(--ink-soft); text-align: left; margin: 0 0 12px; }
.featured-card a.view-link { font-size: 12.5px; text-decoration: underline; text-decoration-color: var(--rule); text-underline-offset: 3px; }

/* ================= FOTOS EM DESTAQUE (home) ================= */
.recent-photos { display: grid; grid-template-columns: 1fr; gap: 26px; }
.recent-photos-2 { grid-template-columns: 1fr 1fr; }
@media (max-width: 640px) { .recent-photos-2 { grid-template-columns: 1fr; } }

.recent-photo { display: block; text-decoration: none; color: inherit; }
.recent-photo-frame {
  display: block; aspect-ratio: 4/3; overflow: hidden;
  border: 6px solid var(--paper-raised); outline: 1px solid var(--rule);
  box-shadow: 0 10px 22px -12px rgba(42,32,25,0.45);
  transform: rotate(-0.6deg);
}
.recent-photo:nth-child(2) .recent-photo-frame { transform: rotate(0.6deg); }
.recent-photo-frame img { width: 100%; height: 100%; object-fit: cover; display: block; }
.recent-photo-cap { display: block; margin-top: 12px; font-family: Georgia, "Iowan Old Style", Palatino, ui-serif, serif; font-style: italic; font-size: 16px; color: var(--ink); }
.recent-photo-meta { display: block; margin-top: 3px; font-size: 12.5px; color: var(--ink-faint); }

/* ================= ÁLBUM DE FOTOS (página /fotos.php) ================= */
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; }
.photo-tile { position: relative; display: block; aspect-ratio: 4/3; border-radius: 3px; overflow: hidden; border: 1px solid var(--rule); }
.photo-tile img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.2s ease; }
.photo-tile:hover img { transform: scale(1.04); }
.photo-tile-cap {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 18px 10px 8px;
  background: linear-gradient(0deg, rgba(20,7,12,0.78), transparent);
  color: #f5eedd; font-size: 12px;
}
.chip-active { background: var(--wine-700); color: var(--paper-raised); border-color: var(--wine-700); }

.photo-detail { display: grid; grid-template-columns: minmax(0,1.4fr) minmax(0,1fr); gap: 30px; align-items: start; }
@media (max-width: 700px) { .photo-detail { grid-template-columns: 1fr; } }
.photo-detail img { width: 100%; border-radius: 4px; border: 1px solid var(--rule); box-shadow: 0 14px 30px -16px rgba(42,32,25,0.5); }
.photo-detail-caption { font-family: Georgia, "Iowan Old Style", Palatino, ui-serif, serif; font-style: italic; font-size: 19px; margin: 0 0 8px; }
.photo-detail-meta { font-size: 13.5px; color: var(--ink-soft); margin: 0; }
.photo-detail-meta .unset { color: var(--ink-faint); font-style: italic; }

/* ================= ARQUIVO (categorias, rodapé de conteúdo) ================= */
.archive { background: var(--paper-deep); border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.archive .wrap { padding-top: clamp(30px, 4vw, 40px); padding-bottom: clamp(30px, 4vw, 40px); }
.archive h2 { font-size: 16px; text-transform: uppercase; letter-spacing: 0.14em; font-family: Optima, "Segoe UI", sans-serif; font-style: normal; color: var(--ink-soft); margin: 0 0 4px; }
.archive .lede { color: var(--ink-faint); margin: 0 0 18px; max-width: 56ch; font-size: 13.5px; }
.drawer-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.drawer { display: inline-flex; align-items: center; gap: 7px; padding: 7px 13px; background: var(--paper-raised); border: 1px solid var(--rule); border-radius: 100px; text-decoration: none; color: var(--ink-soft); font-size: 13px; }
.drawer:hover { border-color: var(--brass-dim); color: var(--wine-700); }

/* ================= FOOTER ================= */
footer { background: var(--wine-900); color: #cbb693; padding: 40px 0 28px; }
footer .foot-grid { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; font-size: 13.5px; }
footer a { text-decoration: none; color: #e0c988; }
footer a:hover { text-decoration: underline; }
footer .foot-links { display: flex; gap: 20px; flex-wrap: wrap; }
footer .powered { margin-top: 22px; font-size: 12px; color: #8a7457; text-align: center; }

/* ================= ADMIN ================= */
.admin-bar { background: var(--wine-900); color: var(--brass-light); font-size: 13px; padding: 10px 0; }
.admin-bar .wrap { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.admin-bar a { color: var(--brass-light); text-decoration: none; }
.admin-bar a:hover { text-decoration: underline; }

.admin-card { background: var(--paper-raised); border: 1px solid var(--rule); border-radius: 3px; padding: 24px clamp(18px,4vw,32px); margin: 24px 0; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.admin-table th { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--rule); font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--brass-dim); }
.admin-table td { padding: 8px 10px; border-bottom: 1px solid var(--rule); }
.admin-table tr:hover td { background: var(--paper); }
.admin-actions { display: flex; gap: 10px; }
.admin-actions a, .admin-actions button { font-size: 12.5px; }

.flash { padding: 12px 16px; border-radius: 3px; margin: 16px 0; font-size: 14px; }
.flash-ok { background: #e3ecdf; border: 1px solid var(--ok); color: #2f4527; }
.flash-error { background: #f3ded9; border: 1px solid var(--danger); color: #5c261b; }

.login-box { max-width: 360px; margin: 60px auto; }

@media (prefers-reduced-motion: reduce) { .btn { transition: none; } }
