/* ═══════════════════════════════════════════════════
   BASE — Reset, Typography, Layout, Header, Footer
   SportSweeper Theme
   ═══════════════════════════════════════════════════ */

/* ─── Reset ───────────────────────────────────────── */

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

html {
  overflow-x: hidden;
}

body {
  font-family: var(--font-body);
  background: var(--white);
  color: var(--slate-800);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.6;
  overflow-x: hidden;
  width: 100%;
}

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

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

ul, ol {
  list-style: none;
}

button {
  font-family: inherit;
  cursor: pointer;
}

/* ─── Layout ──────────────────────────────────────── */

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 2rem;
}

main,
.site-footer {
  max-width: 100vw;
  overflow-x: hidden;
}

.site-header {
  max-width: 100vw;
  /* NOTE: Do NOT set overflow:hidden here — it clips the mobile nav dropdown.
     The nav-main is position:absolute extending below the header. */
}

/* ─── Typography Utilities ────────────────────────── */

.section-label {
  display: inline-flex;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--green-700);
  background: var(--green-50);
  border: 1px solid var(--green-200);
  padding: 0.35rem 0.85rem;
  border-radius: 100px;
  margin-bottom: 1rem;
}

.section-title {
  font-family: var(--font-display);
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--slate-900);
  line-height: 1.15;
  margin-bottom: 1rem;
  letter-spacing: -0.02em;
  max-width: 600px;
}

.section-subtitle {
  font-size: 1.1rem;
  color: var(--slate-500);
  max-width: 560px;
  margin-bottom: 3.5rem;
  line-height: 1.7;
}

/* ─── Announcement Bar ────────────────────────────── */

.announcement-bar {
  background: var(--green-900);
  color: var(--green-200);
  text-align: center;
  padding: 0.5rem 1rem;
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.04em;
}

.announcement-bar strong {
  color: var(--amber-400);
}

/* ─── Site Header ─────────────────────────────────── */

.site-header {
  background: var(--slate-950);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 0;
  gap: 2rem;
}

/* ─── Logo ────────────────────────────────────────── */

.logo-wrap {
  display: flex;
  align-items: center;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.15rem;
  white-space: nowrap;
}

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

.logo-sub {
  font-size: 0.65rem;
  color: var(--slate-500);
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-left: 0.75rem;
  padding-left: 0.75rem;
  border-left: 1px solid rgba(255, 255, 255, 0.1);
  white-space: nowrap;
}

/* ─── Primary Navigation ──────────────────────────── */

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

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

.nav-main ul li a,
.nav-main > a {
  display: block;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--slate-400);
  transition: color 0.15s;
  position: relative;
}

.nav-main ul li a:hover,
.nav-main > a:hover {
  color: var(--green-400);
}

.nav-main ul li.current-menu-item > a,
.nav-main ul li.current-page-ancestor > a,
.nav-main > a.active {
  color: var(--white);
  font-weight: 600;
}

.nav-main ul li.current-menu-item > a::after,
.nav-main ul li.current-page-ancestor > a::after,
.nav-main > a.active::after {
  content: '';
  position: absolute;
  bottom: -1rem;
  left: 1rem;
  right: 1rem;
  height: 2px;
  background: var(--green-600);
  border-radius: 1px;
}

/* ─── Header Actions ──────────────────────────────── */

.header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.header-phone {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--slate-400);
  font-weight: 500;
}

.btn-quote {
  background: var(--green-600);
  color: var(--white);
  padding: 0.6rem 1.25rem;
  border-radius: var(--radius);
  font-size: 0.85rem;
  font-weight: 600;
  transition: all 0.2s;
  border: none;
  cursor: pointer;
  display: inline-block;
}

.btn-quote:hover {
  background: var(--green-800);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(22, 101, 52, 0.3);
  color: var(--white);
}

/* ─── Mobile Nav Toggle ───────────────────────────── */

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  cursor: pointer;
  padding: 0.4rem;
  background: none;
  border: none;
  border-radius: var(--radius);
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--slate-400);
  border-radius: 2px;
  transition: all 0.25s;
}

.site-header.nav-open .nav-toggle span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.site-header.nav-open .nav-toggle span:nth-child(2) {
  opacity: 0;
}

.site-header.nav-open .nav-toggle span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ─── Site Footer ─────────────────────────────────── */

.site-footer {
  background: var(--slate-950);
  color: var(--slate-400);
  padding: 4rem 0 2rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 3rem;
  margin-bottom: 3rem;
}

.footer-brand p {
  font-size: 0.85rem;
  line-height: 1.6;
  margin-top: 0.75rem;
  max-width: 280px;
}

.footer-brand .footer-address {
  font-size: 0.85rem;
  margin-top: 0.75rem;
  color: var(--slate-300);
  line-height: 1.7;
}

.footer-brand .footer-address a {
  color: var(--green-400);
}

.footer-brand .footer-address a:hover {
  color: var(--green-300);
}

.footer-col h5 {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--slate-300);
  margin-bottom: 1rem;
}

.footer-col a {
  display: block;
  font-size: 0.85rem;
  color: var(--slate-400);
  padding: 0.3rem 0;
  transition: color 0.15s;
}

.footer-col a:hover {
  color: var(--green-400);
}

.footer-parent {
  font-size: 0.75rem;
  color: var(--slate-500);
  margin-top: 1rem;
}

.footer-parent a {
  color: var(--slate-400);
  text-decoration: underline;
  text-decoration-color: var(--slate-600);
}

.footer-logo-img {
  height: 52px;
  width: auto;
  margin-bottom: 0.5rem;
  filter: brightness(1.2);
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.78rem;
  color: var(--slate-500);
}

.footer-bottom a {
  color: var(--slate-400);
}

.footer-bottom a:hover {
  color: var(--green-400);
}

/* ─── WordPress Core ──────────────────────────────── */

.screen-reader-text {
  clip: rect(1px, 1px, 1px, 1px);
  height: 1px;
  overflow: hidden;
  position: absolute !important;
  width: 1px;
  word-wrap: normal !important;
}

/* ─── Skip to Content ─────────────────────────────── */

.skip-to-content {
  position: absolute;
  top: -100%;
  left: 0;
  background: var(--green-600);
  color: var(--white);
  padding: 0.75rem 1.5rem;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  z-index: 9999;
  border-radius: 0 0 var(--radius) 0;
  transition: top 0.2s;
}

.skip-to-content:focus {
  top: 0;
  outline: 3px solid var(--amber-400);
  outline-offset: 2px;
}

/* ─── Responsive ──────────────────────────────────── */

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

@media (max-width: 768px) {
  .nav-toggle {
    display: flex;
  }

  .nav-main {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--slate-950);
    padding: 1rem 0 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    z-index: 50;
  }

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

  .nav-main ul {
    flex-direction: column;
    align-items: flex-start;
  }

  .nav-main ul li a {
    padding: 0.75rem 2rem;
    font-size: 1rem;
    width: 100%;
  }

  .nav-main ul li.current-menu-item > a::after {
    display: none;
  }

  .logo-sub {
    display: none;
  }

  .header-phone {
    display: none;
  }

  .footer-grid {
    grid-template-columns: 1fr;
  }

  .footer-bottom {
    flex-direction: column;
    gap: 0.5rem;
    text-align: center;
  }

  .section-title {
    font-size: 2rem;
  }
}

@media (max-width: 480px) {
  .btn-quote {
    display: none;
  }
}

/* ─── 404 Page ────────────────────────────────────── */

.error-404 {
  min-height: 70vh;
  display: flex;
  align-items: center;
}

.error-hero {
  width: 100%;
  background: var(--green-950);
  padding: 6rem 0;
}

.error-inner {
  text-align: center;
  max-width: 560px;
  margin: 0 auto;
}

.error-code {
  display: block;
  font-family: var(--font-mono);
  font-size: 6rem;
  font-weight: 500;
  color: var(--green-700);
  line-height: 1;
  margin-bottom: 1rem;
}

.error-title {
  font-family: var(--font-display);
  font-size: 2.5rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 1rem;
}

.error-message {
  font-size: 1.1rem;
  color: var(--green-300);
  margin-bottom: 2.5rem;
  line-height: 1.6;
}

.error-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* ─── Generic Page Template ───────────────────────── */

.page-hero {
  background: var(--green-950);
  padding: 4rem 0;
}

.page-hero h1 {
  font-family: var(--font-display);
  font-size: 2.5rem;
  font-weight: 700;
  color: #fff;
  margin: 0;
}

.page-content {
  padding: 4rem 0;
}

.prose {
  max-width: 780px;
}

.prose h1,
.prose h2,
.prose h3,
.prose h4 {
  font-family: var(--font-display);
  color: var(--slate-900);
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  line-height: 1.25;
}

.prose h2 { font-size: 1.75rem; }
.prose h3 { font-size: 1.35rem; }

.prose p {
  color: var(--slate-700);
  line-height: 1.75;
  margin-bottom: 1.25rem;
}

.prose ul,
.prose ol {
  list-style: disc;
  padding-left: 1.5rem;
  margin-bottom: 1.25rem;
  color: var(--slate-700);
}

.prose ol { list-style: decimal; }

.prose li {
  margin-bottom: 0.4rem;
  line-height: 1.65;
}

.prose a {
  color: var(--green-700);
  text-decoration: underline;
}

.prose a:hover {
  color: var(--green-600);
}

.prose img {
  border-radius: var(--radius);
  margin: 1.5rem 0;
}

/* ─── Blog Index ──────────────────────────────────── */

.blog-content {
  padding: 4rem 0;
}

.blog-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  margin-bottom: 3rem;
}

.blog-card {
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: #fff;
  transition: box-shadow 0.2s;
}

.blog-card:hover {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.blog-card-image img {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

.blog-card-body {
  padding: 1.5rem;
}

.blog-card-meta {
  font-size: 0.78rem;
  color: var(--slate-400);
  margin-bottom: 0.5rem;
}

.blog-card-title {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--slate-900);
  margin-bottom: 0.75rem;
  line-height: 1.3;
}

.blog-card-title a {
  color: inherit;
}

.blog-card-title a:hover {
  color: var(--green-700);
}

.blog-card-excerpt {
  font-size: 0.875rem;
  color: var(--slate-500);
  line-height: 1.65;
  margin-bottom: 1.25rem;
}

.blog-pagination {
  display: flex;
  justify-content: center;
}

.blog-pagination .nav-links {
  display: flex;
  gap: 0.5rem;
}

.blog-pagination .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--slate-600);
  border: 1px solid var(--slate-200);
  transition: all 0.15s;
}

.blog-pagination .page-numbers.current,
.blog-pagination .page-numbers:hover {
  background: var(--green-600);
  border-color: var(--green-600);
  color: #fff;
}

.blog-empty {
  text-align: center;
  padding: 4rem 0;
  color: var(--slate-500);
}

/* ─── Shared Button Styles ────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.75rem;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 600;
  font-family: var(--font-body);
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-primary {
  background: var(--green-600);
  color: #fff;
}

.btn-primary:hover {
  background: var(--green-700);
  color: #fff;
  box-shadow: 0 4px 12px rgba(22, 101, 52, 0.3);
  transform: translateY(-1px);
}

.btn-secondary {
  background: transparent;
  color: var(--slate-700);
  border: 1px solid var(--slate-300);
}

.btn-secondary:hover {
  border-color: var(--slate-400);
  background: var(--slate-50);
  color: var(--slate-800);
}

.btn-sm {
  padding: 0.5rem 1.1rem;
  font-size: 0.82rem;
}

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

  .page-hero h1 {
    font-size: 1.85rem;
  }

  .error-code {
    font-size: 4rem;
  }

  .error-title {
    font-size: 1.85rem;
  }

  /* Prevent wide tables from causing horizontal page scroll.
     Exclude .site-header .container — overflow clips the mobile nav dropdown. */
  main .container,
  .site-footer .container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}
