/*
Theme Name: NSP North Central Region
Theme URI: https://nspncr.org
Author: Aslan Interactive
Description: Custom theme for the National Ski Patrol North Central Region. Navy/red/ice palette with bold uppercase display headings.
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 7.4
License: GNU General Public License v2 or later
Text Domain: nspncr
*/

:root {
  --navy: #0d1e45;
  --blue: #dceff8;
  --ice: #f4f9fc;
  --red: #d8343f;
  --pine: #1f5c45;
  --slate: #5f6b7a;
  --ink: #162235;
  --line: #d8e0e7;
  --white: #ffffff;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--ice);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 16px;
  line-height: 1.6;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  height: auto;
  max-width: 100%;
}

button,
.button,
.header-cta {
  min-height: 44px;
}

/* ---------- Header ---------- */

.site-header {
  align-items: center;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 16px 24px;
  grid-template-columns: minmax(200px, 300px) 1fr auto;
  padding: 14px clamp(20px, 5vw, 72px);
  position: sticky;
  top: 0;
  z-index: 100;
}

.brand img {
  display: block;
  height: auto;
  max-width: 100%;
}

.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 18px;
  justify-content: center;
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-nav li {
  position: relative;
}

.site-nav a {
  color: var(--navy);
  display: inline-block;
  font-size: 0.84rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  padding: 10px 0;
  text-transform: uppercase;
}

.site-nav a:hover {
  color: var(--red);
}

.site-nav li.menu-item-has-children > a::after {
  content: " \25BE";
  font-size: 0.7em;
}

.site-nav .sub-menu {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 0 0 8px 8px;
  box-shadow: 0 14px 30px rgba(13, 30, 69, 0.14);
  display: none;
  left: -16px;
  min-width: 220px;
  padding: 8px 0;
  position: absolute;
  top: 100%;
  z-index: 50;
}

.site-nav li:hover > .sub-menu,
.site-nav li:focus-within > .sub-menu {
  display: block;
}

.site-nav .sub-menu li {
  display: block;
}

.site-nav .sub-menu a {
  display: block;
  padding: 8px 16px;
}

.header-cta,
.button {
  align-items: center;
  border-radius: 6px;
  display: inline-flex;
  font-size: 0.85rem;
  font-weight: 800;
  justify-content: center;
  padding: 12px 18px;
  text-align: center;
  text-transform: uppercase;
}

.header-cta,
.button.primary {
  background: var(--red);
  color: var(--white);
}

.header-cta:hover,
.button.primary:hover {
  background: #b8232e;
  color: var(--white);
}

.button.secondary {
  background: var(--white);
  border: 1px solid var(--line);
  color: var(--navy);
}

.button.secondary:hover {
  border-color: var(--red);
  color: var(--red);
}

.menu-toggle {
  display: none;
}

/* ---------- Shared type ---------- */

.eyebrow {
  color: var(--red);
  font-size: 0.8rem;
  font-weight: 900;
  letter-spacing: 0.13em;
  margin: 0 0 12px;
  text-transform: uppercase;
}

.display,
.hero h1,
.section-heading h2,
.spotlight h2,
.recognition h2,
.join h2,
.site-footer h2,
.page-hero h1 {
  color: var(--navy);
  font-family: "Arial Black", Arial, Helvetica, sans-serif;
  letter-spacing: 0;
  line-height: 0.98;
  margin: 0;
  text-transform: uppercase;
}

.section,
.split-section,
.recognition,
.join,
.site-footer {
  padding: 72px clamp(20px, 5vw, 72px);
}

.section-heading {
  align-items: end;
  display: flex;
  gap: 24px;
  justify-content: space-between;
  margin-bottom: 28px;
}

.section-heading h2,
.spotlight h2,
.recognition h2,
.join h2,
.site-footer h2 {
  font-size: clamp(2rem, 4vw, 4.2rem);
}

.section-heading .button {
  flex-shrink: 0;
}

/* ---------- Hero (front page) ---------- */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(280px, 420px);
  min-height: 640px;
  overflow: hidden;
  position: relative;
}

.hero-media {
  background:
    linear-gradient(90deg, rgba(13, 30, 69, 0.92), rgba(13, 30, 69, 0.62), rgba(13, 30, 69, 0.16)),
    url("/wp-content/themes/nspncr/assets/hero.jpg") var(--navy);
  background-position: center;
  background-size: cover;
  inset: 0;
  position: absolute;
}

.hero-content {
  align-self: center;
  color: var(--white);
  max-width: 760px;
  padding: 88px clamp(24px, 7vw, 96px);
  position: relative;
  z-index: 1;
}

.hero h1 {
  color: var(--white);
  font-size: 35px;
  max-width: 900px;
}

.hero-content > p:not(.eyebrow) {
  color: #e8f2f7;
  font-size: clamp(1.05rem, 1.7vw, 1.32rem);
  line-height: 1.65;
  max-width: 680px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 28px;
}

.hero-panel {
  align-self: end;
  background: rgba(255, 255, 255, 0.94);
  border-left: 6px solid var(--red);
  margin: 0 clamp(24px, 5vw, 72px) 56px 0;
  padding: 28px;
  position: relative;
  z-index: 1;
}

.hero-panel strong {
  color: var(--navy);
  display: block;
  font-size: 0.9rem;
  margin-bottom: 18px;
  text-transform: uppercase;
}

.hero-panel div {
  align-items: baseline;
  border-top: 1px solid var(--line);
  display: flex;
  gap: 14px;
  padding: 15px 0;
}

.hero-panel span {
  color: var(--pine);
  font-family: "Arial Black", Arial, Helvetica, sans-serif;
  font-size: 2.2rem;
}

.hero-panel p {
  color: var(--slate);
  margin: 0;
}

/* ---------- Events band ---------- */

.events-band {
  background: var(--white);
}

.event-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.event-card {
  align-items: stretch;
  background: var(--ice);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  grid-template-columns: 92px 1fr;
  overflow: hidden;
  transition: border-color 160ms ease;
}

.event-card:hover {
  border-color: var(--red);
}

.event-date {
  align-items: center;
  background: var(--navy);
  color: var(--white);
  display: flex;
  font-family: "Arial Black", Arial, Helvetica, sans-serif;
  justify-content: center;
  padding: 18px;
  text-align: center;
}

.event-card > div:last-child {
  padding: 20px;
}

.event-card span,
.program-card span,
.news-list time {
  color: var(--red);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.event-card h3,
.program-card h3,
.news-list h3 {
  color: var(--navy);
  margin: 6px 0 8px;
}

.event-card p,
.program-card p,
.news-list p {
  color: var(--slate);
  margin: 0;
}

/* ---------- Programs grid ---------- */

.programs {
  background: linear-gradient(180deg, var(--ice), #ffffff);
}

.program-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.program-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 180px;
  padding: 22px;
  transition: transform 160ms ease, border-color 160ms ease;
}

.program-card:hover {
  border-color: var(--red);
  transform: translateY(-3px);
}

.program-card h3 {
  font-family: "Arial Black", Arial, Helvetica, sans-serif;
  font-size: 1.35rem;
  line-height: 1.05;
  text-transform: uppercase;
}

/* ---------- News + spotlight ---------- */

.split-section {
  background: var(--white);
  display: grid;
  gap: 24px;
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.65fr);
}

.news-list {
  display: grid;
  gap: 14px;
}

.news-list article {
  border-top: 1px solid var(--line);
  padding: 22px 0;
}

.news-list h3 {
  font-size: 1.2rem;
}

.news-list a {
  color: var(--pine);
  font-weight: 900;
}

.spotlight {
  background:
    linear-gradient(rgba(31, 92, 69, 0.88), rgba(31, 92, 69, 0.88)),
    var(--pine);
  background-position: center;
  background-size: cover;
  border-radius: 8px;
  color: var(--white);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 440px;
  padding: 34px;
}

.spotlight h2,
.spotlight .eyebrow {
  color: var(--white);
}

.spotlight p {
  color: #eef7f1;
  line-height: 1.65;
}

.spotlight .button {
  align-self: flex-start;
  margin-top: 12px;
}

/* ---------- Recognition band ---------- */

.recognition {
  align-items: center;
  background: var(--navy);
  color: var(--white);
  display: grid;
  gap: 28px;
  grid-template-columns: 1fr 1fr auto;
}

.recognition h2,
.recognition .eyebrow {
  color: var(--white);
}

.recognition p {
  color: #d7e5ef;
  line-height: 1.65;
  margin: 0;
}

/* ---------- Join band ---------- */

.join {
  background:
    linear-gradient(135deg, rgba(244, 249, 252, 0.95), rgba(220, 239, 248, 0.9)),
    repeating-linear-gradient(45deg, rgba(31, 92, 69, 0.08) 0 2px, transparent 2px 24px);
  display: grid;
  gap: 40px;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
}

.join-copy p:not(.eyebrow) {
  color: var(--slate);
  font-size: 1.08rem;
  line-height: 1.65;
}

.steps {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.steps > div,
.steps > a {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: block;
  min-height: 190px;
  padding: 24px;
}

.steps > a:hover {
  border-color: var(--red);
}

.steps span {
  align-items: center;
  background: var(--red);
  border-radius: 999px;
  color: var(--white);
  display: flex;
  font-weight: 900;
  height: 42px;
  justify-content: center;
  width: 42px;
}

.steps p {
  color: var(--navy);
  font-family: "Arial Black", Arial, Helvetica, sans-serif;
  font-size: 1.28rem;
  line-height: 1.1;
  text-transform: uppercase;
}

/* ---------- Calendar ---------- */

.calendar {
  background: var(--white);
}

.calendar-shell {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.calendar-toolbar {
  align-items: center;
  background: var(--navy);
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  padding: 14px;
}

.calendar-toolbar .button {
  background: var(--white);
  border: 0;
  border-radius: 6px;
  color: var(--navy);
  font-weight: 900;
  padding: 10px 14px;
}

.calendar-embed {
  background: #fbfdfe;
  padding: 0;
}

.calendar-embed iframe {
  border: 0;
  display: block;
  height: 640px;
  width: 100%;
}

/* ---------- Footer ---------- */

.site-footer {
  align-items: center;
  background: #0a142e;
  color: var(--white);
  display: grid;
  gap: 28px;
  grid-template-columns: 280px 1fr auto;
}

.site-footer img {
  background: var(--white);
  border-radius: 8px;
  display: block;
  max-width: 100%;
  padding: 10px;
}

.site-footer h2 {
  color: var(--white);
  font-size: clamp(1.6rem, 3vw, 3rem);
}

.site-footer p {
  color: #d7e5ef;
  margin: 10px 0 0;
}

.site-footer a:hover {
  color: var(--blue);
}

.footer-menu ul {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  list-style: none;
  margin: 14px 0 0;
  padding: 0;
}

.footer-menu a {
  color: #d7e5ef;
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
}

.footer-credit {
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  color: #8fa2c0;
  font-size: 0.82rem;
  grid-column: 1 / -1;
  margin-top: 12px;
  padding-top: 20px;
}

/* ---------- Interior pages ---------- */

.page-hero {
  background:
    linear-gradient(90deg, rgba(13, 30, 69, 0.97), rgba(13, 30, 69, 0.85)),
    repeating-linear-gradient(45deg, rgba(220, 239, 248, 0.09) 0 2px, transparent 2px 26px),
    var(--navy);
  color: var(--white);
  padding: 84px clamp(20px, 5vw, 72px) 64px;
}

.page-hero h1 {
  color: var(--white);
  font-size: clamp(2.2rem, 5vw, 4.6rem);
  max-width: 1000px;
}

.page-hero .meta {
  color: #b9cade;
  font-size: 0.95rem;
  margin: 16px 0 0;
}

.page-hero .meta a {
  color: var(--blue);
  font-weight: 800;
}

.content-wrap {
  margin: 0 auto;
  max-width: 1040px;
  padding: 56px clamp(20px, 5vw, 72px) 88px;
}

.entry-content {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 1.02rem;
  line-height: 1.7;
  padding: clamp(24px, 4vw, 56px);
}

.entry-content > *:first-child {
  margin-top: 0;
}

.entry-content h1,
.entry-content h2,
.entry-content h3,
.entry-content h4 {
  color: var(--navy);
  font-family: "Arial Black", Arial, Helvetica, sans-serif;
  line-height: 1.05;
  margin: 1.6em 0 0.5em;
  text-transform: uppercase;
}

.entry-content h1 { font-size: 1.9rem; }
.entry-content h2 { font-size: 1.6rem; }
.entry-content h3 { font-size: 1.25rem; }
.entry-content h4 { font-size: 1.05rem; }

.entry-content a:not(.button) {
  border-bottom: 2px solid rgba(31, 92, 69, 0.25);
  color: var(--pine);
  font-weight: 700;
}

.entry-content a:not(.button):hover {
  border-bottom-color: var(--pine);
}

.entry-content ul,
.entry-content ol {
  padding-left: 1.4em;
}

.entry-content li {
  margin: 0.35em 0;
}

.entry-content hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 2.2em 0;
}

.entry-content blockquote {
  border-left: 5px solid var(--red);
  color: var(--slate);
  margin: 1.5em 0;
  padding: 0.3em 0 0.3em 1.2em;
}

.entry-content img {
  border-radius: 8px;
}

.entry-content .aligncenter {
  display: block;
  margin-left: auto;
  margin-right: auto;
}

.entry-content .alignleft {
  float: left;
  margin: 0 20px 12px 0;
}

.entry-content .alignright {
  float: right;
  margin: 0 0 12px 20px;
}

.entry-content figure {
  margin: 1.5em 0;
  max-width: 100%;
}

.entry-content iframe {
  border: 0;
  max-width: 100%;
}

/* Tables: neutralize legacy inline sizing, style consistently */
.entry-content table {
  border-collapse: collapse;
  height: auto !important;
  margin: 1.5em 0;
  width: 100% !important;
}

.entry-content .table-scroll {
  overflow-x: auto;
}

.entry-content td,
.entry-content th {
  border: 1px solid var(--line);
  height: auto !important;
  padding: 10px 12px;
  text-align: left;
  vertical-align: top;
  width: auto !important;
}

.entry-content tr:first-child td,
.entry-content th,
.entry-content thead td {
  background: var(--navy);
  color: var(--white);
}

.entry-content tr:first-child td a,
.entry-content th a,
.entry-content thead td a {
  border-bottom-color: rgba(220, 239, 248, 0.4);
  color: var(--blue);
}

.entry-content tbody tr:nth-child(even) {
  background: var(--ice);
}

/* Buttons inside content */
.entry-content .button {
  border-bottom: 0;
  margin: 6px 8px 6px 0;
}

/* Callout card (converted Divi CTAs) */
.entry-content .callout,
.front-callout {
  background: var(--ice);
  border: 1px solid var(--line);
  border-left: 6px solid var(--red);
  border-radius: 8px;
  margin: 1.6em 0;
  padding: 24px 26px;
}

.entry-content .callout h2,
.entry-content .callout h3 {
  margin-top: 0;
}

/* Post meta on single */
.entry-meta {
  color: var(--slate);
  font-size: 0.88rem;
  margin-bottom: 20px;
}

/* Archive cards */
.archive-list {
  display: grid;
  gap: 16px;
}

.archive-list article {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 26px 28px;
  transition: border-color 160ms ease;
}

.archive-list article:hover {
  border-color: var(--red);
}

.archive-list time {
  color: var(--red);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.archive-list h2 {
  color: var(--navy);
  font-family: "Arial Black", Arial, Helvetica, sans-serif;
  font-size: 1.4rem;
  margin: 8px 0 10px;
  text-transform: uppercase;
}

.archive-list p {
  color: var(--slate);
  margin: 0;
}

.pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 32px;
}

.pagination .page-numbers {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--navy);
  font-weight: 800;
  padding: 8px 14px;
}

.pagination .page-numbers.current {
  background: var(--navy);
  color: var(--white);
}

/* ---------- Responsive ---------- */

@media (max-width: 1100px) {
  .site-header {
    grid-template-columns: minmax(180px, 260px) 1fr;
  }

  .header-cta {
    display: none;
  }

  .hero,
  .split-section,
  .recognition,
  .join,
  .site-footer {
    grid-template-columns: 1fr;
  }

  .hero-panel {
    margin-left: clamp(24px, 7vw, 96px);
  }

  .event-grid,
  .steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .program-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .site-header {
    grid-template-columns: 1fr auto;
    position: static;
  }

  .menu-toggle {
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: 6px;
    color: var(--navy);
    display: inline-flex;
    font-weight: 900;
    padding: 10px 14px;
  }

  .site-nav {
    display: none;
    grid-column: 1 / -1;
  }

  .site-nav.open {
    display: block;
  }

  .site-nav ul {
    flex-direction: column;
    gap: 0;
  }

  .site-nav .sub-menu {
    border: 0;
    box-shadow: none;
    display: block;
    padding: 0 0 0 18px;
    position: static;
  }

  .hero {
    min-height: auto;
  }

  .hero-content {
    padding-top: 64px;
  }

  .hero-panel {
    margin: 0 20px 28px;
  }

  .section-heading {
    align-items: start;
    flex-direction: column;
  }

  .event-grid,
  .program-grid,
  .steps {
    grid-template-columns: 1fr;
  }

  .calendar-embed iframe {
    height: 520px;
  }
}
