/* =============================
   THE INDUS LEDGER — STYLESHEET
   ============================= */

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

:root {
  --ink: #1a1714;
  --ink2: #2e2a25;
  --paper: #f7f3ec;
  --paper2: #efe9de;
  --accent: #9b1d20;
  --accent2: #c8392b;
  --gold: #b8860b;
  --muted: #7a7265;
  --border: #d4cdc0;
  --border2: #c0b9ab;
  --card: #ffffff;
  --nav-bg: #1a1714;
  --ticker-bg: #9b1d20;
}

html { scroll-behavior: smooth; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: 'Barlow', sans-serif;
  font-size: 15px;
  line-height: 1.6;
}

a { text-decoration: none; color: inherit; }
.container { max-width: 1100px; margin: 0 auto; padding: 0 1.25rem; }

/* ---- TICKER ---- */
.ticker-wrap {
  background: var(--ticker-bg);
  color: #fff;
  display: flex;
  align-items: center;
  overflow: hidden;
  height: 34px;
  font-size: 12px;
}
.ticker-label {
  background: #fff;
  color: var(--accent);
  font-weight: 600;
  font-size: 10px;
  letter-spacing: 0.12em;
  padding: 0 10px;
  height: 100%;
  display: flex;
  align-items: center;
  flex-shrink: 0;
  border-right: 2px solid var(--accent2);
}
.ticker-track {
  display: flex;
  white-space: nowrap;
  animation: ticker-scroll 40s linear infinite;
  overflow: hidden;
}
.ticker-item {
  padding: 0 2rem;
  opacity: 0.92;
}
.ticker-item::after {
  content: '  ◆  ';
  opacity: 0.4;
}
@keyframes ticker-scroll {
  0%   { transform: translateX(100vw); }
  100% { transform: translateX(-100%); }
}

/* ---- MASTHEAD ---- */
.masthead {
  background: var(--paper);
  border-bottom: 3px double var(--ink);
  padding-bottom: 0;
}
.masthead-top {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 1rem 1.25rem 0.75rem;
  gap: 1rem;
}
.masthead-meta {
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.05em;
}
.pipe { margin: 0 6px; opacity: 0.4; }
.masthead-logo { text-align: center; }
.logo-urdu { font-size: 11px; color: var(--muted); letter-spacing: 0.1em; margin-bottom: 2px; }
.logo {
  font-family: 'Playfair Display', serif;
  font-weight: 900;
  font-size: clamp(2rem, 5vw, 3.2rem);
  letter-spacing: -0.02em;
  line-height: 1;
  color: var(--ink);
}
.logo em { font-style: italic; color: var(--accent); }
.logo-sub {
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 4px;
}
.masthead-actions { display: flex; justify-content: flex-end; }
.btn-subscribe {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 7px 18px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.2s;
}
.btn-subscribe:hover { background: var(--ink); }

/* ---- MAIN NAV ---- */
.main-nav {
  display: flex;
  gap: 0;
  border-top: 1px solid var(--border);
  background: var(--nav-bg);
  overflow-x: auto;
  scrollbar-width: none;
}
.main-nav::-webkit-scrollbar { display: none; }
.nav-btn {
  background: none;
  border: none;
  color: rgba(255,255,255,0.6);
  font-family: 'Barlow', sans-serif;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 11px 18px;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  transition: color 0.15s, border-color 0.15s;
  white-space: nowrap;
}
.nav-btn:hover { color: #fff; }
.nav-btn.active { color: #fff; border-bottom-color: var(--accent2); }

/* ---- SEARCH STRIP ---- */
.search-strip {
  background: var(--paper2);
  border-bottom: 1px solid var(--border);
  padding: 0.6rem 0;
}
.search-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}
.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--card);
  border: 1px solid var(--border2);
  padding: 0 10px;
  flex: 1;
  max-width: 480px;
}
.search-box svg { color: var(--muted); flex-shrink: 0; }
.search-box input {
  flex: 1;
  border: none;
  background: none;
  font-family: 'Barlow', sans-serif;
  font-size: 14px;
  color: var(--ink);
  padding: 7px 0;
  outline: none;
}
.search-box input::placeholder { color: var(--muted); }
.search-box button {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 5px 14px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.05em;
  cursor: pointer;
  text-transform: uppercase;
}
.search-box button:hover { background: var(--ink); }
.search-meta { display: flex; align-items: center; gap: 12px; font-size: 12px; color: var(--muted); }
.refresh-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  background: none;
  border: 1px solid var(--border2);
  color: var(--muted);
  font-size: 12px;
  font-family: 'Barlow', sans-serif;
  padding: 5px 12px;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}
.refresh-btn:hover { border-color: var(--ink); color: var(--ink); }
.refresh-btn svg { flex-shrink: 0; }

/* ---- MAIN CONTENT ---- */
.main-content { padding: 1.5rem 1.25rem 2rem; }

/* Loading */
.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 4rem 0;
  color: var(--muted);
  font-size: 14px;
  font-style: italic;
}
.spinner {
  width: 32px; height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.error-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--muted);
}
.error-state h2 { font-family: 'Libre Baskerville', serif; font-size: 1.2rem; margin-bottom: 0.5rem; color: var(--ink); }
.error-state p { font-size: 13px; line-height: 1.7; }
.error-state a { color: var(--accent); }

/* ---- NEWS GRID ---- */
.section-eyebrow {
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 0.35rem;
}
.divider-rule {
  width: 40px;
  height: 2px;
  background: var(--accent);
  margin: 0.6rem 0;
}

/* Hero Story */
.hero-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  border: 1px solid var(--border);
  background: var(--card);
  margin-bottom: 1.5px;
}
.hero-main {
  padding: 1.5rem;
  border-right: 1px solid var(--border);
}
.hero-image {
  position: relative;
  overflow: hidden;
  background: var(--paper2);
}
.hero-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}
.hero-image:hover img { transform: scale(1.03); }
.hero-headline {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.4rem, 3vw, 2rem);
  font-weight: 900;
  line-height: 1.2;
  margin-bottom: 0.75rem;
}
.hero-headline a:hover { color: var(--accent); }
.hero-desc {
  font-family: 'Libre Baskerville', serif;
  font-size: 14px;
  line-height: 1.75;
  color: #3a3530;
  margin-bottom: 0.75rem;
}
.story-meta {
  font-size: 11px;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.source-tag {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  background: var(--paper2);
  color: var(--ink2);
  padding: 2px 8px;
  border: 1px solid var(--border);
}
.read-more {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-top: 0.75rem;
  transition: gap 0.15s;
}
.read-more:hover { gap: 8px; }
.read-more svg { width: 12px; height: 12px; }

/* 2-col featured */
.featured-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5px;
  margin-bottom: 1.5px;
}
.featured-card {
  background: var(--card);
  border: 1px solid var(--border);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
}
.featured-image {
  overflow: hidden;
  background: var(--paper2);
  aspect-ratio: 16/9;
  margin-bottom: 0.9rem;
}
.featured-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.35s;
}
.featured-image:hover img { transform: scale(1.04); }
.featured-headline {
  font-family: 'Playfair Display', serif;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 0.5rem;
}
.featured-headline a:hover { color: var(--accent); }
.featured-desc {
  font-size: 13px;
  color: #3a3530;
  line-height: 1.6;
  margin-bottom: 0.6rem;
  flex: 1;
}

/* More Stories list */
.more-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 1px;
}
.more-header-text {
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--card);
  background: var(--ink);
  padding: 6px 14px;
}
.list-stories {
  border: 1px solid var(--border);
  background: var(--card);
}
.list-story {
  display: grid;
  grid-template-columns: 36px 70px 1fr;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border);
  align-items: flex-start;
  transition: background 0.15s;
}
.list-story:last-child { border-bottom: none; }
.list-story:hover { background: var(--paper2); }
.list-num {
  font-family: 'Playfair Display', serif;
  font-size: 1.6rem;
  font-weight: 900;
  color: var(--border2);
  line-height: 1;
  padding-top: 2px;
}
.list-image {
  overflow: hidden;
  background: var(--paper2);
  aspect-ratio: 1;
}
.list-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.list-headline {
  font-family: 'Playfair Display', serif;
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 4px;
}
.list-headline a:hover { color: var(--accent); }
.img-placeholder {
  width: 100%;
  height: 100%;
  background: var(--paper2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  opacity: 0.4;
}

/* Sidebar layout for larger view */
@media (min-width: 900px) {
  .content-grid {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 1.5rem;
    align-items: flex-start;
  }
}

/* Sidebar */
.sidebar {}
.sidebar-widget {
  background: var(--card);
  border: 1px solid var(--border);
  margin-bottom: 1.25rem;
}
.sidebar-title {
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--card);
  background: var(--accent);
  padding: 8px 12px;
}
.sidebar-item {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.sidebar-item:last-child { border-bottom: none; }
.sidebar-item-headline {
  font-family: 'Playfair Display', serif;
  font-size: 0.85rem;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 3px;
}
.sidebar-item-headline a:hover { color: var(--accent); }
.sidebar-item-meta { font-size: 11px; color: var(--muted); }
.ad-placeholder {
  background: var(--paper2);
  border: 1px dashed var(--border2);
  display: flex;
  align-items: center;
  justify-content: center;
  height: 200px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* ---- FOOTER ---- */
.site-footer {
  background: var(--ink);
  color: rgba(255,255,255,0.7);
  padding: 2.5rem 0 1.5rem;
  margin-top: 2rem;
  border-top: 3px solid var(--accent);
}
.footer-inner { text-align: center; }
.footer-logo {
  font-family: 'Playfair Display', serif;
  font-size: 1.6rem;
  font-weight: 900;
  color: #fff;
  margin-bottom: 6px;
}
.footer-logo em { font-style: italic; color: var(--accent2); }
.footer-tagline { font-size: 12px; letter-spacing: 0.08em; margin-bottom: 1rem; }
.footer-links {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}
.footer-links a { font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; color: rgba(255,255,255,0.5); transition: color 0.15s; }
.footer-links a:hover { color: #fff; }
.footer-copy { font-size: 11px; color: rgba(255,255,255,0.35); }
.footer-copy a { color: rgba(255,255,255,0.5); }

/* ---- RESPONSIVE ---- */
@media (max-width: 768px) {
  .hero-section { grid-template-columns: 1fr; }
  .hero-image { aspect-ratio: 16/9; min-height: unset; }
  .hero-main { border-right: none; border-bottom: 1px solid var(--border); }
  .featured-row { grid-template-columns: 1fr; }
  .masthead-top { grid-template-columns: 1fr; gap: 0.5rem; text-align: center; }
  .masthead-actions { justify-content: center; }
  .list-story { grid-template-columns: 30px 60px 1fr; }
}

@media (max-width: 480px) {
  .logo { font-size: 1.8rem; }
  .list-story { grid-template-columns: 28px 1fr; }
  .list-image { display: none; }
}
