/*
  Chilia Veche Website - Main Stylesheet
  Design System: Editorial, magazine-style with generous whitespace
  
  Table of Contents:
  1. CSS Variables
  2. Reset & Base
  3. Typography
  4. Layout & Grid
  5. Components
  6. Utilities
  7. Responsive
*/

/* ============================================
   1. CSS Variables
   ============================================ */
:root {
  /* Colors - Rooted in the Delta: water, reeds, earth, sky */
  --color-white: #FFFFFF;
  --color-off-white: #FAFAF8;
  --color-light-grey: #E8E8E6;
  --color-grey: #A0A09F;
  --color-charcoal: #2C2C2C;
  --color-black: #0F0F0F;
  
  --color-water: #5A7C8E;      /* Muted blue-grey (Danube water) */
  --color-reed: #B8A888;       /* Warm beige (reed beds) */
  --color-sky: #A8BCC7;        /* Pale blue (delta sky) */
  --color-earth: #6B5D52;      /* Warm brown (river earth) */
  
  --color-accent-primary: #FF8C42;  /* Orange - links */
  --color-accent-mark: #C9A961;     /* Warm gold - thin bars */
  
  --color-link: var(--color-accent-primary);
  --color-link-hover: var(--color-charcoal);
  --color-border: rgba(0, 0, 0, 0.1);
  
  /* Typography */
  --font-display: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  
  /* Spacing - Generous, consistent scale */
  --space-xs: 8px;
  --space-sm: 16px;
  --space-md: 32px;
  --space-lg: 64px;
  --space-xl: 96px;
  --space-xxl: 128px;
  --space-huge: 160px;

  /* Content Widths - Centralized design system */
  --content-width-max: 1400px;      /* Main content width (default) */
  --content-width-narrow: 900px;    /* Narrow content (special cases) */
  --content-width-reading: 720px;   /* Optimal reading width (articles) */

  /* Transitions */
  --transition-fast: 0.2s ease;
  --transition-base: 0.3s ease;
  --transition-slow: 0.5s ease;
}

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  font-size: 18px;
  line-height: 1.7;
  color: var(--color-charcoal);
  background: var(--color-light-grey);
  overflow-x: hidden;
}

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

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

a:hover {
  color: var(--color-link-hover);
}

/* ============================================
   3. Typography
   ============================================ */

/* Hero Title - Massive, bold, graphic element */
.hero-title,
.title-hero {
  font-family: var(--font-display);
  font-size: clamp(48px, 8vw, 96px);
  line-height: 1;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--color-charcoal);
}

/* Page Title - Large, commanding */
.page-title,
.title-page {
  font-family: var(--font-display);
  font-size: clamp(40px, 6vw, 72px);
  line-height: 1.1;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--color-charcoal);
  margin-bottom: var(--space-md);
}

/* Section Title */
.section-title,
.title-section {
  font-family: var(--font-display);
  font-size: clamp(32px, 4vw, 48px);
  line-height: 1.2;
  font-weight: 600;
  color: var(--color-charcoal);
  margin-bottom: var(--space-md);
}

/* Split/Editorial Title */
.split-title,
.editorial-title {
  font-family: var(--font-display);
  font-size: clamp(28px, 3.5vw, 42px);
  line-height: 1.2;
  font-weight: 600;
  color: var(--color-charcoal);
  margin-bottom: var(--space-md);
}

/* Subsection */
.title-subsection {
  font-family: var(--font-display);
  font-size: clamp(24px, 2.5vw, 32px);
  line-height: 1.3;
  font-weight: 600;
  color: var(--color-charcoal);
  margin-bottom: var(--space-sm);
}

/* Intro / Lede Text - Slightly larger, more prominent */
.text-intro,
.editorial-intro,
.page-intro {
  font-size: clamp(18px, 1.5vw, 22px);
  line-height: 1.6;
  font-weight: 400;
  color: var(--color-charcoal);
  margin-bottom: var(--space-md);
}

/* Body Text */
.text-body,
p {
  font-size: 18px;
  line-height: 1.7;
  font-weight: 400;
  color: var(--color-charcoal);
  margin-bottom: var(--space-sm);
}

.content-body p:last-child,
.editorial-body p:last-child {
  margin-bottom: 0;
}

/* Small / Meta Text - Uppercase labels */
.text-small,
.meta-label,
.page-meta {
  font-size: 14px;
  line-height: 1.5;
  font-weight: 400;
  letter-spacing: 0.02em;
  color: var(--color-grey);
  text-transform: uppercase;
}

/* Navigation / Labels */
.text-nav {
  font-size: 12px;
  line-height: 1.4;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* Section Numbers - Editorial style (LABEL — NUMBER) */
.section-meta {
  display: flex;
  align-items: baseline;
  gap: var(--space-xs);
  margin-bottom: var(--space-md);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--color-grey);
}

.section-label {
  order: 1;
}

.section-meta::after {
  content: '—';
  order: 2;
  margin: 0 4px;
}

.section-number {
  order: 3;
}

/* Remove old individual styling */
.section-label,
.section-number {
  font-size: inherit;
  font-weight: inherit;
  text-transform: inherit;
  letter-spacing: inherit;
  color: inherit;
  display: inline;
  margin: 0;
}

/* Emphasis */
em {
  font-style: italic;
  color: var(--color-charcoal);
}

/* ============================================
   4. Layout & Grid
   ============================================ */

/* Container - Max width with breathing room */
.container {
  max-width: var(--content-width-max);
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

/* Narrow container - Use sparingly for special cases only
   Most pages should use .container for consistent width */
.container-narrow {
  max-width: var(--content-width-narrow);
  margin: 0 auto;
  padding: 0 var(--space-md);
}

/* Reading container - Optimal line length for text-heavy content */
.container-reading {
  max-width: var(--content-width-reading);
  margin: 0 auto;
  padding: 0 var(--space-md);
}

/* Grid Systems */

/* Asymmetric: Narrow sidebar + Main content */
.grid-asymmetric {
  display: grid;
  grid-template-columns: 1fr 3fr;
  gap: var(--space-lg);
  align-items: start;
}

/* Split: Image + Content side by side */
.grid-split {
  display: grid;
  grid-template-columns: 2fr 3fr;
  gap: 0;
  align-items: center;
}

/* Feature: Image emphasis + Content */
.grid-feature {
  display: grid;
  grid-template-columns: 40% 1fr;
  gap: var(--space-xl);
  align-items: center;
}

.grid-feature--reverse {
  grid-template-columns: 1fr 40%;
}

/* Responsive grid collapse */
@media (max-width: 1024px) {
  .grid-asymmetric,
  .grid-split,
  .grid-feature,
  .grid-feature--reverse {
    grid-template-columns: 1fr;
    gap: var(--space-lg);
  }
}

@media (max-width: 768px) {
  .container {
    padding: 0 var(--space-md);
  }
  .container-narrow {
    padding: 0 var(--space-sm);
  }
}

/* ============================================
   5. Components
   ============================================ */

/* ----- HERO SECTION ----- */
.hero-full {
  position: relative;
  width: 100%;
  height: 80vh;
  min-height: 600px;
  overflow: hidden;
}

.hero-image-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.hero-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Dark overlay for text readability */
.hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(to bottom, rgba(0,0,0,0.2), rgba(0,0,0,0.5));
}

.hero-content {
  position: relative;
  z-index: 10;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  height: 100%;
  text-align: center;
  color: white;
  padding: 0 var(--space-md);
}

.hero-meta {
  margin-bottom: var(--space-md);
}

.meta-location {
  font-size: 14px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  opacity: 0.9;
}

.hero-title {
  color: white;
  margin-bottom: var(--space-sm);
}

.hero-subtitle {
  font-size: clamp(18px, 2vw, 24px);
  font-weight: 300;
  letter-spacing: 0.02em;
  color: white;
  opacity: 1;
}

/* ----- PAGE HEADER ----- */
.page-header {
  padding: var(--space-xxl) 0 var(--space-xl);
  background: var(--color-white);
}

/* Page header with background image */
.page-header--image {
  position: relative;
  height: 50vh;
  min-height: 400px;
  display: flex;
  align-items: center;
  padding: 0;
  overflow: hidden;
}

.page-header--image .container-narrow {
  position: relative;
  z-index: 10;
}

.page-header--image .page-meta,
.page-header--image .page-title {
  color: white;
}

.page-title--overlay {
  color: white;
}

.header-image-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

.header-image-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.header-image-container .hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(to bottom, rgba(0,0,0,0.3), rgba(0,0,0,0.6));
  z-index: 2;
}

/* ----- SECTIONS ----- */
.section-intro,
.content-section {
  padding: var(--space-xxl) 0;
  background: var(--color-white);
}

/* Alternate background for visual separation */
.content-section--alt {
  background: var(--color-off-white);
}

/* Editorial block: centered, narrow, magazine-style */
.editorial-block {
  padding: var(--space-huge) 0;
  background: var(--color-white);
}

.editorial-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 var(--space-md);
}

.editorial-meta {
  margin-bottom: var(--space-md);
}

.meta-number {
  margin-left: var(--space-xs);
  color: var(--color-grey);
}

/* ----- SPLIT SECTION ----- */
.split-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 600px;
}

.split-image {
  position: relative;
  overflow: hidden;
}

.split-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.split-content {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: var(--space-xl);
  background: var(--color-white);
}

/* ----- SIDEBAR & MAIN CONTENT ----- */
.sidebar-narrow {
  position: relative;
  padding-top: 0;
  padding-left: 0;
}

/* Removed vertical accent line */

.main-content {
  background: var(--color-white);
  padding: var(--space-xl);
}

/* ----- FEATURE CONTENT ----- */
.feature-content {
  padding: var(--space-lg) 0;
}

.feature-image img {
  width: 100%;
  height: auto;
}

/* ----- ACCENT BAR ----- */
/* Removed - no longer used */
.accent-bar {
  display: none;
}

/* ----- IMAGE CIRCLE MASK ----- */
.image-circle-mask {
  width: 100%;
  max-width: 400px;
  aspect-ratio: 1;
  border-radius: 50%;
  overflow: hidden;
}

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

/* ----- LINKS WITH EXTENDED UNDERLINE ----- */
.link-extended {
  position: relative;
  display: inline-block;
  font-size: 16px;
  font-weight: 500;
  color: var(--color-link);
  text-decoration: none;
  transition: color var(--transition-base);
}

/* Extended underline effect */
.link-extended::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: -4px;
  right: -4px;
  height: 1px;
  background: currentColor;
  transition: all var(--transition-base);
}

.link-extended:hover {
  color: var(--color-link-hover);
}

.link-extended:hover::after {
  left: -8px;
  right: -8px;
}

/* ----- CIRCULAR OUTLINE BUTTONS ----- */
.btn-circle {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 1px solid var(--color-charcoal);
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-base);
  font-size: 20px;
}

.btn-circle:hover {
  background: var(--color-charcoal);
  color: white;
}

/* ----- CTA BUTTONS ----- */
.cta-button {
  display: inline-block;
  margin-top: var(--space-lg);
  padding: 14px 32px;
  font-size: 15px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-white);
  background: var(--color-accent-primary);
  border-radius: 4px;
  text-decoration: none;
  transition: all var(--transition-base);
  box-shadow: 0 2px 8px rgba(74, 107, 124, 0.2);
}

.cta-button:hover {
  background: var(--color-charcoal);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(74, 107, 124, 0.3);
  color: var(--color-white);
}

/* ----- DOT SEPARATOR ----- */
.dot-separator {
  margin: 0 12px;
  color: var(--color-grey);
}

/* ----- CONTENT CARD ----- */
.content-card {
  background: var(--color-white);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
  padding: var(--space-xl);
  margin-bottom: var(--space-lg);
}

/* ----- TIMELINE PREVIEW SECTION ----- */
.timeline-preview-section {
  padding: var(--space-xxl) 0;
  background: var(--color-white);
}

.timeline-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--space-lg);
  margin-bottom: var(--space-xl);
}

.timeline-preview-card {
  background: var(--color-off-white);
  padding: var(--space-lg);
  border-radius: 8px;
  border-left: 4px solid var(--color-accent-primary);
  transition: all var(--transition-base);
}

.timeline-preview-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.timeline-preview-date {
  display: block;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-accent-primary);
  margin-bottom: var(--space-sm);
}

.timeline-preview-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--color-charcoal);
  margin-bottom: var(--space-sm);
  line-height: 1.3;
}

.timeline-preview-card p {
  font-size: 15px;
  line-height: 1.6;
  color: var(--color-charcoal);
  margin: 0;
}

.timeline-preview-cta {
  text-align: center;
}

/* ----- FOOTER ----- */
.main-footer {
  padding: var(--space-xl) 0;
  background: var(--color-charcoal);
  color: var(--color-light-grey);
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer-nav {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.footer-nav a {
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-light-grey);
}

.footer-nav a:hover {
  color: var(--color-white);
}

/* ============================================
   6. Utilities
   ============================================ */
.text-center {
  text-align: center;
}

/* Margin utilities */
.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
.mb-xl { margin-bottom: var(--space-xl); }

.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mt-xl { margin-top: var(--space-xl); }

/* ============================================
   7. Responsive
   ============================================ */

/* Tablet */
@media (max-width: 1024px) {
  .split-section {
    grid-template-columns: 1fr;
  }
  
  .split-image {
    height: 400px;
  }
}

/* Mobile */
@media (max-width: 768px) {
  body {
    font-size: 16px;
  }
  
  .hero-full {
    height: 60vh;
    min-height: 400px;
  }
  
  .section-intro,
  .content-section,
  .editorial-block {
    padding: var(--space-xl) 0;
  }
  
  .split-content,
  .feature-content,
  .main-content {
    padding: var(--space-lg) var(--space-md);
  }
  
  .footer-content {
    flex-direction: column;
    gap: var(--space-md);
    text-align: center;
  }
  
  .footer-nav {
    flex-wrap: wrap;
    justify-content: center;
  }
}

/* Desktop - Buttons fit content */
@media (min-width: 1025px) {
  .cta-button {
    width: fit-content;
  }
}
