/* Jersey Chess Club — redesign */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@600;700;800&family=Inter:wght@400;500;600;700&display=swap');

:root {
  --board-dark: #b21a2b;
  --board-darker: #7a0f1f;
  --gold: #d81e3f;
  --gold-light: #ffd0d6;
  --cream: #fdf5f6;
  --paper: #ffffff;
  --ink: #241c1d;
  --ink-soft: #6b5456;
  --line: #f2d7da;
  --radius: 10px;
  --shadow: 0 6px 24px rgba(122, 15, 31, 0.10);
  --shadow-lg: 0 16px 48px rgba(122, 15, 31, 0.18);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--ink);
  background: var(--cream);
  line-height: 1.6;
}

h1, h2, h3, h4 {
  font-family: 'Playfair Display', Georgia, serif;
  color: var(--board-darker);
  line-height: 1.2;
  margin: 0 0 0.5em;
}

a { color: var(--board-dark); text-decoration: none; }
a:hover { color: var(--gold); }

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

.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Skip link ---------- */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--gold);
  color: #fff;
  padding: 10px 16px;
  z-index: 1000;
  border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

/* ---------- Top bar ---------- */
.topbar {
  background: var(--board-darker);
  color: #f0c3c8;
  font-size: 0.85rem;
}
.topbar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 6px;
  padding-bottom: 6px;
  flex-wrap: wrap;
  gap: 6px;
}
.topbar a { color: #f0c3c8; }
.topbar a:hover { color: var(--gold-light); }
.topbar .topbar-links { display: flex; gap: 18px; align-items: center; }

/* ---------- Header / Nav ---------- */
header.site-header {
  background: rgba(139, 20, 35, 0.86);
  backdrop-filter: blur(10px) saturate(140%);
  -webkit-backdrop-filter: blur(10px) saturate(140%);
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 100;
  transition: background 0.25s ease, box-shadow 0.25s ease;
}
header.site-header.scrolled {
  background: rgba(122, 15, 31, 0.96);
  box-shadow: var(--shadow-lg);
}

.nav-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  max-width: 1120px;
  margin: 0 auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #fff;
}
.brand:hover { color: var(--gold-light); }
.brand .crest {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--gold-light);
  object-fit: cover;
  box-shadow: var(--shadow);
  flex: none;
}
.brand-text .name {
  font-family: 'Playfair Display', serif;
  font-weight: 700;
  font-size: 1.25rem;
  display: block;
}
.brand-text .tag {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold-light);
  display: block;
}

nav.primary-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

nav.primary-nav > ul {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 2px;
  align-items: center;
}

nav.primary-nav > ul > li { position: relative; }

nav.primary-nav > ul > li > a,
nav.primary-nav > ul > li > button.nav-toggle {
  color: #fdeef0;
  font-weight: 600;
  font-size: 0.94rem;
  padding: 10px 14px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
}

nav.primary-nav > ul > li > a:hover,
nav.primary-nav > ul > li > button.nav-toggle:hover,
nav.primary-nav > ul > li.active > a {
  background: rgba(255,255,255,0.1);
  color: var(--gold-light);
}

.dropdown { position: relative; }
.dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--paper);
  min-width: 250px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 8px;
  list-style: none;
  margin: 6px 0 0;
  border: 1px solid var(--line);
}
.dropdown:hover .dropdown-menu,
.dropdown:focus-within .dropdown-menu {
  display: block;
}
.dropdown-menu li a {
  display: block;
  padding: 9px 12px;
  border-radius: 6px;
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 500;
}
.dropdown-menu li a:hover { background: var(--cream); color: var(--board-dark); }

.nav-toggle .chev { font-size: 0.7em; transition: transform 0.2s; }

.mobile-toggle {
  display: none;
  background: none;
  border: none;
  color: #fff;
  font-size: 1.6rem;
  cursor: pointer;
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  background:
    linear-gradient(160deg, rgba(88,10,22,0.94) 10%, rgba(122,15,31,0.86) 45%, rgba(178,26,43,0.80) 100%),
    url('../images/hero-chess-pieces.jpg');
  background-size: cover;
  background-position: center 38%;
  color: #fff;
  padding: 110px 0 128px;
  text-align: center;
  overflow: hidden;
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 120%, rgba(216,30,63,0.35), transparent 60%);
  pointer-events: none;
}
.hero .container { position: relative; z-index: 1; }
.hero .eyebrow, .hero h1, .hero p.lead, .hero-actions {
  animation: heroRise 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
.hero h1 { animation-delay: 0.08s; text-shadow: 0 4px 28px rgba(0,0,0,0.35); }
.hero p.lead { animation-delay: 0.16s; }
.hero-actions { animation-delay: 0.24s; }
@keyframes heroRise {
  from { opacity: 0; transform: translateY(22px); }
  to { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .hero .eyebrow, .hero h1, .hero p.lead, .hero-actions { animation: none; }
}
.hero .eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--gold-light);
  font-weight: 600;
  font-size: 0.82rem;
  margin-bottom: 14px;
}
.hero h1 {
  color: #fff;
  font-size: clamp(2.1rem, 5vw, 3.4rem);
  margin-bottom: 18px;
}
.hero p.lead {
  max-width: 640px;
  margin: 0 auto 30px;
  color: #f0c3c8;
  font-size: 1.1rem;
}
.hero-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

.btn {
  display: inline-block;
  padding: 13px 26px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  border: 2px solid transparent;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn-gold {
  background: var(--gold);
  color: #fff;
}
.btn-gold:hover { background: var(--gold-light); color: var(--board-darker); box-shadow: 0 10px 24px rgba(216,30,63,0.30); }
.btn-outline {
  border-color: rgba(255,255,255,0.6);
  color: #fff;
}
.btn-outline:hover { border-color: var(--gold-light); color: var(--gold-light); }
.btn-dark {
  background: var(--board-dark);
  color: #fff;
}
.btn-dark:hover { background: var(--board-darker); color: var(--gold-light); }

/* ---------- Page header (non-home) ---------- */
.page-hero {
  position: relative;
  background: linear-gradient(120deg, var(--board-darker), var(--board-dark));
  color: #fff;
  padding: 68px 0 72px;
  overflow: hidden;
}
.page-hero.photo-events,
.page-hero.photo-prestige,
.page-hero.photo-inner {
  background-size: cover;
  background-position: center;
}
.page-hero.photo-events {
  background-image: linear-gradient(120deg, rgba(88,10,22,0.92), rgba(122,15,31,0.82)), url('../images/tournament-hall.jpg');
}
.page-hero.photo-prestige {
  background-image: linear-gradient(120deg, rgba(88,10,22,0.92), rgba(122,15,31,0.80)), url('../images/gold-silver-set.jpg');
}
.page-hero.photo-inner {
  background-image: linear-gradient(120deg, rgba(88,10,22,0.92), rgba(122,15,31,0.82)), url('../images/marble-board.jpg');
}
.page-hero .container { position: relative; z-index: 1; }
.page-hero .eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.78rem;
  color: var(--gold-light);
  font-weight: 700;
  margin-bottom: 10px;
}
.page-hero h1 { color: #fff; margin-bottom: 8px; font-size: clamp(1.9rem, 4vw, 2.6rem); }
.page-hero p { color: #f0c3c8; max-width: 640px; margin: 0; }
.breadcrumb { font-size: 0.85rem; color: #d99aa0; margin-bottom: 14px; }
.breadcrumb a { color: #d99aa0; }
.breadcrumb a:hover { color: var(--gold-light); }

/* ---------- Sections ---------- */
main { display: block; }
.section { padding: 64px 0; }
.section.alt { background: var(--paper); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-head { text-align: center; max-width: 680px; margin: 0 auto 40px; }
.section-head .eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--board-dark);
}
.section-head p { color: var(--ink-soft); }

/* ---------- Cards ---------- */
.grid { display: grid; gap: 24px; }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }

.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px;
  box-shadow: var(--shadow);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.card .icon {
  width: 46px; height: 46px;
  border-radius: 10px;
  background: var(--cream);
  color: var(--board-dark);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem;
  margin-bottom: 14px;
}
.card h3 { font-size: 1.15rem; margin-bottom: 8px; }
.card p { color: var(--ink-soft); margin: 0; font-size: 0.95rem; }

.event-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.event-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.event-card .band {
  height: 8px;
  background: linear-gradient(90deg, var(--gold), var(--board-dark));
}
.event-card .body { padding: 22px; flex: 1; display: flex; flex-direction: column; }
.event-card .tag {
  align-self: flex-start;
  background: var(--cream);
  color: var(--board-dark);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 4px 10px;
  border-radius: 999px;
  margin-bottom: 12px;
}
.event-card h3 { font-size: 1.1rem; margin-bottom: 8px; }
.event-card p { color: var(--ink-soft); font-size: 0.93rem; flex: 1; }
.event-card .more { margin-top: 14px; font-weight: 600; font-size: 0.9rem; }

/* ---------- Highlight banner ---------- */
.banner {
  background: var(--paper);
  border: 1px solid var(--gold);
  border-left: 6px solid var(--gold);
  border-radius: var(--radius);
  padding: 24px 28px;
  box-shadow: var(--shadow);
}
.banner h3 { margin-bottom: 6px; }

/* ---------- Info list ---------- */
.info-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 16px; }
.info-list li {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
}
.info-list .ico {
  font-size: 1.3rem;
  color: var(--gold);
  flex: none;
}
.info-list strong { display: block; color: var(--board-darker); }

/* ---------- Table ---------- */
.table-wrap { overflow-x: auto; border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid var(--line); }
table {
  width: 100%;
  border-collapse: collapse;
  background: var(--paper);
  font-size: 0.94rem;
}
thead th {
  background: var(--board-dark);
  color: #fff;
  text-align: left;
  padding: 12px 16px;
  font-weight: 600;
  white-space: nowrap;
}
tbody td {
  padding: 11px 16px;
  border-bottom: 1px solid var(--line);
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:nth-child(even) { background: #fdf3f4; }
tbody tr:hover { background: #fbe3e6; }
td.num, th.num { text-align: right; }
tr.win td.result { color: var(--board-dark); font-weight: 700; }
.rank-1 { background: linear-gradient(90deg, rgba(200,20,45,0.14), transparent); }

/* ---------- Committee ---------- */
.committee-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; }
.committee-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  gap: 14px;
  align-items: center;
  box-shadow: var(--shadow);
}
.committee-card .avatar {
  width: 52px; height: 52px; border-radius: 50%;
  background: var(--board-dark);
  color: var(--gold-light);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-family: 'Playfair Display', serif;
  flex: none;
}
.committee-card .role { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--board-dark); font-weight: 700; }
.committee-card .name { font-weight: 600; }
.committee-card .email { font-size: 0.82rem; color: var(--ink-soft); word-break: break-all; }

/* ---------- Forms ---------- */
.form-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: var(--shadow);
}
.field { margin-bottom: 18px; }
.field label { display: block; font-weight: 600; margin-bottom: 6px; font-size: 0.92rem; }
.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.95rem;
  background: var(--cream);
  color: var(--ink);
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: 2px solid var(--gold);
  outline-offset: 1px;
  background: #fff;
}
.field-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px,1fr)); gap: 18px; }
.checkbox-group { display: flex; flex-wrap: wrap; gap: 14px; }
.checkbox-group label { display: flex; align-items: center; gap: 8px; font-weight: 500; font-size: 0.92rem; }
.checkbox-group input { width: auto; }
.form-note { font-size: 0.85rem; color: var(--ink-soft); margin-top: 10px; }

/* ---------- Two column layout ---------- */
.two-col {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 40px;
  align-items: start;
}
@media (max-width: 860px) { .two-col { grid-template-columns: 1fr; } }

.map-box {
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
  height: 100%;
  min-height: 320px;
}
.map-box iframe { width: 100%; height: 100%; min-height: 320px; border: 0; }

/* ---------- Prose ---------- */
.prose { max-width: 760px; }
.prose p { margin-bottom: 1.1em; color: var(--ink-soft); }
.prose h2 { margin-top: 1.6em; }
.prose ul { color: var(--ink-soft); }

/* ---------- CTA strip ---------- */
.cta-strip {
  background: var(--board-darker);
  color: #fff;
  padding: 54px 0;
  text-align: center;
}
.cta-strip h2 { color: #fff; }
.cta-strip p { color: #f0c3c8; max-width: 560px; margin: 0 auto 24px; }

/* ---------- Footer ---------- */
footer.site-footer {
  background: var(--board-darker);
  color: #f0c3c8;
  padding: 48px 0 20px;
  font-size: 0.92rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 32px;
  padding-bottom: 32px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
.footer-grid h4 { color: #fff; font-family: 'Inter', sans-serif; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 14px; }
.footer-grid ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.footer-grid a { color: #f0c3c8; }
.footer-grid a:hover { color: var(--gold-light); }
.footer-brand { display: flex; gap: 12px; align-items: center; margin-bottom: 14px; }
.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 20px;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 0.84rem;
}
.footer-bottom a { color: #f0c3c8; }
.footer-social a {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 50%;
  background: rgba(255,255,255,0.08);
  margin-right: 8px;
}
.footer-social a:hover { background: var(--gold); color: #fff; }

/* ---------- Alert / confirm messages ---------- */
.alert {
  padding: 14px 18px;
  border-radius: 8px;
  font-size: 0.92rem;
  margin-bottom: 16px;
  display: none;
}
.alert.success { background: #e4f3e6; color: #1a6d3c; border: 1px solid #b9e0c0; }
.alert.error { background: #fbe7e7; color: #a52424; border: 1px solid #f3c1c1; }

/* ---------- Responsive nav ---------- */
@media (max-width: 940px) {
  .mobile-toggle { display: block; }
  nav.primary-nav {
    position: absolute;
    top: 100%;
    left: 0; right: 0;
    background: var(--board-dark);
    flex-direction: column;
    align-items: stretch;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease;
    box-shadow: var(--shadow-lg);
  }
  nav.primary-nav.open { max-height: 80vh; overflow-y: auto; }
  nav.primary-nav > ul { flex-direction: column; align-items: stretch; padding: 10px 16px 20px; gap: 0; }
  nav.primary-nav > ul > li > a, nav.primary-nav > ul > li > button.nav-toggle { width: 100%; justify-content: space-between; }
  .dropdown-menu { position: static; box-shadow: none; border: none; background: rgba(0,0,0,0.15); display: none; margin: 4px 0; }
  .dropdown.open .dropdown-menu { display: block; }
  header.site-header { position: relative; }
}

/* ---------- Scroll reveal ---------- */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s cubic-bezier(0.2,0.7,0.2,1), transform 0.7s cubic-bezier(0.2,0.7,0.2,1);
}
.reveal.visible { opacity: 1; transform: translateY(0); }
.reveal-stagger.visible > * { opacity: 1; transform: translateY(0); }
.reveal-stagger > * {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal-stagger.visible > *:nth-child(1) { transition-delay: 0.02s; }
.reveal-stagger.visible > *:nth-child(2) { transition-delay: 0.10s; }
.reveal-stagger.visible > *:nth-child(3) { transition-delay: 0.18s; }
.reveal-stagger.visible > *:nth-child(4) { transition-delay: 0.26s; }
.reveal-stagger.visible > *:nth-child(5) { transition-delay: 0.34s; }
.reveal-stagger.visible > *:nth-child(6) { transition-delay: 0.42s; }
@media (prefers-reduced-motion: reduce) {
  .reveal, .reveal-stagger > * { opacity: 1; transform: none; transition: none; }
}

/* ---------- Photo feature (About / Junior Chess content images) ---------- */
.photo-feature {
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  position: relative;
  isolation: isolate;
  min-height: 280px;
}
.photo-feature img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.6s ease; }
.photo-feature:hover img { transform: scale(1.045); }
.photo-feature .caption {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 14px 18px;
  background: linear-gradient(0deg, rgba(88,10,22,0.88), transparent);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 600;
}

/* ---------- Stats strip ---------- */
.stats-strip {
  background: var(--board-darker);
  color: #fff;
  padding: 46px 0;
}
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 24px;
  text-align: center;
}
.stats-grid .stat-num {
  font-family: 'Playfair Display', serif;
  font-weight: 800;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  color: var(--gold-light);
  line-height: 1;
  margin-bottom: 6px;
}
.stats-grid .stat-label {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #f0c3c8;
}

/* ---------- Enhanced button shine ---------- */
.btn { position: relative; overflow: hidden; }
.btn::before {
  content: "";
  position: absolute;
  top: 0; left: -60%;
  width: 40%; height: 100%;
  background: linear-gradient(115deg, transparent, rgba(255,255,255,0.35), transparent);
  transform: skewX(-20deg);
  transition: left 0.55s ease;
}
.btn:hover::before { left: 130%; }

/* ---------- Enhanced card shine on hover ---------- */
.card, .event-card, .committee-card {
  position: relative;
  isolation: isolate;
}
.card::after, .event-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(216,30,63,0.06), transparent 55%);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
  z-index: -1;
}
.card:hover::after, .event-card:hover::after { opacity: 1; }

/* ---------- Utility ---------- */
.mt-0 { margin-top: 0; }
.text-center { text-align: center; }
.stack { display: grid; gap: 10px; }
