/* ============================================
   Ozo Ģimene — Family Website
   Oak Tree Theme (Ozols)
   ============================================ */

/* --- CSS Variables --- */
:root {
  --forest: #4A6741;
  --forest-deep: #2D3B2D;
  --forest-light: #6B8F5E;
  --bark: #5C4033;
  --bark-light: #7D5A4A;
  --amber: #C49A3C;
  --amber-light: #D4B06A;
  --amber-glow: #E8C96E;
  --cream: #F5F0E8;
  --cream-warm: #FAF6EE;
  --linen: #F7F5F2;
  --text-dark: #2C2C2C;
  --text-body: #4A4A4A;
  --text-light: #7A7A7A;
  --white: #FFFFFF;
  --shadow: 0 4px 20px rgba(44, 44, 44, 0.08);
  --shadow-hover: 0 12px 35px rgba(44, 44, 44, 0.15);
  --shadow-deep: 0 8px 30px rgba(45, 59, 45, 0.12);
  --radius: 12px;
  --radius-sm: 8px;
  --transition: 0.3s ease;
  --font-serif: 'Cormorant Garamond', Georgia, serif;
  --font-script: 'Dancing Script', cursive;
  --font-sans: 'Lato', 'Segoe UI', sans-serif;
  --max-width: 1200px;
}

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

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

body {
  font-family: var(--font-sans);
  color: var(--text-dark);
  background: var(--white);
  line-height: 1.6;
  overflow-x: hidden;
}

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

a {
  text-decoration: none;
  color: inherit;
  transition: color var(--transition);
}

/* --- Navigation --- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(74, 103, 65, 0.1);
  transition: all var(--transition);
}

.nav.scrolled {
  box-shadow: 0 2px 20px rgba(44, 44, 44, 0.08);
}

.nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 18px 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-serif);
  font-size: 1rem;
  font-weight: 600;
  color: var(--forest);
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

.nav-logo svg {
  width: 24px;
  height: 24px;
  color: var(--amber);
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 36px;
}

.nav-links a {
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 400;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--text-body);
  position: relative;
  padding: 4px 0;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--amber);
  transition: width var(--transition);
}

.nav-links a:hover::after,
.nav-links a.active::after {
  width: 100%;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--forest);
}

/* Mobile nav toggle */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text-dark);
  transition: var(--transition);
}

/* --- Hero Section --- */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background: url('images/hero-oak.jpg') center/cover no-repeat;
  filter: brightness(0.6) saturate(0.8);
  transform: scale(1.05);
  transition: transform 8s ease;
}

.hero:hover .hero-bg {
  transform: scale(1);
}

.hero-grain {
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.03'/%3E%3C/svg%3E");
  pointer-events: none;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(45, 59, 45, 0.3) 0%,
    rgba(45, 59, 45, 0.1) 40%,
    rgba(45, 59, 45, 0.4) 100%
  );
}

.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 0 20px;
}

.hero-content h1 {
  font-family: var(--font-script);
  font-size: 5rem;
  font-weight: 400;
  color: var(--white);
  text-shadow: 0 2px 30px rgba(0,0,0,0.3);
  margin-bottom: 16px;
  letter-spacing: 2px;
}

.hero-sub {
  font-family: var(--font-serif);
  font-size: 1.4rem;
  font-weight: 300;
  font-style: italic;
  color: rgba(255,255,255,0.9);
  letter-spacing: 1px;
  text-shadow: 0 1px 10px rgba(0,0,0,0.2);
}

.hero-leaf-left,
.hero-leaf-right {
  position: absolute;
  z-index: 1;
  opacity: 0.15;
  pointer-events: none;
}

.hero-leaf-left {
  left: 40px;
  bottom: 20%;
  width: 120px;
  transform: rotate(-15deg);
}

.hero-leaf-right {
  right: 40px;
  top: 25%;
  width: 100px;
  transform: rotate(20deg) scaleX(-1);
}

.hero-scroll {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: rgba(255,255,255,0.7);
  font-family: var(--font-sans);
  font-size: 0.75rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  animation: float 2.5s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(8px); }
}

/* --- Couple Section --- */
.couple-section {
  padding: 80px 40px;
  background: var(--cream);
  position: relative;
}

.couple-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 1px;
  height: 60px;
  background: linear-gradient(to bottom, transparent, var(--amber));
}

.couple-strip {
  max-width: 700px;
  margin: 0 auto;
  display: flex;
  justify-content: center;
  gap: 80px;
}

.couple-card {
  text-align: center;
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.8s ease;
}

.couple-card.visible {
  opacity: 1;
  transform: translateY(0);
}

.couple-img {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--white);
  box-shadow: var(--shadow-deep);
  margin: 0 auto 20px;
  transition: transform var(--transition);
}

.couple-img:hover {
  transform: scale(1.05);
}

.couple-name {
  font-family: var(--font-serif);
  font-size: 1.8rem;
  font-weight: 600;
  color: var(--forest);
  margin-bottom: 4px;
}

.couple-role {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1rem;
  color: var(--text-light);
}

/* --- Section Base --- */
.section {
  padding: 100px 40px;
  position: relative;
}

.section-inner {
  max-width: var(--max-width);
  margin: 0 auto;
}

.section-warm {
  background: var(--cream-warm);
}

.section-forest {
  background: var(--forest-deep);
  color: var(--white);
}

.section-white {
  background: var(--white);
}

/* --- Lielvārde Belt Divider --- */
.belt-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 40px 0;
}

.belt-divider .belt-line {
  width: 60px;
  height: 1px;
  background: var(--amber);
  opacity: 0.5;
}

.belt-symbol {
  width: 24px;
  height: 24px;
  opacity: 0.4;
}

/* --- Story Section --- */
.story-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: center;
}

.story-image {
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-deep);
}

.story-image img {
  width: 100%;
  height: 400px;
  object-fit: cover;
  transition: transform 0.6s ease;
}

.story-image:hover img {
  transform: scale(1.03);
}

.story-text {
  opacity: 0;
  transform: translateX(30px);
  transition: all 0.8s ease;
}

.story-text.visible {
  opacity: 1;
  transform: translateX(0);
}

.story-text .line {
  width: 40px;
  height: 2px;
  background: var(--amber);
  margin-bottom: 24px;
}

.story-text h2 {
  font-family: var(--font-serif);
  font-size: 2.8rem;
  font-weight: 400;
  color: var(--forest);
  margin-bottom: 24px;
  line-height: 1.2;
}

.story-text p {
  font-size: 1.05rem;
  color: var(--text-body);
  line-height: 1.8;
  margin-bottom: 16px;
}

/* --- Tree Rings Timeline --- */
.timeline-section {
  padding: 100px 40px;
  background: var(--cream);
  text-align: center;
}

.timeline-title {
  font-family: var(--font-serif);
  font-size: 2.8rem;
  font-weight: 400;
  color: var(--forest);
  margin-bottom: 12px;
}

.timeline-sub {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.1rem;
  color: var(--text-light);
  margin-bottom: 60px;
}

.tree-rings {
  position: relative;
  max-width: 600px;
  margin: 0 auto;
}

.ring {
  position: relative;
  display: flex;
  align-items: center;
  gap: 30px;
  margin-bottom: 40px;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.6s ease;
}

.ring.visible {
  opacity: 1;
  transform: translateY(0);
}

.ring-circle {
  flex-shrink: 0;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: 2px solid var(--amber);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-serif);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--forest);
  background: var(--white);
  box-shadow: 0 0 0 4px rgba(196, 154, 60, 0.1);
  position: relative;
}

.ring-circle::after {
  content: '';
  position: absolute;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: 1px solid rgba(196, 154, 60, 0.15);
}

.ring-content {
  text-align: left;
}

.ring-year {
  font-family: var(--font-serif);
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--forest);
  margin-bottom: 4px;
}

.ring-event {
  font-size: 0.95rem;
  color: var(--text-body);
}

/* Vertical line connecting rings */
.tree-rings::before {
  content: '';
  position: absolute;
  left: 29px;
  top: 30px;
  bottom: 30px;
  width: 2px;
  background: linear-gradient(to bottom, var(--amber), var(--forest-light));
  opacity: 0.3;
}

/* --- Journey / Gallery Section --- */
.gallery-header {
  text-align: center;
  margin-bottom: 60px;
}

.gallery-header h2 {
  font-family: var(--font-serif);
  font-size: 2.8rem;
  font-weight: 400;
  color: var(--white);
  margin-bottom: 12px;
}

.gallery-header p {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.1rem;
  color: rgba(255,255,255,0.7);
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  max-width: var(--max-width);
  margin: 0 auto;
}

.gallery-item {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition);
  /* Polaroid feel */
  background: var(--white);
  padding: 8px 8px 30px;
}

.gallery-item:nth-child(odd) {
  transform: rotate(-1.5deg);
}

.gallery-item:nth-child(even) {
  transform: rotate(1.5deg);
}

.gallery-item:hover {
  transform: rotate(0) scale(1.03);
  box-shadow: var(--shadow-hover);
  z-index: 2;
}

.gallery-item img {
  width: 100%;
  height: 250px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  /* Warm amber tone */
  filter: sepia(0.15) saturate(0.9);
}

.gallery-caption {
  text-align: center;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 0.85rem;
  color: var(--text-light);
  padding-top: 8px;
}

/* --- Family Tree Preview --- */
.tree-preview {
  text-align: center;
  padding: 100px 40px;
  background: var(--cream-warm);
}

.tree-preview h2 {
  font-family: var(--font-serif);
  font-size: 2.8rem;
  font-weight: 400;
  color: var(--forest);
  margin-bottom: 16px;
}

.tree-preview p {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.1rem;
  color: var(--text-light);
  max-width: 500px;
  margin: 0 auto 40px;
}

.tree-illustration {
  max-width: 300px;
  margin: 0 auto 40px;
  opacity: 0.6;
}

.btn-oak {
  display: inline-block;
  padding: 14px 36px;
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--white);
  background: var(--forest);
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all var(--transition);
  box-shadow: 0 4px 15px rgba(74, 103, 65, 0.3);
}

.btn-oak:hover {
  background: var(--forest-deep);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(74, 103, 65, 0.4);
}

/* --- Footer --- */
.footer {
  background: var(--forest-deep);
  color: rgba(255,255,255,0.8);
  padding: 80px 40px 40px;
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 60px;
}

.footer-brand h3 {
  font-family: var(--font-script);
  font-size: 2rem;
  color: var(--amber-light);
  margin-bottom: 16px;
  font-weight: 400;
}

.footer-brand p {
  font-size: 0.95rem;
  line-height: 1.7;
  color: rgba(255,255,255,0.6);
}

.footer h4 {
  font-family: var(--font-serif);
  font-size: 1rem;
  font-weight: 600;
  color: var(--white);
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 20px;
}

.footer-links {
  list-style: none;
}

.footer-links li {
  margin-bottom: 10px;
}

.footer-links a {
  font-size: 0.9rem;
  color: rgba(255,255,255,0.6);
  transition: color var(--transition);
}

.footer-links a:hover {
  color: var(--amber-light);
}

.footer-contact p {
  font-size: 0.9rem;
  color: rgba(255,255,255,0.6);
  margin-bottom: 8px;
}

.footer-contact a {
  color: var(--amber-light);
}

.footer-bottom {
  max-width: var(--max-width);
  margin: 40px auto 0;
  padding-top: 24px;
  border-top: 1px solid rgba(255,255,255,0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  color: rgba(255,255,255,0.4);
}

.footer-bottom .heart {
  color: var(--amber);
}

/* --- Lightbox --- */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(0,0,0,0.9);
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.lightbox.active {
  display: flex;
}

.lightbox img {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
  border-radius: var(--radius);
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

.lightbox-close {
  position: absolute;
  top: 30px;
  right: 30px;
  width: 40px;
  height: 40px;
  background: rgba(255,255,255,0.1);
  border: none;
  border-radius: 50%;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition);
}

.lightbox-close:hover {
  background: rgba(255,255,255,0.2);
}

/* --- Scroll Animations --- */
.fade-in {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.8s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* --- Responsive --- */
@media (max-width: 900px) {
  .nav-inner {
    padding: 14px 24px;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(255,255,255,0.98);
    backdrop-filter: blur(10px);
    flex-direction: column;
    padding: 24px;
    gap: 20px;
    border-bottom: 1px solid rgba(74,103,65,0.1);
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
  }

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

  .nav-toggle {
    display: flex;
  }

  .hero-content h1 {
    font-size: 3rem;
  }

  .hero-sub {
    font-size: 1.1rem;
  }

  .couple-strip {
    flex-direction: column;
    gap: 40px;
    align-items: center;
  }

  .story-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }

  .footer-inner {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .footer-bottom {
    flex-direction: column;
    gap: 8px;
    text-align: center;
  }

  .hero-leaf-left,
  .hero-leaf-right {
    display: none;
  }
}

@media (max-width: 600px) {
  .hero-content h1 {
    font-size: 2.4rem;
  }

  .section {
    padding: 60px 20px;
  }

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

  .gallery-item:nth-child(odd),
  .gallery-item:nth-child(even) {
    transform: rotate(0);
  }
}

/* --- Page-specific: Family Tree --- */
.tree-page-hero {
  padding: 160px 40px 80px;
  text-align: center;
  background: linear-gradient(135deg, var(--cream) 0%, var(--cream-warm) 100%);
}

.tree-page-hero h1 {
  font-family: var(--font-serif);
  font-size: 3.2rem;
  font-weight: 400;
  color: var(--forest);
  margin-bottom: 12px;
}

.tree-page-hero p {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.3rem;
  color: var(--text-body);
  max-width: 500px;
  margin: 0 auto;
  line-height: 1.6;
}

/* Tree Container */
.tree-container {
  padding: 60px 20px 100px;
  overflow-x: auto;
}

.tree {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 700px;
  padding: 40px 0;
}

/* Generation rows */
.generation {
  display: flex;
  justify-content: center;
  gap: 40px;
  margin-bottom: 20px;
  position: relative;
}

.gen-label {
  position: absolute;
  left: -100px;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 0.85rem;
  color: var(--text-light);
  white-space: nowrap;
}

.person {
  text-align: center;
  position: relative;
}

.person-circle {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: 2px solid var(--amber);
  overflow: hidden;
  margin: 0 auto 10px;
  box-shadow: 0 0 0 4px rgba(196, 154, 60, 0.1);
  background: var(--cream);
}

.person-circle img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.person-circle.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-serif);
  font-size: 1.8rem;
  color: var(--forest);
  background: var(--cream);
}

.person-name {
  font-family: var(--font-serif);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--forest);
}

.person-years {
  font-size: 0.75rem;
  color: var(--text-light);
}

/* Connector lines */
.connector {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
}

.connector-line {
  width: 2px;
  height: 30px;
  background: var(--amber);
  opacity: 0.4;
}

.connector-horizontal {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}

.connector-h-line {
  height: 2px;
  width: 100px;
  background: var(--amber);
  opacity: 0.4;
}

.connector-h-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--amber);
  opacity: 0.6;
}
