/*
Theme Name: The Branch Times
Theme URI: https://example.com/branch-times
Author: Branch Times Development
Author URI: https://example.com
Description: A clean, editorial newspaper theme for The Branch Times. Features a classic news layout with category and subcategory hierarchy, sticky header, responsive design, and article pages.
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: branch-times
Tags: news, editorial, newspaper, responsive, custom-menu
*/

/* ===================================================
   THE BRANCH TIMES — WordPress Theme Stylesheet
   =================================================== */

/* --- Reset & Base --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --color-header-bg: #eaf6fa;
  --color-nav-active: #2c3e6b;
  --color-text: #1a1a1a;
  --color-text-secondary: #444;
  --color-text-muted: #666;
  --color-border: #ccc;
  --color-border-light: #e0e0e0;
  --color-bg: #fff;
  --color-bg-alt: #f5f5f5;
  --color-link: #1a1a1a;
  --color-subscribe-bg: #2c3e6b;
  --color-subscribe-text: #fff;
  --color-placeholder: #c8c8c8;
  --font-heading: 'GFS Didot', 'Playfair Display', 'Didot', 'Times New Roman', serif;
  --font-body: 'Lato', 'Helvetica Neue', Arial, sans-serif;
  --font-masthead: 'Playfair Display', 'GFS Didot', 'Didot', serif;
  --h1-desktop: 1.875rem;
  --h1-mobile: 1.5625rem;
  --h2-desktop: 1.5625rem;
  --h2-mobile: 1rem;
  --body-size: 0.8125rem;
  --max-width: 1200px;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  font-size: var(--body-size);
  line-height: 1.6;
  color: var(--color-text);
  background: var(--color-bg);
}

a {
  color: var(--color-link);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

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

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.2;
}

h1 { font-size: var(--h1-desktop); }
h2 { font-size: var(--h2-desktop); }
h3 { font-size: 1.125rem; font-weight: 700; }
h4 { font-size: 0.9375rem; font-weight: 700; }

/* --- Image Placeholders --- */
.img-placeholder {
  background-color: var(--color-placeholder);
  width: 100%;
  display: block;
  position: relative;
}
.img-placeholder--hero { aspect-ratio: 16 / 8; }
.img-placeholder--card { aspect-ratio: 1 / 1; }
.img-placeholder--thumb { aspect-ratio: 1 / 1; }
.img-placeholder--wide { aspect-ratio: 20 / 8; }
.img-placeholder--article { aspect-ratio: 16 / 8; }

.img-placeholder-caption {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  background: rgba(0,0,0,0.6);
  color: #fff;
  font-size: 0.6875rem;
  padding: 0.375rem 0.625rem;
}

/* Post thumbnails */
.post-thumbnail {
  width: 100%;
  display: block;
}
.post-thumbnail img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
}

/* ===================================================
   HEADER
   =================================================== */
.site-header {
  background: var(--color-header-bg);
  position: relative;
  z-index: 100;
}

.site-header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1rem 1.5rem;
}

.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 0.75rem;
}

.header-search-icon {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.25rem;
  color: var(--color-text);
  padding: 0.25rem;
  display: flex;
  align-items: center;
}

.masthead {
  font-family: var(--font-masthead);
  font-size: 2.7rem;
  font-style: italic;
  font-weight: 400;
  text-align: center;
  flex: 1;
  letter-spacing: 0.02em;
}
.masthead a { text-decoration: none; color: var(--color-text); }

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

.btn-subscribe {
  background: var(--color-subscribe-bg);
  color: var(--color-subscribe-text);
  border: none;
  padding: 0.5rem 1.25rem;
  font-family: var(--font-body);
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  border-radius: 2px;
}
.btn-subscribe:hover { opacity: 0.9; }

.header-login {
  font-size: 0.8125rem;
  color: var(--color-text);
}

/* Search Toggle Wrap — inline search at icon position */
.search-toggle-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.search-bar-inline {
  display: none;
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  z-index: 300;
}
.search-toggle-wrap.search-open .header-search-icon { display: none; }
.search-toggle-wrap.search-open .search-bar-inline { display: block; }
.search-bar-inline input {
  width: 240px;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--color-border);
  font-family: var(--font-body);
  font-size: 0.8125rem;
  outline: none;
  background: #fff;
}

/* Desktop Navigation */
.main-nav {
  display: flex;
  justify-content: center;
  gap: 2.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--color-border);
}

.nav-item { position: relative; }
.nav-item > a {
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 400;
  color: var(--color-text);
  text-decoration: none;
  padding: 0.5rem 0;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}
.nav-item > a:hover { color: var(--color-nav-active); text-decoration: none; }
.nav-item > a .nav-arrow { font-size: 0.5rem; transition: transform 0.2s; }

.nav-dropdown {
  display: none;
  position: absolute;
  top: 100%; left: 0;
  background: #fff;
  border: 1px solid var(--color-border);
  min-width: 180px;
  z-index: 200;
  padding: 0.5rem 0;
}
.nav-item:hover .nav-dropdown { display: block; }
.nav-dropdown a {
  display: block;
  padding: 0.375rem 1rem;
  font-size: 0.8125rem;
  color: var(--color-text);
  white-space: nowrap;
}
.nav-dropdown a:hover { background: var(--color-bg-alt); text-decoration: none; }

.nav-item.active > a {
  color: var(--color-nav-active);
  border-bottom: 2px solid var(--color-nav-active);
}

/* Ticker bar */
.ticker-bar {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0.625rem 1.5rem;
  display: flex;
  gap: 1.5rem;
  font-size: 0.75rem;
  color: var(--color-text-muted);
  border-top: 1px solid var(--color-border);
  background-color: #fff;
}
.ticker-bar a { color: var(--color-text-muted); }
.ticker-live { color: #c0392b; font-weight: 700; }
.page-ticker { border-bottom: 1px solid var(--color-border-light); }

/* Sticky Header */
.sticky-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  background: var(--color-header-bg);
  z-index: 1000;
  transform: translateY(-100%);
  transition: transform 0.3s ease;
}
.sticky-header.visible { transform: translateY(0); }
.sticky-header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0.5rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.sticky-header .masthead { font-size: 1.5rem; }
.sticky-header .main-nav { border-top: none; padding-top: 0; gap: 1.5rem; margin-right: 2rem; }
.sticky-header .header-actions { gap: 0.75rem; flex-shrink: 0; }

/* Hamburger */
.hamburger-btn {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.25rem;
  color: var(--color-text);
  line-height: 1;
}

/* Mobile Menu Overlay */
.mobile-menu-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.4);
  z-index: 1999;
}
.mobile-menu-overlay.active { display: block; }

/* Mobile Menu Panel */
.mobile-menu {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 280px;
  max-height: 100vh;
  background: #fff;
  z-index: 2000;
  overflow-y: auto;
}
.mobile-menu.active { display: block; }

.mobile-menu-header {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--color-border-light);
}

.mobile-close-btn {
  background: none;
  border: none;
  font-size: 1.75rem;
  cursor: pointer;
  color: var(--color-text);
  padding: 0;
  line-height: 1;
}

.mobile-search {
  padding: 0.75rem 1.25rem;
  border-bottom: 1px solid var(--color-border-light);
}
.mobile-search input {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--color-border);
  font-family: var(--font-body);
  font-size: 0.875rem;
  outline: none;
}

.mobile-nav { padding: 0; }

.mobile-nav-item { border-bottom: 1px solid var(--color-border-light); }

.mobile-nav-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.875rem 1.25rem;
}

.mobile-nav-row > a {
  font-size: 1rem;
  font-weight: 400;
  color: var(--color-text);
  text-decoration: none;
}
.mobile-nav-row > a:hover { text-decoration: underline; }

.mobile-nav-toggle {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  color: var(--color-text);
  font-size: 1.25rem;
  font-weight: 300;
  line-height: 1;
}

.mobile-sub-nav {
  display: none;
  padding: 0 1.25rem 0.75rem 2rem;
}
.mobile-nav-item.open .mobile-sub-nav { display: block; }

.mobile-sub-nav a {
  display: block;
  padding: 0.4rem 0;
  font-size: 0.875rem;
  color: var(--color-text-secondary);
  text-decoration: none;
}
.mobile-sub-nav a:hover { color: var(--color-text); }

/* ===================================================
   CONTENT
   =================================================== */
.site-content {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* --- Hero Section --- */
.hero-section { padding: 1.5rem 0; border-bottom: 1px solid #b7b7b7; }
.hero-headline {
  font-family: var(--font-heading);
  font-size: var(--h1-desktop);
  font-weight: 700;
  margin-bottom: 0.25rem;
  font-style: italic;
}
.hero-layout {
  display: grid;
  grid-template-columns: .5fr 2fr 1fr;
  gap: 1.5rem;
}
.hero-left h3 { font-size: 1.125rem; margin-bottom: 0.5rem; line-height: 1.3; }
.hero-left p { font-size: var(--body-size); color: var(--color-text-secondary); line-height: 1.6; margin-bottom: 0.75rem; }

.hero-sidebar { display: flex; flex-direction: column; gap: 1.25rem; padding-left: 1rem; border-left: 1px solid #ccc;}
.sidebar-card { padding-bottom: 1.25rem; border-bottom: 1px solid var(--color-border-light); }
.sidebar-card:last-child { border-bottom: none; padding-bottom: 0; }
.sidebar-card h4 { font-size: 0.9375rem; font-weight: 700; margin-bottom: 0.375rem; line-height: 1.3; }
.sidebar-card p { font-size: 0.75rem; color: var(--color-text-muted); line-height: 1.5; }
.sidebar-card-with-img { display: grid; grid-template-columns: 1fr 80px; gap: 0.75rem; }
.sidebar-card-img { width: 80px; height: 80px; background: var(--color-placeholder); }

.sidebar-card-with-img > a { display: block; width: 80px; height: 80px; flex-shrink: 0; }
.sidebar-card-with-img > a .sidebar-card-img { width: 100%; height: 100%; }

/* --- Featured Section --- */
.featured-section { padding: 1.5rem 0; border-bottom: 1px solid #b7b7b7; }
.featured-layout { display: grid; grid-template-columns: 1.5fr 1fr 1fr; gap: 1.5rem; }
.featured-main { grid-column: 1 / 3; }
.featured-main h2 { font-size: var(--h2-desktop); font-weight: 700; margin-bottom: 0.375rem; font-style: italic; }
.featured-main-content { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; margin-top: 0.75rem; }
.featured-main h3 { font-size: 1rem; margin-bottom: 0.375rem; }
.featured-main p { font-size: var(--body-size); color: var(--color-text-secondary); line-height: 1.6; }
.featured-sidebar-section { display: flex; flex-direction: column; gap: 1.25rem; padding-left: 1rem; border-left: 1px solid #ccc;}

/* --- Three Column Grid --- */
.three-col-section { padding: 1.5rem 0;  border-bottom: 1px solid #b7b7b7;  }
.three-col-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1.5rem; }
.three-col-grid.with-sidebar { grid-template-columns: 1fr 1fr 1fr 1.25fr; }
.three-col-main { grid-column: 1 / 4; display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1.5rem; }
.grid-card h3 { font-size: 1rem; font-weight: 700; margin-top: 0.625rem; margin-bottom: 0.375rem; line-height: 1.3; }
.grid-card p { font-size: var(--body-size); color: var(--color-text-secondary); line-height: 1.5; }

/* --- Bottom Section --- */
.bottom-section { padding: 1.5rem 0; border-bottom: 1px solid #b7b7b7;  }
.bottom-layout { display: grid; grid-template-columns: 1.5fr 1fr 1fr; gap: 1.5rem; }
.bottom-main { grid-column: 1 / 3; }
.bottom-main h2 { font-size: var(--h2-desktop); font-weight: 700; margin-bottom: 0.375rem; font-style: italic; }
.bottom-main-inner { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; margin-top: 0.75rem; }
.bottom-main h3 { font-size: 1rem; margin-bottom: 0.375rem; }
.bottom-main p { font-size: var(--body-size); color: var(--color-text-secondary); line-height: 1.6; }

/* --- Category Page --- */
.category-hero { padding: 1.5rem 0; border-bottom: 2px solid var(--color-text); }
.category-hero h1 { font-size: var(--h1-desktop); font-weight: 700; margin-bottom: 1rem; text-align: center; font-style: italic; }
.category-hero-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.category-hero-left h2 { font-size: 1.25rem; font-weight: 700; margin-bottom: 0.375rem; line-height: 1.3; }
.category-hero-left p { font-size: var(--body-size); color: var(--color-text-secondary); line-height: 1.6; }

/* --- Subcategory Page --- */
.breadcrumb { padding: 1rem 0; font-size: 0.75rem; color: var(--color-text-muted); }
.breadcrumb a { color: var(--color-text-muted); }
.breadcrumb a:hover { color: var(--color-text); }
.subcategory-title {
  text-align: center;
  font-size: var(--h1-desktop);
  font-weight: 700;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--color-border-light);
  margin-bottom: 1.5rem;
}
.subcategory-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; padding-bottom: 2rem; }
.subcat-card { padding-bottom: 2rem; border-bottom: 1px solid var(--color-border-light); }
.subcat-card h2 { font-size: var(--h2-desktop); font-weight: 700; margin-top: 0.75rem; margin-bottom: 0.5rem; line-height: 1.3; }
.subcat-card p { font-size: var(--body-size); color: var(--color-text-secondary); line-height: 1.6; margin-bottom: 0.5rem; }
.read-more { font-size: var(--body-size); font-weight: 700; color: var(--color-text); }

.subcat-card .post-thumbnail {
  aspect-ratio: 1 / 1;
  overflow: hidden;
}

.subcat-card .post-thumbnail img {
  width: 80%;
  height: 80%;
  object-fit: cover;
}

.subcat-card {
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--color-border-light);
  max-width: 80%;
  margin-left: auto;
  margin-right: auto;
}

.subcat-card .post-thumbnail {
  aspect-ratio: 1 / 1;
  overflow: hidden;
}

.subcat-card .post-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.subcat-card .img-placeholder {
  aspect-ratio: 1 / 1;
}

.subcat-card h2 {
  margin-top: 0.5rem;
}

/* --- Article Page --- */
.article-header { padding: 1.5rem 0 1rem; }
.article-header h1 { font-size: var(--h1-desktop); font-weight: 700; line-height: 1.25; max-width: 700px; margin: 0 auto; }
.article-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 700px;
  margin: 0.75rem auto 0;
}
.article-meta-left { font-size: 0.8125rem; color: var(--color-text-muted); }
.article-meta-left .author { font-weight: 600; color: var(--color-text); }
.article-share-icons { display: flex; gap: 0.75rem; }
.article-share-icons button {
  background: none; border: none; cursor: pointer;
  font-size: 1rem; color: var(--color-text-muted); padding: 0.25rem;
}
.article-hero-image { max-width: 700px;margin: 1.25rem auto;display:block;}
.article-hero-image img {
  display: block;
  margin: 0 auto;
  width: 80%;
  height: auto;
  object-fit: cover;
}
.article-body { max-width: 700px; margin: 0 auto; padding-bottom: 2rem; }
.article-body p { margin-bottom: 1.25rem; line-height: 1.7; font-size: var(--body-size); }
.article-bottom-share {
  display: flex; gap: 0.75rem;
  padding: 1.5rem 0;
  border-top: 1px solid var(--color-border-light);
  max-width: 700px; margin: 0 auto;
}
.article-bottom-share a { font-size: 1.25rem; color: var(--color-text); }

/* Related Articles */
.related-section {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1.5rem 1.5rem 2rem;
  border-top: 1px solid var(--color-border-light);
}
.related-section h3 { font-size: 1rem; font-weight: 700; margin-bottom: 1rem; }
.related-carousel {
  display: flex; gap: 1.25rem;
  overflow-x: auto; scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch; padding-bottom: 0.5rem;
}
.related-card { flex: 0 0 180px; scroll-snap-align: start; }
.related-card h4 { font-size: 0.75rem; font-weight: 700; margin-top: 0.5rem; line-height: 1.3; }
.related-card .post-thumbnail,
.related-card .img-placeholder { height: 100px; }
.related-carousel-nav { display: flex; justify-content: flex-end; gap: 0.5rem; margin-top: 0.75rem; }
.related-carousel-nav button {
  background: none;
  border: 1px solid var(--color-border);
  width: 2rem; height: 2rem; cursor: pointer;
  font-size: 0.875rem;
  display: flex; align-items: center; justify-content: center;
}

/* ===================================================
   FOOTER
   =================================================== */
.site-footer {
  background: var(--color-header-bg);
  padding: 2rem 1.5rem 1.25rem;
}
.footer-inner { max-width: var(--max-width); margin: 0 auto; }
.footer-top { display: flex; justify-content: space-between; align-items: flex-start; }
.footer-nav { display: grid; grid-template-columns: repeat(4, 1fr); gap: 2rem; flex: 1; }
.footer-nav-col h4 { font-family: var(--font-body); font-size: 0.875rem; font-weight: 700; margin-bottom: 0.625rem; }
.footer-nav-col a { display: block; font-size: 0.75rem; color: var(--color-text-muted); padding: 0.2rem 0; }
.footer-nav-col a:hover { color: var(--color-text); }
.footer-right { text-align: right; }
.footer-right-label { font-size: 0.75rem; color: var(--color-text-muted); margin-bottom: 0.375rem; }
.footer-right-links { display: flex; align-items: center; gap: 0.5rem; }
.footer-account { margin-bottom: 1rem; }
.footer-account a { font-size: 0.75rem; color: var(--color-text-muted); }
.footer-social a { font-size: 1.25rem; color: var(--color-text); }
.footer-bottom {
  text-align: center;
  padding-top: 1.5rem; margin-top: 1.5rem;
  border-top: 1px solid var(--color-border);
  font-size: 0.6875rem; color: var(--color-text-muted);
}

/* ===================================================
   RESPONSIVE — TABLET
   =================================================== */
@media (min-width: 601px) and (max-width: 900px)  {
  .hero-layout { grid-template-columns: 1fr 1fr; }
  .hero-sidebar { grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; gap: 1rem; border-left: none; padding-left: 0; }
  .sidebar-card { flex: 1 1 calc(50% - 0.5rem); border-bottom: none; padding-bottom: 0; }
  .featured-layout { grid-template-columns: 1fr !important; }
  .featured-main { grid-column: auto !important; }
  .featured-sidebar-section { grid-column: auto !important; flex-direction: row; flex-wrap: wrap; border-left: none; padding-left: 0; }
  .three-col-grid.with-sidebar { grid-template-columns: 1fr !important; }
  .three-col-main { grid-column: auto !important; grid-template-columns: 1fr 1fr; }
  .bottom-layout { grid-template-columns: 1fr !important; }
  .bottom-main { grid-column: auto !important; }
  .bottom-layout .featured-sidebar-section { grid-column: auto !important; border-left: none; padding-left: 0; }
  .category-hero-layout { grid-template-columns: 1fr; }
  .footer-nav { grid-template-columns: repeat(2, 1fr); }

  .sidebar-card-with-img > a {
    width: 80px;
    height: 80px;
  }

}

/* ===================================================
   RESPONSIVE — MOBILE
   =================================================== */
@media (max-width: 600px) {
  h1 { font-size: var(--h1-mobile); }
  h2 { font-size: var(--h2-mobile); }
  .site-header-inner { padding: 0.75rem 1rem; }
  .masthead { font-size: 1rem; }
  .main-nav { display: none; }
  .hamburger-btn { display: block; }
  .header-login { display: none; }
  .header-search-icon { display: none; }
  .ticker-bar { padding: 0.5rem 1rem; overflow-x: auto; white-space: nowrap; }
  .site-content { padding: 0 20px; overflow-x: hidden; }

  /* Force single column on all grids */
  .hero-layout,
  .featured-layout,
  .bottom-layout,
  .category-hero-layout {
    grid-template-columns: 1fr !important;
    gap: 1rem;
  }

  .three-col-grid.with-sidebar {
    grid-template-columns: 1fr !important;
  }

  /* Reset all column spans */
  .featured-main,
  .bottom-main,
  .three-col-main,
  .hero-sidebar,
  .featured-sidebar-section {
    grid-column: auto !important;
  }

  /* Stack inner grids */
  .featured-main-content,
  .bottom-main-inner,
  .three-col-main {
    grid-template-columns: 1fr !important;
  }

  .hero-headline { font-size: var(--h1-mobile); }

.hero-sidebar,
  .featured-sidebar-section {
    display: flex !important;
    flex-direction: column !important;
    gap: 1rem;
    width: 100%;
    border-left: none !important;
    padding-left: 0 !important;
  }

  .sidebar-card {
    flex: 1 1 100% !important;
    max-width: 100% !important;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--color-border-light);
  }

  .featured-sidebar-section {
    flex-direction: column;
    border-left: none;
    padding-left: 0;
  }

  .sidebar-card-with-img { grid-template-columns: 1fr 70px; }

  /* Subcategory */
  .subcategory-grid { grid-template-columns: 1fr; }
  .subcategory-title { font-size: var(--h1-mobile); }
  .subcat-card h2 { font-size: var(--h2-mobile); }

  /* Article */
  .article-header h1 { font-size: var(--h1-mobile); }
  .article-meta { flex-direction: column; align-items: flex-start; gap: 0.5rem; }

  /* Footer */
  .footer-top { flex-direction: column; gap: 1.5rem; }
  .footer-nav { grid-template-columns: 1fr 1fr; }
  .footer-right { text-align: left; }

  /* Sticky header mobile */
  .sticky-header .main-nav { display: none; }
  .sticky-header .hamburger-btn { display: block; }
  .sticky-header .header-login { display: block; }
  .sticky-header-inner { padding: 0.5rem 1rem; }
  .sticky-header .masthead { font-size: 1.25rem; }

  /* Full-width section dividers */
  .hero-section,
  .featured-section,
  .three-col-section,
  .bottom-section,
  .category-hero {
    margin-left: -20px;
    margin-right: -20px;
    padding-left: 20px;
    padding-right: 20px;
  }

  /* Sidebar cards - fix sizing on mobile */
  .sidebar-card-with-img {
    grid-template-columns: 1fr 70px;
    gap: 0.5rem;
  }
  .sidebar-card-with-img > a {
    width: 70px;
    height: 70px;
  }
  .sidebar-card-img {
    width: 70px;
    height: 70px;
  }

  /* Make sure all sidebar sections are visible and stacked */
  .hero-sidebar,
  .featured-sidebar-section {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 100%;
    border-left: none !important;
    padding-left: 0 !important;
  }

  .sidebar-card {
    flex: 1 1 100%;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--color-border-light);
  }

  .sidebar-card:last-child {
    border-bottom: none;
    padding-bottom: 0;
  }

  /* Remove extra space between sections */
  .hero-section,
  .featured-section,
  .three-col-section,
  .bottom-section,
  .category-hero {
    padding: 1rem 20px;
    margin-left: -20px;
    margin-right: -20px;
  }

  /* Grid card images full width */
  .grid-card {
    margin-bottom: 1rem;
  }

  /* Bottom section inner */
  .bottom-main-inner {
    gap: 1rem;
  }

}

/* ===================================================
   RESPONSIVE — SMALL MOBILE (320px+)
   =================================================== */
@media (max-width: 480px) {
  body {
    overflow-x: hidden;
  }

  .site-content { padding: 0 20px; }

  /* Header */
  .site-header-inner {
    padding: 0.5rem 0.75rem;
  }

  .masthead {
    font-size: 1.35rem;
  }

  .btn-subscribe {
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
  }

  .ticker-bar {
    padding: 0.5rem 0.75rem;
    gap: 1rem;
    font-size: 0.6875rem;
  }

  /* Hero */
  .hero-headline {
    font-size: 1.25rem;
    line-height: 1.3;
  }

  .hero-left h3 {
    font-size: 0.9375rem;
  }

  .hero-left p,
  .featured-main p,
  .bottom-main p,
  .grid-card p {
    font-size: 0.75rem;
  }

  /* Sidebar cards */
  .sidebar-card-with-img {
    grid-template-columns: 1fr 60px;
    gap: 0.5rem;
  }

  .sidebar-card-img {
    width: 60px;
    height: 60px;
  }

  .sidebar-card h4 {
    font-size: 0.8125rem;
  }

  .sidebar-card p {
    font-size: 0.6875rem;
  }

  /* Featured section */
  .featured-main h2 {
    font-size: 1.125rem;
  }

  /* Category page hero */
  .category-hero h1 {
    font-size: 1.25rem;
  }

  .category-hero-layout {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .category-hero-left h2 {
    font-size: 1rem;
  }

  /* Bottom section */
  .bottom-main h2 {
    font-size: 1.125rem;
  }

  .bottom-main h3 {
    font-size: 0.875rem;
  }

  /* Grid cards */
  .grid-card h3 {
    font-size: 0.875rem;
  }

  /* Footer */
  .site-footer {
    padding: 1.5rem 0.75rem 1rem;
  }

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

  .footer-nav-col h4 {
    font-size: 0.8125rem;
  }

  .footer-nav-col a {
    font-size: 0.6875rem;
  }

  .footer-bottom {
    font-size: 0.625rem;
  }

  /* Prevent long words from overflowing */
  .hero-headline,
  .featured-main h2,
  .bottom-main h2,
  .category-hero h1,
  .grid-card h3,
  .sidebar-card h4,
  .subcat-card h2 {
    overflow-wrap: break-word;
    word-break: break-word;
    hyphens: auto;
  }
}

@media (max-width: 360px) {
  .masthead {
    font-size: 1.15rem;
  }

  .hero-headline {
    font-size: 1.125rem;
  }

  .btn-subscribe {
    padding: 0.3rem 0.5rem;
    font-size: 0.6875rem;
  }

  .header-top {
    gap: 0.375rem;
  }


  .footer-nav {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }
}


.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}
