/* Root Design Tokens - Soft Modern Aesthetic */
:root {
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --bg-canvas: #f8faf9;
  --bg-surface: #ffffff;
  --bg-surface-elevated: #ffffff;
  --bg-subtle: #f0f4f2;
  --bg-soft-green: #e9f2ee;
  --bg-soft-terracotta: #fdf2ed;
  --text-main: #1d2723;
  --text-muted: #4e5f58;
  --text-light: #6a7b74;
  --brand-primary: #1e4d3b;
  --brand-primary-hover: #15392b;
  --brand-accent-clay: #c85a32;
  --brand-accent-clay-hover: #ad4924;
  --brand-accent-court: #2a7255;
  --border-light: #e0e8e4;
  --border-focus: #1e4d3b;
  --shadow-micro: 0 2px 6px rgba(18, 38, 30, 0.04), 0 8px 24px rgba(18, 38, 30, 0.05);
  --shadow-elevated: 0 4px 12px rgba(18, 38, 30, 0.06), 0 16px 36px rgba(18, 38, 30, 0.08);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;
  --space-4: 4px;
  --space-8: 8px;
  --space-12: 12px;
  --space-16: 16px;
  --space-24: 24px;
  --space-40: 40px;
  --space-64: 64px;
  --space-96: 96px;
  --container-max: 1160px;
  --header-height: 64px;
}

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

html {
  font-family: var(--font-sans);
  background-color: var(--bg-canvas);
  color: var(--text-main);
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--bg-canvas);
  color: var(--text-main);
}

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

a {
  color: var(--brand-accent-court);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color 0.15s ease;
}

a:hover {
  color: var(--brand-accent-clay);
}

h1, h2, h3, h4, h5, h6 {
  color: var(--text-main);
  line-height: 1.25;
  font-weight: 700;
  overflow-wrap: anywhere;
}

p, li, dd {
  font-size: 1.05rem;
  color: var(--text-muted);
  line-height: 1.7;
}

/* Accessible Focus States */
:focus-visible {
  outline: 2px solid var(--border-focus);
  outline-offset: 3px;
}

/* Layout Container */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--space-24);
  padding-right: var(--space-24);
}

/* Header Component (Not sticky, exact height guidelines) */
.site-header {
  background-color: var(--bg-surface);
  border-bottom: 1px solid var(--border-light);
  height: var(--header-height);
  position: relative;
  z-index: 50;
}

.header-container {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-16);
}

.brand-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-8);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--brand-primary);
  text-decoration: none;
  overflow-wrap: anywhere;
  min-width: 0;
}

.brand-icon {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
}

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

.nav-link {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  padding: var(--space-8) var(--space-4);
  border-radius: var(--radius-sm);
  transition: color 0.15s ease;
}

.nav-link:hover,
.nav-link[aria-current="page"] {
  color: var(--brand-primary);
}

.header-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: var(--brand-primary);
  color: #ffffff;
  padding: var(--space-8) var(--space-16);
  border-radius: var(--radius-full);
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: var(--shadow-micro);
  transition: background-color 0.15s ease;
}

.header-cta:hover {
  background-color: var(--brand-primary-hover);
  color: #ffffff;
}

.nav-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: var(--space-8);
  color: var(--text-main);
  cursor: pointer;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
}

.nav-mobile-overlay {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background-color: var(--bg-surface);
  border-bottom: 2px solid var(--border-light);
  box-shadow: var(--shadow-elevated);
  padding: var(--space-24);
  z-index: 100;
}

.nav-mobile-overlay.is-visible {
  display: block;
}

.nav-mobile-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-16);
}

.nav-mobile-list .nav-link {
  font-size: 1.05rem;
  display: block;
  padding: var(--space-8) 0;
}

/* Hero Section */
.hero-section {
  padding-top: var(--space-64);
  padding-bottom: var(--space-64);
  background: linear-gradient(180deg, var(--bg-surface) 0%, var(--bg-canvas) 100%);
  border-bottom: 1px solid var(--border-light);
}

.hero-inner {
  max-width: 800px;
}

.eyebrow-tag {
  display: inline-flex;
  align-items: center;
  gap: var(--space-8);
  background-color: var(--bg-soft-green);
  color: var(--brand-primary);
  padding: var(--space-4) var(--space-12);
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--space-16);
}

.hero-title {
  font-size: clamp(2rem, 4.5vw, 3rem);
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.02em;
  margin-bottom: var(--space-24);
}

.hero-subtitle {
  font-size: 1.25rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: var(--space-40);
}

/* Card Style: Horizontal Split (Media left, metadata + tags + CTA right) */
.section-cards {
  padding-top: var(--space-64);
  padding-bottom: var(--space-64);
}

.cards-heading-group {
  margin-bottom: var(--space-40);
}

.section-title {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: var(--space-12);
}

.section-desc {
  font-size: 1.1rem;
  color: var(--text-muted);
  max-width: 700px;
}

.cards-collection {
  display: flex;
  flex-direction: column;
  gap: var(--space-40);
}

.horizontal-card {
  display: flex;
  flex-direction: row;
  background-color: var(--bg-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-micro);
  overflow: hidden;
  min-width: 0;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.horizontal-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-elevated);
}

.card-media {
  flex: 0 0 42%;
  min-width: 0;
  position: relative;
  background-color: var(--bg-subtle);
}

.card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.card-body {
  flex: 1 1 58%;
  padding: var(--space-40);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: var(--space-24);
  min-width: 0;
}

.card-top {
  display: flex;
  flex-direction: column;
  gap: var(--space-16);
}

.card-meta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-12);
}

.badge-tag {
  background-color: var(--bg-soft-terracotta);
  color: var(--brand-accent-clay);
  font-size: 0.8rem;
  font-weight: 600;
  padding: var(--space-4) var(--space-12);
  border-radius: var(--radius-full);
}

.badge-tag.accent-green {
  background-color: var(--bg-soft-green);
  color: var(--brand-primary);
}

.card-meta-detail {
  font-size: 0.85rem;
  color: var(--text-light);
}

.card-title {
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.3;
}

.card-title a {
  color: inherit;
  text-decoration: none;
}

.card-title a:hover {
  color: var(--brand-accent-clay);
}

.card-excerpt {
  font-size: 1rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.card-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: var(--space-16);
  border-top: 1px solid var(--border-light);
}

.btn-card {
  display: inline-flex;
  align-items: center;
  gap: var(--space-8);
  background-color: var(--brand-primary);
  color: #ffffff;
  padding: var(--space-8) var(--space-24);
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  transition: background-color 0.15s ease;
}

.btn-card:hover {
  background-color: var(--brand-primary-hover);
  color: #ffffff;
}

.read-time-pill {
  font-size: 0.85rem;
  color: var(--text-light);
}

/* Supporting Highlight Section */
.section-highlight {
  padding-top: var(--space-64);
  padding-bottom: var(--space-64);
  background-color: var(--bg-subtle);
  border-top: 1px solid var(--border-light);
  border-bottom: 1px solid var(--border-light);
}

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

.highlight-box {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: var(--space-24);
  box-shadow: var(--shadow-micro);
  min-width: 0;
}

.stat-number {
  display: block;
  font-size: 2rem;
  font-weight: 800;
  color: var(--brand-primary);
  margin-bottom: var(--space-12);
  line-height: 1.1;
}

.stat-label {
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: var(--space-8);
  font-size: 1.1rem;
}

.stat-desc {
  font-size: 0.95rem;
  color: var(--text-muted);
}

/* Sub-page Article Layout */
.article-header {
  padding-top: var(--space-64);
  padding-bottom: var(--space-40);
  background: linear-gradient(180deg, var(--bg-surface) 0%, var(--bg-canvas) 100%);
  border-bottom: 1px solid var(--border-light);
}

.article-hero-wrap {
  max-width: 860px;
}

.article-title {
  font-size: clamp(2rem, 4vw, 2.75rem);
  font-weight: 800;
  color: var(--text-main);
  margin-top: var(--space-16);
  margin-bottom: var(--space-24);
  line-height: 1.2;
}

.article-lead {
  font-size: 1.2rem;
  color: var(--text-muted);
  line-height: 1.65;
  margin-bottom: var(--space-24);
}

.article-meta-bar {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-16);
  align-items: center;
  padding-top: var(--space-16);
  border-top: 1px solid var(--border-light);
  font-size: 0.9rem;
  color: var(--text-light);
}

.article-main {
  padding-top: var(--space-64);
  padding-bottom: var(--space-64);
}

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

.article-banner-img {
  width: 100%;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-micro);
  border: 1px solid var(--border-light);
  margin-bottom: var(--space-40);
  max-height: 480px;
  object-fit: cover;
}

.article-content h2 {
  font-size: 1.7rem;
  margin-top: var(--space-40);
  margin-bottom: var(--space-16);
  color: var(--text-main);
}

.article-content h3 {
  font-size: 1.3rem;
  margin-top: var(--space-24);
  margin-bottom: var(--space-12);
  color: var(--brand-primary);
}

.article-content p {
  margin-bottom: var(--space-24);
}

.article-content ul, 
.article-content ol {
  margin-top: var(--space-8);
  margin-bottom: var(--space-24);
  padding-left: var(--space-24);
}

.article-content li {
  margin-bottom: var(--space-8);
}

.article-content blockquote {
  border-left: 4px solid var(--brand-accent-clay);
  background-color: var(--bg-soft-terracotta);
  padding: var(--space-16) var(--space-24);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  margin: var(--space-24) 0;
  font-style: italic;
}

.article-content blockquote p {
  margin: 0;
  color: var(--text-main);
}

.content-table-wrapper {
  overflow-x: auto;
  margin: var(--space-24) 0 var(--space-40) 0;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  background-color: var(--bg-surface);
}

.styled-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.95rem;
}

.styled-table th {
  background-color: var(--bg-soft-green);
  color: var(--brand-primary);
  font-weight: 700;
  padding: var(--space-12) var(--space-16);
  border-bottom: 2px solid var(--border-light);
}

.styled-table td {
  padding: var(--space-12) var(--space-16);
  border-bottom: 1px solid var(--border-light);
  color: var(--text-muted);
}

.styled-table tr:last-child td {
  border-bottom: none;
}

/* Related Guides Section */
.related-section {
  padding-top: var(--space-64);
  padding-bottom: var(--space-64);
  background-color: var(--bg-subtle);
  border-top: 1px solid var(--border-light);
}

/* Contact Page Form & Layout */
.contact-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-40);
  margin-top: var(--space-40);
}

.contact-card-form {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: var(--space-40);
  box-shadow: var(--shadow-micro);
}

.form-group {
  margin-bottom: var(--space-24);
}

.form-label {
  display: block;
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: var(--space-8);
  color: var(--text-main);
}

.form-control {
  width: 100%;
  padding: var(--space-12) var(--space-16);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 1rem;
  color: var(--text-main);
  background-color: var(--bg-canvas);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-control:focus {
  border-color: var(--border-focus);
  background-color: var(--bg-surface);
}

.form-control.is-invalid {
  border-color: #b91c1c;
  background-color: #fef2f2;
}

.form-error {
  display: none;
  font-size: 0.85rem;
  color: #b91c1c;
  margin-top: var(--space-4);
}

.form-error.is-visible {
  display: block;
}

.btn-submit {
  width: 100%;
  background-color: var(--brand-primary);
  color: #ffffff;
  padding: var(--space-16) var(--space-24);
  border: none;
  border-radius: var(--radius-md);
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: var(--shadow-micro);
  transition: background-color 0.15s ease;
}

.btn-submit:hover {
  background-color: var(--brand-primary-hover);
  color: #ffffff;
}

.form-status {
  display: none;
  margin-top: var(--space-16);
  padding: var(--space-16);
  border-radius: var(--radius-md);
  font-size: 0.95rem;
}

.form-status.success.is-visible {
  display: block;
  background-color: var(--bg-soft-green);
  color: var(--brand-primary);
  border: 1px solid var(--border-light);
}

.contact-info-panel {
  display: flex;
  flex-direction: column;
  gap: var(--space-24);
}

.info-block {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: var(--space-24);
  box-shadow: var(--shadow-micro);
}

.info-block h3 {
  font-size: 1.25rem;
  margin-bottom: var(--space-8);
  color: var(--text-main);
}

/* Static Map Block */
.static-map-container {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-micro);
}

.static-map-graphic {
  width: 100%;
  height: 220px;
  background: linear-gradient(135deg, #dcebe2 0%, #cae3d6 50%, #b8d9c8 100%);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid var(--border-light);
}

.map-court-motif {
  width: 160px;
  height: 90px;
  border: 2px solid rgba(255, 255, 255, 0.85);
  position: relative;
}

.map-court-net {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  border-left: 2px dashed rgba(255, 255, 255, 0.9);
}

.map-pin {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -100%);
  background-color: var(--brand-accent-clay);
  color: #ffffff;
  padding: 6px 12px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
  box-shadow: 0 4px 10px rgba(0,0,0,0.15);
  white-space: nowrap;
}

.map-caption {
  padding: var(--space-16);
  font-size: 0.85rem;
  color: var(--text-light);
  background-color: var(--bg-surface);
}

/* Footer Section */
.site-footer {
  background-color: var(--bg-surface);
  border-top: 1px solid var(--border-light);
  padding-top: var(--space-64);
  padding-bottom: var(--space-40);
  margin-top: auto;
}

.footer-top {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: var(--space-40);
  margin-bottom: var(--space-40);
}

.footer-brand h4 {
  font-size: 1.25rem;
  color: var(--brand-primary);
  margin-bottom: var(--space-12);
}

.footer-brand p {
  font-size: 0.95rem;
  color: var(--text-muted);
  max-width: 380px;
  margin-bottom: var(--space-12);
}

.footer-links-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: var(--space-16);
}

.footer-links-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
}

.footer-links-list a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.15s ease;
}

.footer-links-list a:hover {
  color: var(--brand-primary);
  text-decoration: underline;
}

.footer-bottom {
  padding-top: var(--space-24);
  border-top: 1px solid var(--border-light);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-16);
  font-size: 0.85rem;
  color: var(--text-light);
}

.legal-meta-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-16);
  list-style: none;
}

/* Cookie Banner */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background-color: #ffffff;
  color: var(--text-main);
  border-top: 2px solid var(--border-light);
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.08);
  padding: var(--space-24);
  z-index: 1000;
}

.cookie-banner[hidden] {
  display: none !important;
}

.cookie-banner-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-16);
}

.cookie-banner-text {
  max-width: 680px;
  font-size: 0.92rem;
  color: var(--text-muted);
  line-height: 1.5;
}

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

.btn-cookie {
  padding: var(--space-8) var(--space-16);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s ease;
}

.btn-cookie-primary {
  background-color: var(--brand-primary);
  color: #ffffff;
}

.btn-cookie-primary:hover {
  background-color: var(--brand-primary-hover);
  color: #ffffff;
}

.btn-cookie-secondary {
  background-color: var(--bg-subtle);
  color: var(--text-main);
  border-color: var(--border-light);
}

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

.btn-cookie-text {
  background: transparent;
  color: var(--text-muted);
  border-color: var(--border-light);
}

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

/* Responsive Rules & Reflows */
@media (max-width: 900px) {
  .horizontal-card {
    flex-direction: column;
  }
  .card-media {
    flex: 0 0 auto;
    height: 240px;
  }
  .contact-layout {
    grid-template-columns: 1fr;
  }
  .footer-top {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 768px) {
  :root {
    --header-height: 52px;
  }
  .nav-desktop {
    display: none;
  }
  .nav-toggle {
    display: flex;
  }
  .footer-top {
    grid-template-columns: 1fr;
  }
  .card-body {
    padding: var(--space-24);
  }
  .card-bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-12);
  }
}

/* Breakpoint below 400px down to 320px */
@media (max-width: 380px) {
  .container {
    padding-left: var(--space-16);
    padding-right: var(--space-16);
  }
  .hero-title {
    font-size: 1.75rem;
  }
  .card-body {
    padding: var(--space-16);
  }
  .cookie-banner {
    padding: var(--space-16);
  }
  .cookie-banner-actions {
    flex-direction: column;
    width: 100%;
  }
  .btn-cookie {
    width: 100%;
    text-align: center;
  }
}

/* Motion Preferences */
@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;
  }
}