/* ===========================
   PS Public Art - Static Pages
   Shared styles for About, Guide, Discover, FAQ
   =========================== */

/* ===========================
   CSS VARIABLES & DESIGN TOKENS
   =========================== */
:root {
  /* Colors - Light Mode */
  --brand: #2563eb;
  --brand-ink: #ffffff;
  --bg: #ffffff;
  --surface: #f7f7f8;
  --text: #111111;
  --subtle: #6b6f76;
  --border: #e5e7eb;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;

  /* Spacing */
  --space-xs: 8px;
  --space-sm: 16px;
  --space-md: 32px;
  --space-lg: 64px;
  --space-xl: 96px;

  /* Typography */
  --font-body: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;

  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.12);
  --shadow-lg: 0 12px 24px rgba(0, 0, 0, 0.15);

  /* Transitions */
  --transition-fast: 0.2s ease-in-out;
  --transition-normal: 0.3s ease-in-out;
  --transition-slow: 0.6s ease-out;
}

/* Dark Mode */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1e1e1e;        /* Warm charcoal - comfortable dark gray */
    --surface: #2d2d2d;    /* Slightly elevated cards */
    --text: #eef1f5;
    --subtle: #9ca3af;
    --border: #404040;     /* Adjusted to match new background */
    --brand: #4f8cff;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 12px 24px rgba(0, 0, 0, 0.5);
  }
}

/* ===========================
   BASE STYLES
   =========================== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ===========================
   TYPOGRAPHY
   =========================== */
h1, h2, h3, h4, h5, h6 {
  line-height: 1.2;
  font-weight: 700;
  margin-bottom: var(--space-sm);
}

h1 {
  font-size: clamp(36px, 5vw, 56px);
  font-weight: 700;
}

h2 {
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 600;
}

h3 {
  font-size: clamp(22px, 3vw, 28px);
  font-weight: 600;
}

h4 {
  font-size: 20px;
  font-weight: 600;
}

p {
  margin-bottom: var(--space-sm);
  color: var(--text);
  opacity: 0.9;
}

a {
  color: var(--brand);
  text-decoration: none;
  transition: opacity var(--transition-fast);
}

a:hover {
  opacity: 0.8;
}

/* ===========================
   LAYOUT COMPONENTS
   =========================== */
.page-container {
  min-height: 100vh;
  background: var(--bg);
}

.page-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  padding: var(--space-sm);
  backdrop-filter: blur(10px);
  background: rgba(255, 255, 255, 0.9);
}

@media (prefers-color-scheme: dark) {
  .page-header {
    background: rgba(30, 30, 30, 0.9);
  }
}

.header-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.back-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: var(--surface);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-weight: 500;
  transition: all var(--transition-fast);
}

.back-button:hover {
  background: var(--brand);
  color: var(--brand-ink);
  opacity: 1;
}

.page-footer {
  background: var(--surface);
  padding: var(--space-md) var(--space-sm);
  margin-top: var(--space-xl);
  border-top: 1px solid var(--border);
  text-align: center;
}

.footer-links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin-bottom: var(--space-sm);
  font-size: 14px;
}

.footer-links a {
  color: var(--subtle);
  transition: color var(--transition-fast);
}

.footer-links a:hover {
  color: var(--brand);
  opacity: 1;
}

.footer-separator {
  color: var(--subtle);
  opacity: 0.5;
}

.footer-meta {
  font-size: 12px;
  color: var(--subtle);
  opacity: 0.7;
}

/* ===========================
   HERO SECTIONS
   =========================== */
.hero {
  position: relative;
  height: 60vh;
  min-height: 400px;
  max-height: 600px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--surface);
}

.hero-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  animation: kenburns 20s ease-in-out infinite alternate;
}

@keyframes kenburns {
  0% {
    transform: scale(1) translate(0, 0);
  }
  100% {
    transform: scale(1.15) translate(-3%, -3%);
  }
}

.hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.3) 0%, rgba(0, 0, 0, 0.5) 100%);
}

.hero-content {
  position: relative;
  z-index: 10;
  text-align: center;
  color: white;
  padding: var(--space-md);
  max-width: 800px;
}

.hero h1 {
  color: white;
  font-size: clamp(36px, 6vw, 64px);
  text-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
  margin-bottom: var(--space-sm);
}

.hero-subtitle {
  font-size: clamp(18px, 3vw, 24px);
  color: rgba(255, 255, 255, 0.95);
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.3);
  font-weight: 400;
  line-height: 1.4;
}

/* ===========================
   CONTENT SECTIONS
   =========================== */
.section {
  padding: var(--space-lg) var(--space-sm);
  max-width: 1200px;
  margin: 0 auto;
}

.section-narrow {
  max-width: 800px;
  margin: 0 auto;
}

.section-title {
  font-size: clamp(28px, 4vw, 40px);
  text-align: center;
  margin-bottom: var(--space-md);
}

.section-subtitle {
  text-align: center;
  font-size: 18px;
  color: var(--subtle);
  margin-bottom: var(--space-md);
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

/* ===========================
   CARDS
   =========================== */
.card {
  background: var(--surface);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-normal);
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-md);
  margin-bottom: var(--space-md);
}

.card-icon {
  width: 48px;
  height: 48px;
  background: var(--brand);
  color: var(--brand-ink);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-sm);
}

.card-icon svg {
  width: 24px;
  height: 24px;
}

.card h3 {
  margin-bottom: var(--space-xs);
}

.card p {
  font-size: 15px;
  line-height: 1.6;
}

/* ===========================
   BUTTONS
   =========================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 28px;
  font-size: 16px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  transition: all var(--transition-normal);
  text-decoration: none;
}

.btn-primary {
  background: var(--brand);
  color: var(--brand-ink);
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

.btn-primary:hover {
  background: #1d4ed8;
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.4);
  opacity: 1;
}

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--border);
  opacity: 1;
}

.btn-center {
  display: flex;
  justify-content: center;
  margin: var(--space-md) 0;
}

/* ===========================
   HORIZONTAL SCROLL CARDS
   =========================== */
.scroll-container {
  display: flex;
  gap: var(--space-sm);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  padding-bottom: var(--space-sm);
  margin-bottom: var(--space-md);
}

.scroll-container::-webkit-scrollbar {
  height: 8px;
}

.scroll-container::-webkit-scrollbar-track {
  background: var(--surface);
  border-radius: 4px;
}

.scroll-container::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

.scroll-container::-webkit-scrollbar-thumb:hover {
  background: var(--subtle);
}

.scroll-card {
  flex: 0 0 280px;
  scroll-snap-align: start;
  background: var(--surface);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-normal);
}

.scroll-card:hover {
  transform: scale(1.02);
  box-shadow: var(--shadow-md);
}

/* ===========================
   ACCORDION (FAQ)
   =========================== */
.accordion {
  max-width: 800px;
  margin: 0 auto;
}

.accordion-item {
  background: var(--surface);
  border-radius: var(--radius-sm);
  margin-bottom: var(--space-xs);
  overflow: hidden;
  transition: all var(--transition-normal);
}

.accordion-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-sm);
  cursor: pointer;
  user-select: none;
  transition: background var(--transition-fast);
}

.accordion-header:hover {
  background: var(--border);
}

.accordion-title {
  font-size: 16px;
  font-weight: 600;
  margin: 0;
}

.accordion-icon {
  width: 20px;
  height: 20px;
  transition: transform var(--transition-normal);
}

.accordion-item.active .accordion-icon {
  transform: rotate(180deg);
}

.accordion-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--transition-normal);
}

.accordion-item.active .accordion-content {
  max-height: 500px;
}

.accordion-body {
  padding: 0 var(--space-sm) var(--space-sm);
  color: var(--subtle);
  line-height: 1.6;
}

/* ===========================
   IMAGE CAROUSEL
   =========================== */
.carousel {
  position: relative;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto var(--space-md);
}

.carousel-container {
  display: flex;
  overflow: hidden;
  border-radius: var(--radius-md);
}

.carousel-slide {
  min-width: 100%;
  transition: transform var(--transition-slow);
}

.carousel-slide img {
  width: 100%;
  height: 400px;
  object-fit: cover;
  display: block;
}

.carousel-controls {
  position: absolute;
  top: 50%;
  width: 100%;
  display: flex;
  justify-content: space-between;
  transform: translateY(-50%);
  padding: 0 var(--space-sm);
  pointer-events: none;
}

.carousel-btn {
  pointer-events: all;
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.9);
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
  box-shadow: var(--shadow-md);
}

.carousel-btn:hover {
  background: white;
  transform: scale(1.1);
}

@media (prefers-color-scheme: dark) {
  .carousel-btn {
    background: rgba(45, 45, 45, 0.9);
    color: white;
  }

  .carousel-btn:hover {
    background: #2d2d2d;
  }
}

.carousel-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: var(--space-sm);
}

.carousel-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.carousel-dot.active {
  background: var(--brand);
  width: 24px;
  border-radius: 4px;
}

/* ===========================
   ANIMATIONS
   =========================== */
.fade-in {
  opacity: 0;
  transform: translateY(30px);
  transition: all var(--transition-slow);
}

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

.slide-in-left {
  opacity: 0;
  transform: translateX(-30px);
  transition: all var(--transition-slow);
}

.slide-in-left.visible {
  opacity: 1;
  transform: translateX(0);
}

.slide-in-right {
  opacity: 0;
  transform: translateX(30px);
  transition: all var(--transition-slow);
}

.slide-in-right.visible {
  opacity: 1;
  transform: translateX(0);
}

/* ===========================
   PARALLAX
   =========================== */
.parallax-section {
  position: relative;
  min-height: 400px;
  background-attachment: fixed;
  background-position: center;
  background-size: cover;
  display: flex;
  align-items: center;
  justify-content: center;
}

.parallax-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
}

.parallax-content {
  position: relative;
  z-index: 10;
  text-align: center;
  color: white;
  padding: var(--space-md);
  max-width: 800px;
}

/* ===========================
   TIMELINE
   =========================== */
.timeline {
  max-width: 800px;
  margin: var(--space-lg) auto;
  position: relative;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--border);
  transform: translateX(-50%);
}

.timeline-item {
  display: flex;
  gap: var(--space-md);
  margin-bottom: var(--space-md);
  position: relative;
}

.timeline-dot {
  width: 16px;
  height: 16px;
  background: var(--brand);
  border-radius: 50%;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  box-shadow: 0 0 0 4px var(--bg);
}

.timeline-content {
  flex: 1;
  background: var(--surface);
  padding: var(--space-sm);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
}

.timeline-year {
  font-weight: 700;
  color: var(--brand);
  margin-bottom: 4px;
}

/* ===========================
   RESPONSIVE
   =========================== */
@media (max-width: 768px) {
  .section {
    padding: var(--space-md) var(--space-sm);
  }

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

  .hero {
    height: 50vh;
    min-height: 350px;
  }

  .timeline::before {
    left: 20px;
  }

  .timeline-dot {
    left: 20px;
  }

  .timeline-item {
    padding-left: 50px;
  }

  .parallax-section {
    background-attachment: scroll;
  }
}

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

.text-subtle {
  color: var(--subtle);
}

.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }

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