:root {
  --green: #007a61;
  --green-dark: #00594a;
  --green-light: #e6f3f0;
  --clay: #ce6129;
  --clay-dark: #a94e20;
  --clay-light: #fbe9de;
  --ink: #1c2422;
  --ink-soft: #556262;
  --paper: #ffffff;
  --paper-soft: #f6f7f6;
  --border: #e2e6e4;
  --radius: 14px;
  --shadow: 0 6px 24px rgba(28, 36, 34, 0.08);
  --maxw: 1160px;
  font-size: 16px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.55;
}
img, svg { max-width: 100%; }
a { color: var(--green); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { font-family: inherit; font-weight: 700; line-height: 1.15; margin: 0 0 0.5em; letter-spacing: -0.01em; }
h1 { font-size: clamp(2rem, 4vw, 3rem); }
h2 { font-size: clamp(1.5rem, 2.6vw, 2.1rem); }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1em; }
.container { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 26px; border-radius: 999px; font-weight: 600; font-size: 0.98rem;
  border: none; cursor: pointer; transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
  text-decoration: none;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary { background: var(--clay); color: #fff; box-shadow: 0 8px 20px rgba(206,97,41,0.28); }
.btn-primary:hover { background: var(--clay-dark); }
.btn-secondary { background: var(--green); color: #fff; }
.btn-secondary:hover { background: var(--green-dark); }
.btn-ghost { background: transparent; color: var(--green); border: 1.5px solid var(--green); }
.btn-ghost:hover { background: var(--green-light); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; box-shadow: none; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 40; background: #ffffff;
  border-bottom: 1px solid var(--border);
}
.site-header .inner { display: flex; align-items: center; justify-content: space-between; padding: 14px 24px; max-width: var(--maxw); margin: 0 auto; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.15rem; color: var(--ink); text-decoration: none; }
.brand:hover { text-decoration: none; }
.logo-mark { width: 32px; height: 32px; border-radius: 8px; flex-shrink: 0; display: block; }
.footer-brand { display: flex; align-items: center; gap: 10px; }
.footer-brand .logo-mark { width: 28px; height: 28px; }
.nav-links { display: flex; align-items: center; gap: 26px; }
.nav-links a { color: var(--ink); font-weight: 600; font-size: 0.95rem; }
.nav-links a.active { color: var(--green); }
.header-actions { display: flex; align-items: center; gap: 14px; }
.lang-switch { display: flex; gap: 4px; background: var(--paper-soft); border-radius: 999px; padding: 3px; }
.lang-switch a { padding: 5px 10px; border-radius: 999px; font-size: 0.8rem; font-weight: 700; color: var(--ink-soft); text-transform: uppercase; }
.lang-switch a.active { background: var(--green); color: #fff; }
.nav-toggle { display: none; }

@media (max-width: 860px) {
  .nav-links { position: fixed; inset: 64px 0 0 0; background: #fff; flex-direction: column; padding: 28px 24px; gap: 20px; transform: translateY(-110%); transition: transform .25s ease; }
  .nav-links.open { transform: translateY(0); }
  .nav-toggle { display: inline-flex; background: none; border: none; font-size: 1.5rem; cursor: pointer; color: var(--ink); }
}

/* Hero (image carousel) */
.hero {
  background-color: var(--green-dark);
  color: #fff; padding: 100px 24px 120px; position: relative; overflow: hidden;
}
.hero-slides { position: absolute; inset: 0; z-index: 0; }
.hero-slide {
  position: absolute; inset: 0; background-size: cover; background-position: center;
  transform: translateX(100%); will-change: transform;
  animation-timing-function: cubic-bezier(.4,0,.2,1);
}
.hero-slide:nth-child(1) { animation: heroSlide0 20s infinite; }
.hero-slide:nth-child(2) { animation: heroSlide1 20s infinite; }
.hero-slide:nth-child(3) { animation: heroSlide2 20s infinite; }
.hero-slide:nth-child(4) { animation: heroSlide3 20s infinite; }
.hero-overlay {
  position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(155deg, rgba(0,89,74,0.90) 0%, rgba(10,20,18,0.78) 100%);
}
.hero .inner { max-width: var(--maxw); margin: 0 auto; position: relative; z-index: 2; }

/* Push transition: at every boundary the outgoing slide moves 0% -> -100%
   over the exact same window the incoming slide moves 100% -> 0%, so they
   travel together at the same rate — never overlapping, never gapping.
   Off-screen, a slide "teleports" from -100% back to +100% (imperceptible,
   since it's outside the frame either way) to queue up for its next entrance. */
@keyframes heroSlide0 {
  0%     { transform: translateX(0%); }
  19%    { transform: translateX(0%); }
  25%    { transform: translateX(-100%); }
  25.1%  { transform: translateX(100%); }
  94%    { transform: translateX(100%); }
  100%   { transform: translateX(0%); }
}
@keyframes heroSlide1 {
  0%     { transform: translateX(100%); }
  19%    { transform: translateX(100%); }
  25%    { transform: translateX(0%); }
  44%    { transform: translateX(0%); }
  50%    { transform: translateX(-100%); }
  50.1%  { transform: translateX(100%); }
  100%   { transform: translateX(100%); }
}
@keyframes heroSlide2 {
  0%     { transform: translateX(100%); }
  44%    { transform: translateX(100%); }
  50%    { transform: translateX(0%); }
  69%    { transform: translateX(0%); }
  75%    { transform: translateX(-100%); }
  75.1%  { transform: translateX(100%); }
  100%   { transform: translateX(100%); }
}
@keyframes heroSlide3 {
  0%     { transform: translateX(100%); }
  69%    { transform: translateX(100%); }
  75%    { transform: translateX(0%); }
  94%    { transform: translateX(0%); }
  100%   { transform: translateX(-100%); }
}

@media (prefers-reduced-motion: reduce) {
  .hero-slide { animation: none !important; transform: translateX(100%); }
  .hero-slide:first-child { transform: translateX(0%); }
}
.hero h1 { max-width: 720px; }
.hero p.lead { max-width: 560px; font-size: 1.15rem; opacity: 0.92; }
.hero .cta-row { margin-top: 32px; display: flex; gap: 16px; flex-wrap: wrap; }

/* Sections */
.section { padding: 64px 0; }
.section-soft { background: var(--paper-soft); }
.section-head { max-width: 640px; margin-bottom: 36px; }
.section-head p { color: var(--ink-soft); }

.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
@media (max-width: 860px) { .grid-3 { grid-template-columns: 1fr; } }

.about-grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 40px; align-items: center; }
@media (max-width: 860px) { .about-grid { grid-template-columns: 1fr; } }
.about-image { border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); aspect-ratio: 4/3; }
.about-image img { width: 100%; height: 100%; object-fit: cover; display: block; }

.feature-card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow); }
.feature-card .num { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 10px; background: var(--clay-light); color: var(--clay-dark); font-weight: 800; margin-bottom: 14px; }

.news-card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column; }
.news-card .body { padding: 22px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.news-card .date { font-size: 0.8rem; font-weight: 700; color: var(--clay-dark); text-transform: uppercase; letter-spacing: 0.04em; }
.news-card .excerpt { color: var(--ink-soft); font-size: 0.95rem; flex: 1; }

.map-wrap { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 28px; align-items: stretch; }
@media (max-width: 860px) { .map-wrap { grid-template-columns: 1fr; } }
.map-frame { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); box-shadow: var(--shadow); min-height: 320px; }
.map-frame iframe { width: 100%; height: 100%; min-height: 320px; border: 0; display: block; }
.directions-card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow); }
.directions-card .addr { font-weight: 700; margin-bottom: 6px; }
.directions-card .phone { color: var(--green); font-weight: 700; }

/* Footer */
.site-footer { background: var(--ink); color: #dfe7e4; padding: 52px 0 28px; }
.site-footer .grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 32px; margin-bottom: 32px; }
@media (max-width: 700px) { .site-footer .grid { grid-template-columns: 1fr; } }
.site-footer h4 { color: #fff; font-size: 0.95rem; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 14px; }
.site-footer a { color: #c7d2ce; }
.site-footer .bottom { border-top: 1px solid rgba(255,255,255,0.12); padding-top: 20px; font-size: 0.85rem; color: #9aa8a3; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; }

/* Cookie banner */
.cookie-banner {
  position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 100;
  max-width: 720px; margin: 0 auto; background: #fff; border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: 0 12px 40px rgba(0,0,0,0.18);
  padding: 20px 22px; display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  transform: translateY(140%); transition: transform .35s ease;
}
.cookie-banner.show { transform: translateY(0); }
.cookie-banner p { margin: 0; font-size: 0.9rem; color: var(--ink-soft); flex: 1 1 260px; }
.cookie-banner .actions { display: flex; gap: 10px; }
.cookie-banner .btn { padding: 9px 18px; font-size: 0.85rem; }

/* Timeline (History page) */
.timeline { position: relative; margin: 40px 0; padding-left: 32px; }
.timeline::before { content: ""; position: absolute; left: 7px; top: 0; bottom: 0; width: 2px; background: var(--border); }
.timeline-item {
  position: relative; padding-bottom: 56px; opacity: 0; transform: translateY(16px); transition: opacity .5s ease, transform .5s ease;
  display: grid; grid-template-columns: 1.3fr 1fr; gap: 32px; align-items: center;
}
.timeline-item.in-view { opacity: 1; transform: translateY(0); }
.timeline-item::before { content: ""; position: absolute; left: -32px; top: 4px; width: 16px; height: 16px; border-radius: 50%; background: var(--clay); border: 3px solid #fff; box-shadow: 0 0 0 2px var(--clay); }
.timeline-item .year { display: inline-block; background: var(--green-light); color: var(--green-dark); font-weight: 800; padding: 3px 12px; border-radius: 999px; font-size: 0.85rem; margin-bottom: 8px; }
.timeline-item h3 { margin-bottom: 4px; }
.timeline-item p { color: var(--ink-soft); max-width: 480px; }
.timeline-image { border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); aspect-ratio: 5/3; }
.timeline-image img { width: 100%; height: 100%; object-fit: cover; display: block; }
@media (max-width: 700px) {
  .timeline-item { grid-template-columns: 1fr; gap: 16px; }
}

/* Etiquette */
.etiquette-section {
  border-bottom: 1px solid var(--border); padding: 36px 0;
  display: grid; grid-template-columns: 1.2fr 0.8fr; gap: 32px; align-items: center;
}
.etiquette-section:last-child { border-bottom: none; }
.etiquette-section.reverse .etiquette-text { order: 2; }
.etiquette-section.reverse .etiquette-image { order: 1; }
.etiquette-section h3 { color: var(--green-dark); }
.etiquette-image { border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); aspect-ratio: 4/3; }
.etiquette-image img { width: 100%; height: 100%; object-fit: cover; display: block; }
@media (max-width: 700px) {
  .etiquette-section, .etiquette-section.reverse { grid-template-columns: 1fr; }
  .etiquette-section.reverse .etiquette-text, .etiquette-section.reverse .etiquette-image { order: initial; }
}

/* Page hero (non-home pages) */
.page-hero { background: var(--paper-soft); padding: 56px 0 40px; border-bottom: 1px solid var(--border); }
.page-hero p { color: var(--ink-soft); max-width: 620px; }

/* Booking page */
.booking-layout { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 32px; align-items: start; }
@media (max-width: 960px) { .booking-layout { grid-template-columns: 1fr; } }
.booking-panel { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 28px; }
.booking-steps { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; }
.booking-steps span { font-size: 0.78rem; font-weight: 700; padding: 6px 12px; border-radius: 999px; background: var(--paper-soft); color: var(--ink-soft); }
.booking-steps span.active { background: var(--green); color: #fff; }
.field { margin-bottom: 18px; }
.field label { display: block; font-weight: 600; font-size: 0.88rem; margin-bottom: 6px; }
.field input[type="text"], .field input[type="email"], .field input[type="tel"], .field select, .field input[type="date"] {
  width: 100%; padding: 11px 14px; border: 1.5px solid var(--border); border-radius: 10px; font-size: 0.95rem; font-family: inherit;
}
.field input:focus, .field select:focus { outline: none; border-color: var(--green); }
.radio-row { display: flex; gap: 10px; flex-wrap: wrap; }
.radio-pill { position: relative; }
.radio-pill input { position: absolute; opacity: 0; }
.radio-pill label { display: inline-flex; padding: 9px 16px; border: 1.5px solid var(--border); border-radius: 999px; cursor: pointer; font-size: 0.88rem; font-weight: 600; color: var(--ink-soft); margin: 0; }
.radio-pill input:checked + label { background: var(--green); border-color: var(--green); color: #fff; }

.date-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px,1fr)); gap: 8px; margin-bottom: 6px; }
.date-cell { padding: 10px 4px; text-align: center; border: 1.5px solid var(--border); border-radius: 10px; cursor: pointer; font-size: 0.85rem; background: #fff; }
.date-cell .dow { display: block; font-size: 0.7rem; color: var(--ink-soft); text-transform: uppercase; }
.date-cell.selected { background: var(--green); border-color: var(--green); color: #fff; }
.date-cell.selected .dow { color: rgba(255,255,255,0.8); }
.date-cell.disabled { opacity: 0.35; cursor: not-allowed; }

.time-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px,1fr)); gap: 8px; margin: 14px 0; }
.time-cell { padding: 10px 4px; text-align: center; border: 1.5px solid var(--border); border-radius: 10px; cursor: pointer; font-size: 0.85rem; font-weight: 600; background: #fff; }
.time-cell.selected { background: var(--clay); border-color: var(--clay); color: #fff; }
.time-cell.disabled { opacity: 0.35; cursor: not-allowed; text-decoration: line-through; }

.court-map-wrap { position: sticky; top: 90px; }
.court-map-wrap .hint { font-size: 0.82rem; color: var(--ink-soft); margin-bottom: 10px; }
#court-map rect.court { fill: #f0f2f1; stroke: var(--ink); stroke-width: 2; cursor: pointer; transition: fill .2s ease, opacity .2s ease; }
#court-map rect.court.available { fill: var(--green-light); }
#court-map rect.court.selected { fill: var(--green); }
#court-map rect.court.dim { opacity: 0.4; cursor: not-allowed; }
#court-map .court-group:hover rect.court:not(.selected):not(.dim) { fill: #a7ddc7; }
#court-map rect.house { fill: #f0f2f1; stroke: var(--ink); stroke-width: 2; }
#court-map text { font-size: 15px; font-weight: 700; fill: var(--ink); pointer-events: none; }
#court-map text.selected-text { fill: #fff; }

.summary-card { background: var(--paper-soft); border-radius: var(--radius); padding: 20px; margin-top: 8px; }
.summary-row { display: flex; justify-content: space-between; font-size: 0.9rem; padding: 6px 0; border-bottom: 1px solid var(--border); }
.summary-row:last-child { border-bottom: none; font-weight: 800; font-size: 1rem; color: var(--green-dark); }

.notice { font-size: 0.82rem; color: var(--ink-soft); background: var(--clay-light); border-radius: 10px; padding: 10px 14px; margin-bottom: 18px; }

.state-message { text-align: center; padding: 60px 24px; }
.state-message .icon { font-size: 3rem; margin-bottom: 12px; }

/* Admin */
.admin-body { max-width: 900px; margin: 40px auto; padding: 0 20px; }
table.admin-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
table.admin-table th, table.admin-table td { border: 1px solid var(--border); padding: 8px 10px; text-align: left; }
table.admin-table th { background: var(--paper-soft); }
