/**
 * Local News — listing (index) + article detail mobile-first layout.
 * Prevents horizontal whitespace; touch-friendly filters, cards, and article body.
 */

/* ── Page shell: clip stray ad iframe overflow ── */
html:has(body.page-local-news),
html:has(body.page-local-news-article) {
  overflow-x: clip;
}

body.page-local-news,
body.page-local-news-article {
  overflow-x: clip;
  max-width: 100%;
}

body.page-local-news *,
body.page-local-news-article * {
  box-sizing: border-box;
}

/* ── Listing: hero ── */
body.page-local-news .news-hero {
  padding: 2rem 0 1.5rem;
}

body.page-local-news .news-hero h1 {
  font-size: clamp(1.35rem, 4.5vw, 2rem);
  line-height: 1.25;
}

body.page-local-news .news-hero .lead-copy {
  opacity: 0.9;
  max-width: 560px;
  font-size: clamp(0.9rem, 2.8vw, 1rem);
  margin-bottom: 1rem;
}

body.page-local-news .news-search-bar {
  max-width: 100%;
  width: 100%;
}

body.page-local-news .news-search-bar .form-control {
  min-width: 0;
  flex: 1 1 auto;
  border-radius: 8px 0 0 8px;
  border-right: none;
}

body.page-local-news .news-search-bar .btn-search {
  flex-shrink: 0;
  padding: 10px 16px;
}

/* ── Listing: category chips (horizontal scroll on small screens) ── */
.news-cat-strip {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.35rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding: 0.15rem 0 0.35rem;
  margin: 0 -0.15rem;
}

.news-cat-strip::-webkit-scrollbar {
  display: none;
}

.news-cat-strip .cat-chip {
  flex: 0 0 auto;
  margin: 0;
  white-space: nowrap;
}

@media (min-width: 992px) {
  .news-cat-strip {
    flex-wrap: wrap;
    overflow-x: visible;
    margin: 0;
    padding: 0;
  }
}

/* ── Listing: hero article card ── */
body.page-local-news .hero-article-card {
  min-height: 220px;
}

body.page-local-news .hero-article-content {
  padding: 1.25rem 1rem;
}

body.page-local-news .hero-article-content h2 {
  font-size: clamp(1.05rem, 4vw, 1.5rem);
}

@media (min-width: 768px) {
  body.page-local-news .news-hero {
    padding: 3rem 0 2rem;
  }

  body.page-local-news .hero-article-card {
    min-height: 320px;
  }

  body.page-local-news .hero-article-content {
    padding: 1.75rem 2rem;
  }
}

/* ── Listing: cards & grid ── */
body.page-local-news .news-card-title {
  overflow-wrap: anywhere;
  word-break: break-word;
}

body.page-local-news .news-card-meta {
  overflow-wrap: anywhere;
}

body.page-local-news .row.g-4 > [class*="col-"] {
  min-width: 0;
}

/* ── Listing: pagination touch targets ── */
body.page-local-news .pagination {
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.25rem;
}

body.page-local-news .pagination .page-link {
  min-width: 2.5rem;
  min-height: 2.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* ── Listing: subscribe strip ── */
body.page-local-news .subscribe-strip {
  padding: 1.25rem 1rem !important;
}

body.page-local-news .subscribe-strip .subscribe-form {
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
}

body.page-local-news .subscribe-strip .form-control {
  max-width: 100% !important;
  flex: 1 1 180px;
  min-width: 0;
}

body.page-local-news .subscribe-strip .btn-subscribe {
  flex: 0 0 auto;
  white-space: nowrap;
}

/* ── Ad zones on listing ── */
.news-ad-zone {
  max-width: 100%;
  overflow: hidden;
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
}

/* ══════════════════════════════════════════
   Article detail
   ══════════════════════════════════════════ */

body.page-local-news-article .container.article-container {
  max-width: 900px;
  width: 100%;
  padding-left: max(1rem, env(safe-area-inset-left));
  padding-right: max(1rem, env(safe-area-inset-right));
  min-width: 0;
}

body.page-local-news-article .article-header h1 {
  font-size: clamp(1.35rem, 4.8vw, 2rem);
  line-height: 1.3;
  overflow-wrap: anywhere;
  word-break: break-word;
}

body.page-local-news-article .article-content {
  overflow-wrap: anywhere;
  word-break: break-word;
  min-width: 0;
}

body.page-local-news-article .article-content img,
body.page-local-news-article .article-content video,
body.page-local-news-article .article-content iframe,
body.page-local-news-article .article-content embed,
body.page-local-news-article .article-content object {
  max-width: 100% !important;
  height: auto;
}

body.page-local-news-article .article-content table {
  display: block;
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

body.page-local-news-article .article-content pre,
body.page-local-news-article .article-content code {
  max-width: 100%;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

body.page-local-news-article .article-content h2 {
  font-size: clamp(1.2rem, 4vw, 2rem);
}

body.page-local-news-article .article-content h3 {
  font-size: clamp(1.05rem, 3.2vw, 1.5rem);
}

/* Embedded feature blocks (psb-feature, pkw-feature, etc.) */
body.page-local-news-article .article-content .psb-feature,
body.page-local-news-article .article-content .pkw-feature,
body.page-local-news-article .article-content [class*="-feature"] {
  max-width: 100%;
  overflow-x: clip;
}

body.page-local-news-article .article-content .psb-pills,
body.page-local-news-article .article-content .pkw-pills {
  flex-wrap: wrap;
}

body.page-local-news-article .article-content .psb-grid,
body.page-local-news-article .article-content .pkw-grid {
  grid-template-columns: minmax(0, 1fr) !important;
}

@media (min-width: 640px) {
  body.page-local-news-article .article-content .psb-grid,
  body.page-local-news-article .article-content .pkw-grid {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)) !important;
  }
}

body.page-local-news-article .article-content .psb-figure,
body.page-local-news-article .article-content .pkw-figure,
body.page-local-news-article .article-content figure {
  max-width: 100%;
}

/* Share bar */
body.page-local-news-article .article-share-bar {
  gap: 0.5rem;
}

body.page-local-news-article .article-whatsapp-cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.5rem;
  font-size: clamp(0.82rem, 2.5vw, 0.9rem);
  line-height: 1.45;
  overflow-wrap: anywhere;
  margin: 0.75rem 0 0;
}

body.page-local-news-article .article-whatsapp-cta a {
  color: #25d366;
  font-weight: 600;
  text-decoration: none;
}

body.page-local-news-article .article-whatsapp-cta a[href*="facebook"] {
  color: #1877f2;
}

body.page-local-news-article .article-whatsapp-cta .cta-sep {
  color: #9ca3af;
}

@media (max-width: 480px) {
  body.page-local-news-article .article-whatsapp-cta .cta-sep {
    display: none;
  }

  body.page-local-news-article .article-whatsapp-cta a {
    flex: 1 1 100%;
  }
}

/* TOC — collapsible on mobile */
body.page-local-news-article .article-toc {
  margin: 1rem 0;
}

body.page-local-news-article .article-toc summary.article-toc-title {
  cursor: pointer;
  list-style: none;
  font-family: 'Playfair Display', serif;
  font-size: 1.05rem;
  color: var(--myomr-green, #14532d);
  font-weight: 600;
  padding: 0.25rem 0;
}

body.page-local-news-article .article-toc summary.article-toc-title::-webkit-details-marker {
  display: none;
}

body.page-local-news-article .article-toc summary.article-toc-title::after {
  content: ' ▾';
  font-size: 0.85em;
  opacity: 0.7;
}

body.page-local-news-article .article-toc[open] summary.article-toc-title::after {
  content: ' ▴';
}

@media (min-width: 768px) {
  body.page-local-news-article .article-toc summary.article-toc-title {
    pointer-events: none;
  }

  body.page-local-news-article .article-toc summary.article-toc-title::after {
    display: none;
  }
}

/* Related articles */
.article-related-wrap {
  margin-top: 2.5rem;
  padding: 1.25rem 1rem;
  background: #f8f9fa;
  border-radius: 8px;
  max-width: 100%;
  overflow: hidden;
}

.article-related-wrap h3 {
  color: var(--myomr-green, #14532d);
  margin-bottom: 1.25rem;
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.2rem, 3.5vw, 1.75rem);
}

.article-related-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1rem;
}

@media (min-width: 640px) {
  .article-related-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 992px) {
  .article-related-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.article-related-card {
  padding: 1rem;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
  min-width: 0;
  transition: transform 0.2s, box-shadow 0.2s;
}

.article-related-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.12);
}

.article-related-card a {
  color: inherit;
  text-decoration: none;
  display: block;
}

.article-related-card img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  border-radius: 5px;
  margin-bottom: 0.75rem;
}

.article-related-card h4 {
  color: var(--myomr-green, #14532d);
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 0.5rem;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.article-related-card .related-date {
  color: #6c757d;
  font-size: 0.85rem;
  margin: 0 0 0.5rem;
}

.article-related-card .related-summary {
  color: #555;
  font-size: 0.9rem;
  line-height: 1.5;
  margin: 0;
}

.article-related-all {
  text-align: center;
  margin-top: 1.25rem;
}

.article-related-all a {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  background: var(--myomr-green, #14532d);
  color: #fff;
  text-decoration: none;
  border-radius: 5px;
  font-weight: 600;
}

.article-related-all a:hover {
  background: #22c55e;
  color: #fff;
}

/* Community CTA block */
body.page-local-news-article .community-awareness-section {
  padding: 1.5rem 1rem !important;
  margin: 2rem 0 !important;
  max-width: 100%;
  overflow: hidden;
}

body.page-local-news-article .community-awareness-section .container {
  max-width: 100%;
  padding-left: 0;
  padding-right: 0;
  width: 100%;
}

body.page-local-news-article .community-awareness-section h2 {
  font-size: clamp(1.35rem, 4.5vw, 2.5rem) !important;
}

body.page-local-news-article .community-awareness-section h3 {
  font-size: clamp(1.05rem, 3vw, 1.5rem) !important;
}

body.page-local-news-article .community-awareness-section p,
body.page-local-news-article .community-awareness-section li {
  font-size: clamp(0.95rem, 2.8vw, 1.1rem) !important;
}

body.page-local-news-article .community-awareness-section .wa-cta-link {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: center;
  text-align: center;
  max-width: 100%;
  font-size: clamp(0.9rem, 2.8vw, 1.1rem) !important;
  padding: 0.75rem 1rem !important;
  line-height: 1.4 !important;
}

/* Language switch banners */
body.page-local-news-article .article-lang-switch {
  padding: 1rem !important;
  margin: 1.25rem 0 !important;
  text-align: center;
}

body.page-local-news-article .article-lang-switch a {
  display: inline-block;
  padding: 0.65rem 1.15rem;
  font-size: 0.95rem;
}

/* Tablet polish */
@media (min-width: 768px) and (max-width: 1023px) {
  body.page-local-news .container,
  body.page-local-news-article .container.article-container {
    padding-left: 1.25rem;
    padding-right: 1.25rem;
  }
}
