@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;500;600;700;800;900&family=Source+Sans+3:wght@300;400;500;600;700&display=swap');

:root {
  --bg: hsl(40,20%,97%);
  --fg: hsl(220,20%,10%);
  --card: hsl(0,0%,100%);
  --card-fg: hsl(220,20%,10%);
  --primary: hsl(0,72%,51%);
  --primary-fg: hsl(0,0%,100%);
  --secondary: hsl(220,14%,92%);
  --secondary-fg: hsl(220,20%,10%);
  --muted: hsl(40,15%,93%);
  --muted-fg: hsl(220,10%,46%);
  --border: hsl(220,13%,87%);
  --font-display: 'Playfair Display', Georgia, serif;
  --font-body: 'Source Sans 3', -apple-system, sans-serif;
  --radius: 0.375rem;
}

/* Loading bar */
#loading-bar {
  position: fixed; top: 0; left: 0; width: 0; height: 3px;
  background: var(--primary); z-index: 9999;
  pointer-events: none;
}
#loading-bar.active {
  width: 70%;
  transition: width .6s cubic-bezier(.1,.7,.3,1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: var(--font-body); background: var(--bg); color: var(--fg); line-height: 1.6; }
h1, h2, h3, h4, h5, h6 { font-family: var(--font-display); }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }
.container { max-width: 1280px; margin: 0 auto; padding: 0 1rem; }

/* Skeleton */
.skeleton { background: linear-gradient(90deg, var(--muted) 25%, hsl(40,15%,89%) 50%, var(--muted) 75%); background-size: 200% 100%; animation: shimmer 1.5s infinite; border-radius: var(--radius); }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* Header */
.header { border-bottom: 1px solid var(--border); background: var(--card); }
.header-top { border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; padding: .5rem 0; font-size: .75rem; color: var(--muted-fg); text-transform: uppercase; letter-spacing: .05em; font-weight: 500; }
.header-logo { padding: 1.5rem 0; text-align: center; }
.header-logo h1 { font-size: 2.5rem; font-weight: 900; letter-spacing: -.02em; display: inline; }
.header-logo .accent-line { width: 6rem; height: 2px; background: var(--primary); margin: .25rem auto 0; }
.header-logo .subtitle { font-size: .8rem; font-weight: 500; color: var(--muted-fg); letter-spacing: .3em; text-transform: uppercase; margin-top: .25rem; }
nav.main-nav { border-top: 1px solid var(--border); }
nav.main-nav ul { display: flex; align-items: center; justify-content: center; gap: .25rem; list-style: none; padding: .25rem 0; flex-wrap: wrap; }
nav.main-nav a { display: inline-block; padding: .5rem 1rem; font-size: .875rem; font-weight: 500; color: var(--muted-fg); transition: color .2s; }
nav.main-nav a:hover, nav.main-nav a.active { color: var(--primary); }
nav.main-nav a.home-link { font-weight: 600; color: var(--fg); }

/* Breaking ticker */
.ticker { background: var(--primary); color: var(--primary-fg); overflow: hidden; }
.ticker-inner { display: flex; align-items: center; }
.ticker-label { flex-shrink: 0; padding: .5rem 1rem .5rem 0; font-size: .75rem; font-weight: 900; text-transform: uppercase; letter-spacing: .05em; border-right: 1px solid rgba(255,255,255,.3); }
.ticker-content { overflow: hidden; padding: .5rem 0 .5rem 1rem; white-space: nowrap; }
.ticker-content span { font-size: .875rem; font-weight: 500; }
.ticker-sep { margin: 0 1.5rem; opacity: .5; }
@keyframes marquee { 0% { transform: translateX(0); } 100% { transform: translateX(-50%); } }
.ticker-scroll { display: inline-block; animation: marquee 30s linear infinite; }

/* Cards */
.card-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem; }
@media (max-width: 1024px) { .card-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 768px) { .card-grid { grid-template-columns: 1fr; } }
.card a { display: block; }
.card-img { overflow: hidden; border-radius: var(--radius); aspect-ratio: 16/10; background: var(--muted); }
.card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s; }
.card a:hover .card-img img { transform: scale(1.05); }
.card-meta { margin-top: .75rem; }
.card-cat { font-size: .75rem; font-weight: 600; color: var(--primary); text-transform: uppercase; }
.card-title { font-size: 1.125rem; font-weight: 700; line-height: 1.3; margin-top: .25rem; transition: color .2s; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-family: var(--font-display); }
.card a:hover .card-title { color: var(--primary); }
.card-excerpt { font-size: .875rem; color: var(--muted-fg); margin-top: .375rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-info { display: flex; align-items: center; gap: .5rem; margin-top: .5rem; font-size: .75rem; color: var(--muted-fg); }
.card-info .author { font-weight: 500; }

/* Featured hero */
.hero-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 1.5rem; }
@media (max-width: 1024px) { .hero-grid { grid-template-columns: 1fr; } }
.hero-main { position: relative; overflow: hidden; border-radius: var(--radius); min-height: 350px; display: block; }
.hero-main img { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; }
.hero-main .overlay { position: absolute; inset: 0; background: linear-gradient(to top, rgba(0,0,0,.8), rgba(0,0,0,.3), transparent); }
.hero-main .hero-content { position: absolute; bottom: 0; left: 0; right: 0; padding: 2rem; color: #fff; }
.hero-main .hero-content h2 { font-size: 2rem; font-weight: 700; line-height: 1.2; }
.hero-main .hero-content p { color: rgba(255,255,255,.8); margin-top: .5rem; font-size: 1rem; }
.badge { display: inline-block; padding: .125rem .5rem; font-size: .75rem; font-weight: 600; border-radius: var(--radius); }
.badge-breaking { background: var(--primary); color: var(--primary-fg); margin-bottom: .75rem; animation: pulse 2s infinite; }
.badge-cat { background: rgba(255,255,255,.2); color: #fff; backdrop-filter: blur(4px); margin-bottom: .75rem; margin-left: .25rem; }
.badge-secondary { background: var(--secondary); color: var(--secondary-fg); }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .7; } }
.hero-side { display: flex; flex-direction: column; gap: 1rem; }
.hero-side-card { flex: 1; display: flex; flex-direction: column; }
.hero-side-card .card-img { aspect-ratio: 16/10; }

/* Compact cards */
.compact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 3rem; }
@media (max-width: 1024px) { .compact-grid { grid-template-columns: 1fr; } }
.compact-col h2 { font-size: 1.125rem; font-weight: 700; border-bottom: 2px solid var(--primary); padding-bottom: .5rem; margin-bottom: .5rem; }
.compact-card { display: flex; gap: 1rem; padding: 1rem 0; border-bottom: 1px solid var(--border); }
.compact-card:last-child { border-bottom: none; }
.compact-card .thumb { flex-shrink: 0; width: 5rem; height: 5rem; border-radius: var(--radius); overflow: hidden; background: var(--muted); }
.compact-card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.compact-card .info { flex: 1; min-width: 0; }
.compact-card .card-title { font-size: .875rem; }

/* Section divider */
.divider { display: flex; align-items: center; gap: 1rem; padding: 2rem 0; }
.divider .line { flex: 1; height: 1px; background: var(--border); }
.divider h2 { font-size: 1.25rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; }

/* Footer */
.footer { border-top: 1px solid var(--border); background: var(--card); margin-top: 4rem; padding: 3rem 0; text-align: center; }
.footer .brand { display: flex; align-items: center; justify-content: center; gap: .5rem; font-size: 1.25rem; font-weight: 700; font-family: var(--font-display); }
.footer p { font-size: .875rem; color: var(--muted-fg); max-width: 28rem; margin: .75rem auto 0; }
.footer .copy { font-size: .75rem; color: var(--muted-fg); margin-top: 1rem; }

/* Article page */
.article-hero { width: 100%; aspect-ratio: 21/9; max-height: 500px; overflow: hidden; position: relative; }
.article-hero img { width: 100%; height: 100%; object-fit: cover; }
.article-hero .gradient { position: absolute; inset: 0; background: linear-gradient(to top, rgba(0,0,0,.5), transparent); }
.article-body { max-width: 48rem; margin: -4rem auto 0; position: relative; z-index: 1; background: var(--card); border-radius: var(--radius); padding: 1.5rem 2.5rem; box-shadow: 0 4px 20px rgba(0,0,0,.08); border: 1px solid var(--border); }
.article-body .back { display: inline-flex; align-items: center; gap: .25rem; font-size: .875rem; color: var(--muted-fg); margin-bottom: 1rem; transition: color .2s; }
.article-body .back:hover { color: var(--primary); }
.article-body .badges { display: flex; align-items: center; gap: .5rem; margin-bottom: .75rem; }
.article-body h1 { font-size: 2rem; font-weight: 700; line-height: 1.25; margin-bottom: 1rem; }
.article-body .meta { display: flex; align-items: center; gap: .75rem; font-size: .875rem; color: var(--muted-fg); margin-bottom: 1.5rem; padding-bottom: 1.5rem; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.article-body .meta .author-name { font-weight: 600; color: var(--fg); }
.article-body .content p { margin-bottom: 1rem; font-size: 1rem; line-height: 1.75; }
.related { max-width: 64rem; margin: 3rem auto 0; padding: 0 1rem; }

/* Category page */
.cat-title { font-size: 1.875rem; font-weight: 700; border-bottom: 2px solid var(--primary); padding-bottom: .75rem; display: inline-block; margin-bottom: 2rem; }

/* 404 */
.not-found { text-align: center; padding: 4rem 1rem; }
.not-found h1 { font-size: 2rem; font-weight: 700; margin-bottom: .5rem; }
.not-found p { color: var(--muted-fg); margin-bottom: 1rem; }
.not-found a { color: var(--primary); }

/* Responsive */
@media (max-width: 768px) {
  .hero-main .hero-content h2 { font-size: 1.25rem; }
  .hero-main { min-height: 250px; }
  .article-body { margin-top: -2rem; padding: 1rem 1.25rem; }
  .article-body h1 { font-size: 1.5rem; }
  .header-logo h1 { font-size: 2rem; }
  .compact-card .thumb { width: 4rem; height: 4rem; }
}