/* Costa Verde — pine and teal, calendar first. Outfit. */

:root {
  --pine: #0e3b36;
  --pine-2: #145248;
  --teal: #14685c;
  --mist: #e5f2ee;
  --paper: #f7fbfa;
  --card: #ffffff;
  --sand: #c4a36a;
  --ink: #14302c;
  --muted: #3e5c56;
  --line: #c9ddd6;
  --focus: #0b6e62;
  --font: "Outfit", "Avenir Next", "Segoe UI", sans-serif;
  --max: 1120px;
}

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

[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--mist);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.45;
}

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

button,
a { font: inherit; color: inherit; }

button {
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

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

.demo {
  background: var(--pine);
  color: #e7f6f2;
  text-align: center;
  padding: 8px 16px;
  font-size: 13px;
  letter-spacing: 0.01em;
}

.wrap {
  width: min(var(--max), calc(100% - 32px));
  margin-inline: auto;
}

header.site {
  background: var(--pine);
  color: #f3fbf8;
}

.bar {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 72px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand img {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  object-fit: cover;
}

.brand strong {
  display: block;
  font-weight: 600;
  font-size: 18px;
  letter-spacing: -0.02em;
}

.brand span {
  display: block;
  color: #b7d5ce;
  font-size: 13px;
}

.langs {
  margin-left: auto;
  display: flex;
  gap: 4px;
}

.langs button,
.filters button,
.clear-day {
  min-height: 36px;
  padding: 0 10px;
  border-radius: 999px;
}

.langs button[aria-pressed="true"] {
  background: #f3fbf8;
  color: var(--pine);
  font-weight: 600;
}

.hero {
  margin: 20px auto 0;
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  height: 220px;
  background: var(--pine-2);
}

.hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 60%;
}

.hero::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 130px;
  background: linear-gradient(to top, rgba(8, 32, 28, 0.72), transparent);
}

.hero-copy {
  position: absolute;
  z-index: 1;
  left: 24px;
  bottom: 20px;
  right: 24px;
  color: white;
}

.hero-copy h1 {
  margin: 0;
  font-size: clamp(32px, 4vw, 48px);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.05;
}

.hero-copy p {
  margin: 6px 0 0;
  max-width: 42ch;
  font-size: 16px;
}

.layout {
  display: grid;
  grid-template-columns: minmax(280px, 380px) 1fr;
  gap: 20px;
  padding: 20px 0 48px;
  align-items: start;
}

.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
}

.panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.panel-head h2 {
  margin: 0;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.03em;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.filters button {
  border: 1px solid var(--line);
  color: var(--muted);
}

.filters button[aria-pressed="true"] {
  background: var(--pine);
  border-color: var(--pine);
  color: white;
  font-weight: 600;
}

.dow,
.grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.dow {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.day {
  aspect-ratio: 1;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: var(--ink);
  position: relative;
}

.day:hover { background: var(--mist); }

.day.is-on {
  background: var(--pine);
  color: white;
}

.day .num {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  font-size: 15px;
}

.dots { display: flex; gap: 3px; height: 7px; }

.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--teal);
}

.dot[data-source="club"] { background: var(--sand); }

.day.is-on .dot { background: white; }

.list { display: flex; flex-direction: column; }

.row {
  display: grid;
  grid-template-columns: 48px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 14px 4px;
  border-top: 1px solid var(--line);
  text-align: left;
  width: 100%;
}

.row:first-child { border-top: 0; }

.row .num {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}

.row h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 500;
}

.row .meta {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.src {
  font-size: 13px;
  font-weight: 600;
  color: var(--teal);
}

.row[data-source="club"] .src { color: #8a6a32; }
.row[data-source="open"] .src { color: var(--muted); font-weight: 500; }
.row[data-source="open"] h3 { color: var(--muted); font-weight: 500; }

.empty,
.clear-day {
  color: var(--muted);
  font-size: 14px;
}

.clear-day {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 12px;
  min-height: 32px;
}

.tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}

footer.site {
  border-top: 1px solid var(--line);
  background: var(--paper);
  padding: 28px 0 40px;
  color: var(--muted);
  font-size: 14px;
}

footer.site .wrap {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

footer.site .wrap > div:first-child {
  display: flex;
  gap: 12px;
}

footer.site strong { color: var(--ink); font-weight: 600; }

@media (max-width: 800px) {
  .layout { grid-template-columns: 1fr; }
  .hero { height: 180px; border-radius: 0; width: 100%; margin-top: 0; }
  .wrap { width: min(var(--max), calc(100% - 24px)); }
  .bar { min-height: 64px; }
  .brand span { display: none; }
  .row { grid-template-columns: 36px 1fr; }
  .src { grid-column: 2; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

/* Production additions */
.month-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.month-nav button {
  min-width: 36px;
  min-height: 36px;
  border-radius: 10px;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 18px;
  line-height: 1;
}

.month-nav button:hover { background: var(--mist); color: var(--ink); }
.month-nav button:disabled { opacity: 0.35; cursor: default; }

.dot[data-source="society"] { background: #6b8fd4; }
.dot[data-source="club_private"] { background: var(--sand); }
.dot[data-source="federated"] { background: var(--teal); }

.row[data-source="society"] .src { color: #3d5f9e; }
.row[data-source="club_private"] .src { color: #8a6a32; }
.row[data-source="federated"] .src { color: var(--teal); }

.row a.title {
  color: inherit;
  text-decoration: none;
}
.row a.title:hover { text-decoration: underline; color: var(--pine); }

.row .entry {
  font-size: 13px;
  font-weight: 600;
  color: var(--pine);
  text-decoration: none;
  white-space: nowrap;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 10px;
  min-height: 32px;
  display: inline-flex;
  align-items: center;
}
.row .entry:hover {
  background: var(--pine);
  border-color: var(--pine);
  color: white;
}

.count-pill {
  font-size: 13px;
  color: var(--muted);
  font-weight: 500;
}

.pad {
  aspect-ratio: 1;
}

.day.has-events { font-weight: 600; }

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 12px;
  font-size: 12px;
  color: var(--muted);
}
.legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.legend .dot { display: inline-block; }

@media (max-width: 800px) {
  .row { grid-template-columns: 36px 1fr auto; }
  .row .entry { grid-column: auto; }
}

/* Shared-engine row with entry button */
.row.has-entry { grid-template-columns: 48px 1fr auto auto; }
@media (max-width: 800px) { .row.has-entry { grid-template-columns: 36px 1fr auto; } }
.tpl-picker { --pk-bg: #082a26; --pk-fg: #d6ece6; --pk-accent: #c4a36a; --pk-accent-fg: #0e3b36; }

/* ---- Template picker (shared, appended at build) ---- */
.tpl-picker {
  background: var(--pk-bg, #111);
  color: var(--pk-fg, #fff);
  font-size: 14px;
  line-height: 1.3;
  position: relative;
  z-index: 5;
}
.tpl-picker .pk-in {
  width: min(1120px, calc(100% - 24px));
  margin-inline: auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 6px;
  padding: 8px 0;
}
.tpl-picker .pk-label {
  opacity: 0.8;
  margin-right: 6px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.tpl-picker a {
  color: inherit;
  text-decoration: none;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid transparent;
  white-space: nowrap;
}
.tpl-picker a:hover { border-color: currentColor; }
.tpl-picker a[aria-current="page"] {
  background: var(--pk-accent, #fff);
  color: var(--pk-accent-fg, #111);
  font-weight: 600;
}
.tpl-picker .pk-sep { opacity: 0.45; }
@media (max-width: 560px) {
  .tpl-picker .pk-label { width: 100%; }
  .tpl-picker .pk-sep { display: none; }
}

/* ---- Shared event-row extras (titles link to source entry pages) ---- */
.row a.title { color: inherit; text-decoration: none; }
.row a.title:hover { text-decoration: underline; }
.noscript-list { padding: 8px 0 24px; }
.noscript-list li { margin: 6px 0; }
