/* ================================================================
   Jackson Soccer Club — Shared Stylesheet
   ================================================================ */

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

:root {
  --red:       #C8102E;
  --dark-red:  #9B0D23;
  --black:     #1A1A1A;
  --white:     #FFFFFF;
  --gray:      #F4F4F4;
  --border:    #E5E7EB;
  --text:      #1A1A1A;
  --muted:     #666666;
  --open:      #16a34a;
  --open-bg:   #dcfce7;
  --closed:    #dc2626;
  --closed-bg: #fee2e2;
}

html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
  color: var(--text);
  background: var(--white);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main { flex: 1; }

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

a { color: var(--red); }

/* ── HEADER ── */
#site-header header {
  background: var(--black);
  position: sticky;
  top: 0;
  z-index: 500;
  box-shadow: 0 2px 10px rgba(0,0,0,0.5);
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.25rem;
  height: 66px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.site-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  flex-shrink: 0;
}

.site-logo img {
  height: 50px;
  width: auto;
}

.logo-text {
  color: var(--white);
  font-size: 1rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  line-height: 1.2;
}

.logo-text small {
  display: block;
  font-size: 0.62rem;
  font-weight: 400;
  letter-spacing: 0.12em;
  color: #999;
  margin-top: 2px;
  text-transform: uppercase;
}

.desktop-nav { display: flex; align-items: center; }

.desktop-nav ul {
  display: flex;
  list-style: none;
  gap: 0.1rem;
  align-items: center;
  flex-wrap: nowrap;
}

.desktop-nav a {
  display: block;
  padding: 0.42rem 0.65rem;
  color: #ccc;
  text-decoration: none;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-radius: 4px;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}

.desktop-nav a:hover,
.desktop-nav a.active { background: var(--red); color: var(--white); }

/* ── SEARCH ── */
.search-wrap {
  position: relative;
  flex-shrink: 1;
}

.search-wrap input[type="search"] {
  background: #222;
  border: 1px solid #444;
  border-radius: 5px;
  color: #ddd;
  padding: 0.38rem 0.75rem;
  font-size: 0.78rem;
  width: 150px;
  transition: width 0.2s, border-color 0.15s;
  outline: none;
}

.search-wrap input[type="search"]:focus {
  border-color: var(--red);
  width: 210px;
}

.search-wrap input[type="search"]::placeholder { color: #666; }

.search-results {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: #1e1e1e;
  border: 1px solid #333;
  border-radius: 7px;
  min-width: 250px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
  z-index: 600;
  overflow: hidden;
}

.search-results.open { display: block; }

.search-results a {
  display: block;
  padding: 0.6rem 1rem;
  color: #ccc;
  text-decoration: none;
  font-size: 0.85rem;
  border-bottom: 1px solid #2a2a2a;
  transition: background 0.1s, color 0.1s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-results a:last-child { border-bottom: none; }
.search-results a:hover { background: var(--red); color: #fff; }

.mobile-search-li {
  padding: 0.6rem 0 !important;
  border-bottom: 1px solid #222 !important;
}

.mobile-search-li input[type="search"] {
  width: 100%;
  background: #222;
  border: 1px solid #444;
  border-radius: 5px;
  color: #ddd;
  padding: 0.5rem 0.75rem;
  font-size: 0.9rem;
  outline: none;
}

.mobile-search-li input[type="search"]:focus { border-color: var(--red); }

.search-results-mobile {
  position: static;
  margin-top: 0.4rem;
  box-shadow: none;
  min-width: unset;
  border-radius: 5px;
}

.hamburger {
  display: none;
  background: none;
  border: 1px solid #444;
  border-radius: 5px;
  padding: 0.4rem 0.65rem;
  cursor: pointer;
  color: var(--white);
  font-size: 1.1rem;
  line-height: 1;
}

#mobile-nav {
  display: none;
  background: #111;
  border-top: 3px solid var(--red);
}

#mobile-nav.open { display: block; }

#mobile-nav ul {
  list-style: none;
  padding: 0.5rem 1.25rem 1rem;
}

#mobile-nav a {
  display: block;
  padding: 0.7rem 0;
  color: #ccc;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid #222;
  transition: color 0.15s;
}

#mobile-nav a:hover { color: var(--red); }
#mobile-nav li:last-child a { border-bottom: none; }

/* ── RED ACCENT BAR under header ── */
.accent-bar { height: 4px; background: var(--red); }

/* ── PAGE HERO ── */
.page-hero {
  background: var(--black);
  color: var(--white);
  padding: 2.5rem 1.25rem;
  text-align: center;
}

.page-hero h1 {
  font-size: clamp(1.6rem, 4vw, 2.5rem);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.page-hero p {
  margin-top: 0.5rem;
  font-size: 0.95rem;
  color: #aaa;
}

/* Home hero gets red background */
.home-hero {
  background: var(--red);
  color: var(--white);
  padding: 3rem 1.25rem;
  text-align: center;
}

.home-hero h1 {
  font-size: clamp(1.8rem, 5vw, 3rem);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.home-hero p {
  margin-top: 0.4rem;
  font-size: 1rem;
  opacity: 0.88;
}

.hero-btn {
  display: inline-block;
  margin-top: 1.25rem;
  padding: 0.75rem 2rem;
  background: var(--white);
  color: var(--red);
  font-size: 0.85rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  text-decoration: none;
  border-radius: 30px;
  transition: opacity 0.15s, transform 0.15s;
}

.hero-btn:hover { opacity: 0.88; transform: translateY(-1px); }

/* ── LAYOUT ── */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

.page-body {
  max-width: 1200px;
  margin: 2rem auto;
  padding: 0 1.25rem 3rem;
}

/* Home: full-width content wrapper */
.home-layout {
  max-width: 1200px;
  margin: 2rem auto;
  padding: 0 1.25rem 3rem;
}

/* Home: top row — Helpful Links + Get Directions side by side on desktop */
.home-top-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
  align-items: start;
}

/* ── SECTION TITLES ── */
.section-title {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.95rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding-bottom: 0.65rem;
  border-bottom: 3px solid var(--red);
  margin-bottom: 1.25rem;
}

.section-title .pill {
  margin-left: auto;
  background: var(--gray);
  color: var(--muted);
  font-size: 0.68rem;
  padding: 0.18rem 0.55rem;
  border-radius: 20px;
  font-weight: 600;
  white-space: nowrap;
}

/* ── ANNOUNCEMENT CAROUSEL ── */
.carousel-wrap {
  position: relative;
}

.cards-grid {
  display: flex;
  overflow: hidden;
  gap: 0;
}

.cards-track {
  display: flex;
  gap: 1.1rem;
  transition: transform 0.45s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
}

.cards-track .card {
  flex: 0 0 calc(25% - 0.825rem);
  min-width: 0;
}

/* Carousel nav arrows */
.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: var(--red);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  font-size: 1.1rem;
  cursor: pointer;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  transition: background 0.15s;
}
.carousel-btn:hover { background: var(--dark-red); }
.carousel-btn.prev { left: -18px; }
.carousel-btn.next { right: -18px; }
.carousel-btn:disabled { opacity: 0.3; cursor: default; }

/* Dot indicators */
.carousel-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 1rem;
}
.carousel-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border);
  border: none;
  cursor: pointer;
  padding: 0;
  transition: background 0.2s, transform 0.2s;
}
.carousel-dot.active {
  background: var(--red);
  transform: scale(1.3);
}

/* Progress bar under carousel */
.carousel-progress {
  height: 3px;
  background: var(--border);
  border-radius: 2px;
  margin-top: 0.75rem;
  overflow: hidden;
}
.carousel-progress-bar {
  height: 100%;
  background: var(--red);
  width: 0%;
  transition: width linear;
}

@media (max-width: 960px) {
  .cards-track .card { flex: 0 0 calc(50% - 0.55rem); }
  .carousel-btn { display: none; }
}

@media (max-width: 640px) {
  .cards-track .card { flex: 0 0 100%; }
  .card-img { height: 180px; }
  .card-placeholder { height: 180px; }
}

.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  transition: box-shadow 0.2s, transform 0.2s;
  display: flex;
  flex-direction: column;
}

.card:hover {
  box-shadow: 0 6px 24px rgba(0,0,0,0.1);
  transform: translateY(-2px);
}

.card-img {
  width: 100%;
  height: 200px;         /* fixed height — same for every card */
  object-fit: cover;     /* default; JS overrides to contain for portraits */
  object-position: center;
  background: #f0f0f0;   /* neutral fill shown behind portrait images */
  display: block;
}

.card-placeholder {
  width: 100%;
  height: 200px;         /* match card-img so cards are uniform */
  background: linear-gradient(135deg, var(--red), var(--dark-red));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
}

.card-body { padding: 1rem; flex: 1; display: flex; flex-direction: column; }

.card-date {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--red);
  margin-bottom: 0.35rem;
}

.card-title {
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.35;
  margin-bottom: 0.4rem;
}

.card-desc {
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.55;
  flex: 1;
}

.card-link {
  display: inline-block;
  margin-top: 0.75rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--red);
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.card-link:hover { text-decoration: underline; }

/* ── FIELD STATUS ── */
.field-block {
  background: var(--gray);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 1rem;
}

.field-block-head {
  background: var(--black);
  color: var(--white);
  padding: 0.8rem 1rem;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
}

.complex-name {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.complex-addr {
  font-size: 0.68rem;
  color: #aaa;
  margin-top: 2px;
}

.complex-updated {
  font-size: 0.68rem;
  color: var(--muted);
  padding: 0.35rem 1rem 0.5rem;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0.22rem 0.65rem;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  flex-shrink: 0;
}

.badge-open  { background: var(--open-bg);   color: var(--open);   }
.badge-closed{ background: var(--closed-bg); color: var(--closed); }

.status-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.badge-open  .status-dot { background: var(--open);   }
.badge-closed .status-dot { background: var(--closed); }

.field-rows { padding: 0.4rem 0.5rem; }

.field-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.55rem 0.75rem;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 7px;
  margin-bottom: 0.35rem;
}

.field-row:last-child { margin-bottom: 0; }

.field-label { font-size: 0.82rem; font-weight: 600; }
.field-updated { font-size: 0.63rem; color: #bbb; margin-top: 1px; }

/* Full fields page — wider layout */
.fields-wide .field-block { margin-bottom: 1.25rem; }

/* ── CONTENT SECTIONS (Travel, Coaches, Rec) ── */
.content-section {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.75rem;
  margin-bottom: 1.5rem;
}

.content-section h2 {
  font-size: 1.2rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 1rem;
  padding-bottom: 0.6rem;
  border-bottom: 2px solid var(--red);
}

.content-section h3 {
  font-size: 1rem;
  font-weight: 700;
  margin: 1.25rem 0 0.5rem;
  color: var(--black);
}

.content-section p {
  font-size: 0.9rem;
  line-height: 1.7;
  color: #444;
  margin-bottom: 0.75rem;
}

.content-section ul, .content-section ol {
  padding-left: 1.25rem;
  margin-bottom: 0.75rem;
}

.content-section li {
  font-size: 0.9rem;
  line-height: 1.7;
  color: #444;
  margin-bottom: 0.2rem;
}

.content-section .highlight {
  background: #fff8f8;
  border-left: 3px solid var(--red);
  padding: 0.75rem 1rem;
  border-radius: 0 6px 6px 0;
  margin: 0.75rem 0;
  font-size: 0.88rem;
  color: #444;
}

/* Doc links */
.doc-links { display: flex; flex-direction: column; gap: 0.5rem; margin: 0.75rem 0; }

.doc-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 1rem;
  background: var(--gray);
  border: 1px solid var(--border);
  border-radius: 7px;
  color: var(--black);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  transition: background 0.15s, border-color 0.15s;
  width: fit-content;
}

.doc-link:hover { background: #ffe5e5; border-color: var(--red); color: var(--red); }

/* External links */
.ext-link-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.75rem;
  margin-top: 0.75rem;
}

.ext-link {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.75rem 1rem;
  background: var(--gray);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--black);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  transition: background 0.15s, border-color 0.15s;
}

.ext-link:hover { background: #ffe5e5; border-color: var(--red); color: var(--red); }

.ext-link-grid--sm { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }

.ext-link--sm {
  font-size: 0.78rem;
  padding: 0.4rem 0.7rem;
  gap: 0.4rem;
}

.ext-link--plain {
  background: #f9f9f9;
  color: #999;
  cursor: default;
  border-color: #ddd;
}

.ext-link--plain:hover { background: #f9f9f9; border-color: #ddd; color: #999; }

/* ── BOARD TABLE ── */
.board-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
  margin-top: 0.75rem;
}

.board-card {
  background: var(--gray);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
}

.board-card.open-seat { opacity: 0.55; }

.board-name {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 0.2rem;
}

.board-role {
  font-size: 0.78rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.5rem;
}

.board-email {
  font-size: 0.8rem;
  color: var(--red);
  text-decoration: none;
  font-weight: 600;
}

.board-email:hover { text-decoration: underline; }

/* ── DIVISIONS TABLE ── */
.div-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  margin-top: 0.75rem;
}

.div-table th {
  background: var(--black);
  color: var(--white);
  padding: 0.65rem 1rem;
  text-align: left;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.div-table td {
  padding: 0.65rem 1rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  line-height: 1.5;
}

.div-table tr:last-child td { border-bottom: none; }
.div-table tr:nth-child(even) td { background: var(--gray); }

/* ── CONTACT BLOCK ── */
.contact-block {
  background: var(--black);
  color: var(--white);
  border-radius: 10px;
  padding: 1.5rem;
}

.contact-block h3 {
  font-size: 0.85rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.75rem;
  color: #ccc;
}

.contact-block p, .contact-block a {
  font-size: 0.88rem;
  line-height: 1.7;
  color: #ddd;
  text-decoration: none;
}

.contact-block a:hover { color: var(--red); }

/* ── CALENDAR EMBED ── */
.calendar-wrap {
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}

.calendar-wrap iframe {
  width: 100%;
  display: block;
  border: none;
}

/* ── LOADING ── */
.loading {
  padding: 2rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.88rem;
}

/* ── ALERT BANNER ── */
.alert-banner {
  background: #fff3cd;
  border-left: 4px solid #f59e0b;
  padding: 0.85rem 1.25rem;
  font-size: 0.88rem;
  color: #78350f;
  margin-bottom: 1.5rem;
  border-radius: 0 6px 6px 0;
}

/* ── SPONSOR LOGO GRID (club-info page) ── */
.sponsor-logo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1.25rem;
  margin-top: 1rem;
}

.sponsor-logo-grid a {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
  transition: box-shadow 0.2s, transform 0.2s;
}

.sponsor-logo-grid a:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  transform: translateY(-2px);
}

.sponsor-logo-grid img {
  max-height: 80px;
  max-width: 100%;
  width: auto;
  object-fit: contain;
}

/* ── SPONSOR BAR ── */
.sponsor-bar {
  background: var(--gray);
  border-top: 1px solid var(--border);
  padding: 1.25rem 0;
  overflow: hidden;
}

.sponsor-track {
  display: flex;
  align-items: center;
  gap: 3rem;
  padding: 0 2rem;
  flex-wrap: wrap;
  justify-content: center;
}

.sponsor-track img {
  height: 40px;
  width: auto;
  object-fit: contain;
  filter: grayscale(0.4);
  opacity: 0.7;
  transition: opacity 0.2s;
}

.sponsor-track img:hover { opacity: 1; filter: none; }

/* ── FOOTER ── */
#site-footer footer {
  background: var(--black);
  color: var(--white);
  padding: 2.75rem 1.25rem 1.5rem;
}

.footer-grid {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 2rem;
}

.footer-logo-wrap {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.footer-logo-wrap img { height: 48px; width: auto; }

.footer-brand { font-size: 0.95rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; }

.footer-tagline { font-size: 0.8rem; color: #888; line-height: 1.7; margin-top: 0.25rem; }

.footer-socials {
  display: flex;
  gap: 0.75rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}

.footer-socials a {
  color: #aaa;
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 600;
  transition: color 0.15s;
}

.footer-socials a:hover { color: var(--red); }

.footer-col h4 {
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #777;
  margin-bottom: 0.75rem;
}

.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 0.4rem; }
.footer-col a { color: #bbb; text-decoration: none; font-size: 0.82rem; transition: color 0.15s; }
.footer-col a:hover { color: var(--red); }

.footer-bottom {
  max-width: 1200px;
  margin: 2rem auto 0;
  padding-top: 1.25rem;
  border-top: 1px solid #222;
  text-align: center;
  font-size: 0.75rem;
  color: #555;
}

/* ── RESPONSIVE ── */
@media (max-width: 960px) {
  .home-top-row { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 640px) {
  .desktop-nav { display: none; }
  .hamburger { display: block; }
  /* Hide login button and desktop search on mobile — both are in the mobile menu */
  .header-login-btn { display: none !important; }
  .search-wrap { display: none; }
  /* Let the logo shrink so hamburger is never clipped */
  .site-logo { flex-shrink: 1; min-width: 0; }
  .logo-text { font-size: 0.82rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .logo-text small { display: none; }
  .site-logo img { height: 40px; }
  .footer-grid { grid-template-columns: 1fr; gap: 1.5rem; }
  .home-hero { padding: 2rem 1rem; }
  .content-section { padding: 1.25rem; }
  .board-grid { grid-template-columns: 1fr 1fr; }
  .div-table { font-size: 0.8rem; }
  .div-table th, .div-table td { padding: 0.5rem 0.6rem; }
}

@media (max-width: 400px) {
  .board-grid { grid-template-columns: 1fr; }
}
