/* BASE STYLES & CUSTOM PROPERTIES */
:root {
  /* Soft Modern Palette */
  --bg-color: #f8fafc;
  --surface: #ffffff;
  --text-main: #0f172a;
  --text-muted: #475569;
  --accent-main: #38bdf8;
  --accent-hover: #0284c7;
  --accent-light: #e0f2fe;
  --border-color: #e2e8f0;
  --error: #ef4444;
  
  /* Spacing Scale */
  --sp-4: 4px;
  --sp-8: 8px;
  --sp-12: 12px;
  --sp-16: 16px;
  --sp-24: 24px;
  --sp-40: 40px;
  --sp-64: 64px;
  
  /* Radii & Shadows */
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --shadow-soft: 0 8px 30px rgba(15, 23, 42, 0.04);
  --shadow-hover: 0 12px 40px rgba(15, 23, 42, 0.08);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

*, *::before, *::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--bg-color);
  color: var(--text-main);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

main {
  flex: 1;
}

h1, h2, h3, h4, h5, h6, .brand-name, .nav-link {
  overflow-wrap: anywhere;
  margin-top: 0;
  color: var(--text-main);
}

h1 { font-size: clamp(2rem, 5vw, 3rem); line-height: 1.2; margin-bottom: var(--sp-24); }
h2 { font-size: clamp(1.5rem, 4vw, 2rem); line-height: 1.3; margin-bottom: var(--sp-16); margin-top: var(--sp-40); }
h3 { font-size: clamp(1.25rem, 3vw, 1.5rem); margin-bottom: var(--sp-12); }
p { margin-top: 0; margin-bottom: var(--sp-16); }

a {
  color: var(--accent-hover);
  text-decoration: underline;
  text-underline-offset: 4px;
}

a:hover {
  text-decoration: none;
}

:focus-visible {
  outline: 3px solid var(--accent-main);
  outline-offset: 2px;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
  border-radius: var(--radius-sm);
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--sp-24);
  min-width: 0;
}

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

/* BUTTONS */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: var(--accent-main);
  color: #ffffff;
  padding: var(--sp-12) var(--sp-24);
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: background-color 0.2s, transform 0.2s;
}

.btn:hover {
  background-color: var(--accent-hover);
  color: #ffffff;
}

.btn-compact {
  padding: var(--sp-8) var(--sp-16);
  font-size: 0.875rem;
}

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

.btn-secondary:hover {
  background-color: var(--bg-color);
  color: var(--text-main);
}

/* HEADER */
.site-header {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  height: 64px;
  display: flex;
  align-items: center;
  position: relative;
  z-index: 100;
}

.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  height: 100%;
}

.brand {
  display: flex;
  align-items: center;
  gap: var(--sp-8);
  text-decoration: none;
  color: var(--text-main);
  font-weight: 700;
  font-size: 1.25rem;
  z-index: 101;
}

.brand svg {
  width: 28px;
  height: 28px;
  fill: var(--accent-main);
}

.site-nav {
  display: flex;
  gap: var(--sp-24);
}

.site-nav a {
  text-decoration: none;
  color: var(--text-muted);
  font-weight: 500;
  transition: color 0.2s;
}

.site-nav a:hover {
  color: var(--accent-hover);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: var(--sp-16);
  z-index: 101;
}

.hamburger {
  display: none;
  background: none;
  border: none;
  padding: var(--sp-4);
  cursor: pointer;
  color: var(--text-main);
}

.hamburger svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
}

/* HERO SECTION */
.hero {
  padding: var(--sp-64) 0;
  text-align: center;
  background: linear-gradient(135deg, var(--surface) 0%, var(--bg-color) 100%);
  border-bottom: 1px solid var(--border-color);
}

.hero-title {
  margin-bottom: var(--sp-16);
}

.hero-subtitle {
  font-size: 1.25rem;
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto var(--sp-24);
}

/* FRAMED CANVAS CARDS */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--sp-40) var(--sp-24);
  padding: var(--sp-64) 0;
}

.card-framed {
  position: relative;
  display: block;
  z-index: 1;
  text-decoration: none;
  height: 100%;
  min-width: 0;
}

.card-framed::before {
  content: "";
  position: absolute;
  top: 16px;
  left: 16px;
  width: 100%;
  height: 100%;
  background-color: var(--accent-light);
  border-radius: var(--radius-md);
  z-index: -1;
  transition: top 0.3s ease, left 0.3s ease;
}

.card-content-wrapper {
  background: var(--surface);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-soft);
  height: 100%;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  overflow: hidden;
}

.card-framed:hover .card-content-wrapper {
  transform: translateY(-8px);
  box-shadow: var(--shadow-hover);
}

.card-framed img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: 0;
  border-bottom: 1px solid var(--border-color);
}

.card-body {
  padding: var(--sp-24);
  display: flex;
  flex-direction: column;
  flex: 1;
}

.card-body h3 {
  color: var(--text-main);
  margin-bottom: var(--sp-8);
  font-size: 1.25rem;
}

.card-body p {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: var(--sp-16);
  flex: 1;
}

.card-cta {
  color: var(--accent-hover);
  font-weight: 600;
  font-size: 0.875rem;
  display: inline-flex;
  align-items: center;
  gap: var(--sp-4);
}

/* SECTIONS */
.section-pad {
  padding: var(--sp-64) 0;
}

.bg-surface {
  background-color: var(--surface);
}

.text-center {
  text-align: center;
}

/* ARTICLE / CONTENT PAGES */
.article-header {
  padding: var(--sp-64) 0 var(--sp-40);
  text-align: center;
  border-bottom: 1px solid var(--border-color);
  background-color: var(--surface);
}

.article-hero-img {
  width: 100%;
  max-height: 400px;
  object-fit: cover;
  border-radius: var(--radius-md);
  margin: var(--sp-40) 0;
}

.article-body {
  padding: var(--sp-40) 0 var(--sp-64);
  font-size: 1.125rem;
}

.article-body h2 {
  margin-top: var(--sp-64);
}

.article-body h3 {
  margin-top: var(--sp-40);
}

.article-body ul, .article-body ol {
  margin-bottom: var(--sp-24);
  padding-left: var(--sp-24);
}

.article-body li {
  margin-bottom: var(--sp-8);
}

/* STATS BLOCK */
.stat-block {
  background: var(--accent-light);
  padding: var(--sp-24);
  border-radius: var(--radius-md);
  margin: var(--sp-40) 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.stat-value {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--accent-hover);
  margin-bottom: var(--sp-12);
}

.stat-label {
  font-size: 1rem;
  color: var(--text-main);
  font-weight: 500;
}

/* TABLES (For Cookie Policy) */
.table-wrapper {
  width: 100%;
  overflow-x: auto;
  margin-bottom: var(--sp-24);
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 600px;
}

th, td {
  padding: var(--sp-12) var(--sp-16);
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

th {
  background-color: var(--bg-color);
  font-weight: 600;
}

/* FORMS */
.form-group {
  margin-bottom: var(--sp-24);
}

.form-label {
  display: block;
  font-weight: 500;
  margin-bottom: var(--sp-8);
}

.form-control {
  width: 100%;
  padding: var(--sp-12);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 1rem;
  background-color: var(--surface);
  color: var(--text-main);
  transition: border-color 0.2s;
}

.form-control:focus {
  outline: none;
  border-color: var(--accent-main);
  box-shadow: 0 0 0 3px var(--accent-light);
}

.form-control.is-invalid {
  border-color: var(--error);
}

.error-message {
  display: none;
  color: var(--error);
  font-size: 0.875rem;
  margin-top: var(--sp-4);
}

.form-control.is-invalid + .error-message {
  display: block;
}

textarea.form-control {
  min-height: 150px;
  resize: vertical;
}

.success-message {
  padding: var(--sp-24);
  background-color: #dcfce7;
  color: #166534;
  border-radius: var(--radius-sm);
  text-align: center;
  font-weight: 500;
}

/* MAP BLOCK */
.map-block {
  width: 100%;
  height: 300px;
  background: #e2e8f0;
  border-radius: var(--radius-md);
  margin-bottom: var(--sp-24);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-weight: 600;
  background-image: repeating-linear-gradient(45deg, #cbd5e1 25%, transparent 25%, transparent 75%, #cbd5e1 75%, #cbd5e1), repeating-linear-gradient(45deg, #cbd5e1 25%, var(--surface) 25%, var(--surface) 75%, #cbd5e1 75%, #cbd5e1);
  background-position: 0 0, 10px 10px;
  background-size: 20px 20px;
}

/* FOOTER */
.site-footer {
  background-color: var(--surface);
  border-top: 1px solid var(--border-color);
  padding: var(--sp-64) 0 var(--sp-24);
  margin-top: auto;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--sp-40);
  margin-bottom: var(--sp-40);
}

.footer-col h4 {
  font-size: 1.125rem;
  margin-bottom: var(--sp-16);
}

.footer-col ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-col li {
  margin-bottom: var(--sp-8);
}

.footer-col a {
  color: var(--text-muted);
  text-decoration: none;
}

.footer-col a:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

.footer-bottom {
  text-align: center;
  padding-top: var(--sp-24);
  border-top: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 0.875rem;
}

/* COOKIE BANNER */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: var(--surface);
  border-top: 1px solid var(--border-color);
  padding: var(--sp-16) 0;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.05);
  z-index: 1000;
  transform: translateY(100%);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.cookie-banner.is-visible {
  transform: translateY(0);
}

.cookie-inner {
  display: flex;
  flex-direction: column;
  gap: var(--sp-16);
}

@media (min-width: 768px) {
  .cookie-inner {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

.cookie-text {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin: 0;
  flex: 1;
}

.cookie-actions {
  display: flex;
  gap: var(--sp-8);
  flex-wrap: wrap;
}

/* RESPONSIVE */
@media (max-width: 767px) {
  .site-header {
    height: 52px;
  }
  
  .hamburger {
    display: block;
  }

  .site-nav {
    position: absolute;
    top: 52px;
    left: 0;
    width: 100%;
    background: var(--surface);
    flex-direction: column;
    padding: var(--sp-24);
    gap: var(--sp-16);
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow-soft);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: opacity 0.3s, transform 0.3s, visibility 0.3s;
  }

  .site-nav.is-active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }

  .card-framed::before {
    top: 0;
    left: 0;
  }

  .header-actions .btn-compact {
    display: none;
  }
}

@media (max-width: 399px) {
  h1 { font-size: 1.75rem; }
  .card-grid { grid-template-columns: 1fr; }
  .cookie-actions { flex-direction: column; width: 100%; }
  .cookie-actions button { width: 100%; }
}