/* ==========================================================
   Magazine-style template
   Layout: top bar > header/nav > hero grid > content + sidebar > footer
   No frameworks, no JavaScript. Change the colors/fonts below
   to restyle the whole page.
   ========================================================== */

/* ---------- 1. Design tokens (edit these first) ---------- */
:root {
  --accent: #c8102e;        /* category labels, underlines, hover */
  --ink: #1f1f1f;           /* main text */
  --muted: #6e6e6e;         /* dates, secondary text */
  --line: #e2e2e2;          /* thin borders */
  --dark: #1b1b1b;          /* top bar + footer background */
  --placeholder: #8c9199;   /* image placeholder color */
  --max-width: 1200px;

  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* ---------- 2. Base / reset ---------- */
*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink);
  background: #fff;
}

a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }
a:focus-visible, input:focus-visible, button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

h1, h2, h3 { line-height: 1.25; margin: 0; }
ul { list-style: none; margin: 0; padding: 0; }
p { margin: 0; }

/* Centered page container */
.wrap {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
}

/* Hidden visually but still read by screen readers */
.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------- 3. Small reusable pieces ---------- */

/* Red category label */
.cat {
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.cat:hover { text-decoration: underline; }

/* Section headings: uppercase title, thin rule, short red underline */
.section-title {
  position: relative;
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
  font-size: 1.1rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.section-title::after {
  content: "";
  position: absolute;
  left: 0; bottom: -1px;
  width: 60px; height: 3px;
  background: var(--accent);
}

/* ---------- 4. Top bar ---------- */
.topbar {
  background: var(--dark);
  color: #fff;
  font-size: 0.85rem;
}
.topbar-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  height: 40px;
}
.trending-label {
  flex: none;
  padding: 2px 10px;
  background: var(--accent);
  text-transform: uppercase;
  font-size: 0.75rem;
}
/* The trending list sits in one line and hides what doesn't fit */
.trending-list {
  display: flex;
  gap: 24px;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
}
.social { display: flex; gap: 14px; flex: none; }
.topbar a:hover { color: #fff; text-decoration: underline; }

/* ---------- 5. Header, logo, navigation, search ---------- */
.site-header { border-bottom: 1px solid var(--line); }

.header-inner {
  display: flex;
  align-items: center;
  gap: 32px;
  min-height: 80px;
}

.logo {
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.main-nav { flex: 1; }
.main-nav > ul { display: flex; gap: 4px; }

.main-nav a {
  display: block;
  padding: 12px 14px;
  font-weight: 700;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

/* Dropdown: hidden until hover or keyboard focus */
.has-sub { position: relative; }
.sub {
  display: none;
  position: absolute;
  top: 100%; left: 0;
  z-index: 10;
  min-width: 180px;
  padding: 6px 0;
  background: #fff;
  border: 1px solid var(--line);
  border-top: 3px solid var(--accent);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.1);
}
.sub a {
  padding: 8px 16px;
  font-size: 0.85rem;
  font-weight: 500;
  text-transform: none;
}
.has-sub:hover > .sub,
.has-sub:focus-within > .sub { display: block; }

.search { display: flex; }
.search input {
  width: 150px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-right: 0;
  font: inherit;
  font-size: 0.9rem;
}
.search button {
  padding: 8px 14px;
  border: 0;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
}

/* ---------- 6. Hero grid ---------- */
/* Two columns: big story on the left (spans 3 rows), three small on the right */
.hero {
  display: grid;
  grid-template-columns: 2fr 1fr;
  grid-template-rows: repeat(3, 150px);
  gap: 4px;
  margin-top: 24px;
}

.tile {
  position: relative;
  display: flex;
  align-items: flex-end;
  background: var(--placeholder);   /* swap for background-image: url(...) */
  background-size: cover;
  color: #fff;
}
.tile-large { grid-row: span 3; }

/* Text sits on a dark fade so it stays readable over any photo */
.tile-text {
  width: 100%;
  padding: 40px 18px 16px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.75), transparent);
}
.tile .cat { color: #fff; background: var(--accent); padding: 2px 8px; }
.tile h2 { margin: 8px 0 4px; font-size: 1.9rem; }
.tile h3 { margin-top: 6px; font-size: 1.05rem; }
.tile time { font-size: 0.8rem; opacity: 0.85; }
.tile a:hover { color: #fff; text-decoration: underline; }

/* ---------- 7. Content + sidebar layout ---------- */
.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 40px;
  margin: 40px 0;
}

.category { margin-bottom: 40px; }

/* Two cards per row */
.card-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.thumb {
  display: block;
  aspect-ratio: 3 / 2;
  background: var(--placeholder);   /* swap for a real image */
  background-size: cover;
}

.meta { margin: 12px 0 6px; font-size: 0.8rem; color: var(--muted); }
.meta .cat { margin-right: 8px; }

.card h3 { font-size: 1.15rem; }
.excerpt { margin-top: 8px; font-size: 0.95rem; color: var(--muted); }

/* ---------- 8. Sidebar ---------- */
.banner {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 300 / 170;
  margin-bottom: 32px;
  background: var(--placeholder);
  color: #fff;
  font-size: 0.85rem;
}
.banner:hover { color: #fff; }

.widget { margin-bottom: 32px; }

.social-list { display: flex; flex-wrap: wrap; gap: 8px; }
.social-list a {
  display: block;
  padding: 6px 12px;
  border: 1px solid var(--line);
  font-size: 0.85rem;
}

/* Simple vertical list with a rule between items (used in sidebar + footer) */
.link-list li { padding: 8px 0; border-bottom: 1px solid var(--line); }
.link-list li:last-child { border-bottom: 0; }

/* ---------- 9. Footer ---------- */
.site-footer {
  background: var(--dark);
  color: #ccc;
  font-size: 0.95rem;
}
.footer-inner {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 40px;
  padding-top: 40px;
  padding-bottom: 24px;
}
.logo-footer { display: inline-block; margin-bottom: 12px; color: #fff; }
.footer-title {
  margin-bottom: 8px;
  color: #fff;
  font-size: 0.95rem;
  text-transform: uppercase;
}
.site-footer .link-list li { border-bottom-color: #333; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.copyright {
  padding-top: 16px;
  padding-bottom: 24px;
  border-top: 1px solid #333;
  font-size: 0.85rem;
  color: #999;
}

/* ---------- 10. Responsive ---------- */

/* Tablet: sidebar drops below the content */
@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .header-inner { flex-wrap: wrap; gap: 8px 20px; padding-top: 12px; padding-bottom: 12px; }
  .main-nav { order: 3; flex-basis: 100%; overflow-x: auto; }
  .main-nav > ul { white-space: nowrap; }
  .sub { display: none !important; }   /* keep nav simple on touch screens */
}

/* Phone: single-column hero and cards */
@media (max-width: 600px) {
  .trending-list, .social { display: none; }
  .hero { grid-template-columns: 1fr; grid-template-rows: 260px repeat(3, 120px); }
  .tile-large { grid-row: auto; }
  .tile h2 { font-size: 1.4rem; }
  .card-grid { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr; }
  .search { width: 100%; }
  .search input { flex: 1; width: auto; }
}
