/* ==========================================================================
   Samachar Live - News Portal stylesheet
   Design: fluid, responsive, modern. Theme colors via CSS custom properties.
   ========================================================================== */

:root {
  --primary: #c62828;
  --primary-dark: #8e1c1c;
  --secondary: #1a1a2e;
  --accent: #f9a825;
  --bg: #f4f5f7;
  --surface: #ffffff;
  --text: #1f2430;
  --muted: #6b7280;
  --border: #e5e7eb;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(0, 0, 0, .08), 0 4px 16px rgba(0, 0, 0, .05);
  --shadow-lg: 0 10px 40px rgba(0, 0, 0, .12);
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-serif: Georgia, 'Times New Roman', serif;
  --container: 1280px;
  --header-bg: #ffffff;
  --nav-bg: var(--primary);
  --nav-text: #ffffff;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 16px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
button { font-family: inherit; cursor: pointer; }

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 16px;
}

/* ---------- Top bar ---------- */
.topbar {
  background: var(--secondary);
  color: rgba(255, 255, 255, .85);
  font-size: .82rem;
  padding: 7px 0;
}
.topbar .container { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.topbar-date { display: flex; align-items: center; gap: 6px; }
.topbar-social a { color: rgba(255,255,255,.75); margin-left: 12px; transition: color .2s; }
.topbar-social a:hover { color: var(--accent); }

/* ---------- Header ---------- */
.site-header { background: var(--header-bg); padding: var(--header-pad, 18px) 0; box-shadow: 0 1px 0 var(--border); }
.site-header .container { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.header-style-center .site-header .container { justify-content: center; }
.logo { display: flex; flex-direction: column; }
.logo img { max-height: 64px; width: auto; }
.logo-text { font-family: var(--font-serif); font-size: 1.9rem; font-weight: 800; color: var(--primary); line-height: 1.1; letter-spacing: -.5px; }
.logo-text span { color: var(--secondary); }
.logo-tagline { font-size: .8rem; color: var(--muted); letter-spacing: .5px; }

.header-actions { display: flex; align-items: center; gap: 14px; }
.icon-btn { background: none; border: none; color: var(--secondary); font-size: 1.15rem; padding: 8px; border-radius: 8px; transition: background .2s; }
.icon-btn:hover { background: var(--bg); }

/* ---------- Header layout: Modern ---------- */
.header-style-modern .site-header {
  position: sticky; top: 0; z-index: 1000;
  background: var(--header-bg);
  box-shadow: 0 2px 8px rgba(0,0,0,.08);
}
.header-style-modern .site-header .container { justify-content: space-between; }
.header-style-modern .modern-nav { display: flex; align-items: center; }
.header-style-modern .nav-menu > li > a { color: var(--text); }
.header-style-modern .nav-menu > li > a:hover,
.header-style-modern .nav-menu > li.active > a { background: none; color: var(--primary); }
.header-style-modern .nav-toggle { display: none; }

/* ---------- Header layout: Compact ---------- */
.header-style-compact .site-header { padding: max(6px, calc(var(--header-pad, 18px) - 8px)) 0; }
.header-style-compact .site-header .container { justify-content: space-between; }
.header-style-compact .logo img { max-height: 40px; }
.header-style-compact .logo-text { font-size: 1.45rem; }
.header-style-compact .navbar { box-shadow: 0 1px 4px rgba(0,0,0,.12); }
.header-style-compact .nav-menu > li > a { padding: 10px 12px; font-size: .86rem; }

/* ---------- Header layout: Bold ---------- */
.header-style-bold .site-header {
  background: linear-gradient(135deg, var(--secondary), var(--primary));
  color: #fff; box-shadow: 0 3px 12px rgba(0,0,0,.18);
}
.header-style-bold .site-header .container { justify-content: space-between; }
.header-style-bold .logo-text { color: #fff; }
.header-style-bold .logo-tagline { color: rgba(255,255,255,.75); }
.header-style-bold .navbar { background: none; box-shadow: none; position: static; flex: 1; }
.header-style-bold .nav-menu { justify-content: flex-start; }
.header-style-bold .nav-menu > li > a { color: rgba(255,255,255,.92); }
.header-style-bold .nav-menu > li > a:hover,
.header-style-bold .nav-menu > li.active > a { background: rgba(0,0,0,.18); }
.header-style-bold .header-actions { margin-left: auto; }
.header-style-bold .nav-search { margin-left: 0; }
.header-style-bold .nav-search input { background: rgba(0,0,0,.2); color: #fff; }
.header-style-bold .nav-search input:focus { width: 170px; padding: 7px 14px; }
.header-style-bold .nav-search input::placeholder { color: rgba(255,255,255,.75); }
.header-style-bold .nav-search button { color: #fff; }
.header-style-bold .icon-btn { color: #fff; }
.header-style-bold .icon-btn:hover { background: rgba(0,0,0,.18); }
.header-style-bold .nav-toggle { color: #fff; }
.header-style-bold .nav-menu .dropdown { border-radius: 10px; }

/* ---------- Header layout: Editorial ---------- */
.header-style-editorial .editorial-header { padding: calc(var(--header-pad, 18px) + 6px) 0 6px; position: relative; }
.header-style-editorial .editorial-header .container { justify-content: center; }
.header-style-editorial .editorial-logo { align-items: center; }
.header-style-editorial .logo-text { font-size: 2.4rem; letter-spacing: -.5px; }
.header-style-editorial .editorial-header .header-actions { position: absolute; right: 0; }
.header-style-editorial .editorial-tagline {
  text-align: center; font-size: .8rem; letter-spacing: 3px; text-transform: uppercase;
  color: var(--muted); padding: 8px 0 14px;
}
.header-style-editorial .navbar { position: static; box-shadow: 0 1px 0 var(--border); }
.header-style-editorial .navbar .container { justify-content: center; }
.header-style-editorial .nav-menu > li > a { padding: 12px 16px; text-transform: uppercase; font-size: .82rem; letter-spacing: .6px; }
.header-style-editorial .nav-search { position: absolute; right: 0; }

/* ---------- Navigation ---------- */
.navbar { background: var(--nav-bg); color: var(--nav-text); position: sticky; top: 0; z-index: 1000; box-shadow: 0 2px 8px rgba(0,0,0,.15); }
.navbar .container { display: flex; align-items: center; }
.nav-toggle { display: none; background: none; border: none; color: inherit; font-size: 1.4rem; padding: 14px 12px; }
.nav-menu { display: flex; align-items: center; overflow: visible; scrollbar-width: none; }
.nav-menu::-webkit-scrollbar { display: none; }
.nav-menu li { position: relative; }
.nav-menu > li > a { display: block; padding: 14px 15px; font-weight: 600; font-size: .92rem; white-space: nowrap; transition: background .2s; }
.nav-menu > li > a:hover, .nav-menu > li.active > a { background: rgba(255,255,255,.18); }

/* Sub-menu dropdowns (WordPress style) */
.nav-menu .caret { font-size: .7em; margin-left: 4px; opacity: .8; }
.nav-menu .dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 230px;
  background: #ffffff;
  color: var(--text);
  box-shadow: 0 10px 30px rgba(0,0,0,.18);
  border-radius: 0 0 10px 10px;
  border: 1px solid var(--border);
  padding: 6px 0;
  z-index: 1000;
}
.nav-menu .dropdown .dropdown { top: 0; left: 100%; border-radius: 10px; margin-left: 2px; }
.nav-menu li:hover > .dropdown, .nav-menu li:focus-within > .dropdown { display: block; }
.nav-menu .dropdown li { position: relative; }
.nav-menu .dropdown > li > a {
  display: block;
  padding: 10px 16px;
  font-weight: 500;
  font-size: .88rem;
  white-space: nowrap;
  color: #2b2f3a;
  border-bottom: 1px solid var(--border);
  transition: background .15s, color .15s;
}
.nav-menu .dropdown > li:last-child > a { border-bottom: none; }
.nav-menu .dropdown > li > a:hover { background: var(--bg); color: var(--primary); }
.nav-menu .dropdown .caret { transform: rotate(-90deg); }
.nav-search { margin-left: auto; display: flex; align-items: center; }
.nav-search form { display: flex; }
.nav-search input {
  width: 0; border: none; outline: none; padding: 0; background: rgba(255,255,255,.15); color: #fff;
  border-radius: 20px; transition: all .3s; font-size: .85rem;
}
.nav-search input:focus { width: 170px; padding: 7px 14px; }
.nav-search input::placeholder { color: rgba(255,255,255,.7); }
.nav-search button { background: none; border: none; color: #fff; font-size: 1rem; padding: 12px; }

/* Mobile menu */
@media (max-width: 900px) {
  .nav-toggle { display: block; }
  .navbar .container { flex-wrap: wrap; }
  .header-style-modern .modern-nav { width: 100%; }
  .header-style-modern .nav-toggle { display: block; }
  .header-style-modern .nav-menu {
    display: none; width: 100%; flex-direction: column; max-height: 75vh; overflow-y: auto;
    background: var(--header-bg); border-top: 1px solid var(--border);
  }
  .header-style-modern .nav-menu.open { display: flex; }
  .header-style-modern .nav-menu > li > a { color: var(--text); }
  .nav-menu {
    display: none; width: 100%; flex-direction: column; max-height: 75vh; overflow-y: auto;
    background: var(--nav-bg); border-top: 1px solid rgba(255,255,255,.15);
  }
  .nav-menu.open { display: flex; }
  .nav-menu > li > a { width: 100%; }
  .nav-menu li { width: 100%; }
  .nav-menu .dropdown {
    position: static; display: block; width: 100%; min-width: 0;
    background: rgba(0,0,0,.18); color: #fff; box-shadow: none; border: none;
    border-radius: 0; padding: 0 0 4px;
  }
  .nav-menu .dropdown .dropdown { margin-left: 10px; }
  .nav-menu .dropdown > li > a { color: rgba(255,255,255,.9); border-bottom: 1px solid rgba(255,255,255,.08); }
  .nav-menu .dropdown > li > a:hover { background: rgba(255,255,255,.1); color: var(--accent); }
  .nav-menu .caret { display: none; }
  .nav-search { width: 100%; padding: 10px 12px; }
  .nav-search input, .nav-search input:focus { width: 100%; padding: 8px 14px; }
  .nav-search form { width: 100%; display: flex; gap: 8px; }
  .header-style-editorial .editorial-header .header-actions { position: static; }
  .header-style-editorial .navbar .container { justify-content: flex-start; }
  .header-style-editorial .nav-search { position: static; }
  .header-style-bold .site-header { flex-wrap: wrap; }
  .header-style-bold .navbar { width: 100%; order: 3; }
  .header-style-bold .nav-search { width: auto; padding: 0; }
  .header-style-bold .nav-search input, .header-style-bold .nav-search input:focus { width: 0; padding: 0; }
  .header-style-bold .nav-search input:focus { width: 140px; padding: 7px 12px; }
  .header-style-bold .nav-menu { background: none; border-top: none; }
}

/* ---------- Breaking ticker ---------- */
.breaking { background: var(--accent); color: #222; }
.breaking .container { display: flex; align-items: center; gap: 12px; padding: 8px 16px; overflow: hidden; }
.breaking-label { font-weight: 800; text-transform: uppercase; font-size: .78rem; background: #111; color: #fff; padding: 3px 10px; border-radius: 4px; white-space: nowrap; letter-spacing: .5px; }
.breaking-track { overflow: hidden; flex: 1; white-space: nowrap; }
.breaking-items { display: inline-block; animation: ticker 30s linear infinite; }
.breaking-track:hover .breaking-items { animation-play-state: paused; }
.breaking-items a { margin-right: 34px; font-weight: 600; font-size: .9rem; }
.breaking-items a:hover { text-decoration: underline; }
@keyframes ticker { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ---------- Hero ---------- */
.hero { padding: 24px 0 8px; }
.hero-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 20px; }
.hero-main { position: relative; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.hero-main img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.hero-main .hero-overlay { position: absolute; inset: auto 0 0 0; padding: 50px 20px 18px; background: linear-gradient(to top, rgba(0,0,0,.85), transparent); color: #fff; }
.hero-main .cat-badge { display: inline-block; background: var(--primary); color: #fff; font-size: .7rem; font-weight: 700; padding: 3px 9px; border-radius: 4px; margin-bottom: 8px; text-transform: uppercase; letter-spacing: .5px; }
.hero-main h2 { font-family: var(--font-serif); font-size: 1.6rem; line-height: 1.25; }
.hero-main .meta { font-size: .8rem; opacity: .85; margin-top: 6px; }

.hero-side { display: flex; flex-direction: column; gap: 16px; }
.hero-card { display: flex; gap: 12px; background: var(--surface); border-radius: var(--radius); padding: 12px; box-shadow: var(--shadow); }
.hero-card img { width: 108px; height: 76px; object-fit: cover; border-radius: 8px; flex-shrink: 0; }
.hero-card h4 { font-size: .88rem; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.hero-card .meta { font-size: .72rem; color: var(--muted); margin-top: 3px; }

/* ---------- Sections ---------- */
.section { padding: 24px 0; }
.section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.section-head h2 { font-size: 1.15rem; font-weight: 800; text-transform: uppercase; letter-spacing: .5px; border-left: 4px solid var(--primary); padding-left: 10px; }
.section-head a.see-all { font-size: .8rem; color: var(--primary); font-weight: 600; }

.grid { display: grid; gap: 20px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.card { background: var(--surface); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); transition: transform .25s, box-shadow .25s; }
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.card-img { position: relative; overflow: hidden; }
.card-img img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; transition: transform .4s; }
.card:hover .card-img img { transform: scale(1.05); }
.card-body { padding: 14px 16px 16px; }
.cat-badge { display: inline-block; background: var(--primary); color: #fff; font-size: .66rem; font-weight: 700; padding: 2px 8px; border-radius: 4px; text-transform: uppercase; letter-spacing: .5px; margin-bottom: 8px; }
.card h3 { font-family: var(--font-serif); font-size: 1.02rem; line-height: 1.35; font-weight: 700; }
.card:hover h3 { color: var(--primary); }
.card .excerpt { color: var(--muted); font-size: .87rem; margin-top: 6px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.meta { color: var(--muted); font-size: .76rem; margin-top: 8px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.meta .sep { opacity: .5; }

/* ---------- Layout two columns ---------- */
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; padding: 24px 0; }
.sidebar .widget { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; margin-bottom: 20px; }
.widget h3 { font-size: .95rem; font-weight: 800; text-transform: uppercase; letter-spacing: .5px; margin-bottom: 12px; border-left: 4px solid var(--primary); padding-left: 10px; }
.widget-list li { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px dashed var(--border); }
.widget-list li:last-child { border-bottom: none; }
.widget-list img { width: 80px; height: 58px; object-fit: cover; border-radius: 6px; flex-shrink: 0; }
.widget-list a { font-size: .85rem; font-weight: 600; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.widget-list a:hover { color: var(--primary); }
.widget-list .meta { margin-top: 4px; }
.tag-cloud { display: flex; flex-wrap: wrap; gap: 8px; }
.tag-cloud a { background: var(--bg); border: 1px solid var(--border); padding: 4px 12px; border-radius: 20px; font-size: .78rem; font-weight: 600; transition: all .2s; }
.tag-cloud a:hover { background: var(--primary); color: #fff; border-color: var(--primary); }
.social-follow { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.social-follow a { text-align: center; padding: 9px; border-radius: 8px; color: #fff; font-size: .8rem; font-weight: 600; }
.social-follow .fb { background: #1877f2; }
.social-follow .tw { background: #111; }
.social-follow .ig { background: linear-gradient(45deg, #f09433, #dc2743); }
.social-follow .yt { background: #ff0000; }

/* ---------- Article page ---------- */
.article { max-width: 820px; margin: 0 auto; padding: 28px 16px; }
.breadcrumb { font-size: .8rem; color: var(--muted); margin-bottom: 14px; }
.breadcrumb a { color: var(--primary); }
.article h1 { font-family: var(--font-serif); font-size: clamp(1.5rem, 4vw, 2.3rem); line-height: 1.25; margin: 8px 0 12px; }
.article .byline { display: flex; align-items: center; gap: 12px; padding-bottom: 16px; border-bottom: 1px solid var(--border); margin-bottom: 20px; flex-wrap: wrap; }
.avatar { width: 42px; height: 42px; border-radius: 50%; background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 800; }
.article .excerpt { font-size: 1.1rem; color: #374151; font-family: var(--font-serif); font-style: italic; margin-bottom: 18px; }
.article .featured-img { border-radius: var(--radius); margin-bottom: 8px; box-shadow: var(--shadow); }
.article-figure figcaption { font-size: .78rem; color: var(--muted); text-align: center; margin-bottom: 22px; }
.article-body { font-size: 1.06rem; }
.article-body p { margin-bottom: 18px; }
.article-body h2, .article-body h3 { margin: 26px 0 12px; font-family: var(--font-serif); }
.article-body img { border-radius: var(--radius); margin: 10px 0; }
.article-body ul, .article-body ol { margin: 0 0 18px 22px; }
.article-body blockquote { border-left: 4px solid var(--primary); background: var(--bg); padding: 14px 18px; border-radius: 0 8px 8px 0; font-family: var(--font-serif); font-style: italic; margin: 18px 0; }
.article-body a { color: var(--primary); text-decoration: underline; }
.article-body figure { margin: 18px 0; }
.article-body figure figcaption { font-size: .78rem; color: var(--muted); text-align: center; }

/* ---------- Post display styles ---------- */
.article-wrap { display: block; }
.post-style-classic .article { max-width: 820px; }
.post-style-centered .article { max-width: 700px; }
.post-style-centered .article h1 { text-align: center; margin-top: 14px; }
.post-style-centered .article .byline { justify-content: center; border-bottom: none; padding-bottom: 8px; }
.post-style-centered .article .excerpt { text-align: center; }
.post-style-centered .article-figure figcaption { text-align: center; }
.post-style-magazine .article { max-width: none; }
.post-style-magazine .article-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 30px; align-items: start; }
.post-style-magazine .article-sidebar { position: sticky; top: 20px; }
@media (max-width: 900px) {
  .post-style-magazine .article-wrap { grid-template-columns: 1fr; }
  .post-style-magazine .article-sidebar { position: static; }
}

.tag-list { display: flex; flex-wrap: wrap; gap: 8px; margin: 22px 0; }
.tag-list a { background: var(--bg); border: 1px solid var(--border); padding: 4px 14px; border-radius: 20px; font-size: .8rem; font-weight: 600; }
.tag-list a:hover { background: var(--primary); color: #fff; }

.share { display: flex; align-items: center; gap: 10px; margin: 20px 0; flex-wrap: wrap; }
.share span { font-weight: 700; font-size: .85rem; }
.share a,
.share button {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 38px; height: 38px; border-radius: 8px; color: #fff;
  font-size: .85rem; padding: 0 10px; font-weight: 600;
}
.share button { border: none; cursor: pointer; font-family: inherit; line-height: 1; }
.share a:hover,
.share button:hover { filter: brightness(1.1); }
.share .fb { background: #1877f2; }
.share .tw { background: #111; }
.share .wa { background: #25d366; }
.share .tg { background: #229ed9; }
.share .ln { background: #0a66c2; }
.share .em { background: #4b5563; }
.share .ig { background: radial-gradient(circle at 30% 107%, #fdf497 0%, #fd5949 45%, #d6249f 60%, #285AEB 90%); }
.share .cp { background: #374151; }

.related { margin-top: 30px; }

/* ---------- Pagination ---------- */
.pagination { display: flex; justify-content: center; gap: 8px; margin: 26px 0; flex-wrap: wrap; }
.pagination a, .pagination span { min-width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; font-weight: 600; font-size: .9rem; padding: 0 12px; }
.pagination a:hover { border-color: var(--primary); color: var(--primary); }
.pagination .current { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ---------- Search ---------- */
.search-hero { background: var(--secondary); color: #fff; padding: 40px 0; text-align: center; }
.search-hero h1 { font-family: var(--font-serif); font-size: 1.8rem; margin-bottom: 18px; }
.search-box { display: flex; max-width: 560px; margin: 0 auto; background: #fff; border-radius: 40px; overflow: hidden; }
.search-box input { flex: 1; border: none; outline: none; padding: 14px 22px; font-size: 1rem; }
.search-box button { background: var(--primary); border: none; color: #fff; padding: 0 24px; font-size: 1rem; }

/* ---------- Category page ---------- */
.category-head { background: linear-gradient(135deg, var(--secondary), var(--primary)); color: #fff; padding: 30px 0; }
.category-head h1 { font-family: var(--font-serif); font-size: 1.9rem; }
.category-head p { opacity: .85; margin-top: 6px; max-width: 640px; }

/* ---------- Author archive ---------- */
.author-head { text-align: center; }
.author-head .container { display: flex; flex-direction: column; align-items: center; }
.author-avatar { width: 88px; height: 88px; border-radius: 50%; object-fit: cover; border: 3px solid rgba(255,255,255,.8); box-shadow: var(--shadow); margin-bottom: 10px; }
.author-head h1 { margin-bottom: 4px; }
.byline .byline-author { color: var(--primary); text-decoration: none; }
.byline .byline-author:hover { text-decoration: underline; }

/* ---------- Epaper ---------- */
.epaper-hero { background: linear-gradient(135deg, var(--secondary), var(--primary)); color: #fff; padding: 34px 0; text-align: center; }
.epaper-hero h1 { font-family: var(--font-serif); font-size: 2rem; margin-bottom: 6px; }
.epaper-hero p { opacity: .85; }
.epaper-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 22px; padding: 28px 0; }
.epaper-card { background: var(--surface); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); transition: transform .25s; }
.epaper-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.epaper-card .cover { position: relative; aspect-ratio: 3 / 4; overflow: hidden; }
.epaper-card .cover img { width: 100%; height: 100%; object-fit: cover; }
.epaper-card .cover::after { content: ''; position: absolute; inset: 0; background: linear-gradient(to top, rgba(0,0,0,.4), transparent); }
.epaper-card .read { position: absolute; inset: auto 0 0 0; z-index: 2; text-align: center; padding: 14px; background: linear-gradient(to top, rgba(0,0,0,.75), transparent); }
.epaper-card .read a { background: var(--primary); color: #fff; display: inline-block; padding: 8px 18px; border-radius: 24px; font-weight: 700; font-size: .85rem; }
.epaper-card .read a:hover { background: var(--accent); color: #111; }
.epaper-card .info { padding: 14px 16px; }
.epaper-card .info h3 { font-size: .95rem; font-weight: 700; }
.epaper-card .info p { color: var(--muted); font-size: .8rem; margin-top: 3px; }

/* Epaper viewer */
.viewer-toolbar { background: var(--secondary); color: #fff; padding: 12px 0; position: sticky; top: 0; z-index: 900; }
.viewer-toolbar .container { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.viewer-toolbar a, .viewer-toolbar button { background: rgba(255,255,255,.12); color: #fff; border: none; padding: 8px 16px; border-radius: 6px; font-size: .85rem; font-weight: 600; }
.viewer-toolbar a:hover, .viewer-toolbar button:hover { background: var(--primary); }
.viewer-zoom { display: flex; gap: 8px; align-items: center; }
.viewer-toolbar button:disabled { opacity: .4; cursor: not-allowed; }
.page-display { background: #2a2a2a; min-height: 70vh; overflow: auto; padding: 24px; text-align: center; }
.page-display img { max-width: 100%; height: auto; margin: 0 auto; box-shadow: 0 10px 40px rgba(0,0,0,.5); transition: transform .2s; }
.viewer-nav { text-align: center; padding: 16px; }
.viewer-nav a { display: inline-block; background: var(--primary); color: #fff; padding: 12px 24px; border-radius: 8px; font-weight: 700; margin: 0 6px; }
.viewer-nav a:hover { background: var(--primary-dark); }

/* ---------- Static page ---------- */
.page-content { max-width: 820px; margin: 0 auto; padding: 28px 16px; }
.page-content h1 { font-family: var(--font-serif); font-size: 1.9rem; margin-bottom: 18px; }
.page-content .body { font-size: 1.05rem; }
.page-content .body p { margin-bottom: 16px; }

/* ---------- Row / Column layout (inserted from the TinyMCE editor) ---------- */
.row-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin: 20px 0; }
.row-cols.cols-3 { grid-template-columns: 1fr 1fr 1fr; }
.row-cols .col > :first-child { margin-top: 0; }
.row-cols .col > :last-child { margin-bottom: 0; }
.row-cols .col img { display: block; }
@media (max-width: 640px) {
  .row-cols, .row-cols.cols-3 { grid-template-columns: 1fr; }
}

/* ---------- Footer ---------- */
.site-footer { background: var(--secondary); color: rgba(255,255,255,.8); margin-top: auto; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1.2fr; gap: 30px; padding: 44px 0 30px; }
.footer-grid h4 { color: #fff; font-size: .95rem; text-transform: uppercase; letter-spacing: .5px; margin-bottom: 16px; }
.footer-grid .about p { font-size: .88rem; margin-top: 10px; }
.footer-grid ul li { margin-bottom: 9px; font-size: .88rem; }
.footer-grid ul a:hover { color: var(--accent); }
.newsletter { display: flex; margin-top: 14px; border-radius: 6px; overflow: hidden; }
.newsletter input { flex: 1; border: none; padding: 10px 14px; font-size: .85rem; outline: none; }
.newsletter button { background: var(--primary); border: none; color: #fff; padding: 0 16px; font-weight: 700; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.12); padding: 16px 0; font-size: .8rem; text-align: center; }

/* ---------- Footer layout: Minimal ---------- */
.footer-style-minimal .site-footer { text-align: center; }
.footer-style-minimal .footer-minimal {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding: 46px 0 30px;
}
.footer-style-minimal .footer-brand {
  font-family: var(--font-serif); font-size: 1.7rem; font-weight: 800; color: #fff;
}
.footer-style-minimal .footer-tagline { font-size: .9rem; opacity: .8; }
.footer-style-minimal .footer-social { display: flex; gap: 18px; flex-wrap: wrap; justify-content: center; margin-top: 6px; }
.footer-style-minimal .footer-social a { color: rgba(255,255,255,.75); font-size: .88rem; }
.footer-style-minimal .footer-social a:hover { color: var(--accent); }
.footer-style-minimal .footer-contact { font-size: .82rem; opacity: .7; }
.footer-style-minimal .footer-bottom { border-top: none; padding-top: 6px; }

/* ---------- Footer layout: Rich ---------- */
.footer-style-rich .footer-rich-news { text-align: center; padding: 36px 0 8px; }
.footer-style-rich .footer-rich-news .newsletter { max-width: 520px; margin: 0 auto; }
.footer-style-rich .footer-rich-note { font-size: .8rem; opacity: .75; margin-top: 10px; }
.footer-style-rich .footer-grid { padding-top: 28px; }
.footer-style-rich .footer-rich-social {
  display: flex; justify-content: center; gap: 18px; flex-wrap: wrap;
  padding: 18px 0 4px; margin-top: 12px; border-top: 1px solid rgba(255,255,255,.12);
}
.footer-style-rich .footer-rich-social a { color: rgba(255,255,255,.75); font-size: .86rem; }
.footer-style-rich .footer-rich-social a:hover { color: var(--accent); }

/* ---------- Footer layout: Simple ---------- */
.footer-style-simple .footer-simple {
  display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap;
  padding: 26px 0;
}
.footer-style-simple .footer-simple-brand { display: flex; align-items: baseline; gap: 10px; }
.footer-style-simple .footer-brand {
  font-family: var(--font-serif); font-size: 1.4rem; font-weight: 800; color: #fff;
}
.footer-style-simple .footer-tagline { font-size: .85rem; opacity: .75; }
.footer-style-simple .footer-simple-links { display: flex; gap: 16px; flex-wrap: wrap; }
.footer-style-simple .footer-simple-links a { color: rgba(255,255,255,.75); font-size: .88rem; }
.footer-style-simple .footer-simple-links a:hover { color: var(--accent); }
.footer-style-simple .footer-simple-social { display: flex; gap: 14px; }
.footer-style-simple .footer-simple-social a { color: rgba(255,255,255,.75); font-size: .86rem; }
.footer-style-simple .footer-simple-social a:hover { color: var(--accent); }
.footer-style-simple .footer-bottom { border-top: none; }

/* ---------- Footer layout: Magazine ---------- */
.footer-style-magazine .footer-magazine { grid-template-columns: 2fr 1fr 1fr 1.4fr 1.2fr; gap: 24px; }
.footer-style-magazine .footer-grid .tag-cloud a {
  background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.15); color: rgba(255,255,255,.8);
}
.footer-style-magazine .footer-grid .tag-cloud a:hover { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ---------- 404 / maintenance ---------- */
.error-page { text-align: center; padding: 90px 20px; }
.error-page .code { font-size: 6rem; font-weight: 800; color: var(--primary); line-height: 1; font-family: var(--font-serif); }
.error-page h1 { font-family: var(--font-serif); margin: 10px 0 14px; }
.error-page a { display: inline-block; margin-top: 18px; background: var(--primary); color: #fff; padding: 12px 26px; border-radius: 8px; font-weight: 700; }

/* ---------- Utilities ---------- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
.text-primary { color: var(--primary); }
.center { text-align: center; }
.mt-1 { margin-top: 10px; } .mt-2 { margin-top: 20px; } .mt-3 { margin-top: 30px; }
.mb-1 { margin-bottom: 10px; } .mb-2 { margin-bottom: 20px; }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-side { flex-direction: row; flex-wrap: wrap; }
  .hero-card { flex: 1 1 30%; min-width: 240px; }
  .layout { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 700px) {
  .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .hero-main h2 { font-size: 1.25rem; }
  .site-header .container { flex-wrap: wrap; }
  .logo-text { font-size: 1.5rem; }
  .hero-side { flex-direction: column; flex-wrap: nowrap; }
  .hero-card { flex: none; width: 100%; min-width: 0; }
}

@media (max-width: 480px) {
  .footer-grid { grid-template-columns: 1fr; }
  .topbar-social { display: none; }
}

/* ---------- Dark mode ---------- */
html.dark { --bg: #0f1218; --surface: #181c25; --text: #e7e9ee; --muted: #9aa2b1; --border: #2a2f3a; --header-bg: #14181f; --shadow: 0 1px 3px rgba(0,0,0,.5); }
html.dark .site-footer { background: #0a0c11; }
html.dark .card, html.dark .widget, html.dark .hero-card { background: var(--surface); }
html.dark .article-body { color: #d5d9e0; }

/* ---------- Offline / PWA ---------- */
.offline-indicator {
  background: #3a3f47;
  color: #fff;
  text-align: center;
  font-size: .82rem;
  font-weight: 600;
  padding: 9px 16px;
}
.offline-indicator[hidden] { display: none; }

main, .site-footer { transition: filter .25s ease, opacity .25s ease; }
html.is-offline main,
html.is-offline .site-footer {
  filter: grayscale(1);
  opacity: .72;
}

/* ---------- Admin & Reporter shared ---------- */
.auth-body { background: linear-gradient(135deg, var(--secondary), #3a3a5e); min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.auth-card { background: #fff; border-radius: 14px; box-shadow: var(--shadow-lg); width: 100%; max-width: 400px; padding: 34px; }
.auth-card .logo { text-align: center; margin-bottom: 24px; }
.auth-card h1 { font-size: 1.3rem; text-align: center; margin-bottom: 4px; }
.auth-card .sub { text-align: center; color: var(--muted); font-size: .85rem; margin-bottom: 22px; }
.auth-card label { display: block; font-size: .82rem; font-weight: 600; margin: 14px 0 6px; }
.auth-card input[type=text], .auth-card input[type=password], .auth-card input[type=email] { width: 100%; padding: 11px 14px; border: 1px solid var(--border); border-radius: 8px; font-size: .95rem; outline: none; }
.auth-card input:focus { border-color: var(--primary); }
.auth-card button { width: 100%; margin-top: 20px; background: var(--primary); color: #fff; border: none; padding: 12px; border-radius: 8px; font-weight: 700; font-size: .95rem; }
.auth-card button:hover { background: var(--primary-dark); }
.alert { padding: 12px 16px; border-radius: 8px; font-size: .86rem; margin-bottom: 14px; }
.alert-error { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.alert-success { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }
.alert-info { background: #e0f2fe; color: #075985; border: 1px solid #bae6fd; }

/* ---------- Advertisement slots ---------- */
.ad-slot { margin: 18px auto; padding: 10px; max-width: 100%; text-align: center; background: var(--surface); border: 1px dashed var(--border); border-radius: var(--radius); overflow: hidden; }
.ad-slot a { display: inline-block; max-width: 100%; }
.ad-slot .ad-img { display: block; max-width: 100%; height: auto; margin: 0 auto; }
.ad-slot[data-placement="header"] { margin-top: 0; }
.ad-slot[data-placement="sidebar_top"] { margin-top: 0; margin-bottom: 20px; }
.ad-slot[data-placement="sidebar_bottom"] { margin-top: 20px; }
.ad-slot[data-placement="footer"] { background: transparent; border-style: none; padding: 0; }

/* ---------- Header custom HTML block ---------- */
.header-custom { background: var(--surface); border-bottom: 1px solid var(--border); text-align: center; }
.header-custom > :first-child { margin-top: 0; }
.header-custom > :last-child { margin-bottom: 0; }

/* ---------- Footer map embed ---------- */
.footer-map { margin: 0 0 18px; }
.footer-map iframe, .footer-map img, .footer-map video { display: block; max-width: 100%; border: 0; border-radius: 8px; }

/* ---------- Call / chat button (header action area) ---------- */
.chat-btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--primary); color: #fff; text-decoration: none;
  padding: 8px 14px; border-radius: 999px; box-shadow: 0 2px 8px rgba(0,0,0,.12);
  font-size: .82rem; font-weight: 600; line-height: 1.2; white-space: nowrap;
  transition: background .15s, transform .15s;
}
.chat-btn:hover { background: var(--primary-dark); color: #fff; transform: translateY(-1px); }
.chat-btn svg { flex-shrink: 0; }
.header-style-bold .chat-btn { background: #fff; color: var(--primary); }
.header-style-bold .chat-btn:hover { background: rgba(255,255,255,.85); }
@media (max-width: 640px) {
  .chat-btn-label { display: none; }
  .chat-btn { padding: 8px 10px; }
}
