/*
 * Readability and accessibility layer shared by every public page.
 * Loaded after the page stylesheet (see layouts/site.php) so it can correct
 * values the page files set, without editing each of them:
 *  - text colours that missed WCAG AA contrast (4.5:1) on white;
 *  - on phones, a minimum readable type scale (the page files shrank the desktop
 *    layout proportionally, down to 6–9px), single-column grids and 44px touch
 *    targets for the header controls.
 */

/* ---------------------------------------------------------------- contrast */
:root { --text-muted: #5f6774; --link: #0567c9; }
.date, .breadcrumb, .page-heading p, .meta, .section-link, .recommend-meta, .brief .meta, .latest-story .meta, .mini-story .meta { color: var(--text-muted); }
.category, .article-topic, .lead-copy .category, .story-card .category, .latest-story .category, .mini-story .category,
.brief .category, .region-card .category { color: color-mix(in srgb, var(--accent, var(--blue)) 78%, #000); }
.story-card p, .lead-copy p, .recommend-copy p, .region-card p, .region-highlight-copy p, .latest-story p { color: var(--text-muted); }
.main-nav > a.active, .main-nav > a:hover { color: var(--link); }
.ad-placeholder { color: var(--text-muted); }
.recommend-image .category-pill { background: var(--link); } /* white on #0878df was 4.41:1 */
.auth-alt a, .auth-lead a, .article-source a { color: var(--link); }
.auth-field small, .article-actions-hint, .article-figure figcaption { color: var(--text-muted); }

/* Active nav links: colour plus an underline, so colour is not the only cue. */
.main-nav > a.active { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 8px; }

/* The closed off-canvas sidebar used to cast its shadow onto the page edge. */
.sidebar { box-shadow: none; }
.sidebar.open { box-shadow: 10px 0 30px #0001; }

/* Desktop nav links: taller hit area without changing the layout. */
.main-nav > a:not(.main-brand) { padding-block: 10px; }

/* ----------------------------------------------------------------- tablets */
@media (min-width: 761px) and (max-width: 1150px) {
  .icon-button { width: 44px; height: 44px; }
  .topbar-cta { min-height: 44px; }
}

/* ------------------------------------------------------------------ phones */
@media (max-width: 760px) {
  /* Header controls: 44px touch targets. */
  .icon-button { width: 44px; height: 44px; }
  .main-nav > a:not(.main-brand) { display: inline-flex; min-height: 44px; align-items: center; font-size: 14px; }
  .trending a { display: inline-flex; min-height: 36px; align-items: center; font-size: 12px; }

  /* Stack the two-column page layouts. */
  .content-layout, .business-layout, .region-content, .lead-layout { grid-template-columns: minmax(0, 1fr) !important; }
  .side-stories, .split-section .list-stories, .sidebar-cards { grid-template-columns: minmax(0, 1fr) !important; }

  /* Card grids: two columns on large phones, one on small ones (below). */
  .cards-grid, .cards-grid.two-up, .category-grid, .recommend-grid, .articles, .authors-grid,
  .region-section .cards-grid, .region-section.wide .cards-grid, .region-content .region-section .cards-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  /* Minimum type scale. */
  .breadcrumb, .section-link { font-size: 12px; }
  .page-heading p, .region-hero-copy p { font-size: 14px; line-height: 1.5; }
  .category, .story-card .category, .latest-story .category, .region-card .category, .brief .category,
  .mini-story .category, .region-highlight-image span, .region-hero-label { font-size: 11px; }
  .meta, .latest-story .meta, .recommend-meta, .brief .meta, .mini-story .meta, .article-stats { font-size: 12px; }
  .story-card h3, .latest-story h3, .region-card h3, .region-highlight-copy h3, .brief h3, .mini-story h3,
  .recommend-copy h3, .article-copy h2 { font-size: 15px; line-height: 1.35; }
  .story-card p, .lead-copy p, .region-card p, .region-highlight-copy p, .recommend-copy p, .article-copy p { font-size: 13px; line-height: 1.5; }
  .right-column .section-heading h2, .region-side .section-heading h2, .advertisement h2 { font-size: 16px; }
  .sport-pill strong, .technology-pill strong, .entertainment-pill strong, .region-pill strong,
  .market-stat-label, .market-change, .author-card strong, .ad-placeholder, .region-info p { font-size: 12px; }
  .region-pill small, .market-row small, .clock-city, .topic-tags a { font-size: 11px; }
  .market-stat-value, .market-row, .market-row strong, .clock-time { font-size: 13px; }
  .filter-button { font-size: 12px; }

  /* Footer: two readable columns. */
  footer { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 22px 16px; }
  .footer-brand p { font-size: 13px; line-height: 1.55; }
  .footer-column h2 { font-size: 14px; }
  .footer-column a { display: block; padding: 5px 0; margin-bottom: 0; font-size: 13px; }
  .copyright { font-size: 12px; }
}

@media (max-width: 480px) {
  .cards-grid, .cards-grid.two-up, .category-grid, .recommend-grid, .articles, .authors-grid,
  .region-section .cards-grid, .region-section.wide .cards-grid, .region-content .region-section .cards-grid,
  .region-content .region-highlight-list {
    grid-template-columns: minmax(0, 1fr) !important;
  }
}
