/* ============================================================
   The 50 States Times — Main Stylesheet
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,700;0,900;1,400&family=Source+Serif+4:ital,wght@0,300;0,400;0,600;1,300;1,400&family=IBM+Plex+Sans:wght@400;500;600;700&display=swap');

/* ── Variables ── */
:root {
  --navy:        #0d2b5e;
  --blue:        #1a4b8c;
  --blue-light:  #2563b8;
  --accent:      #c8102e;
  --gold:        #c9a84c;
  --white:       #ffffff;
  --off-white:   #f7f8fa;
  --gray-50:     #f0f2f5;
  --gray-100:    #e4e7ec;
  --gray-300:    #b0b8c4;
  --gray-500:    #6b7888;
  --gray-700:    #374151;
  --gray-900:    #111827;
  --text:        #1a1e2e;
  --text-muted:  #5a6477;
  --border:      #d6dce8;
  --shadow-sm:   0 1px 3px rgba(0,0,0,.08);
  --shadow:      0 4px 16px rgba(0,0,0,.10);
  --shadow-lg:   0 8px 32px rgba(0,0,0,.14);
  --radius:      4px;
  --radius-md:   8px;
  --ff-display:  'Playfair Display', Georgia, serif;
  --ff-body:     'Source Serif 4', Georgia, serif;
  --ff-ui:       'IBM Plex Sans', system-ui, sans-serif;
  --max-w:       1280px;
  --col-gap:     24px;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body { font-family: var(--ff-body); color: var(--text); background: var(--off-white); line-height: 1.65; -webkit-font-smoothing: antialiased; }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }

/* ── Layout ── */
.container { max-width: var(--max-w); margin: 0 auto; padding: 0 20px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--col-gap); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--col-gap); }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--col-gap); }
.layout-main { display: grid; grid-template-columns: 1fr 320px; gap: 32px; align-items: start; }

/* ── Top Bar ── */
.topbar { background: var(--navy); color: rgba(255,255,255,.75); font-family: var(--ff-ui); font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; padding: 6px 0; border-bottom: 1px solid rgba(255,255,255,.1); }
.topbar .container { display: flex; justify-content: space-between; align-items: center; }
.topbar-date { display: flex; align-items: center; gap: 6px; }
.topbar-links { display: flex; gap: 16px; }
.topbar-links a { color: rgba(255,255,255,.65); transition: color .2s; }
.topbar-links a:hover { color: var(--gold); }

/* ── Header ── */
.site-header { background: var(--white); border-bottom: 3px solid var(--navy); position: sticky; top: 0; z-index: 1000; box-shadow: var(--shadow); }
.header-inner { display: flex; align-items: center; justify-content: space-between; padding: 0; }

/* Logo */
.site-logo { padding: 14px 0; display: flex; flex-direction: column; align-items: flex-start; text-decoration: none; }
.logo-stars { font-size: .55rem; letter-spacing: .28em; color: var(--accent); font-family: var(--ff-ui); font-weight: 700; text-transform: uppercase; display: flex; align-items: center; gap: 4px; margin-bottom: 2px; }
.logo-main { font-family: var(--ff-display); font-weight: 900; font-size: 1.9rem; line-height: 1; color: var(--navy); letter-spacing: -.02em; }
.logo-main span { color: var(--accent); }
.logo-sub { font-family: var(--ff-ui); font-size: .62rem; letter-spacing: .2em; text-transform: uppercase; color: var(--gray-500); margin-top: 3px; }

/* Search */
.header-search { display: flex; align-items: center; gap: 8px; }
.header-search form { display: flex; border: 2px solid var(--border); border-radius: 24px; overflow: hidden; transition: border-color .2s; }
.header-search form:focus-within { border-color: var(--blue); }
.header-search input { border: none; outline: none; padding: 7px 16px; font-family: var(--ff-ui); font-size: .85rem; width: 210px; background: var(--gray-50); }
.header-search button { background: var(--blue); color: white; padding: 7px 14px; font-family: var(--ff-ui); font-size: .8rem; font-weight: 600; transition: background .2s; }
.header-search button:hover { background: var(--navy); }

/* ── Navigation ── */
.main-nav { background: var(--navy); }
.main-nav .container { display: flex; align-items: center; }
.nav-menu { display: flex; align-items: center; gap: 0; }
.nav-menu li a { display: block; padding: 13px 18px; font-family: var(--ff-ui); font-size: .82rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: rgba(255,255,255,.82); transition: all .2s; border-bottom: 3px solid transparent; }
.nav-menu li a:hover, .nav-menu li a.active { color: white; border-bottom-color: var(--gold); background: rgba(255,255,255,.06); }
.nav-menu li a.cat-politics  { }
.nav-menu li a.cat-economy   { }
.nav-menu li a.cat-tech      { }
.nav-menu li a.cat-crime     { }

/* Breaking News Ticker */
.breaking-bar { background: var(--accent); color: white; padding: 8px 0; overflow: hidden; }
.breaking-inner { display: flex; align-items: center; gap: 0; }
.breaking-label { background: var(--navy); font-family: var(--ff-ui); font-size: .72rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; padding: 4px 14px; white-space: nowrap; flex-shrink: 0; margin-right: 16px; }
.ticker-wrap { overflow: hidden; flex: 1; }
.ticker { display: flex; gap: 60px; animation: ticker 40s linear infinite; white-space: nowrap; }
.ticker:hover { animation-play-state: paused; }
.ticker span { font-family: var(--ff-ui); font-size: .82rem; font-weight: 500; }
.ticker span::before { content: '▶'; margin-right: 8px; font-size: .6rem; opacity: .7; }
@keyframes ticker { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ── Hero / Featured ── */
.hero-section { background: white; padding: 28px 0 0; border-bottom: 1px solid var(--border); }
.hero-grid { display: grid; grid-template-columns: 1.8fr 1fr; grid-template-rows: auto auto; gap: 2px; background: var(--border); border: 1px solid var(--border); }
.hero-main { grid-row: 1 / 3; position: relative; overflow: hidden; }
.hero-main img { width: 100%; height: 520px; object-fit: cover; transition: transform .4s ease; }
.hero-main:hover img { transform: scale(1.02); }
.hero-main-overlay { position: absolute; bottom: 0; left: 0; right: 0; background: linear-gradient(to top, rgba(0,0,0,.88) 0%, rgba(0,0,0,.5) 55%, transparent 100%); padding: 32px 28px 28px; }
.hero-main-overlay .cat-badge { margin-bottom: 10px; }
.hero-main-overlay h2 { font-family: var(--ff-display); font-size: 1.9rem; font-weight: 900; color: white; line-height: 1.2; margin-bottom: 10px; }
.hero-main-overlay h2 a { color: white; }
.hero-main-overlay h2 a:hover { color: var(--gold); }
.hero-main-overlay .meta { color: rgba(255,255,255,.7); font-family: var(--ff-ui); font-size: .75rem; display: flex; gap: 12px; }

.hero-side { background: white; overflow: hidden; position: relative; }
.hero-side img { width: 100%; height: 255px; object-fit: cover; transition: transform .35s; }
.hero-side:hover img { transform: scale(1.03); }
.hero-side-body { padding: 14px 16px 18px; }
.hero-side-body h3 { font-family: var(--ff-display); font-size: 1.05rem; font-weight: 700; line-height: 1.3; margin-bottom: 6px; }
.hero-side-body h3 a:hover { color: var(--blue); }
.hero-side-body .meta { font-family: var(--ff-ui); font-size: .72rem; color: var(--text-muted); }

/* Category Badge */
.cat-badge { display: inline-block; font-family: var(--ff-ui); font-size: .62rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; padding: 3px 9px; border-radius: 2px; background: var(--accent); color: white; }
.cat-badge.cat-politics   { background: #c0392b; }
.cat-badge.cat-economy    { background: #27ae60; }
.cat-badge.cat-technology { background: #8e44ad; }
.cat-badge.cat-crime      { background: #e67e22; }
.cat-badge.cat-world      { background: #2980b9; }
.cat-badge.cat-opinion    { background: #7f8c8d; }
.cat-badge.cat-us-news    { background: #1a4b8c; }

/* ── Section Headers ── */
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; padding-bottom: 10px; border-bottom: 3px solid var(--navy); }
.section-header h2 { font-family: var(--ff-display); font-size: 1.3rem; font-weight: 900; color: var(--navy); letter-spacing: -.01em; }
.section-header a.see-all { font-family: var(--ff-ui); font-size: .75rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--blue); border-bottom: 1px solid transparent; transition: border-color .2s; }
.section-header a.see-all:hover { border-bottom-color: var(--blue); }

/* ── Article Cards ── */
.article-card { background: white; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; transition: box-shadow .2s, transform .2s; display: flex; flex-direction: column; }
.article-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.card-img { overflow: hidden; aspect-ratio: 16/9; }
.card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s; }
.article-card:hover .card-img img { transform: scale(1.04); }
.card-body { padding: 16px; flex: 1; display: flex; flex-direction: column; }
.card-body .cat-badge { margin-bottom: 8px; }
.card-body h3 { font-family: var(--ff-display); font-size: 1rem; font-weight: 700; line-height: 1.35; margin-bottom: 8px; flex: 1; }
.card-body h3 a:hover { color: var(--blue); }
.card-body .excerpt { font-size: .85rem; color: var(--text-muted); line-height: 1.55; margin-bottom: 10px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-meta { display: flex; align-items: center; justify-content: space-between; font-family: var(--ff-ui); font-size: .72rem; color: var(--gray-500); margin-top: auto; padding-top: 10px; border-top: 1px solid var(--gray-100); }
.card-meta .views { display: flex; align-items: center; gap: 4px; }

/* List-style card */
.article-list-card { display: flex; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--gray-100); align-items: flex-start; }
.article-list-card:last-child { border-bottom: none; }
.list-card-img { width: 88px; height: 66px; flex-shrink: 0; border-radius: var(--radius); overflow: hidden; }
.list-card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.article-list-card:hover .list-card-img img { transform: scale(1.05); }
.list-card-body h4 { font-family: var(--ff-display); font-size: .92rem; font-weight: 700; line-height: 1.3; margin-bottom: 5px; }
.list-card-body h4 a:hover { color: var(--blue); }
.list-card-meta { font-family: var(--ff-ui); font-size: .7rem; color: var(--gray-500); display: flex; gap: 8px; }
.list-card-num { font-family: var(--ff-display); font-size: 2rem; font-weight: 900; color: var(--gray-100); line-height: 1; flex-shrink: 0; width: 36px; text-align: center; padding-top: 4px; }

/* ── Sidebar ── */
.sidebar { display: flex; flex-direction: column; gap: 28px; }
.sidebar-widget { background: white; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.widget-header { background: var(--navy); color: white; font-family: var(--ff-ui); font-size: .72rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; padding: 9px 16px; }
.widget-body { padding: 16px; }

/* Trending widget */
.trending-item { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--gray-100); align-items: flex-start; }
.trending-item:last-child { border-bottom: none; }
.trending-num { font-family: var(--ff-display); font-size: 1.5rem; font-weight: 900; color: var(--gray-100); line-height: 1; flex-shrink: 0; width: 28px; }
.trending-title { font-family: var(--ff-display); font-size: .88rem; font-weight: 700; line-height: 1.3; }
.trending-title a:hover { color: var(--blue); }
.trending-meta { font-family: var(--ff-ui); font-size: .68rem; color: var(--gray-500); margin-top: 3px; }

/* ── Main Content Sections ── */
.content-section { padding: 32px 0; }
.content-section + .content-section { border-top: 1px solid var(--border); }

/* ── Article Page ── */
.article-page { padding: 32px 0; }
.article-headline { font-family: var(--ff-display); font-size: 2.4rem; font-weight: 900; line-height: 1.2; color: var(--navy); margin-bottom: 16px; }
.article-meta-bar { display: flex; align-items: center; gap: 16px; padding: 12px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); margin-bottom: 24px; font-family: var(--ff-ui); font-size: .82rem; color: var(--text-muted); flex-wrap: wrap; }
.article-meta-bar .author { color: var(--navy); font-weight: 600; }
.article-meta-bar .source-link a { color: var(--blue); }
.article-featured-img { margin-bottom: 28px; border-radius: var(--radius-md); overflow: hidden; }
.article-featured-img img { width: 100%; max-height: 480px; object-fit: cover; }
.article-img-caption { font-family: var(--ff-ui); font-size: .75rem; color: var(--gray-500); padding: 6px 0; }
.article-body { font-size: 1.1rem; line-height: 1.8; color: var(--text); }
.article-body p { margin-bottom: 1.4em; }
.article-body h2, .article-body h3 { font-family: var(--ff-display); color: var(--navy); margin: 1.8em 0 .8em; }
.article-body blockquote { border-left: 4px solid var(--gold); padding: 12px 20px; margin: 1.5em 0; background: var(--gray-50); font-style: italic; color: var(--gray-700); }

/* Share buttons */
.share-bar { display: flex; align-items: center; gap: 10px; padding: 20px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); margin: 28px 0; }
.share-label { font-family: var(--ff-ui); font-size: .75rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--gray-500); margin-right: 4px; }
.share-btn { display: flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 4px; font-family: var(--ff-ui); font-size: .78rem; font-weight: 600; color: white; transition: opacity .2s; }
.share-btn:hover { opacity: .85; }
.share-btn.fb { background: #1877f2; }
.share-btn.tw { background: #1da1f2; }
.share-btn.li { background: #0a66c2; }
.share-btn.copy { background: var(--gray-500); }

/* ── Search Page ── */
.search-hero { background: var(--navy); color: white; padding: 40px 0; }
.search-hero h1 { font-family: var(--ff-display); font-size: 2rem; font-weight: 900; margin-bottom: 20px; }
.search-form-large { display: flex; max-width: 600px; }
.search-form-large input { flex: 1; padding: 14px 20px; font-family: var(--ff-ui); font-size: 1rem; border: none; outline: none; border-radius: 4px 0 0 4px; }
.search-form-large button { background: var(--accent); color: white; padding: 14px 24px; font-family: var(--ff-ui); font-weight: 700; border-radius: 0 4px 4px 0; }

/* ── Pagination ── */
.pagination { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 32px 0; }
.pagination a, .pagination span { display: flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: var(--radius); font-family: var(--ff-ui); font-size: .85rem; font-weight: 600; border: 1px solid var(--border); background: white; color: var(--text); transition: all .2s; }
.pagination a:hover { background: var(--blue); color: white; border-color: var(--blue); }
.pagination span.current { background: var(--navy); color: white; border-color: var(--navy); }
.pagination span.dots { border: none; background: none; }

/* ── Footer ── */
.site-footer { background: var(--navy); color: rgba(255,255,255,.8); margin-top: 48px; }
.footer-top { padding: 48px 0 32px; display: grid; grid-template-columns: 1.5fr repeat(4, 1fr); gap: 32px; border-bottom: 1px solid rgba(255,255,255,.1); }
.footer-brand .logo-main { font-family: var(--ff-display); font-size: 1.5rem; font-weight: 900; color: white; margin-bottom: 10px; }
.footer-brand .logo-main span { color: var(--gold); }
.footer-brand p { font-size: .85rem; line-height: 1.6; color: rgba(255,255,255,.6); }
.footer-col h4 { font-family: var(--ff-ui); font-size: .72rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--gold); margin-bottom: 14px; }
.footer-col ul li { margin-bottom: 8px; }
.footer-col ul li a { font-family: var(--ff-ui); font-size: .82rem; color: rgba(255,255,255,.6); transition: color .2s; }
.footer-col ul li a:hover { color: white; }
.footer-bottom { padding: 16px 0; display: flex; align-items: center; justify-content: space-between; font-family: var(--ff-ui); font-size: .75rem; color: rgba(255,255,255,.45); }

/* ── Utility ── */
.badge-new { display: inline-block; background: var(--accent); color: white; font-family: var(--ff-ui); font-size: .6rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; padding: 2px 6px; border-radius: 2px; vertical-align: middle; margin-left: 6px; }
.divider { border: none; border-top: 1px solid var(--border); margin: 24px 0; }
.text-muted { color: var(--text-muted); }
.mt-32 { margin-top: 32px; }
.section-pad { padding: 32px 0; }
.ad-placeholder { background: var(--gray-50); border: 2px dashed var(--border); display: flex; align-items: center; justify-content: center; color: var(--gray-300); font-family: var(--ff-ui); font-size: .8rem; letter-spacing: .05em; text-transform: uppercase; height: 90px; border-radius: var(--radius); }

/* ── Mobile Nav Toggle ── */
.mobile-menu-btn { display: none; flex-direction: column; gap: 5px; padding: 8px; }
.mobile-menu-btn span { display: block; width: 24px; height: 2px; background: white; transition: all .3s; }

/* ── Responsive ── */
@media (max-width: 1100px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .footer-top { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 900px) {
  .layout-main { grid-template-columns: 1fr; }
  .hero-grid { grid-template-columns: 1fr; }
  .hero-main { grid-row: auto; }
  .hero-main img { height: 320px; }
  .article-headline { font-size: 1.8rem; }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .topbar .container { flex-direction: column; gap: 4px; }
  .header-inner { flex-wrap: wrap; padding: 8px 0; }
  .header-search { width: 100%; padding-bottom: 8px; }
  .header-search form { flex: 1; }
  .header-search input { width: auto; flex: 1; }
  .nav-menu { display: none; flex-direction: column; width: 100%; }
  .nav-menu.open { display: flex; }
  .nav-menu li a { padding: 11px 20px; border-bottom: 1px solid rgba(255,255,255,.08); border-bottom-width: 1px !important; }
  .mobile-menu-btn { display: flex; }
  .main-nav .container { flex-wrap: wrap; justify-content: flex-end; }
  .grid-2 { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr; }
  .footer-top { grid-template-columns: 1fr; }
  .logo-main { font-size: 1.4rem; }
}

@media (max-width: 480px) {
  .hero-main img { height: 220px; }
  .hero-main-overlay h2 { font-size: 1.3rem; }
  .article-headline { font-size: 1.4rem; }
  .share-bar { flex-wrap: wrap; }
}

/* ── No-image fallback ── */
.img-placeholder { background: linear-gradient(135deg, var(--navy) 0%, var(--blue-light) 100%); display: flex; align-items: center; justify-content: center; color: rgba(255,255,255,.3); font-size: 2rem; }
