/* public/css/editorial.css */

/* ── 1. Color System (Warm Earth & Charcoal Minimal) ────────────────────── */
:root {
  --background: oklch(0.975 0.008 95);
  --foreground: oklch(0.19 0.015 70);
  --card: oklch(0.99 0.004 95);
  --primary: oklch(0.205 0 0);
  --primary-foreground: oklch(0.985 0 0);
  --accent: oklch(0.62 0.14 42); /* Terracotta / Rust */
  --muted: oklch(0.97 0 0);
  --muted-text: oklch(0.45 0.01 70);
  --border: oklch(0.922 0 0);
  --radius: 0.625rem;
  
  --font-serif: "Playfair Display", Georgia, serif;
  --font-sans: "Inter", system-ui, Arial, sans-serif;
  --transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-theme="dark"] {
  --background: oklch(0.145 0 0);
  --foreground: oklch(0.985 0 0);
  --card: oklch(0.205 0 0);
  --primary: oklch(0.922 0 0);
  --primary-foreground: oklch(0.205 0 0);
  --accent: oklch(0.62 0.14 42);
  --muted: oklch(0.269 0 0);
  --muted-text: oklch(0.7 0 0);
  --border: oklch(1 0 0 / 10%);
}

/* ── 2. Reset & Typography ──────────────────────────────────────────────── */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--background);
  color: var(--foreground);
  font-family: var(--font-sans);
  line-height: 1.6;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.5s ease, color 0.5s ease;
}

/* Typography Hierarchy */
h1, h2, h3, h4, .display-serif {
  font-family: var(--font-serif);
  font-weight: 400;
  letter-spacing: -0.04em;
  line-height: 0.98;
}

h1 {
  font-size: clamp(3rem, 7vw, 5.5rem);
}

h2 {
  font-size: clamp(2.2rem, 5vw, 3.8rem);
}

h3 {
  font-size: clamp(1.8rem, 3.5vw, 2.5rem);
}

p {
  font-size: 1.05rem;
  font-weight: 300;
  line-height: 1.7;
}

/* Section Micro-Labels */
.micro-label {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--accent);
}

.micro-label::before {
  content: "";
  display: inline-block;
  height: 1px;
  width: 2rem;
  background-color: var(--accent);
}

/* ── 3. Layout Utilities ─────────────────────────────────────────────────── */
.max-width-container {
  width: 90%;
  max-width: 1400px;
  margin: 0 auto;
}

.section-padding {
  padding-top: 6rem;
  padding-bottom: 6rem;
}

@media (min-width: 768px) {
  .section-padding {
    padding-top: 8rem;
    padding-bottom: 8rem;
  }
}

/* ── 4. Core Components ──────────────────────────────────────────────────── */

/* Glassmorphic Sticky Header */
.editorial-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: rgb(from var(--background) r g b / 90%);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  transition: var(--transition);
}

.header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 5rem;
}

.brand-logo {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  text-decoration: none;
  color: var(--foreground);
  letter-spacing: -0.02em;
  font-weight: 600;
}

.nav-links {
  display: none;
  gap: 2.5rem;
  list-style: none;
}

@media (min-width: 768px) {
  .nav-links {
    display: flex;
  }
}

.nav-link {
  font-size: 0.85rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  text-decoration: none;
  color: var(--foreground);
  opacity: 0.7;
  transition: opacity 0.3s ease;
}

.nav-link:hover {
  opacity: 1;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

/* Custom Block Buttons */
.btn-block {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 0.85rem 1.75rem;
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  border-radius: var(--radius);
  border: 1px solid var(--foreground);
  cursor: pointer;
  text-decoration: none;
  background-color: var(--foreground);
  color: var(--background);
  transition: var(--transition);
}

.btn-block:hover {
  transform: translateY(-2px);
  background-color: transparent;
  color: var(--foreground);
}

.btn-block-outline {
  background-color: transparent;
  color: var(--foreground);
}

.btn-block-outline:hover {
  background-color: var(--foreground);
  color: var(--background);
}

.btn-icon {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--foreground);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem;
  border-radius: 50%;
  transition: var(--transition);
}

.btn-icon:hover {
  background-color: var(--muted);
}

/* ── 5. Hero Section ─────────────────────────────────────────────────────── */
.hero-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3.5rem;
  align-items: center;
}

@media (min-width: 992px) {
  .hero-grid {
    grid-template-columns: 1.1fr 0.9fr;
    gap: 6rem;
  }
}

.hero-content {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.hero-description {
  max-width: 520px;
  color: var(--muted-text);
}

.hero-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.hero-image-wrapper {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  aspect-ratio: 4/3;
}

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

.hero-mask {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.6) 0%, transparent 100%);
  pointer-events: none;
}

.bookmark-btn {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  width: 3.2rem;
  height: 3.2rem;
  border-radius: 50%;
  background-color: var(--background);
  border: 1px solid var(--border);
  color: var(--foreground);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
  transition: var(--transition);
  z-index: 10;
}

.bookmark-btn:hover {
  transform: scale(1.1);
  background-color: var(--accent);
  color: var(--background);
  border-color: var(--accent);
}

/* ── 6. Visual Asymmetry Grids ───────────────────────────────────────────── */
.grid-asymmetric {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3.5rem;
}

@media (min-width: 768px) {
  .grid-asymmetric {
    grid-template-columns: repeat(3, 1fr);
    gap: 2.5rem;
  }
  
  /* Apply offset to the first item for asymmetry */
  .grid-asymmetric > *:nth-child(1) {
    transform: translateY(2.5rem);
  }
}

/* Interactive Cards */
.editorial-card {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  text-decoration: none;
  color: inherit;
  group-hover: inherit;
}

.card-image-container {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.aspect-16-9 {
  aspect-ratio: 16/9;
}

.aspect-4-3 {
  aspect-ratio: 4/3;
}

.card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.card-body {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.card-title {
  font-size: 1.4rem;
  color: var(--foreground);
}

.card-meta {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--accent);
  font-weight: 500;
}

.card-desc {
  font-size: 0.95rem;
  font-weight: 300;
  color: var(--muted-text);
  margin-top: 0.25rem;
}

/* ── 7. Slide-out Modals / Sidebars ───────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background-color: oklch(0.19 0.015 70 / 40%);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.slide-sidebar {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  max-width: 460px;
  background-color: var(--background);
  border-left: 1px solid var(--border);
  z-index: 1001;
  padding: 3rem 2.5rem;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  overflow-y: auto;
}

.slide-sidebar.active {
  transform: translateX(0);
}

.sidebar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 3.5rem;
}

/* ── 8. Form Fields ──────────────────────────────────────────────────────── */
.form-group {
  margin-bottom: 2rem;
}

.form-label {
  display: block;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.form-input {
  width: 100%;
  padding: 1rem 1.25rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background-color: var(--muted);
  color: var(--foreground);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.3s ease;
}

.form-input:focus {
  border-color: var(--accent);
}

/* ── 9. Dashboard Page Styles ───────────────────────────────────────────── */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
  margin-top: 3.5rem;
}

@media (min-width: 992px) {
  .dashboard-grid {
    grid-template-columns: 2fr 1fr;
  }
}

.kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 2rem;
  margin-bottom: 3rem;
}

.kpi-item {
  border: 1px solid var(--border);
  padding: 2rem;
  border-radius: var(--radius);
  background-color: var(--card);
}

.kpi-num {
  font-family: var(--font-serif);
  font-size: 2.8rem;
  line-height: 1;
  margin-bottom: 0.5rem;
}

.kpi-title {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted-text);
}

.dashboard-panel {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2.5rem;
  background-color: var(--card);
  margin-bottom: 2rem;
}

.panel-title {
  margin-bottom: 2rem;
}

/* Lists and metrics inside dashboard */
.timeline-item {
  display: flex;
  gap: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.5rem;
}

.timeline-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
  margin-bottom: 0;
}

.timeline-date {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  line-height: 1;
  color: var(--accent);
  min-width: 60px;
}

.timeline-content {
  flex: 1;
}

.timeline-title {
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--foreground);
}

.timeline-desc {
  font-size: 0.9rem;
  color: var(--muted-text);
  font-weight: 300;
}

/* ── 10. Footer ────────────────────────────────────────────────────────── */
.editorial-footer {
  border-top: 1px solid var(--border);
  padding-top: 5rem;
  padding-bottom: 5rem;
  margin-top: 8rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3.5rem;
}

@media (min-width: 768px) {
  .footer-grid {
    grid-template-columns: 2fr 1fr 1fr;
    gap: 5rem;
  }
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.footer-link {
  text-decoration: none;
  color: var(--foreground);
  opacity: 0.7;
  font-size: 0.9rem;
  transition: opacity 0.3s ease;
}

.footer-link:hover {
  opacity: 1;
}

.footer-copy {
  margin-top: 4rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--muted-text);
}
