/* ============================================================
   FLEPU FAMILY WEBSITE — Main Stylesheet
   Warm & Classic Theme
   ============================================================ */

/* === Google Fonts === */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,600;0,700;1,400;1,600&family=Lato:wght@300;400;700&display=swap');

/* === Design Tokens === */
:root {
  --cream:        #faf6f0;
  --parchment:    #f2e8d5;
  --parchment2:   #e8d9c0;
  --brown-dark:   #3d1a00;
  --brown-mid:    #8b4513;
  --brown-warm:   #a0522d;
  --brown-light:  #c8956c;
  --gold:         #c9913d;
  --gold-light:   #e8c97a;
  --gold-pale:    #f5e9c8;
  --forest:       #2c5f2e;
  --forest-light: #4a8c4e;
  --text:         #2d1b00;
  --text-mid:     #5a3a1a;
  --text-light:   #8b6342;
  --border:       #d4b896;
  --border-light: #e8d5b7;
  --shadow:       rgba(61, 26, 0, 0.12);
  --shadow-deep:  rgba(61, 26, 0, 0.25);
  --card-bg:      #fffdf8;
  --white:        #ffffff;

  --font-heading: 'Playfair Display', Georgia, serif;
  --font-body:    'Lato', 'Helvetica Neue', Arial, sans-serif;

  --radius:       8px;
  --radius-lg:    16px;
  --transition:   0.25s ease;
}

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

html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: var(--font-body);
  background-color: var(--cream);
  color: var(--text);
  line-height: 1.7;
  min-height: 100vh;
}

img { max-width: 100%; display: block; }
a  { color: var(--brown-mid); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--gold); }
ul { list-style: none; }

h1, h2, h3, h4, h5 {
  font-family: var(--font-heading);
  color: var(--brown-dark);
  line-height: 1.25;
}

/* === Navigation === */
.site-nav {
  background: var(--brown-dark);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 12px var(--shadow-deep);
}

.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
}

.nav-logo-icon {
  width: 38px;
  height: 38px;
  background: var(--gold);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  font-family: var(--font-heading);
  color: var(--brown-dark);
  font-weight: 700;
  flex-shrink: 0;
}

.nav-logo-text {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  color: var(--gold-light);
  font-weight: 600;
  letter-spacing: 0.02em;
}

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

.nav-links a {
  color: var(--parchment);
  font-size: 0.88rem;
  font-weight: 400;
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius);
  letter-spacing: 0.03em;
  transition: background var(--transition), color var(--transition);
}

.nav-links a:hover,
.nav-links a.active {
  background: rgba(201, 145, 61, 0.2);
  color: var(--gold-light);
}

.nav-hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
}

.nav-hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--parchment);
  border-radius: 2px;
  transition: var(--transition);
}

/* === Page Header === */
.page-header {
  background: linear-gradient(135deg, var(--brown-dark) 0%, var(--brown-mid) 100%);
  padding: 4rem 1.5rem 3rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.page-header::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23c9913d' fill-opacity='0.06'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  opacity: 0.5;
}

.page-header h1 {
  font-family: var(--font-heading);
  color: var(--gold-light);
  font-size: clamp(1.8rem, 4vw, 3rem);
  font-weight: 700;
  position: relative;
  margin-bottom: 0.5rem;
}

.page-header p {
  color: var(--parchment);
  font-size: 1.05rem;
  opacity: 0.9;
  position: relative;
  max-width: 600px;
  margin: 0 auto;
}

.page-header .ornament {
  color: var(--gold);
  font-size: 1.5rem;
  display: block;
  margin-bottom: 1rem;
  position: relative;
  letter-spacing: 0.5rem;
}

/* === Main Content === */
.main-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 3rem 1.5rem;
}

/* === Cards === */
.card {
  background: var(--card-bg);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: 0 2px 12px var(--shadow);
  overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition);
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 28px var(--shadow-deep);
}

/* === Buttons === */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.4rem;
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all var(--transition);
  text-transform: uppercase;
}

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

.btn-gold {
  background: var(--gold);
  color: var(--brown-dark);
  border-color: var(--gold);
}
.btn-gold:hover {
  background: var(--gold-light);
  border-color: var(--gold-light);
  color: var(--brown-dark);
}

.btn-outline {
  background: transparent;
  color: var(--brown-mid);
  border-color: var(--brown-mid);
}
.btn-outline:hover {
  background: var(--brown-mid);
  color: var(--white);
}

/* === Section Headers === */
.section-title {
  font-family: var(--font-heading);
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  color: var(--brown-dark);
  margin-bottom: 0.5rem;
}

.section-subtitle {
  color: var(--text-light);
  font-size: 1rem;
  margin-bottom: 2.5rem;
}

.section-divider {
  text-align: center;
  margin: 0 0 2.5rem;
}

.section-divider h2 {
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  display: inline-block;
  position: relative;
  padding: 0 2rem;
}

.section-divider h2::before,
.section-divider h2::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 60px;
  height: 1px;
  background: var(--gold);
}
.section-divider h2::before { right: 100%; }
.section-divider h2::after  { left: 100%; }

/* === Grid Layouts === */
.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.5rem;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 1.5rem;
}

/* === Person Avatar === */
.avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--border);
}

.avatar-placeholder {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--parchment2), var(--brown-light));
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-size: 1.8rem;
  color: var(--white);
  border: 3px solid var(--border);
  flex-shrink: 0;
}

.avatar-placeholder.female {
  background: linear-gradient(135deg, #d4a0b5, #9b5d75);
}

.avatar-placeholder.male {
  background: linear-gradient(135deg, var(--brown-light), var(--brown-warm));
}

/* === Footer === */
.site-footer {
  background: var(--brown-dark);
  color: var(--parchment);
  text-align: center;
  padding: 3rem 1.5rem 2rem;
  margin-top: 4rem;
}

.footer-logo {
  font-family: var(--font-heading);
  font-size: 1.8rem;
  color: var(--gold-light);
  margin-bottom: 0.5rem;
}

.footer-tagline {
  color: var(--text-light);
  font-style: italic;
  margin-bottom: 1.5rem;
}

.footer-variants {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.footer-variants span {
  background: rgba(201, 145, 61, 0.15);
  color: var(--gold-light);
  padding: 0.2rem 0.75rem;
  border-radius: 20px;
  font-size: 0.85rem;
  border: 1px solid rgba(201, 145, 61, 0.3);
}

.footer-bottom {
  border-top: 1px solid rgba(212, 184, 150, 0.2);
  padding-top: 1.25rem;
  color: var(--text-light);
  font-size: 0.82rem;
}

/* === Badge / Tag === */
.badge {
  display: inline-block;
  padding: 0.2rem 0.7rem;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.badge-gen { background: var(--gold-pale); color: var(--brown-warm); border: 1px solid var(--gold); }
.badge-history { background: #e8f0e8; color: var(--forest); border: 1px solid #a8c8a8; }
.badge-traditions { background: #f0e8d8; color: var(--brown-warm); border: 1px solid var(--border); }
.badge-memories { background: #e8e0f0; color: #5a3a7a; border: 1px solid #c8b0e0; }
.badge-milestone { background: var(--gold-pale); color: var(--brown-warm); border: 1px solid var(--gold); }
.badge-birth { background: #e0f0e8; color: var(--forest); border: 1px solid #90c098; }
.badge-founding { background: #f0e8e0; color: var(--brown-warm); border: 1px solid var(--border); }

/* === Modal === */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(61, 26, 0, 0.6);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  backdrop-filter: blur(4px);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition);
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.modal {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  max-width: 640px;
  width: 100%;
  max-height: 88vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px var(--shadow-deep);
  transform: scale(0.96) translateY(8px);
  transition: transform var(--transition);
}

.modal-overlay.open .modal {
  transform: scale(1) translateY(0);
}

.modal-header {
  background: linear-gradient(135deg, var(--brown-dark), var(--brown-mid));
  padding: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.modal-header h2 {
  color: var(--gold-light);
  font-family: var(--font-heading);
  font-size: 1.3rem;
}

.modal-close {
  background: rgba(255,255,255,0.15);
  border: none;
  color: var(--parchment);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background var(--transition);
}
.modal-close:hover { background: rgba(255,255,255,0.25); }

.modal-body {
  padding: 1.75rem;
}

/* === Search Input === */
.search-box {
  position: relative;
  max-width: 420px;
  margin-bottom: 2rem;
}

.search-box input {
  width: 100%;
  padding: 0.7rem 1rem 0.7rem 2.8rem;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 0.95rem;
  background: var(--card-bg);
  color: var(--text);
  transition: border-color var(--transition);
}

.search-box input:focus {
  outline: none;
  border-color: var(--gold);
}

.search-icon {
  position: absolute;
  left: 0.8rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-light);
  font-size: 1rem;
}

/* === Scrollbar === */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--parchment); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--brown-light); }

/* === Responsive === */
@media (max-width: 768px) {
  .nav-links {
    display: none;
    position: absolute;
    top: 68px;
    left: 0;
    right: 0;
    background: var(--brown-dark);
    flex-direction: column;
    gap: 0;
    padding: 0.5rem 0 1rem;
    box-shadow: 0 4px 12px var(--shadow-deep);
  }

  .nav-links.open { display: flex; }

  .nav-links a {
    padding: 0.75rem 1.5rem;
    border-radius: 0;
    font-size: 0.95rem;
  }

  .nav-hamburger { display: flex; }

  .site-nav { position: relative; }

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

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

@media (max-width: 480px) {
  .main-content { padding: 2rem 1rem; }
  .page-header { padding: 2.5rem 1rem 2rem; }
}

/* === Utility === */
.text-center { text-align: center; }
.text-gold { color: var(--gold); }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.italic { font-style: italic; }

/* === Empty State === */
.empty-state {
  text-align: center;
  padding: 3rem 1.5rem;
  color: var(--text-light);
}
.empty-state .empty-icon { font-size: 3rem; margin-bottom: 1rem; display: block; }
.empty-state h3 { font-family: var(--font-heading); margin-bottom: 0.5rem; color: var(--brown-mid); }

/* === Ornamental divider === */
.ornament-line {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 2rem 0;
}
.ornament-line::before,
.ornament-line::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}
.ornament-line span {
  color: var(--gold);
  font-size: 1.2rem;
  flex-shrink: 0;
}

/* === Info rows in modal / profile === */
.info-row {
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border-light);
  font-size: 0.93rem;
}
.info-row:last-child { border-bottom: none; }
.info-label {
  font-weight: 700;
  color: var(--text-mid);
  min-width: 90px;
  flex-shrink: 0;
}
.info-value { color: var(--text); }

/* === Notification toast === */
.toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: var(--brown-dark);
  color: var(--gold-light);
  padding: 0.85rem 1.4rem;
  border-radius: var(--radius);
  font-size: 0.9rem;
  box-shadow: 0 4px 16px var(--shadow-deep);
  z-index: 300;
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.35s ease;
}
.toast.show {
  transform: translateY(0);
  opacity: 1;
}
