/* MyClub public website renderer — professional base + two polished templates.
 * Colors come from CSS variables the renderer sets from the club config, with
 * sensible per-template fallbacks. */

:root {
  --mc-primary: #1f6feb;
  --mc-secondary: #0aa06e;
  --mc-bg: #ffffff;
  --mc-text: #1b2230;
  --mc-accent: #ff6a3d;
  --mc-muted: #5b6472;
  --mc-line: #e6e9f0;
  --mc-surface: #f7f9fc;
  --mc-max: 1120px;
  --mc-measure: 62ch;
  --mc-radius: 16px;
  --mc-font: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --mc-shadow: 0 10px 30px rgba(17, 24, 39, 0.08);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--mc-font);
  color: var(--mc-text);
  background: var(--mc-bg);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--mc-primary); text-decoration: none; }
h1, h2, h3 { line-height: 1.2; }

.mc-loading { padding: 5rem 1rem; text-align: center; color: var(--mc-muted); }
.mc-error { max-width: 640px; margin: 5rem auto; padding: 0 1.25rem; text-align: center; }
.mc-error h1 { color: var(--mc-primary); font-size: 2rem; }

/* Header / nav */
.mc-header {
  background: color-mix(in srgb, var(--mc-bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  position: sticky; top: 0; z-index: 20;
  border-bottom: 1px solid var(--mc-line);
}
.mc-header-inner {
  max-width: var(--mc-max); margin: 0 auto; padding: 0 1.5rem;
  display: flex; align-items: center; justify-content: space-between;
  min-height: 72px; gap: 1rem; flex-wrap: wrap;
}
.mc-brand { font-weight: 800; font-size: 1.3rem; color: var(--mc-text); letter-spacing: -0.01em; }
.mc-nav { display: flex; gap: 1.5rem; flex-wrap: wrap; align-items: center; }
.mc-nav a {
  color: var(--mc-muted); font-weight: 600; padding: 0.4rem 0; position: relative;
  transition: color 0.15s ease;
}
.mc-nav a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 2px;
  background: var(--mc-primary); transform: scaleX(0); transform-origin: left;
  transition: transform 0.18s ease;
}
.mc-nav a:hover { color: var(--mc-text); }
.mc-nav a.active { color: var(--mc-text); }
.mc-nav a.active::after, .mc-nav a:hover::after { transform: scaleX(1); }

/* Main / blocks */
.mc-main { max-width: var(--mc-max); margin: 0 auto; padding: 2rem 1.5rem 4rem; }
.mc-block { margin: 2rem 0; }
.mc-text { max-width: var(--mc-measure); font-size: 1.06rem; color: var(--mc-text); }
.mc-text p { white-space: pre-line; margin: 0 0 1rem; }
.mc-text :first-child { margin-top: 0; }
.mc-text :last-child { margin-bottom: 0; }

.mc-image { margin: 2rem 0; }
.mc-image img { border-radius: var(--mc-radius); box-shadow: var(--mc-shadow); }
.mc-image figcaption { color: var(--mc-muted); font-size: 0.9rem; margin-top: 0.6rem; text-align: center; }

.mc-line { border: 0; border-top: 1px solid var(--mc-line); margin: 3rem 0; }
.mc-line--dashed { border-top-style: dashed; }
.mc-line--dotted { border-top-style: dotted; }

/* Sections */
.mc-section { margin: 3rem 0; }
.mc-section-inner { max-width: var(--mc-max); margin: 0 auto; }
.mc-section h2 { margin: 0 0 0.4rem; font-size: 1.9rem; letter-spacing: -0.01em; }
.mc-section > .mc-section-inner > p { color: var(--mc-muted); font-size: 1.1rem; margin: 0; max-width: var(--mc-measure); }

/* Hero (a primary-background section, typically the first block on a page) */
.mc-section--primary {
  color: #fff; border-radius: var(--mc-radius);
  padding: clamp(3rem, 7vw, 5.5rem) 1.75rem; text-align: center;
  background: var(--mc-primary);
}
.mc-section--primary h2 {
  font-size: clamp(2rem, 5vw, 3.1rem); margin-bottom: 0.75rem; color: #fff;
}
.mc-section--primary > .mc-section-inner > p {
  color: rgba(255, 255, 255, 0.9); font-size: clamp(1.05rem, 2.2vw, 1.3rem);
  margin: 0 auto; max-width: 46ch;
}

/* Lists (events / news) */
.mc-events h3, .mc-news h3 { font-size: 1.4rem; margin: 0 0 1rem; }
.mc-events ul, .mc-news ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.75rem; }
.mc-events li, .mc-news li {
  display: flex; flex-direction: column; gap: 0.2rem;
  padding: 1rem 1.15rem; background: var(--mc-surface);
  border: 1px solid var(--mc-line); border-radius: 12px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.mc-events li:hover, .mc-news li:hover { transform: translateY(-2px); box-shadow: var(--mc-shadow); }
.mc-list-date {
  font-size: 0.8rem; color: var(--mc-primary); font-weight: 800;
  text-transform: uppercase; letter-spacing: 0.04em;
}
.mc-list-title { font-weight: 700; font-size: 1.05rem; }
.mc-list-text { color: var(--mc-muted); }
.mc-list-empty { color: var(--mc-muted); background: none; border: 0; }

/* Forms */
.mc-form {
  display: flex; flex-direction: column; gap: 0.4rem; max-width: 560px;
  background: var(--mc-surface); border: 1px solid var(--mc-line);
  border-radius: var(--mc-radius); padding: 1.75rem;
}
.mc-form h3 { margin: 0 0 0.5rem; font-size: 1.4rem; }
.mc-form label { font-weight: 600; font-size: 0.92rem; margin-top: 0.6rem; }
.mc-form input, .mc-form textarea {
  padding: 0.8rem 0.9rem; border: 1px solid #cdd4e0; border-radius: 10px;
  font: inherit; width: 100%; background: #fff; transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.mc-form input:focus, .mc-form textarea:focus {
  outline: none; border-color: var(--mc-primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--mc-primary) 20%, transparent);
}
.mc-form textarea { min-height: 130px; resize: vertical; }
.mc-form button {
  align-self: flex-start; margin-top: 1rem; padding: 0.8rem 1.6rem;
  background: var(--mc-primary); color: #fff; border: 0; border-radius: 999px;
  font-weight: 700; font-size: 1rem; cursor: pointer; transition: filter 0.15s ease, transform 0.1s ease;
}
.mc-form button:hover { filter: brightness(1.05); }
.mc-form button:active { transform: translateY(1px); }
.mc-form-status { color: var(--mc-secondary); font-weight: 700; margin: 0.75rem 0 0; }

/* Footer */
.mc-footer { border-top: 1px solid var(--mc-line); margin-top: 3rem; background: var(--mc-surface); }
.mc-footer-inner {
  max-width: var(--mc-max); margin: 0 auto; padding: 2rem 1.5rem;
  color: var(--mc-muted); font-size: 0.92rem;
}

/* =========================================================================
 * Template 1 — "modern" (sporty clubs): bold, energetic, gradient accents.
 * ========================================================================= */
body.tpl-modern {
  --mc-font: "Segoe UI", system-ui, Roboto, Arial, sans-serif;
  --mc-radius: 18px;
}
body.tpl-modern .mc-header { box-shadow: 0 4px 24px rgba(0, 0, 0, 0.05); }
body.tpl-modern .mc-brand { text-transform: uppercase; letter-spacing: 0.02em; }
body.tpl-modern .mc-nav a { text-transform: uppercase; font-size: 0.82rem; letter-spacing: 0.06em; }
body.tpl-modern h1, body.tpl-modern h2 { font-weight: 800; letter-spacing: -0.02em; }
body.tpl-modern .mc-section > .mc-section-inner > h2 {
  display: inline-block; padding-bottom: 0.35rem;
  border-bottom: 4px solid var(--mc-accent);
}
body.tpl-modern .mc-section--primary {
  background: linear-gradient(135deg, var(--mc-primary), var(--mc-accent));
  box-shadow: var(--mc-shadow);
}
body.tpl-modern .mc-section--primary h2 { border: 0; }
body.tpl-modern .mc-form button { box-shadow: 0 8px 20px color-mix(in srgb, var(--mc-primary) 35%, transparent); }

/* =========================================================================
 * Template 2 — "classic" (traditional): elegant serif, understated, refined.
 * ========================================================================= */
body.tpl-classic {
  --mc-font: Georgia, "Times New Roman", "Iowan Old Style", serif;
  --mc-radius: 6px;
  --mc-surface: #f6f4ef;
  --mc-line: #e3ddd0;
}
body.tpl-classic .mc-header { background: var(--mc-bg); border-bottom: 3px double var(--mc-primary); backdrop-filter: none; }
body.tpl-classic .mc-brand { font-weight: 700; letter-spacing: 0.02em; }
body.tpl-classic .mc-nav a { font-weight: 600; font-variant: small-caps; letter-spacing: 0.03em; }
body.tpl-classic .mc-nav a::after { height: 1px; background: var(--mc-primary); }
body.tpl-classic h1, body.tpl-classic h2 { font-weight: 700; }
body.tpl-classic .mc-section > .mc-section-inner > h2 {
  position: relative; padding-bottom: 0.5rem;
}
body.tpl-classic .mc-section > .mc-section-inner > h2::after {
  content: ""; display: block; width: 64px; height: 2px; margin-top: 0.5rem;
  background: var(--mc-primary); opacity: 0.6;
}
body.tpl-classic .mc-section--primary {
  background: var(--mc-primary);
  border-radius: var(--mc-radius);
  border-top: 4px double rgba(255, 255, 255, 0.6);
  border-bottom: 4px double rgba(255, 255, 255, 0.6);
}
body.tpl-classic .mc-form button, body.tpl-classic .mc-brand { border-radius: 3px; }
body.tpl-classic .mc-form button { border-radius: 3px; font-family: var(--mc-font); }
body.tpl-classic .mc-events li, body.tpl-classic .mc-news li { border-radius: 4px; }

@media (max-width: 720px) {
  .mc-header-inner { min-height: 60px; padding: 0.5rem 1.25rem; }
  .mc-nav { gap: 1rem; width: 100%; }
  .mc-main { padding: 1.5rem 1.25rem 3rem; }
  .mc-block { margin: 1.75rem 0; }
}
