/*
Theme Name: Jaffna Report
Description: News theme with a front page like a newspaper, custom ad spaces you manage yourself, and podcasts.
Author: Jaffna Report
Version: 1.1.0
Requires at least: 6.0
Requires PHP: 7.4
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: jaffnareport
*/

:root {
  --bg: #f4f4f8;
  --ink: #17171b;
  --muted: #6c6c77;
  --rule: #b3b3bc;
  --rule-strong: #3a3a42;
  --chip-border: #6f6f7a;
  --radius: 6px;
  --wrap: 1280px;
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
}

body {
  font-family: "Schibsted Grotesk", "Noto Sans Tamil", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.5;
}

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

a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

h1, h2, h3 { font-weight: 500; margin: 0; }
ul { list-style: none; margin: 0; padding: 0; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 16px; }
main.wrap { padding-bottom: 2.5rem; }

.meta { font-size: 11px; color: var(--muted); }

.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; width: 1px; white-space: nowrap;
}
.skip-link:focus {
  clip: auto; clip-path: none; height: auto; width: auto; margin: 0;
  background: #fff; padding: 8px 12px; z-index: 100000; left: 8px; top: 8px;
}

/* spacing helpers */
.mt-3 { margin-top: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }
.my-4 { margin-top: 1.5rem; margin-bottom: 1.5rem; }
.my-5 { margin-top: 3rem; margin-bottom: 3rem; }

/* layout helpers */
.grid { display: grid; gap: 24px; }
.grid > * { min-width: 0; }
.cols-3, .cols-4 { grid-template-columns: 1fr; }
.stack { display: flex; flex-direction: column; gap: 24px; }
.stack > * { min-width: 0; }
@media (min-width: 576px) {
  .cols-3, .cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 992px) {
  .cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .split-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.with-sidebar { display: grid; gap: 40px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 992px) {
  .with-sidebar { grid-template-columns: minmax(0, 1fr) 300px; }
}
.sidebar .ad-slot { margin-bottom: 8px; }

/* ---------- masthead ---------- */
.masthead { padding-top: 14px; }
.topbar {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 11px; padding: 7px 0;
  border-top: 1px solid var(--rule-strong);
  border-bottom: 1px solid var(--rule);
}
.topbar-right { display: flex; align-items: center; gap: 16px; }

.search-form { display: inline-flex; align-items: center; }
.search-form input[type="search"] {
  width: 110px; font: inherit; font-size: 11px; padding: 2px 6px;
  border: 1px solid var(--rule); border-radius: 4px; background: #fff;
}
.search-form button {
  background: none; border: 0; cursor: pointer; font-size: 15px; line-height: 1; padding: 0 0 0 4px;
}

.logo-wrap { padding: 14px 0 12px; text-align: center; }
.logo-link, .custom-logo-link { display: inline-block; line-height: 0; text-decoration: none !important; }
.logo-img, .custom-logo { display: block; margin: 0 auto; height: 90px; width: auto; max-width: 100%; }
.footer-logo .logo-img, .footer-logo .custom-logo { height: 36px; margin: 0; }

.mainnav {
  padding: 10px 0; font-size: 12px; white-space: nowrap; overflow-x: auto;
  border-top: 1px solid var(--rule-strong);
  border-bottom: 1px solid var(--rule-strong);
}
.mainnav .menu { display: flex; justify-content: center; gap: 28px; }
@media (max-width: 767px) {
  .mainnav .menu { justify-content: flex-start; gap: 20px; }
}

/* ---------- category strip ---------- */
.cat-strip {
  display: grid; gap: 16px; grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 28px 0 14px;
}
@media (min-width: 992px) { .cat-strip { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.strip-item { display: flex; gap: 8px; align-items: center; text-decoration: none !important; min-width: 0; }
.strip-thumb {
  position: relative; flex: none; width: 36px; height: 36px;
  border-radius: 4px; overflow: hidden; background: #dcdce3;
}
.strip-thumb img, .strip-thumb .cover-empty {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
}
.strip-text { display: flex; flex-direction: column; min-width: 0; }
.strip-cat { font-size: 9px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; }
.strip-title {
  font-size: 9.5px; color: var(--muted);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

/* ---------- covers ---------- */
.cover { display: block; position: relative; overflow: hidden; border-radius: var(--radius); background: #dcdce3; }
.cover img, .cover-empty {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
}
.ratio-hero { aspect-ratio: 16 / 7.5; }
.ratio-overlay { aspect-ratio: 4 / 4.4; }
.ratio-row { aspect-ratio: 4 / 3; width: 46%; flex: none; }
.ratio-grid { aspect-ratio: 4 / 3; }
.ratio-podcast { aspect-ratio: 3 / 4; width: 92px; flex: none; }

/* ---------- hero ---------- */
.card-hero { margin-bottom: 20px; }
.hero-meta {
  margin: 14px 0 8px; display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 8px;
}
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.03em;
  border: 1px solid var(--chip-border); border-radius: 4px; padding: 2px 7px;
  text-decoration: none !important;
}
.hero-row { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.hero-title { font-size: clamp(1.3rem, 3vw, 1.75rem); line-height: 1.25; max-width: 44rem; }
.read-link { font-size: 12px; white-space: nowrap; }
.empty-note { margin: 40px 0; }

/* ---------- sections ---------- */
.home-section { margin-top: 44px; }
.section-head {
  display: flex; justify-content: space-between; align-items: flex-end;
  margin-bottom: 18px; padding-bottom: 6px; border-bottom: 1px solid var(--rule);
}
.section-head h2 { font-size: 1.05rem; letter-spacing: 0.02em; text-transform: uppercase; }
.view-all { font-size: 11px; }

/* ---------- cards ---------- */
.card-overlay .overlay-text {
  position: absolute; inset: auto 0 0 0; padding: 36px 16px 14px; color: #fff;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0));
  display: block;
}
.card-overlay .overlay-title {
  display: block; font-size: 1rem; margin-bottom: 4px;
  text-decoration: underline; text-underline-offset: 4px;
}
.card-overlay .meta { display: block; color: rgba(255, 255, 255, 0.8); }

.card-row { display: flex; gap: 16px; align-items: stretch; }
.row-text { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 8px; min-width: 0; }
.row-text h3, .card-grid h3 { font-size: 0.9rem; line-height: 1.35; }

.card-grid .meta { display: block; margin: 8px 0 4px; }

.card-podcast { display: flex; gap: 14px; }
.podcast-body { flex: 1; min-width: 0; }
.podcast-body h3 { font-size: 0.85rem; line-height: 1.3; margin-bottom: 6px; }
.podcast-body p { font-size: 11px; color: var(--muted); margin: 0 0 8px; }
.podcast-audio { width: 100%; margin-top: 8px; }

/* ---------- ads ---------- */
.ad-slot { text-align: center; }
.ad-label {
  display: block; margin-bottom: 4px; font-size: 10px; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--muted);
}
.ad-frame { position: relative; width: 100%; margin: 0 auto; overflow: hidden; border-radius: 4px; }
.ad-frame a, .ad-frame img { display: block; width: 100%; height: 100%; }
.ad-frame img { object-fit: cover; }
.ad-placeholder {
  display: flex; align-items: center; justify-content: center; width: 100%; height: 100%;
  border: 1.5px dashed var(--rule); border-radius: 4px; font-size: 12px; color: var(--muted);
  text-decoration: none !important;
}
.ad-placeholder:hover { background: rgba(0, 0, 0, 0.03); }

/* ---------- article and pages ---------- */
.article-page, .page-main, .not-found, .listing { margin-top: 28px; }
.page-main { max-width: 780px; }
.article-title { font-size: clamp(1.7rem, 4vw, 2.6rem); line-height: 1.2; font-weight: 600; margin: 12px 0; }
.article-excerpt { font-size: 1.15rem; color: #3c3c46; }
.prose { font-size: 1.05rem; line-height: 1.8; }
.prose h2 { font-size: 1.4rem; font-weight: 600; margin: 2rem 0 0.75rem; }
.prose h3 { font-size: 1.15rem; font-weight: 600; margin: 1.5rem 0 0.5rem; }
.prose p { margin: 0 0 1.1rem; }
.prose a { text-decoration: underline; text-underline-offset: 3px; }
.prose img { border-radius: var(--radius); }
.prose blockquote { border-left: 3px solid var(--rule-strong); margin: 1.5rem 0; padding-left: 1rem; color: #3c3c46; }
.prose ul, .prose ol { margin: 0 0 1.1rem 1.4rem; }
.prose ul { list-style: disc; }
.prose table { width: 100%; border-collapse: collapse; font-size: 14px; margin-bottom: 1.2rem; }
.prose th, .prose td { border-bottom: 1px solid var(--rule); padding: 6px 8px; text-align: left; }
.alignleft { float: left; margin: 0 1rem 1rem 0; }
.alignright { float: right; margin: 0 0 1rem 1rem; }
.aligncenter { display: block; margin: 0 auto 1rem; }
.wp-caption, figure { max-width: 100%; }
.wp-caption-text, figcaption { font-size: 12px; color: var(--muted); }
.more-stories { margin-top: 36px; }
.tags { margin-top: 24px; }

/* ---------- pagination ---------- */
.pagination { margin-top: 32px; padding-top: 12px; border-top: 1px solid var(--rule); font-size: 13px; }
.pagination .nav-links { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.pagination .current { font-weight: 600; }

/* ---------- footer ---------- */
.site-footer { padding-bottom: 28px; }
.footer-rule { border-top: 2px solid var(--rule-strong); margin-bottom: 10px; }
.footer-row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; padding: 4px 0; }
.footer-links .menu { display: flex; gap: 18px; font-size: 12px; }

/* ---------- E-Magazine banner (home page) ---------- */
.emag-banner {
  display: block;
  position: relative;
  margin-top: 44px;
  border-radius: var(--radius);
  overflow: hidden;
  background: linear-gradient(135deg, #1d2a4d 0%, #3a2a5e 100%);
  color: #fff;
}
.emag-banner:hover { text-decoration: none; }
.emag-banner .emag-img {
  display: block;
  width: 100%;
  height: auto;
  transition: transform 0.4s ease;
}
.emag-banner.has-image { background: none; }
.emag-banner:hover .emag-img { transform: scale(1.01); }
.emag-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 22px 22px;
}
.emag-banner:not(.has-image) .emag-label { min-height: 120px; }
.emag-banner.has-image .emag-label {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 40px 22px 18px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.72), rgba(0, 0, 0, 0));
}
.emag-title { font-size: clamp(1.15rem, 3vw, 1.75rem); font-weight: 600; line-height: 1.2; }
.emag-go {
  font-size: 0.9rem;
  border: 1px solid rgba(255, 255, 255, 0.85);
  border-radius: 999px;
  padding: 5px 14px;
  white-space: nowrap;
}
.emag-banner:hover .emag-go { background: #fff; color: #17171b; }
@media (max-width: 575px) {
  .emag-banner { margin-top: 32px; }
  .emag-label, .emag-banner.has-image .emag-label { padding: 28px 14px 14px; }
}
