/*
Theme Name: Mark Madsen Professional
Theme URI: https://wpmajestic.com/
Author: WpMajestic
Author URI: https://wpmajestic.com/
Description: A sleek, modern, premium custom WordPress theme for elite basketball coach Mark Madsen. Features a bold hero section and magazine-style blog grid.
Version: 1.0.1
Text Domain: mark-madsen
*/

/* --------------------------------------------------------------------------
   RESET & VARIABLES
-------------------------------------------------------------------------- */
:root {
  --color-primary-navy: #003262;
  /* Cal Bears Navy */
  --color-primary-gold: #FDB515;
  /* Cal Bears Gold */
  --color-text-dark: #222222;
  --color-text-light: #555555;
  --color-bg-light: #f9f9f9;
  --color-white: #ffffff;

  --font-primary: 'Inter', system-ui, -apple-system, sans-serif;
  --max-width-container: 1200px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-primary);
  color: var(--color-text-dark);
  background-color: var(--color-bg-light);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  text-decoration: none;
  color: var(--color-primary-navy);
  transition: color 0.3s ease;
}

a:hover {
  color: var(--color-primary-gold);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

.container {
  width: 100%;
  max-width: var(--max-width-container);
  margin: 0 auto;
  padding: 0 24px;
}

/* --------------------------------------------------------------------------
   UTILITIES
-------------------------------------------------------------------------- */
.screen-reader-text {
  border: 0;
  clip: rect(1px, 1px, 1px, 1px);
  clip-path: inset(50%);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute !important;
  width: 1px;
  word-wrap: normal !important;
}

.screen-reader-text:focus {
  background-color: #f1f1f1;
  border-radius: 3px;
  box-shadow: 0 0 2px 2px rgba(0, 0, 0, 0.6);
  clip: auto !important;
  clip-path: none;
  color: #21759b;
  display: block;
  font-size: 14px;
  font-size: 0.875rem;
  font-weight: bold;
  height: auto;
  left: 5px;
  line-height: normal;
  padding: 15px 23px 14px;
  text-decoration: none;
  top: 5px;
  width: auto;
  z-index: 100000;
}

/* --------------------------------------------------------------------------
   HEADER & NAVIGATION
-------------------------------------------------------------------------- */
.site-header {
  position: absolute;
  /* Overlays the hero */
  top: 0;
  left: 0;
  width: 100%;
  z-index: 100;
  padding: 12px 0;
  background-color: var(--color-primary-navy);
}

/* Adjust absolute header when WordPress admin bar is present */
.admin-bar .site-header {
  top: 32px;
}

@media screen and (max-width: 782px) {
  .admin-bar .site-header {
    top: 46px;
  }
}

.site-header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* ---- Branding (Logo + Stacked Text) ---- */
.site-branding {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.custom-logo-link img {
  height: 50px;
  width: auto;
}

.logo-text {
  font-size: 1rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 2px;
  line-height: 1.2;
  margin: 0;
  padding: 0;
}

.logo-text a {
  color: var(--color-white);
}

.logo-text a:hover {
  color: var(--color-primary-gold);
}

/* ---- Header Right (Nav + CTA) ---- */
.header-right {
  display: none;
  /* Hidden on mobile, shown on desktop */
  align-items: center;
  gap: 30px;
}

/* ---- Desktop Navigation ---- */
.main-navigation {
  /* Reset: no fixed positioning on desktop */
  position: static;
  width: auto;
  max-width: none;
  height: auto;
  background-color: transparent;
  box-shadow: none;
  padding: 0;
  overflow: visible;
}

.main-navigation ul {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0;
  list-style: none;
}

/* Pipe separator between menu items */
.main-navigation ul li {
  position: relative;
}

.main-navigation ul li+li::before {
  content: '|';
  color: rgba(255, 255, 255, 0.4);
  padding: 0 15px;
  font-size: 0.85rem;
  font-weight: 300;
}

.main-navigation a {
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--color-white);
  display: inline-block;
  transition: color 0.3s ease;
}

.main-navigation a:hover {
  color: var(--color-primary-gold);
}

/* ---- CTA Button ---- */
.header-cta .btn-header-cta {
  display: inline-block;
  padding: 10px 22px;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--color-primary-gold);
  border: 2px solid var(--color-primary-gold);
  border-radius: 3px;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.header-cta .btn-header-cta:hover {
  background-color: var(--color-primary-gold);
  color: var(--color-primary-navy);
}

/* ---- Show desktop header-right on larger screens ---- */
@media (min-width: 993px) {
  .header-right {
    display: flex;
  }

  .menu-toggle {
    display: none !important;
  }
}

/* ---- Mobile Slide-Out Drawer (below 993px) ---- */
@media (max-width: 992px) {
  .header-right {
    display: contents;
    /* Let children escape the flex container so the fixed nav drawer works */
  }

  .header-cta {
    display: none;
    /* Hidden by default on mobile */
  }

  /* Show CTA inside the drawer when menu is toggled open */
  .main-navigation.toggled~.header-cta {
    display: block;
    position: fixed;
    bottom: 40px;
    right: 0;
    width: 85%;
    max-width: 400px;
    padding: 0 30px;
    z-index: 999;
    box-sizing: border-box;
  }

  .main-navigation.toggled~.header-cta .btn-header-cta {
    display: block;
    text-align: center;
    width: 100%;
  }

  .main-navigation {
    position: fixed;
    top: 0;
    right: -100%;
    width: 85%;
    max-width: 400px;
    height: 100vh;
    background-color: var(--color-primary-navy);
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.3);
    z-index: 998;
    transition: right 0.4s cubic-bezier(0.77, 0.2, 0.05, 1.0);
    padding: 100px 30px 40px;
    overflow-y: auto;
  }

  .main-navigation.toggled {
    right: 0;
  }

  .main-navigation ul {
    flex-direction: column;
    gap: 24px;
  }

  .main-navigation ul li+li::before {
    display: none;
    /* No pipe separators on mobile */
  }

  .main-navigation a {
    font-size: 1.25rem;
    color: var(--color-white);
  }
}

/* --------------------------------------------------------------------------
   HERO SECTION
-------------------------------------------------------------------------- */
.hero-section {
  position: relative;
  height: 85vh;
  min-height: 600px;
  display: flex;
  align-items: center;
  background-color: var(--color-primary-navy);
  background-size: cover;
  background-position: center;
  margin-top: 74px;
  /* Offset for thinner dark header */
}

.hero-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(to right, rgba(0, 50, 98, 0.9), rgba(0, 50, 98, 0.4));
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
  color: var(--color-white);
  max-width: 650px;
  padding-left: 24px;
}

.hero-content h1 {
  font-size: 4.5rem;
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 24px;
  letter-spacing: -1px;
}

.hero-content h1 span {
  color: var(--color-primary-gold);
}

.hero-content p {
  font-size: 1.25rem;
  font-weight: 400;
  margin-bottom: 32px;
  opacity: 0.9;
}

.btn-primary {
  display: inline-block;
  background-color: var(--color-primary-gold);
  color: var(--color-primary-navy);
  padding: 16px 36px;
  font-size: 1.1rem;
  font-weight: 700;
  text-transform: uppercase;
  border-radius: 4px;
  transition: all 0.3s ease;
}

.btn-primary:hover {
  background-color: var(--color-white);
  color: var(--color-primary-navy);
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

/* --------------------------------------------------------------------------
   MAGAZINE GRID / BLOG SECTION
-------------------------------------------------------------------------- */
.home-blog-section {
  padding: 100px 0;
  background-color: var(--color-white);
}

.section-header {
  margin-bottom: 60px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}

.section-title {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--color-primary-navy);
  position: relative;
  display: inline-block;
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 0;
  width: 60px;
  height: 4px;
  background-color: var(--color-primary-gold);
}

.view-all-link {
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.9rem;
  letter-spacing: 1px;
  color: var(--color-primary-navy);
  border-bottom: 2px solid transparent;
}

.view-all-link:hover {
  border-bottom-color: var(--color-primary-gold);
}

.magazine-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 30px;
}

/* Featured Post (Spans 8 columns) */
.post-card.featured {
  grid-column: span 8;
  grid-row: span 2;
  display: flex;
  flex-direction: column;
}

.post-card.featured .post-image {
  height: 100%;
  min-height: 450px;
}

.post-card.featured .post-title {
  font-size: 2rem;
  margin-bottom: 16px;
}

/* Secondary Posts (Span 4 columns) */
.post-card.secondary {
  grid-column: span 4;
}

.post-card.secondary .post-image {
  height: 220px;
}

.post-card {
  background: var(--color-white);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.post-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.post-image {
  width: 100%;
  background-color: #eee;
  overflow: hidden;
}

.post-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.post-card:hover .post-image img {
  transform: scale(1.05);
}

.post-content {
  padding: 24px;
}

.post-meta {
  font-size: 0.85rem;
  color: var(--color-text-light);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 12px;
  font-weight: 600;
  display: flex;
  gap: 15px;
}

.post-meta .category {
  color: var(--color-primary-gold);
}

.post-title {
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 12px;
}

.post-title a {
  color: var(--color-primary-navy);
}

.post-title a:hover {
  color: var(--color-primary-gold);
}

.post-excerpt {
  color: var(--color-text-light);
  font-size: 1rem;
  margin-bottom: 20px;
}

.read-more {
  display: inline-flex;
  align-items: center;
  font-size: 0.9rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--color-primary-navy);
}

.read-more::after {
  content: '→';
  margin-left: 8px;
  font-size: 1.2em;
  transition: transform 0.3s ease;
}

.read-more:hover::after {
  transform: translateX(5px);
}

/* --------------------------------------------------------------------------
   FOOTER
-------------------------------------------------------------------------- */
.site-footer {
  background-color: var(--color-primary-navy);
  color: var(--color-white);
  padding: 60px 0 30px;
}

.footer-centered-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  margin-bottom: 50px;
}

.footer-logo {
  margin-bottom: 30px;
}

.footer-logo img {
  height: 60px;
  width: auto;
  opacity: 0.9;
}

.footer-nav {
  margin-bottom: 30px;
  width: 100%;
}

.footer-nav ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 30px;
}

.footer-nav a {
  color: var(--color-white);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.85rem;
  letter-spacing: 1px;
  opacity: 0.8;
  transition: all 0.3s ease;
}

.footer-nav a:hover {
  color: var(--color-primary-gold);
  opacity: 1;
}

.site-footer .footer-socials {
  display: flex;
  justify-content: center;
  gap: 15px;
}

.site-footer .footer-socials a {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: 44px;
  height: 44px;
  background-color: rgba(255, 255, 255, 0.05);
  border-radius: 50%;
  color: var(--color-white);
  transition: all 0.3s ease;
}

.site-footer .footer-socials a:hover {
  background-color: var(--color-primary-gold);
  color: var(--color-primary-navy);
  transform: translateY(-3px);
}

.site-info {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 30px;
  text-align: center;
  font-size: 0.9rem;
  opacity: 0.7;
}

.site-info a {
  color: var(--color-primary-gold);
  font-weight: 600;
}

/* --------------------------------------------------------------------------
   SINGLE POST TEMPLATE
-------------------------------------------------------------------------- */
.single-post-layout {
  padding-top: 74px;
  /* Offset for fixed dark header */
}

.single-post-hero {
  position: relative;
  width: 100%;
  max-height: 500px;
  overflow: hidden;
}

.single-post-hero img {
  width: 100%;
  height: 500px;
  object-fit: cover;
  display: block;
}

.single-post-header {
  padding: 50px 0 30px;
  border-bottom: 1px solid #e5e5e5;
  margin-bottom: 40px;
  max-width: 800px;
  /* Readable width for titles */
}

.single-post-title {
  font-size: 2.8rem;
  font-weight: 800;
  line-height: 1.15;
  color: var(--color-primary-navy);
  margin-bottom: 16px;
  letter-spacing: -0.5px;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.single-post-meta {
  font-size: 1rem;
  color: var(--color-text-light);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.single-post-meta time {
  color: var(--color-text-light);
}

.single-post-meta .meta-separator {
  color: var(--color-text-light);
}

.single-post-meta .post-author {
  font-weight: 700;
  color: var(--color-primary-navy);
}

/* Post Content */
.single-post-content {
  padding-bottom: 50px;
  font-size: 1.1rem;
  line-height: 1.8;
  color: var(--color-text-dark);
  max-width: 800px;
  /* Optimal reading width */
}

.single-post-content p {
  margin-bottom: 1.5em;
}

.single-post-content h2,
.single-post-content h3,
.single-post-content h4 {
  color: var(--color-primary-navy);
  margin-top: 2em;
  margin-bottom: 0.75em;
  font-weight: 700;
}

.single-post-content h2 {
  font-size: 2rem;
}

.single-post-content h3 {
  font-size: 1.5rem;
}

.single-post-content h4 {
  font-size: 1.25rem;
}

.single-post-content img {
  border-radius: 6px;
  margin: 2em 0;
  max-width: 100%;
  height: auto;
}

.single-post-content blockquote {
  border-left: 4px solid var(--color-primary-gold);
  padding: 16px 24px;
  margin: 2em 0;
  background: var(--color-bg-light);
  font-style: italic;
  color: var(--color-text-light);
}

.single-post-content ul,
.single-post-content ol {
  margin: 1em 0 1.5em 2em;
}

.single-post-content li {
  margin-bottom: 0.5em;
}

/* Gutenberg wide/full images */
.single-post-content .alignwide {
  max-width: 100vw;
  margin-left: calc(-50vw + 50%);
  margin-right: calc(-50vw + 50%);
}

.single-post-content .alignfull {
  max-width: 100vw;
  width: 100vw;
  margin-left: calc(-50vw + 50%);
  margin-right: calc(-50vw + 50%);
}

/* Embedded content (videos, iframes) */
.single-post-content iframe,
.single-post-content video {
  max-width: 100%;
  height: auto;
}

/* Post Navigation */
.post-navigation {
  display: flex;
  justify-content: space-between;
  padding: 30px 0 60px;
  border-top: 1px solid #e5e5e5;
  gap: 20px;
}

.post-navigation a {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--color-primary-navy);
  transition: color 0.3s ease;
}

.post-navigation a:hover {
  color: var(--color-primary-gold);
}

.nav-next {
  text-align: right;
}

/* ---- Single Post: Tablet (max-width: 992px) ---- */
@media (max-width: 992px) {
  .single-post-hero img {
    height: 400px;
  }

  .single-post-title {
    font-size: 2.4rem;
  }

  .single-post-header {
    padding: 40px 0 24px;
    margin-bottom: 32px;
  }
}

/* ---- Single Post: Mobile (max-width: 768px) ---- */
@media (max-width: 768px) {
  .single-post-title {
    font-size: 2rem;
  }

  .single-post-hero img {
    height: 280px;
  }

  .single-post-header {
    padding: 30px 0 20px;
    margin-bottom: 24px;
  }

  .single-post-content {
    font-size: 1rem;
    line-height: 1.75;
  }

  .single-post-content h2 {
    font-size: 1.6rem;
  }

  .single-post-content h3 {
    font-size: 1.3rem;
  }

  .single-post-content blockquote {
    padding: 12px 16px;
    margin: 1.5em 0;
  }

  .post-navigation {
    flex-direction: column;
    padding: 24px 0 40px;
  }

  .nav-next {
    text-align: left;
  }
}

/* ---- Single Post: Small Mobile (max-width: 480px) ---- */
@media (max-width: 480px) {
  .single-post-layout {
    padding-top: 64px;
  }

  .single-post-hero img {
    height: 200px;
  }

  .single-post-title {
    font-size: 1.6rem;
    letter-spacing: 0;
  }

  .single-post-meta {
    font-size: 0.9rem;
  }

  .single-post-content {
    font-size: 0.95rem;
  }

  .single-post-content ul,
  .single-post-content ol {
    margin-left: 1.2em;
  }
}

/* ---- Single Post Layout with Sidebar ---- */
.single-post-container {
  display: flex;
  flex-wrap: wrap;
  gap: 50px;
  align-items: flex-start;
}

.single-post-main {
  flex: 1;
  min-width: 0;
  max-width: 100%;
}

.single-post-sidebar {
  width: 320px;
  flex-shrink: 0;
  padding-top: 50px;
}

/* Sidebar Widgets */
.widget {
  margin-bottom: 40px;
  background: var(--color-white);
  padding: 30px;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
}

.widget-title {
  font-size: 1.1rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--color-primary-navy);
  margin-bottom: 24px;
  position: relative;
  padding-bottom: 12px;
}

.widget-title::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 40px;
  height: 3px;
  background-color: var(--color-primary-gold);
}

/* Bio Widget */
.bio-widget-content {
  text-align: center;
}

.bio-image {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto 16px;
  border: 3px solid var(--color-primary-gold);
  padding: 3px;
}

.bio-widget-content p {
  font-size: 0.95rem;
  color: var(--color-text-light);
  line-height: 1.6;
  margin-bottom: 16px;
}

.btn-read-more {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--color-primary-navy);
}

.btn-read-more:hover {
  color: var(--color-primary-gold);
}

/* Recent Posts Widget */
.widget_recent_entries ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.widget_recent_entries li {
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid #f0f0f0;
}

.widget_recent_entries li:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.widget_recent_entries a {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  color: var(--color-text-dark);
}

.widget_recent_entries a:hover .recent-post-title {
  color: var(--color-primary-gold);
}

.recent-post-thumb {
  width: 60px;
  height: 60px;
  flex-shrink: 0;
  border-radius: 4px;
  overflow: hidden;
}

.recent-post-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.recent-post-info {
  display: flex;
  flex-direction: column;
}

.recent-post-title {
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 4px;
  transition: color 0.3s ease;
}

.recent-post-date {
  font-size: 0.8rem;
  color: var(--color-text-light);
  text-transform: uppercase;
}

/* Categories Widget */
.widget_categories ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.widget_categories li {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px dashed #eaeaea;
}

.widget_categories li:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.widget_categories a {
  font-weight: 600;
  color: var(--color-text-dark);
}

.widget_categories a:hover {
  color: var(--color-primary-gold);
}

/* Newsletter Widget */
.widget_newsletter p {
  font-size: 0.95rem;
  color: var(--color-text-light);
  margin-bottom: 16px;
}

.newsletter-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.newsletter-form input[type="email"] {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-family: var(--font-primary);
  font-size: 0.95rem;
}

.newsletter-form input[type="email"]:focus {
  outline: none;
  border-color: var(--color-primary-gold);
}

.btn-subscribe {
  background-color: var(--color-primary-navy);
  color: var(--color-white);
  border: none;
  padding: 12px;
  border-radius: 4px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.btn-subscribe:hover {
  background-color: var(--color-primary-gold);
}

/* Social Media Widget */
.sidebar-socials {
  display: flex;
  gap: 12px;
}

.sidebar-socials a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background-color: var(--color-bg-light);
  color: var(--color-primary-navy);
  border-radius: 50%;
  transition: all 0.3s ease;
}

.sidebar-socials a:hover {
  background-color: var(--color-primary-gold);
  color: var(--color-white);
  transform: translateY(-2px);
}

/* --------------------------------------------------------------------------
   RESPONSIVE DESIGN & MOBILE MENU (Tablets & Mobile)
-------------------------------------------------------------------------- */

/* Custom Basketball Toggle Container */
.menu-toggle {
  display: block;
  position: relative;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 5px;
  z-index: 999;
  outline: none;
}

.basketball-icon-wrapper {
  position: relative;
  width: 40px;
  height: 40px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.basketball-svg {
  width: 100%;
  height: 100%;
  transition: transform 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55), opacity 0.3s ease;
}

/* Close "X" Bars (Hidden Initially) */
.close-bar {
  position: absolute;
  width: 25px;
  height: 4px;
  background-color: var(--color-primary-gold);
  border-radius: 2px;
  opacity: 0;
  transition: transform 0.4s ease, opacity 0.4s ease;
}

.close-bar.top {
  transform: rotate(0deg) scale(0);
}

.close-bar.bottom {
  transform: rotate(0deg) scale(0);
}

/* ---- IS-ACTIVE ANIMATION STATE ---- */

/* Spin and shrink the basketball when clicked */
.menu-toggle.is-active .basketball-svg {
  transform: rotate(360deg) scale(0);
  opacity: 0;
}

/* Fade in and cross the 'X' bars */
.menu-toggle.is-active .close-bar {
  opacity: 1;
}

.menu-toggle.is-active .close-bar.top {
  transform: rotate(45deg) scale(1);
}

.menu-toggle.is-active .close-bar.bottom {
  transform: rotate(-45deg) scale(1);
}

@media (max-width: 992px) {
  .hero-content h1 {
    font-size: 3.5rem;
  }

  .magazine-grid {
    grid-template-columns: 1fr;
  }

  .post-card.featured,
  .post-card.secondary {
    grid-column: 1 / -1;
  }

  .post-card.featured .post-image,
  .post-card.secondary .post-image {
    height: 350px;
  }

  .footer-content {
    grid-template-columns: 1fr;
  }

  /* Mobile Sidebar styling */
  .single-post-container {
    gap: 40px;
  }

  .single-post-sidebar {
    width: 100%;
    padding-top: 10px;
  }
}

@media (max-width: 768px) {

  /* Hero & Content Adjustments for Mobile */
  .hero-section {
    min-height: 500px;
    height: 75vh;
  }

  .hero-content {
    padding: 0;
  }

  .hero-content h1 {
    font-size: 2.8rem;
    letter-spacing: -0.5px;
  }

  .hero-content p {
    font-size: 1.1rem;
  }
}
/* --------------------------------------------------------------------------
   RELATED POSTS (SINGLE POST)
-------------------------------------------------------------------------- */
.related-posts {
  margin-top: 50px;
  padding-top: 40px;
  border-top: 1px solid #e5e5e5;
}

.related-title {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--color-primary-navy);
  margin-bottom: 25px;
  text-transform: uppercase;
  letter-spacing: 1px;
}


.related-magazine-grid {
  gap: 20px;
}
.related-magazine-grid .post-card.secondary .post-image {
  height: 180px;
}
.related-magazine-grid .post-card.secondary .post-content {
  padding: 16px;
}
.related-magazine-grid .post-title {
  font-size: 1.15rem;
  margin-bottom: 8px;
}
.related-magazine-grid .post-excerpt {
  font-size: 0.9rem;
  margin-bottom: 12px;
}
.related-magazine-grid .read-more {
  font-size: 0.8rem;
}

/* Override magazine block for 3-column layout */
.related-magazine-grid .post-card.secondary {
  grid-column: span 4;
}

@media (max-width: 992px) {
  .related-magazine-grid .post-card.secondary {
    grid-column: span 6;
  }
}
@media (max-width: 768px) {
  .related-magazine-grid .post-card.secondary {
    grid-column: 1 / -1;
  }
}

/* --------------------------------------------------------------------------
   ARCHIVE PAGES
-------------------------------------------------------------------------- */
.archive-header-section {
  border-bottom: 5px solid var(--color-primary-gold);
}

.archive-card {
  grid-column: span 4;
}

/* Pagination styles */
.archive-pagination-wrapper .nav-links {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.archive-pagination-wrapper .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 15px;
  background-color: var(--color-bg-light);
  color: var(--color-primary-navy);
  font-weight: 700;
  border-radius: 4px;
  text-decoration: none;
  transition: all 0.3s ease;
}

.archive-pagination-wrapper .page-numbers.current,
.archive-pagination-wrapper .page-numbers:hover {
  background-color: var(--color-primary-gold);
  color: var(--color-primary-navy);
}

@media (max-width: 992px) {
  .archive-card {
    grid-column: span 6;
  }
}

@media (max-width: 768px) {
  .archive-card {
    grid-column: 1 / -1;
  }
}

/* --------------------------------------------------------------------------
   AJAX LOAD MORE
-------------------------------------------------------------------------- */
.load-more-container {
  text-align: center;
  margin-top: 50px;
  grid-column: 1 / -1;
}

#load-more-posts-btn {
  display: inline-block;
  padding: 15px 40px;
  font-size: 1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  background-color: var(--color-primary-navy);
  color: var(--color-white);
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.3s ease;
}

#load-more-posts-btn:hover {
  background-color: var(--color-primary-gold);
  color: var(--color-primary-navy);
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

#load-more-posts-btn.loading {
  cursor: wait;
  opacity: 0.7;
  pointer-events: none;
}

/* Animation for newly loaded posts */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.ajax-loaded {
  opacity: 0; /* Starts hidden, animation makes it visible */
}

/* --------------------------------------------------------------------------
   STATIC PAGES & GUTENBERG BLOCKS
-------------------------------------------------------------------------- */
.page-layout {
  background-color: var(--color-bg-light);
  padding-bottom: 60px;
}

.page-header-spacer {
  height: 74px; /* Height of the absolute header */
  background-color: var(--color-primary-navy);
}

.page-hero {
  position: relative;
  width: 100%;
  max-height: 400px;
  overflow: hidden;
  margin-top: 74px; /* Offset for fixed dark header */
}

.page-hero img {
  width: 100%;
  height: 400px;
  object-fit: cover;
  display: block;
}

.page-container {
  max-width: 900px;
  margin: 0 auto;
  background-color: var(--color-white);
  padding: 50px 60px;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.04);
  margin-top: -60px; /* Overlap the hero or spacer slightly */
  position: relative;
  z-index: 10;
}

.page-header-spacer + .page-container {
  margin-top: 40px; /* Don't overlap if there's no hero image */
}

.page-title {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--color-primary-navy);
  margin-bottom: 30px;
  text-align: center;
  position: relative;
  padding-bottom: 20px;
}

.page-title::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 4px;
  background-color: var(--color-primary-gold);
}

.page-content {
  font-size: 1.1rem;
  line-height: 1.8;
  color: var(--color-text-dark);
}

/* Gutenberg Block Styling Improvements */
.page-content p {
  margin-bottom: 1.5em;
}

.page-content h2 {
  font-size: 2rem;
  color: var(--color-primary-navy);
  margin: 2em 0 1em;
  font-weight: 700;
}

.page-content h3 {
  font-size: 1.5rem;
  color: var(--color-primary-navy);
  margin: 1.5em 0 1em;
}

.page-content ul, 
.page-content ol {
  margin-bottom: 1.5em;
  padding-left: 20px;
}

.page-content li {
  margin-bottom: 10px;
}

/* Images & Galleries */
.page-content .wp-block-image img,
.page-content .wp-block-gallery img {
  border-radius: 8px;
}

.page-content .wp-block-image figcaption {
  text-align: center;
  font-size: 0.9rem;
  color: var(--color-text-light);
  margin-top: 10px;
}

/* Quotes */
.page-content .wp-block-quote {
  border-left: 4px solid var(--color-primary-gold);
  padding: 20px 30px;
  margin: 2em 0;
  background-color: var(--color-bg-light);
  border-radius: 0 8px 8px 0;
}

.page-content .wp-block-quote p {
  font-size: 1.25rem;
  font-style: italic;
  color: var(--color-primary-navy);
  margin-bottom: 10px;
}

.page-content .wp-block-quote cite {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--color-text-light);
}

/* Buttons */
.page-content .wp-block-button__link {
  background-color: var(--color-primary-gold);
  color: var(--color-primary-navy);
  font-weight: 700;
  border-radius: 4px;
  padding: 12px 24px;
  text-transform: uppercase;
  letter-spacing: 1px;
  transition: all 0.3s ease;
}

.page-content .wp-block-button__link:hover {
  background-color: var(--color-primary-navy);
  color: var(--color-white);
  transform: translateY(-2px);
}

/* Cover Blocks */
.page-content .wp-block-cover {
  margin: 3em 0;
  border-radius: 8px;
  overflow: hidden;
}

@media (max-width: 768px) {
  .page-container {
    padding: 30px 20px;
    margin-top: 20px;
  }
  .page-title {
    font-size: 2rem;
  }
}

/* --------------------------------------------------------------------------
   404 & SEARCH PAGES
-------------------------------------------------------------------------- */
.error-404-hero {
  min-height: 70vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--color-bg-light);
  text-align: center;
  padding: 100px 20px;
}

.error-title {
  font-size: 8rem;
  font-weight: 800;
  color: var(--color-primary-navy);
  margin-bottom: 0px;
  line-height: 1;
}

.error-subtitle {
  font-size: 2rem;
  color: var(--color-primary-gold);
  margin-bottom: 20px;
}

.error-text {
  font-size: 1.2rem;
  color: var(--color-text-light);
  margin-bottom: 40px;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.error-search-form {
  max-width: 550px;
  margin: 0 auto 50px;
  position: relative;
}

.error-search-form form {
  display: flex;
  background-color: var(--color-white);
  border-radius: 50px;
  padding: 6px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
  transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.error-search-form form:focus-within {
  box-shadow: 0 15px 40px rgba(0, 50, 98, 0.15);
  transform: translateY(-2px);
}

.error-search-form input[type='search'],
.error-search-form input[type='text'] {
  flex: 1;
  padding: 15px 25px;
  border: none;
  background: transparent;
  font-family: var(--font-primary);
  font-size: 1.1rem;
  color: var(--color-text-dark);
}

.error-search-form input[type='search']:focus,
.error-search-form input[type='text']:focus {
  outline: none;
}

.error-search-form input[type='search']::placeholder,
.error-search-form input[type='text']::placeholder {
  color: #aaa;
}

.error-search-form button,
.error-search-form input[type='submit'] {
  background-color: var(--color-primary-gold);
  color: var(--color-primary-navy);
  border: none;
  padding: 0 35px;
  border-radius: 40px;
  font-weight: 700;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.error-search-form button:hover,
.error-search-form input[type='submit']:hover {
  background-color: var(--color-primary-navy);
  color: var(--color-white);
  box-shadow: 0 4px 15px rgba(0, 50, 98, 0.2);
}

.search-header {
  background-color: var(--color-primary-navy);
  padding: 60px 0;
  text-align: center;
}

.search-header .archive-title {
  color: var(--color-white);
  font-size: 2.5rem;
  margin: 0;
}

.search-header .archive-title span {
  color: var(--color-primary-gold);
}

.search-no-results {
  text-align: center;
  padding: 60px 0;
  max-width: 600px;
  margin: 0 auto;
}

.search-no-results .page-title {
  font-size: 2rem;
  color: var(--color-primary-navy);
  margin-bottom: 20px;
}
