/* ============================================================
   Casa do Surjão — Global Stylesheet
   Estilo: Híbrido moderno com alma | Modern with soul
   ============================================================ */

/* ── 1. Custom Properties ─────────────────────────────────── */
:root {
  /* Palette */
  --cream:        #F7F3EE;
  --cream-alt:    #EDE8E0;
  --cream-dark:   #DDD4C8;
  --brown:        #3B2F2F;
  --brown-mid:    #5C4438;
  --brown-light:  #7A6558;
  --green:        #7A9E7E;
  --green-dark:   #5A7A5E;
  --green-pale:   #C8DBC9;
  --gold:         #C49A3C;
  --gold-pale:    #F0E4C0;
  --border:       #D4C9BC;
  --shadow:       rgba(59, 47, 47, 0.12);

  /* Typography */
  --font-head:    'Playfair Display', Georgia, serif;
  --font-body:    'Inter', 'Segoe UI', system-ui, sans-serif;

  /* Sizing */
  --container:    1180px;
  --radius:       6px;
  --radius-lg:    12px;

  /* Transitions */
  --ease:         0.25s ease;
}

/* ── 2. Reset & Base ──────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: 18px;
  scroll-behavior: smooth;
  background: var(--cream);
  color: var(--brown);
}

body {
  font-family: var(--font-body);
  line-height: 1.75;
  background: var(--cream);
  overflow-x: hidden;
}

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

a {
  color: var(--green-dark);
  text-decoration: none;
  transition: color var(--ease);
}
a:hover { color: var(--green); }

ul { list-style: none; }

/* ── 3. Typography ────────────────────────────────────────── */
h1, h2, h3, h4, h5 {
  font-family: var(--font-head);
  line-height: 1.25;
  color: var(--brown);
  font-weight: 700;
}

h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.5rem, 3.5vw, 2.25rem); margin-bottom: 0.5em; }
h3 { font-size: clamp(1.2rem, 2.5vw, 1.65rem); margin-bottom: 0.4em; }
h4 { font-size: 1.1rem; margin-bottom: 0.3em; }

p { margin-bottom: 1.1rem; color: var(--brown-mid); }
p:last-child { margin-bottom: 0; }

blockquote {
  border-left: 4px solid var(--green);
  padding: 0.75rem 1.25rem;
  margin: 1.5rem 0;
  background: var(--cream-alt);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-style: italic;
  color: var(--brown-light);
}

strong { color: var(--brown); font-weight: 600; }

/* Decorative divider */
.divider {
  width: 60px;
  height: 3px;
  background: linear-gradient(90deg, var(--green), var(--gold));
  border-radius: 2px;
  margin: 0.75rem 0 1.5rem;
}
.divider--center { margin-left: auto; margin-right: auto; }

/* ── 4. Layout & Container ────────────────────────────────── */
.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.section {
  padding: 5rem 0;
}
.section--alt {
  background: var(--cream-alt);
}
.section--dark {
  background: var(--brown);
  color: var(--cream);
}
.section--dark h2,
.section--dark h3,
.section--dark p { color: var(--cream); }
.section--dark .divider { background: linear-gradient(90deg, var(--green-pale), var(--gold-pale)); }

.section__header {
  text-align: center;
  margin-bottom: 3rem;
}
.section__label {
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--green-dark);
  display: block;
  margin-bottom: 0.5rem;
}
.section--dark .section__label { color: var(--green-pale); }

/* ── 5. Navigation ────────────────────────────────────────── */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  background: rgba(247, 243, 238, 0.96);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  transition: box-shadow var(--ease);
}
.nav.scrolled { box-shadow: 0 2px 20px var(--shadow); }

.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.nav__logo {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}
.nav__logo-name {
  font-family: var(--font-head);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--brown);
}
.nav__logo-sub {
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--green-dark);
}

.nav__links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.nav__link {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--brown-light);
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius);
  transition: background var(--ease), color var(--ease);
  white-space: nowrap;
}
.nav__link:hover,
.nav__link.active {
  color: var(--brown);
  background: var(--cream-alt);
}

.nav__actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Language switcher */
.lang-switcher {
  display: flex;
  background: var(--cream-alt);
  border: 1px solid var(--border);
  border-radius: 20px;
  overflow: hidden;
}
.lang-btn {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  padding: 0.3rem 0.65rem;
  cursor: pointer;
  border: none;
  background: transparent;
  color: var(--brown-light);
  transition: background var(--ease), color var(--ease);
}
.lang-btn.active {
  background: var(--green);
  color: white;
  border-radius: 20px;
}

/* Mobile menu toggle */
.nav__burger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 0.4rem;
  border: none;
  background: transparent;
}
.nav__burger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--brown);
  border-radius: 2px;
  transition: transform var(--ease), opacity var(--ease);
}
.nav__burger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav__burger.open span:nth-child(2) { opacity: 0; }
.nav__burger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Spacer for fixed nav */
.nav-spacer { height: 68px; }

/* ── 6. Hero ──────────────────────────────────────────────── */
.hero {
  position: relative;
  min-height: 90vh;
  display: flex;
  align-items: center;
  overflow: hidden;
  background: var(--brown);
}

.hero__bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% 80%, rgba(122, 158, 126, 0.3) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 20%, rgba(196, 154, 60, 0.2) 0%, transparent 50%),
    linear-gradient(135deg, #2a2020 0%, #3B2F2F 40%, #4a3a30 100%);
  opacity: 0.95;
}

/* Texture overlay */
.hero__bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='4' height='4'%3E%3Crect width='4' height='4' fill='none'/%3E%3Ccircle cx='1' cy='1' r='0.5' fill='rgba(255,255,255,0.03)'/%3E%3C/svg%3E");
  background-size: 4px 4px;
}

.hero__content {
  position: relative;
  z-index: 1;
  max-width: 800px;
  padding: 6rem 1.5rem 4rem;
  margin: 0 auto;
  text-align: center;
}

.hero__eyebrow {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--green-pale);
  display: block;
  margin-bottom: 1.25rem;
}

.hero__title {
  color: var(--cream);
  margin-bottom: 0.5rem;
  text-shadow: 0 2px 20px rgba(0,0,0,0.3);
}

.hero__title em {
  font-style: normal;
  color: var(--gold);
}

.hero__subtitle {
  font-family: var(--font-head);
  font-size: clamp(1rem, 2vw, 1.25rem);
  color: var(--cream-dark);
  font-style: italic;
  margin-bottom: 2rem;
}

.hero__desc {
  font-size: 1rem;
  color: rgba(237, 232, 224, 0.85);
  max-width: 560px;
  margin: 0 auto 2.5rem;
  line-height: 1.7;
}

.hero__cta {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--green);
  color: white;
  padding: 0.8rem 1.75rem;
  border-radius: 30px;
  font-weight: 600;
  font-size: 0.9rem;
  letter-spacing: 0.02em;
  transition: background var(--ease), transform var(--ease);
  box-shadow: 0 4px 16px rgba(0,0,0,0.25);
}
.hero__cta:hover {
  background: var(--green-dark);
  color: white;
  transform: translateY(-2px);
}

.hero__scroll {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  color: rgba(237, 232, 224, 0.5);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.hero__scroll svg {
  animation: bounce 2s infinite;
}
@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(6px); }
}

/* Page hero (inner pages) */
.page-hero {
  background: var(--brown);
  padding: 5rem 1.5rem 3.5rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.page-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 30% 50%, rgba(122, 158, 126, 0.2) 0%, transparent 60%);
}
.page-hero .container { position: relative; z-index: 1; }
.page-hero h1 { color: var(--cream); }
.page-hero p { color: var(--cream-dark); max-width: 600px; margin: 0.75rem auto 0; }
.page-hero .section__label { color: var(--green-pale); }

/* Breadcrumb */
.breadcrumb {
  background: var(--cream-alt);
  border-bottom: 1px solid var(--border);
  padding: 0.6rem 0;
}
.breadcrumb__inner {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: var(--brown-light);
}
.breadcrumb__inner a { color: var(--green-dark); }
.breadcrumb__sep { color: var(--border); }

/* ── 7. Cards ─────────────────────────────────────────────── */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.card {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: transform var(--ease), box-shadow var(--ease);
  display: flex;
  flex-direction: column;
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px var(--shadow);
}

.card__icon {
  font-size: 2.5rem;
  padding: 2rem 2rem 0;
}

.card__body {
  padding: 1.25rem 2rem 2rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.card__title {
  font-family: var(--font-head);
  font-size: 1.2rem;
  color: var(--brown);
  margin-bottom: 0.5rem;
}

.card__text {
  font-size: 0.9rem;
  color: var(--brown-light);
  flex: 1;
  margin-bottom: 1.25rem;
}

.card__link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--green-dark);
}
.card__link:hover { color: var(--green); }
.card__link svg { transition: transform var(--ease); }
.card__link:hover svg { transform: translateX(3px); }

/* ── 8. Buttons ───────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1.5rem;
  border-radius: 30px;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  border: none;
  transition: background var(--ease), transform var(--ease), color var(--ease);
}
.btn:hover { transform: translateY(-2px); }

.btn--primary {
  background: var(--green);
  color: white;
}
.btn--primary:hover { background: var(--green-dark); color: white; }

.btn--outline {
  background: transparent;
  color: var(--green-dark);
  border: 2px solid var(--green);
}
.btn--outline:hover { background: var(--green); color: white; }

.btn--ghost {
  background: transparent;
  color: var(--brown-light);
  border: 1px solid var(--border);
}
.btn--ghost:hover { background: var(--cream-alt); color: var(--brown); }

/* ── 9. Intro / Feature Layout ────────────────────────────── */
.feature {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
}
.feature--reverse .feature__image { order: 2; }
.feature--reverse .feature__text { order: 1; }

.feature__image {
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--cream-alt);
  aspect-ratio: 4/3;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
}
.feature__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.feature__placeholder {
  text-align: center;
  color: var(--brown-light);
  padding: 2rem;
}
.feature__placeholder-icon { font-size: 3rem; margin-bottom: 0.75rem; }
.feature__placeholder p { font-size: 0.85rem; margin: 0; }

.feature__label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--green-dark);
  display: block;
  margin-bottom: 0.5rem;
}

/* ── 10. Timeline ─────────────────────────────────────────── */
.timeline {
  position: relative;
  padding-left: 2rem;
}
.timeline::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.5rem;
  bottom: 0;
  width: 2px;
  background: linear-gradient(180deg, var(--green), var(--gold));
}

.timeline__item {
  position: relative;
  margin-bottom: 2.5rem;
}
.timeline__item::before {
  content: '';
  position: absolute;
  left: -2.45rem;
  top: 0.4rem;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--green);
  border: 3px solid var(--cream);
  box-shadow: 0 0 0 2px var(--green);
}

.timeline__date {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 0.25rem;
}
.timeline__title {
  font-family: var(--font-head);
  font-size: 1.1rem;
  margin-bottom: 0.35rem;
}
.timeline__text {
  font-size: 0.9rem;
  color: var(--brown-light);
}

/* ── 11. Info Tables ──────────────────────────────────────── */
.info-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  margin: 1.5rem 0;
}
.info-table th {
  text-align: left;
  padding: 0.6rem 1rem;
  background: var(--cream-dark);
  color: var(--brown);
  font-weight: 600;
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.info-table td {
  padding: 0.65rem 1rem;
  border-bottom: 1px solid var(--border);
  color: var(--brown-mid);
  vertical-align: top;
}
.info-table tr:last-child td { border-bottom: none; }
.info-table tr:hover td { background: var(--cream-alt); }

/* ── 12. Family Tree ──────────────────────────────────────── */
.tree-wrapper {
  overflow-x: auto;
  padding: 1rem 0;
}

.tree {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  min-width: max-content;
  padding: 2rem;
}

/* Vertical descendant tree using CSS */
.tree ul {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding-left: 2.5rem;
  position: relative;
  gap: 0.5rem;
}

.tree ul::before {
  content: '';
  position: absolute;
  left: 0.9rem;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--border);
}

.tree li {
  position: relative;
  padding: 0.35rem 0;
}

.tree li::before {
  content: '';
  position: absolute;
  left: -1.6rem;
  top: 1.15rem;
  width: 1.6rem;
  height: 2px;
  background: var(--border);
}

.person-card {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  background: white;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 0.45rem 0.9rem;
  cursor: pointer;
  transition: border-color var(--ease), box-shadow var(--ease);
  max-width: 320px;
}
.person-card:hover {
  border-color: var(--green);
  box-shadow: 0 2px 12px var(--shadow);
}
.person-card.highlight {
  border-color: var(--gold);
  background: var(--gold-pale);
}

.person-card__icon { font-size: 1rem; flex-shrink: 0; }
.person-card__info { min-width: 0; }
.person-card__name {
  font-family: var(--font-head);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--brown);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.person-card__dates {
  font-size: 0.72rem;
  color: var(--brown-light);
}
.person-card__location {
  font-size: 0.7rem;
  color: var(--green-dark);
  font-style: italic;
}

.couple-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.25rem;
}
.couple-row .union-sign {
  font-size: 0.8rem;
  color: var(--gold);
  font-weight: 700;
}

/* ── 13. Map Section ──────────────────────────────────────── */
.map-container {
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  height: 380px;
  background: var(--cream-alt);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--brown-light);
}
.map-container iframe {
  width: 100%;
  height: 100%;
  border: none;
}

/* ── 14. Documents / Archive ──────────────────────────────── */
.doc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.25rem;
}

.doc-item {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  transition: box-shadow var(--ease), border-color var(--ease);
}
.doc-item:hover {
  border-color: var(--green);
  box-shadow: 0 4px 16px var(--shadow);
}

.doc-item__icon {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  background: var(--gold-pale);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
}

.doc-item__name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--brown);
  margin-bottom: 0.15rem;
  line-height: 1.3;
}
.doc-item__meta {
  font-size: 0.75rem;
  color: var(--brown-light);
}

/* ── 15. Footer ───────────────────────────────────────────── */
.footer {
  background: var(--brown);
  color: var(--cream-dark);
  padding: 3.5rem 0 2rem;
}

.footer__inner {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 3rem;
  margin-bottom: 2.5rem;
}

.footer__brand-name {
  font-family: var(--font-head);
  font-size: 1.3rem;
  color: var(--cream);
  margin-bottom: 0.5rem;
}
.footer__brand-desc {
  font-size: 0.85rem;
  color: rgba(237, 232, 224, 0.65);
  max-width: 280px;
  margin-bottom: 0;
}

.footer__heading {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--green-pale);
  margin-bottom: 1rem;
}

.footer__links { display: flex; flex-direction: column; gap: 0.4rem; }
.footer__links a {
  font-size: 0.85rem;
  color: rgba(237, 232, 224, 0.7);
  transition: color var(--ease);
}
.footer__links a:hover { color: var(--cream); }

.footer__bottom {
  border-top: 1px solid rgba(212, 201, 188, 0.2);
  padding-top: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8rem;
  color: rgba(237, 232, 224, 0.5);
}

/* ── 16. Tags / Badges ────────────────────────────────────── */
.tag {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.2rem 0.65rem;
  border-radius: 20px;
  background: var(--green-pale);
  color: var(--green-dark);
  margin-right: 0.35rem;
  margin-bottom: 0.35rem;
}
.tag--gold { background: var(--gold-pale); color: var(--gold); }
.tag--brown { background: var(--cream-dark); color: var(--brown-mid); }

/* ── 17. Utility Classes ──────────────────────────────────── */
.text-center { text-align: center; }
.text-right  { text-align: right; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mb-4 { margin-bottom: 2rem; }
.gap-1 { gap: 0.5rem; }
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }

/* Language visibility */
[data-lang] { display: none; }
[data-lang].lang-active { display: block; }
.lang-inline[data-lang].lang-active { display: inline; }

/* ── 18. Responsive ───────────────────────────────────────── */
@media (max-width: 900px) {
  .nav__links { display: none; }
  .nav__burger { display: flex; }

  .nav__links.mobile-open {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 68px;
    left: 0; right: 0;
    background: var(--cream);
    border-bottom: 1px solid var(--border);
    padding: 1rem;
    gap: 0.25rem;
    box-shadow: 0 8px 24px var(--shadow);
  }
  .nav__links.mobile-open .nav__link {
    padding: 0.6rem 1rem;
    font-size: 1rem;
  }

  .feature {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  .feature--reverse .feature__image,
  .feature--reverse .feature__text { order: unset; }

  .footer__inner { grid-template-columns: 1fr 1fr; }
  .footer__inner > div:first-child { grid-column: 1 / -1; }

  .grid-2 { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 600px) {
  html { font-size: 16px; }
  .section { padding: 3.5rem 0; }
  .hero__content { padding: 5rem 1rem 3rem; }
  .footer__inner { grid-template-columns: 1fr; gap: 2rem; }
  .footer__bottom { flex-direction: column; gap: 0.5rem; text-align: center; }
  .grid-3 { grid-template-columns: 1fr; }
  .page-hero { padding: 4rem 1.5rem 2.5rem; }
}

/* ── 19. Print ────────────────────────────────────────────── */
@media print {
  .nav, .hero__scroll, .nav-spacer { display: none; }
  .section { padding: 2rem 0; }
  a { color: inherit; text-decoration: underline; }
}
