/* ████████████████████████████████████████████████████████████████████████████
   pitwallnews.com — F1-themed stylesheet
   Dark base (#15151e), F1 red accent (#e10600), system fonts, responsive grid
   ████████████████████████████████████████████████████████████████████████████ */

/* ── Reset & base ─────────────────────────────────────────────────────────── */

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

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: #15151e;
  color: #e8e8ed;
  line-height: 1.6;
  min-height: 100vh;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}


/* ── Site header ──────────────────────────────────────────────────────────── */

.site-header {
  background: #1a1a26;
  border-bottom: 2px solid #e10600;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.75rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.logo-icon {
  width: auto;
  height: 28px;
}

.logo-text {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #fff;
}

.logo-text span {
  color: #e10600;
}

/* ── Site nav (category links) ────────────────────────────────────────────── */

.site-nav {
  display: flex;
  gap: 0.2rem;
}

.site-nav a {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.7rem;
  border-radius: 5px;
  font-size: 0.8rem;
  font-weight: 600;
  color: #999;
  transition: color 0.15s, background 0.15s;
}

.site-nav a:hover {
  color: var(--nc, #fff);
  background: rgba(255, 255, 255, 0.06);
}

.site-nav a.active {
  color: var(--nc, #fff);
  background: rgba(255, 255, 255, 0.1);
}

.nav-ico {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
  opacity: 0.7;
}

.site-nav a:hover .nav-ico,
.site-nav a.active .nav-ico {
  opacity: 1;
}

/* ── Hamburger button ────────────────────────────────────────────────────── */

.hamburger {
  display: none;
  background: none;
  border: none;
  color: #999;
  cursor: pointer;
  padding: 0.4rem;
  border-radius: 4px;
  transition: color 0.15s, background 0.15s;
}

.hamburger:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.hamburger svg {
  width: 20px;
  height: 20px;
  display: block;
}


/* ── Hero section ─────────────────────────────────────────────────────────── */

.hero {
  max-width: 1200px;
  margin: 1.5rem auto 0;
  padding: 0 1.25rem;
}

.hero-link {
  display: block;
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  background-color: #252535;
  background-size: cover;
  background-position: center;
  min-height: 320px;
}

.hero-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 3rem 2rem 2rem;
  background: linear-gradient(transparent, rgba(21, 21, 30, 0.85) 40%, rgba(21, 21, 30, 0.97));
}

.hero-title {
  font-size: 1.8rem;
  font-weight: 800;
  line-height: 1.2;
  color: #fff;
  margin: 0.5rem 0 0.5rem;
}

.hero-summary {
  font-size: 1rem;
  color: #bbb;
  line-height: 1.5;
  max-width: 700px;
}

.hero-meta {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 0.5rem;
  font-size: 0.8rem;
  color: #888;
}

.hero-source {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  opacity: 0.7;
}

.meta-source {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}


/* ── Content area ─────────────────────────────────────────────────────────── */

.content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 3rem;
}

.section-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 1.25rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #2a2a3a;
}


/* ── Article grid ─────────────────────────────────────────────────────────── */

.article-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

@media (max-width: 900px) {
  .article-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 560px) {
  .article-grid {
    grid-template-columns: 1fr;
  }
}


/* ── Card ─────────────────────────────────────────────────────────────────── */

.card {
  background: #1e1e2e;
  border-radius: 10px;
  overflow: hidden;
  transition: transform 0.15s, box-shadow 0.15s;
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.card a {
  display: block;
  height: 100%;
}

.card-image {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #252535;
}

.card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card-body {
  padding: 1rem 1.15rem 1.15rem;
}

.card-title {
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.3;
  color: #fff;
  margin: 0.4rem 0 0.5rem;
}

.card-summary {
  font-size: 0.85rem;
  color: #999;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.75rem;
  font-size: 0.75rem;
  color: #666;
}

.card-source {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-weight: 500;
}

.source-ico {
  width: 14px;
  height: 14px;
  border-radius: 2px;
  flex-shrink: 0;
  opacity: 0.85;
}


/* ── Cluster source count (on cards) ─────────────────────────────────────── */

.cluster-count {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.75rem;
  color: #888;
  margin-top: 4px;
}

.cluster-ico {
  width: 12px;
  height: 12px;
}


/* ── Category badge ───────────────────────────────────────────────────────── */

.cat-badge {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border-radius: 3px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #fff;
}


/* ── Article detail page ──────────────────────────────────────────────────── */

.article-hero {
  position: relative;
  max-height: 400px;
  overflow: hidden;
}

.article-hero img {
  width: 100%;
  object-fit: cover;
  max-height: 400px;
}

.article-hero-fade {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 120px;
  background: linear-gradient(transparent, #15151e);
}

.article-content {
  max-width: 720px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 3rem;
}

.back-link {
  display: inline-block;
  color: #888;
  font-size: 0.85rem;
  margin-bottom: 1rem;
  transition: color 0.15s;
}

.back-link:hover {
  color: #e10600;
}

.article-title {
  font-size: 1.8rem;
  font-weight: 800;
  line-height: 1.2;
  color: #fff;
  margin: 0.5rem 0 1.25rem;
}

.article-body p {
  font-size: 1.05rem;
  line-height: 1.7;
  color: #ccc;
  margin-bottom: 1rem;
}

.article-meta {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid #2a2a3a;
}

.meta-date,
.meta-source {
  font-size: 0.85rem;
  color: #888;
  margin-bottom: 0.25rem;
}

.read-original {
  display: inline-block;
  margin-top: 1.25rem;
  padding: 0.6rem 1.2rem;
  background: #e10600;
  color: #fff;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 600;
  transition: background 0.15s;
}

.read-original:hover {
  background: #c00500;
}


/* ── "Also reported by" section (detail pages) ───────────────────────────── */

.also-reported {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid #2a2a3a;
}

.also-reported h3 {
  font-size: 0.9rem;
  color: #888;
  margin-bottom: 0.75rem;
}

.also-reported-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.also-reported-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: #1e1e2e;
  border-radius: 6px;
  font-size: 0.85rem;
  color: #ccc;
  transition: background 0.2s;
}

.also-reported-item:hover {
  background: #2a2a3e;
}

.also-in {
  margin-top: 1.5rem;
  font-size: 0.85rem;
  color: #888;
}

.also-in a {
  color: #4a9eff;
  margin-left: 0.35rem;
  transition: color 0.15s;
}

.also-in a:hover {
  color: #e10600;
}


/* ── Category page header ─────────────────────────────────────────────────── */

.cat-header {
  max-width: 1200px;
  margin: 1.5rem auto 0;
  padding: 0 1.25rem;
}

.cat-header-inner {
  background: #1e1e2e;
  border-radius: 12px;
  padding: 2rem 2rem 1.75rem;
  border-left: 4px solid var(--cat-color, #888);
}

.cat-header-icon .nav-ico {
  width: 28px;
  height: 28px;
  color: var(--cat-color, #888);
  opacity: 0.9;
}

.cat-header h1 {
  font-size: 1.6rem;
  font-weight: 800;
  color: #fff;
  margin: 0.5rem 0 0.3rem;
}

.cat-header p {
  font-size: 0.95rem;
  color: #999;
}

/* ── Show more/less toggle ───────────────────────────────────────────────── */

.hidden-card {
  display: none;
}

.article-grid.show-all .hidden-card {
  display: block;
}

.show-toggle {
  display: block;
  margin: 1.5rem auto 0;
  padding: 0.6rem 1.5rem;
  background: #1e1e2e;
  color: #999;
  border: 1px solid #2a2a3a;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}

.show-toggle:hover {
  color: #fff;
  border-color: #555;
}

/* ── About page ──────────────────────────────────────────────────────────── */

.about-content {
  max-width: 720px;
  margin: 0 auto;
  padding: 2.5rem 1.25rem 3rem;
}

.about-content h1 {
  font-size: 1.8rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 1.25rem;
}

.about-content h2 {
  font-size: 1.2rem;
  font-weight: 700;
  color: #fff;
  margin: 2rem 0 0.75rem;
  padding-top: 1.5rem;
  border-top: 1px solid #2a2a3a;
}

.about-content p {
  font-size: 1.05rem;
  line-height: 1.7;
  color: #ccc;
  margin-bottom: 1rem;
}

.about-mission {
  margin-top: 2rem;
  font-size: 1.3rem;
  font-weight: 800;
  font-style: italic;
  color: #e10600;
}

/* ── Archive button (homepage) ────────────────────────────────────────────── */

.archive-btn {
  display: block;
  text-align: center;
  margin: 2rem auto 0;
  padding: 0.7rem 2rem;
  background: #1e1e2e;
  color: #ccc;
  border: 1px solid #2a2a3a;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 600;
  transition: color 0.15s, border-color 0.15s;
  width: fit-content;
}

.archive-btn:hover {
  color: #fff;
  border-color: #e10600;
}

/* ── Archive page ────────────────────────────────────────────────────────── */

.archive-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1.25rem 3rem;
}

.archive-content h1 {
  font-size: 1.6rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 1.25rem;
}

.archive-search {
  margin-bottom: 1rem;
}

.archive-search input {
  width: 100%;
  padding: 0.7rem 1rem;
  background: #1e1e2e;
  border: 1px solid #2a2a3a;
  border-radius: 8px;
  color: #e8e8ed;
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.15s;
}

.archive-search input::placeholder {
  color: #666;
}

.archive-search input:focus {
  border-color: #e10600;
}

.archive-filters {
  margin-bottom: 1.25rem;
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.5rem;
}

.filter-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.35rem 0.75rem;
  background: #1e1e2e;
  border: 1px solid #2a2a3a;
  border-radius: 5px;
  color: #999;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.filter-btn:hover {
  color: #fff;
  border-color: #555;
}

.filter-btn.active {
  color: var(--fc, #fff);
  border-color: var(--fc, #e10600);
  background: rgba(255, 255, 255, 0.06);
}

.filter-btn .nav-ico {
  width: 13px;
  height: 13px;
}

.archive-count {
  font-size: 0.8rem;
  color: #666;
  margin-bottom: 1rem;
}

.no-results {
  color: #888;
  font-size: 0.95rem;
  text-align: center;
  padding: 2rem 0;
}

/* Nav category color CSS custom properties for archive cards */
:root {
  --nc-news: #e10600;
  --nc-analysis: #4a9eff;
  --nc-technical: #00c853;
}

/* ── Footer ───────────────────────────────────────────────────────────────── */

.site-footer {
  background: #111119;
  border-top: 1px solid #2a2a3a;
  padding: 2rem 1.25rem 1.5rem;
  margin-top: 2rem;
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  text-align: center;
}

.footer-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 1.25rem;
}

.footer-logo {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.footer-logo img {
  width: auto;
  height: 32px;
}

.footer-logo .logo-text {
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #fff;
}

.footer-logo .logo-text span {
  color: #e10600;
}

.footer-tagline {
  font-size: 0.9rem;
  font-style: italic;
  color: #888;
  margin-top: 0.4rem;
}

.footer-about-link {
  margin-top: 0.5rem;
}

.footer-about-link a {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #4a9eff;
  transition: color 0.15s;
}

.footer-about-link a:hover {
  color: #e10600;
}

.lang-switch {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.lang-switch a {
  padding: 0.3rem 0.65rem;
  border-radius: 4px;
  font-size: 0.8rem;
  color: #888;
  transition: color 0.15s, background 0.15s;
}

.lang-switch a:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.lang-switch a.active {
  color: #e10600;
}

.footer-legal {
  padding-top: 0.75rem;
  border-top: 1px solid #1e1e2e;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgba(255, 255, 255, 0.2);
}


/* ── Responsive tweaks ────────────────────────────────────────────────────── */

@media (max-width: 768px) {
  .site-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    background: #1a1a26;
    border-bottom: 2px solid #e10600;
    padding: 0.5rem 0;
    z-index: 99;
  }

  .site-nav.open {
    display: flex;
  }

  .site-nav a {
    padding: 0.65rem 1.25rem;
    border-radius: 0;
    font-size: 0.9rem;
  }

  .site-nav a .nav-ico {
    width: 15px;
    height: 15px;
  }

  .hamburger {
    display: block;
  }

  .site-header {
    position: relative;
  }
}

@media (max-width: 560px) {
  .hero {
    margin-top: 1rem;
  }

  .hero-link {
    min-height: 360px;
  }

  .hero-title {
    font-size: 1.3rem;
  }

  .hero-overlay {
    padding: 2rem 1.25rem 1.25rem;
  }

  .article-title {
    font-size: 1.4rem;
  }

  .cat-header-inner {
    padding: 1.5rem 1.25rem 1.25rem;
  }

  .cat-header h1 {
    font-size: 1.3rem;
  }
}
