/*
Theme Name: Civil Insight
Theme URI: https://civilinsight.com
Author: Civil Insight
Author URI: https://civilinsight.com
Description: A professional newspaper-style theme for Civil Insight local news portal.
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: civilinsight
Tags: news, newspaper, blog, local-news, magazine
*/

/* ── RESET & BASE ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --ink:    #111009;
  --paper:  #F7F4EE;
  --warm:   #EDE9DF;
  --accent: #C8371A;
  --gold:   #B8960C;
  --muted:  #7A746A;
  --border: #D4CEBB;
}

html { scroll-behavior: smooth; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: 'Source Serif 4', Georgia, serif;
  font-weight: 300;
  line-height: 1.6;
}

a { color: inherit; text-decoration: none; }
img { display: block; width: 100%; object-fit: cover; }

/* ── TICKER ── */
.ticker-wrap {
  background: var(--accent);
  color: #fff;
  font-family: 'DM Sans', sans-serif;
  font-size: .75rem;
  font-weight: 500;
  letter-spacing: .06em;
  text-transform: uppercase;
  display: flex;
  align-items: stretch;
  height: 2rem;
  position: relative;
}
.ticker-label {
  background: var(--ink);
  padding: 0 1.1rem;
  white-space: nowrap;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  position: relative;
  z-index: 2;
}
.ticker-outer {
  flex: 1;
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: center;
}
.ticker-track {
  display: flex;
  animation: ticker 30s linear infinite;
  white-space: nowrap;
  position: absolute;
  left: 0;
}
.ticker-track span { padding: 0 2.5rem; }
@keyframes ticker { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ── MASTHEAD ── */
.site-header {
  border-bottom: 3px double var(--border);
  padding: 1.25rem 1.5rem .75rem;
}
.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: 'DM Sans', sans-serif;
  font-size: .72rem;
  color: var(--muted);
  letter-spacing: .05em;
  text-transform: uppercase;
  margin-bottom: .75rem;
}
.top-bar nav { display: flex; align-items: center; }
.top-bar nav ul { display: flex; flex-direction: row; list-style: none; margin: 0; padding: 0; }
.top-bar nav ul li { display: inline-block; }
.top-bar nav ul li a,
.top-bar nav a { margin-left: 1.25rem; transition: color .2s; display: inline-block; }
.top-bar nav ul li a:hover,
.top-bar nav a:hover { color: var(--accent); }

.masthead-inner {
  text-align: center;
  padding: .5rem 0 .85rem;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.masthead-rule {
  font-family: 'DM Sans', sans-serif;
  font-size: .65rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: .3rem;
}
.masthead-logo {
  font-family: 'Playfair Display', serif;
  font-weight: 900;
  font-size: clamp(2.8rem, 8vw, 5.5rem);
  line-height: 1;
  letter-spacing: -.02em;
  color: var(--ink);
  display: block;
  transition: color .25s;
}
.masthead-logo:hover { color: var(--accent); }
.masthead-sub {
  font-family: 'DM Sans', sans-serif;
  font-size: .7rem;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: .4rem;
}

.main-nav {
  display: flex;
  justify-content: center;
  gap: 1.75rem;
  margin-top: .9rem;
  font-family: 'DM Sans', sans-serif;
  font-size: .78rem;
  font-weight: 500;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.main-nav a {
  padding-bottom: .15rem;
  border-bottom: 2px solid transparent;
  transition: border-color .2s, color .2s;
}
.main-nav a:hover,
.main-nav .current-menu-item a,
.main-nav .current_page_item a { border-color: var(--accent); color: var(--accent); }

/* ── LAYOUT ── */
.container { max-width: 1160px; margin: 0 auto; padding: 0 1.5rem; }

/* ── HERO GRID ── */
.hero { padding: 2rem 0; border-bottom: 2px solid var(--border); }
.hero-grid {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 0;
}

.lead-story {
  grid-column: 1;
  padding-right: 2rem;
  border-right: 1px solid var(--border);
}
.lead-story .img-wrap { aspect-ratio: 16/9; overflow: hidden; margin-bottom: 1rem; }
.lead-story .img-wrap img { width: 100%; height: 100%; transition: transform .5s ease; }
.lead-story:hover .img-wrap img { transform: scale(1.03); }

.section-tag {
  font-family: 'DM Sans', sans-serif;
  font-size: .68rem;
  font-weight: 500;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: .4rem;
  display: block;
}
.lead-story h2 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: .75rem;
}
.lead-story h2 a:hover { color: var(--accent); }
.lead-story .deck {
  font-size: 1.05rem;
  line-height: 1.65;
  color: #3a3730;
  margin-bottom: .75rem;
}
.byline {
  font-family: 'DM Sans', sans-serif;
  font-size: .72rem;
  color: var(--muted);
  letter-spacing: .03em;
}
.byline strong { color: var(--ink); }

.side-stack {
  padding-left: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}
.side-item { border-bottom: 1px solid var(--border); padding-bottom: 1.25rem; }
.side-item:last-child { border-bottom: none; padding-bottom: 0; }
.side-item .img-wrap { aspect-ratio: 3/2; overflow: hidden; margin-bottom: .6rem; }
.side-item .img-wrap img { width: 100%; height: 100%; transition: transform .45s ease; }
.side-item:hover .img-wrap img { transform: scale(1.04); }
.side-item h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: .3rem;
}
.side-item h3 a:hover { color: var(--accent); }
.side-item .meta { font-size: .83rem; color: var(--muted); }

/* ── SECTION HEAD ── */
.section-head {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin: 2.25rem 0 1.25rem;
}
.section-head h2 {
  font-family: 'Playfair Display', serif;
  font-size: 1.15rem;
  font-weight: 700;
  white-space: nowrap;
}
.section-head::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}
.section-head .tag-line {
  font-family: 'DM Sans', sans-serif;
  font-size: .65rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 500;
}

/* ── CARD GRID ── */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.75rem;
  margin-bottom: 2.5rem;
}
.card .img-wrap { aspect-ratio: 4/3; overflow: hidden; margin-bottom: .75rem; }
.card .img-wrap img { width: 100%; height: 100%; transition: transform .45s ease; }
.card:hover .img-wrap img { transform: scale(1.05); }
.card h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1.08rem;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: .35rem;
}
.card h3 a:hover { color: var(--accent); }
.card .excerpt { font-size: .83rem; color: var(--muted); line-height: 1.5; }

/* ── TWO COL ── */
.two-col {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 2.5rem;
  border-top: 2px solid var(--border);
  padding-top: 2rem;
  margin-bottom: 3rem;
}
.sidebar { border-left: 1px solid var(--border); padding-left: 2rem; }
.sidebar-block { margin-bottom: 2rem; }
.sidebar-block h3 {
  font-family: 'DM Sans', sans-serif;
  font-size: .68rem;
  font-weight: 500;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: .85rem;
  padding-bottom: .4rem;
  border-bottom: 1px solid var(--border);
}
.mini-list { list-style: none; }
.mini-list li {
  padding: .6rem 0;
  border-bottom: 1px dotted var(--border);
  font-family: 'DM Sans', sans-serif;
  font-size: .8rem;
  display: flex;
  align-items: flex-start;
  gap: .5rem;
}
.mini-list li::before { content: '›'; color: var(--accent); font-size: 1rem; line-height: 1.2; flex-shrink: 0; }
.mini-list li:last-child { border-bottom: none; }
.mini-list a:hover { color: var(--accent); }

/* ── NEWSLETTER ── */
.newsletter {
  background: var(--ink);
  color: var(--paper);
  padding: 2.5rem 1.5rem;
  text-align: center;
  margin-bottom: 3rem;
}
.newsletter h2 {
  font-family: 'Playfair Display', serif;
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: .4rem;
}
.newsletter p { font-size: .88rem; color: #b0aa9e; margin-bottom: 1.25rem; }
.nl-form { display: flex; justify-content: center; gap: .5rem; flex-wrap: wrap; }
.nl-form input {
  padding: .65rem 1rem;
  border: 1px solid #444;
  background: #1e1c17;
  color: var(--paper);
  font-family: 'DM Sans', sans-serif;
  font-size: .85rem;
  width: 260px;
  outline: none;
  transition: border-color .2s;
}
.nl-form input:focus { border-color: var(--accent); }
.nl-form button {
  padding: .65rem 1.5rem;
  background: var(--accent);
  color: #fff;
  border: none;
  font-family: 'DM Sans', sans-serif;
  font-size: .8rem;
  font-weight: 500;
  letter-spacing: .08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background .2s;
}
.nl-form button:hover { background: #a82c14; }

/* ── FOOTER ── */
.site-footer {
  background: var(--warm);
  border-top: 3px double var(--border);
  padding: 2rem 1.5rem;
}
.footer-inner {
  max-width: 1160px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 2rem;
}
.footer-brand .brand-name {
  font-family: 'Playfair Display', serif;
  font-size: 1.6rem;
  font-weight: 900;
  margin-bottom: .4rem;
}
.footer-brand p { font-size: .82rem; color: var(--muted); line-height: 1.6; }
.footer-col h4 {
  font-family: 'DM Sans', sans-serif;
  font-size: .68rem;
  font-weight: 500;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: .75rem;
}
.footer-col ul { list-style: none; }
.footer-col ul li { margin-bottom: .45rem; }
.footer-col ul a {
  font-family: 'DM Sans', sans-serif;
  font-size: .82rem;
  color: var(--ink);
  transition: color .2s;
}
.footer-col ul a:hover { color: var(--accent); }
.footer-bottom {
  max-width: 1160px;
  margin: 1.5rem auto 0;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  font-family: 'DM Sans', sans-serif;
  font-size: .7rem;
  color: var(--muted);
}

/* ── SINGLE POST ── */
.single-post-wrap { max-width: 780px; margin: 2.5rem auto; padding: 0 1.5rem; }
.post-header { margin-bottom: 1.5rem; }
.post-header h1 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: .75rem;
}
.post-header .post-meta {
  font-family: 'DM Sans', sans-serif;
  font-size: .75rem;
  color: var(--muted);
}
.post-featured-img { aspect-ratio: 16/9; overflow: hidden; margin-bottom: 1.5rem; }
.post-featured-img img { width: 100%; height: 100%; }
.post-content { font-size: 1.05rem; line-height: 1.8; }
.post-content p { margin-bottom: 1.25rem; }
.post-content h2, .post-content h3 {
  font-family: 'Playfair Display', serif;
  font-weight: 700;
  margin: 1.5rem 0 .75rem;
}

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  .hero-grid { grid-template-columns: 1fr; }
  .lead-story { padding-right: 0; border-right: none; border-bottom: 1px solid var(--border); padding-bottom: 1.5rem; }
  .side-stack { padding-left: 0; flex-direction: row; overflow-x: auto; }
  .side-item { min-width: 220px; }
  .two-col { grid-template-columns: 1fr; }
  .sidebar { border-left: none; padding-left: 0; border-top: 1px solid var(--border); padding-top: 1.5rem; }
  .footer-inner { grid-template-columns: 1fr; }
  .top-bar nav { display: none; }
  .main-nav { gap: 1rem; font-size: .7rem; flex-wrap: wrap; }
}

/* ── CSS LOGO ── */
.masthead-logo-wrap {
  display: inline-block;
  text-decoration: none;
  transition: opacity .25s;
}
.masthead-logo-wrap:hover { opacity: .85; }

.ci-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: .5rem 0;
}

.ci-name {
  font-family: 'Noto Naskh Arabic', 'Georgia', serif;
  font-size: clamp(2.4rem, 6vw, 4rem);
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
  letter-spacing: .04em;
  display: block;
}

.ci-tagline {
  font-family: 'DM Sans', sans-serif;
  font-size: .62rem;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 400;
  display: block;
  margin-top: .4rem;
  text-align: center;
}

/* Hide old masthead-logo if any */
.masthead-logo { display: none; }
.masthead-sub  { display: none; }

/* ── BREAKING NEWS WIDGET ── */
.breaking-news-widget {
  border: 2px solid var(--accent);
  overflow: hidden;
}
.breaking-news-widget .bn-header {
  background: var(--accent);
  color: #fff;
  font-family: 'DM Sans', sans-serif;
  font-size: .68rem;
  font-weight: 500;
  letter-spacing: .16em;
  text-transform: uppercase;
  padding: .5rem .85rem;
  display: flex;
  align-items: center;
  gap: .5rem;
}
.bn-dot {
  width: 7px;
  height: 7px;
  background: #fff;
  border-radius: 50%;
  animation: blink 1s infinite;
  flex-shrink: 0;
}
@keyframes blink { 0%,100%{ opacity:1; } 50%{ opacity:0; } }
.breaking-news-widget ul { list-style: none; padding: 0; margin: 0; }
.breaking-news-widget ul li {
  padding: .65rem .85rem;
  border-bottom: 1px dotted var(--border);
  font-family: 'DM Sans', sans-serif;
  font-size: .8rem;
  line-height: 1.4;
  display: flex;
  gap: .5rem;
  align-items: flex-start;
}
.breaking-news-widget ul li:last-child { border-bottom: none; }
.breaking-news-widget ul li::before {
  content: '›';
  color: var(--accent);
  font-size: 1rem;
  line-height: 1.2;
  flex-shrink: 0;
}
.breaking-news-widget ul li a:hover { color: var(--accent); }

/* ── STOCK MARKET WIDGET ── */
.stock-widget {
  background: var(--warm);
  border: 1px solid var(--border);
  overflow: hidden;
}
.stock-widget .sw-header {
  background: var(--ink);
  color: #fff;
  font-family: 'DM Sans', sans-serif;
  font-size: .68rem;
  font-weight: 500;
  letter-spacing: .16em;
  text-transform: uppercase;
  padding: .5rem .85rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.sw-live {
  display: flex;
  align-items: center;
  gap: .3rem;
  font-size: .6rem;
  color: #4caf50;
  letter-spacing: .08em;
}
.sw-live-dot {
  width: 6px;
  height: 6px;
  background: #4caf50;
  border-radius: 50%;
  animation: blink 1.2s infinite;
}
.stock-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: .75rem .85rem;
  border-bottom: 1px solid var(--border);
}
.stock-row:last-child { border-bottom: none; }
.stock-name {
  font-family: 'DM Sans', sans-serif;
  font-size: .82rem;
  font-weight: 500;
  color: var(--ink);
}
.stock-exchange {
  font-family: 'DM Sans', sans-serif;
  font-size: .62rem;
  color: var(--muted);
  letter-spacing: .06em;
}
.stock-values { text-align: right; }
.stock-price {
  font-family: 'DM Sans', sans-serif;
  font-size: .92rem;
  font-weight: 500;
  color: var(--ink);
}
.stock-change {
  font-family: 'DM Sans', sans-serif;
  font-size: .7rem;
  font-weight: 500;
}
.stock-change.up   { color: #2e7d32; }
.stock-change.down { color: #c62828; }
.sw-footer {
  padding: .4rem .85rem;
  font-family: 'DM Sans', sans-serif;
  font-size: .6rem;
  color: var(--muted);
  text-align: right;
  border-top: 1px solid var(--border);
}

/* ── IMAGE OVERLAY HERO ── */
.hero { padding: 1.5rem 0; border-bottom: 2px solid var(--border); }
.hero-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: .5rem;
  height: 480px;
}

/* Lead — big left card */
.lead-overlay {
  position: relative;
  background-size: cover;
  background-position: center;
  background-color: #222;
  overflow: hidden;
  cursor: pointer;
  transition: transform .4s ease;
}
.lead-overlay:hover { transform: scale(1.01); }
.lead-overlay::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,.85) 0%, rgba(0,0,0,.3) 55%, transparent 100%);
}
.lead-overlay-inner {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 1.5rem;
  z-index: 2;
}
.lead-overlay-inner .section-tag {
  background: var(--accent);
  color: #fff;
  padding: .2rem .6rem;
  font-size: .62rem;
  letter-spacing: .12em;
  display: inline-block;
  margin-bottom: .5rem;
}
.lead-overlay-inner h2 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.3rem, 2.5vw, 2rem);
  font-weight: 700;
  color: #fff;
  line-height: 1.25;
  margin-bottom: .5rem;
  text-shadow: 0 1px 4px rgba(0,0,0,.5);
}
.lead-overlay-inner h2 a { color: #fff; }
.lead-overlay-inner h2 a:hover { color: #f0c0b0; }
.lead-overlay-inner .byline { color: rgba(255,255,255,.75); }

/* Side grid — 2x2 right cards */
.side-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: .5rem;
}
.side-overlay {
  position: relative;
  background-size: cover;
  background-position: center;
  background-color: #333;
  overflow: hidden;
  cursor: pointer;
  transition: transform .35s ease;
}
.side-overlay:hover { transform: scale(1.02); }
.side-overlay::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,.8) 0%, rgba(0,0,0,.2) 60%, transparent 100%);
}
.side-overlay-inner {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: .85rem;
  z-index: 2;
}
.side-overlay-inner .section-tag {
  background: var(--accent);
  color: #fff;
  padding: .15rem .5rem;
  font-size: .58rem;
  letter-spacing: .1em;
  display: inline-block;
  margin-bottom: .35rem;
}
.side-overlay-inner h3 {
  font-family: 'Playfair Display', serif;
  font-size: .92rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.3;
  text-shadow: 0 1px 3px rgba(0,0,0,.6);
}
.side-overlay-inner h3 a { color: #fff; }
.side-overlay-inner h3 a:hover { color: #f0c0b0; }

/* No image fallback */
.lead-overlay:not([style*="url"]),
.side-overlay:not([style*="url"]) { background: linear-gradient(135deg, #1a1814 0%, #2d2a24 100%); }

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  .hero-grid { grid-template-columns: 1fr; height: auto; }
  .lead-overlay { height: 320px; }
  .side-grid { grid-template-columns: 1fr 1fr; }
  .side-overlay { height: 180px; }
}
