/* ==========================================================================
   RESPONSIVE QUERIES
   ========================================================================== */

/* ---- Large tablets / small laptops ---- */
@media (max-width: 1200px) {
  .article.detail {
    padding: 40px;
  }
  .sidebar {
    min-width: 300px !important;
  }
  .subhead a {
    font-size: 12px;
    padding: 0 1vw;
  }
}

/* ---- Hide quote box ---- */
@media (max-width: 1100px) {
  .quoteBox {
    display: none;
  }
}

/* ---- Tablets: article sidebar, sitemap, nav wrapping ---- */
@media (max-width: 950px) {
  .article-layout {
    flex-direction: column;
  }
  .article.detail {
    width: 100%;
    box-sizing: border-box;
  }
  .sidebar-column {
    width: 100%;
    min-width: 0 !important;
    position: static;
    box-sizing: border-box;
  }
  .sidebar,
  .sidebar-art-box {
    width: 100%;
    min-width: 0 !important;
    box-sizing: border-box;
  }
  .subhead {
    white-space: normal;
    flex-wrap: wrap;
    overflow: visible;
    gap: 4px;
  }
  .sitemap-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }
  .sitemap-col h3,
  .sitemap-col ul {
    text-align: center;
  }
  .sitemap-link:hover {
    transform: none;
  }
}

/* ---- Mobile: primary layout changes ---- */
@media (max-width: 768px) {

  /* --- Header --- */
  header {
    font-size: 52px;
    line-height: 56px;
    margin-bottom: 10px;
  }

  .subhead {
    padding: 8px 12px;
    gap: 2px;
  }

  .subhead a {
    font-size: 11px;
    padding: 4px 8px;
  }

  /* Hide the date in the nav on mobile — saves space */
  .subhead b {
    display: none;
  }

  /* --- Category header --- */
  .category-header {
    padding: 24px 16px 20px;
  }

  .category-header-title {
    font-size: 40px;
  }

  .category-description {
    font-size: 15px;
  }

  /* --- Hero section --- */
  .magazine-layout {
    padding: 20px 16px;
  }

  .hero-section {
    padding: 28px 20px;
    margin-bottom: 20px;
  }

  .hero-card h2 {
    font-size: 16px;
    line-height: 1.3;
    margin: 8px 0 14px;
  }

  .hero-excerpt {
    font-size: 16px;
    line-height: 1.55;
  }

  .read-more-btn {
    width: 100%;
    text-align: center;
    box-sizing: border-box;
  }

  /* --- Newspaper columns: stack vertically --- */
  .newspaper-columns {
    flex-direction: column;
  }

  .col-primary {
    flex: none;
    width: 100%;
    padding-right: 0;
    border-right: none;
    border-bottom: 2px solid #cfccc3;
    padding-bottom: 4px;
    margin-bottom: 20px;
    box-sizing: border-box;
  }

  .col-secondary {
    flex: none;
    width: 100%;
    padding-left: 0;
    box-sizing: border-box;
  }

  /* --- Article page --- */
  .article.detail {
    padding: 24px 20px;
    font-size: 17px;
  }

  .article.detail h1 {
    font-size: 28px;
    line-height: 1.2;
  }

  .article.detail h4 {
    font-size: 17px;
  }

  .summary-text {
    max-width: 100%;
    font-size: 16px;
  }

  .summary-title {
    font-size: 17px;
  }

  /* --- Footer --- */
  .main-footer {
    margin-top: 40px;
    margin-bottom: 20px;
  }

  .footer-nav {
    white-space: normal;
    flex-wrap: wrap;
    gap: 6px 0;
    padding: 14px 16px;
    justify-content: center;
  }

  .footer-link {
    padding-left: 10px;
    padding-right: 10px;
  }

  .footer-nav b {
    width: 100%;
    text-align: center;
    padding: 6px 0 0;
  }

  /* --- Back to top button --- */
  #backToTop {
    bottom: 16px;
    right: 16px;
    padding: 8px 12px;
  }

  /* --- Pagination --- */
  .pagination-container {
    gap: 5px;
  }

  .pagination-btn {
    padding: 6px 10px;
    font-size: 10px;
  }
}

/* ---- Small phones ---- */
@media (max-width: 480px) {
  header {
    font-size: 38px;
    line-height: 42px;
  }

  .hero-card h2 {
    font-size: 16px;
  }

  .hero-excerpt {
    font-size: 15px;
  }

  .category-header-title {
    font-size: 32px;
  }

  .primary-story h3 {
    font-size: 17px;
  }

  .secondary-story h4 {
    font-size: 15px;
  }

  .article.detail {
    padding: 20px 16px;
    font-size: 16px;
  }

  .article.detail h1 {
    font-size: 23px;
  }

  .article.detail h4 {
    font-size: 15px;
  }

  .bookshop-widget {
    padding: 16px 12px 28px;
  }
}
