/* News-focused stylesheet for The Plausible Post */
/* Objective: make the site read and feel more like a newspaper (The Onion / WaPo) */

/* Variables */
:root{
  --max-width: 1280px;
  --accent: #c62828;
  --accent-2: #8b1d1d;
  --muted: #4f545c;
  --bg: #f0eae1;
  --card: #fcf8f1;
  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
  --font-serif: "Merriweather", Georgia, "Times New Roman", serif;
  --radius: 8px;
  --shadow: 0 6px 20px rgba(12,18,24,0.06);
  --thin-rule: rgba(12,18,24,0.06);
  --reading-width: 85ch;
}

/* Resets */
* { box-sizing: border-box; }
html,body { height:100%; }
body{
  margin:0;
  font-family: var(--font-sans);
  background: var(--bg); /* subtle grey background for whole page */
  background-image: linear-gradient(rgba(0,0,0,.01) 1px, transparent 1px), linear-gradient(90deg, rgba(0,0,0,.01) 1px, transparent 1px);
  background-size: 10px 10px; /* Subtle grid pattern */
  color:#0b1220;
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
  line-height:1.65;
  font-size:16px;
}

/* Page container */
.container{
  max-width:var(--max-width);
  margin:0 auto;
  padding:0 0.75rem; /* tightened horizontal padding so main content takes more space */
}

/* Utility/topbar - thin band like a newspaper edition line */
.topbar{
  background:transparent;
  font-size:.9rem;
  color:var(--muted);
  padding:.35rem 0;
  text-align:right;
  border-bottom:1px solid var(--thin-rule);
}

/* Masthead */
/* Match the page background so header doesn't visually change on scroll */
.site-header{
  background: var(--bg);
  padding:.5rem 0 .6rem 0;
  border-bottom:1px solid var(--thin-rule);
}
.header-inner{
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:1rem;
}

/* Masthead with logo + brand */
.masthead{
  display:flex;
  align-items:center;
  gap:.75rem;
  text-decoration:none;
  color:inherit;
}

/* Centered masthead variant (logo-only) */
.masthead-center {
  display:flex;
  justify-content:center;
  align-items:center;
  padding: .5rem 0;
}
.site-logo-centered {
  width: 280px; /* Increased width */
  height: auto;
  display:block;
  margin: 0 auto;
}
@media (max-width: 700px) {
  .site-logo-centered { width: 180px; } /* Increased width for smaller screens */
}
.site-logo{
  width:64px;
  height:auto;
  display:block;
  border-radius:6px;
  box-shadow: 0 6px 18px rgba(11,17,26,0.06);
}
.brand{
  display:flex;
  flex-direction:column;
  line-height:1;
}
.site-title{
  margin:0;
  font-family: var(--font-serif);
  font-weight:800;
  letter-spacing:-1px;
  font-size:1.6rem;
  line-height:1;
  text-transform:uppercase;
  color:#081426;
}
.site-title a{ color:inherit; text-decoration:none; }
.site-tagline{
  margin:0;
  color:var(--muted);
  font-size:.825rem;
  font-weight:700;
  letter-spacing:.6px;
  text-transform:uppercase;
}

/* Section navigation styled like newspaper sections */
.main-nav{
  display:flex;
  gap:.5rem;
  margin-top:.5rem;
  flex-wrap:wrap;
  align-items:center;
}
.main-nav a{
  font-size:.85rem;
  color:var(--muted);
  padding:.35rem .55rem;
  border-radius:999px;
  text-decoration:none;
  font-weight:600;
  letter-spacing:.3px;
}
.main-nav a:hover{ color:var(--accent); background:rgba(198,40,40,0.03); transform:translateY(-1px); }

/* Place the search at the far right of the nav */
.nav-search{
  margin-left:auto;
  display:flex;
  align-items:center;
  position:relative;
}

/* Smaller search input inside nav */
.nav-search .site-search{
  width:220px;
  padding:.45rem .6rem;
  border-radius:24px;
  border:1px solid rgba(11,17,26,0.08);
  background: var(--card);
}

/* On small screens, move search below nav items and full width */
@media (max-width: 700px) {
  .nav-search{
    order: 999; /* push to new line */
    width: 100%;
    margin-top: .5rem;
  }
  .nav-search .site-search{
    width:100%;
    max-width: 420px;
  }
}

/* Search results container */
.search-results{
  position:absolute;
  top:100%;
  left:0;
  right:0;
  background:var(--card);
  border:1px solid var(--thin-rule);
  border-radius:8px;
  box-shadow:var(--shadow);
  z-index:10;
  padding:.5rem 0;
  max-height:300px;
  overflow-y:auto;
}

/* Individual search item */
.search-item{
  display:block;
  padding:.5rem 1rem;
  text-decoration:none;
  color:inherit;
  border-bottom:1px solid rgba(11,17,26,0.02);
}
.search-item:last-child{ border-bottom:none; }
.search-item:hover{ background:rgba(11,17,26,0.02); }

.search-item-title{
  font-weight:700;
  color:#0b1220;
  line-height:1.2;
  font-size:.95rem;
}
.search-item-meta{
  color:var(--muted);
  font-size:.8rem;
  margin-top:.15rem;
}
.search-item-excerpt{
  color:#374151;
  font-size:.85rem;
  margin-top:.25rem;
}

/* No results message */
.search-empty{
  padding:.5rem 1rem;
  color:var(--muted);
  font-size:.9rem;
  text-align:center;
}
 
/* Section separator */
.section-separator{
  border-top:2px solid var(--thin-rule); /* Thicker rule */
  margin:2rem 0; /* More vertical margin */
}
 
/* Breaking / top story band */
.breaking{
  background:linear-gradient(90deg, var(--accent), var(--accent-2));
  border-top:1px solid var(--accent);
  padding:.55rem 1.25rem; /* Added horizontal padding */
  margin:.75rem auto;
  max-width:var(--max-width);
  border-radius:6px;
  font-weight:700;
  color:#fff; /* Changed text color to white */
  display:flex; /* Use flexbox for alignment */
  align-items:center;
  justify-content:center; /* Centered content */
  gap:1rem; /* Space between label and text */
}
.breaking a{
  color:inherit;
  text-decoration:none;
}
.breaking-label{
  background:#fff;
  color:var(--accent);
  padding:.2rem .6rem;
  border-radius:4px;
  font-size:.8rem;
  font-weight:900;
  letter-spacing:.5px;
  text-transform:uppercase;
}
.breaking-text{
  font-size:1.1rem; /* Increased font size */
  font-weight:700;
  flex:1; /* Allow text to take remaining space */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color:inherit;
}

/* Homepage layout: lead story + grid (with right-column sidebar) */
/* Increase left column so articles take more horizontal space */
.home-grid{
  display: grid;
  grid-template-columns: 3fr 360px; /* left (articles) larger, right (sidebar) fixed */
  gap: 1rem;
  padding: 1rem 0 2rem 0;
  align-items: start;
}
.articles-main { }
@media (max-width: 999px){
  .home-grid{ grid-template-columns: 1fr; }
}

/* Article list sits inside the main column; teasers stack vertically */
.article-list{
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  padding: 0;
}

/* Sidebar hidden on small screens; will become a fixed-width right column on wide screens */
.sidebar{
  display: none;
}

/* Larger screens: two-column layout with a 360px sidebar */
@media (min-width: 1000px) {
  .home-grid {
    grid-template-columns: 2fr 360px;
    gap: 1.25rem;
  }
  .sidebar{
    display: block;
  }
}

/* On smaller screens fall back to single column */
@media (max-width: 999px){
  .article-list{ grid-template-columns: 1fr; }
}

/* teaser cards — right-side image with left text column (left column increased) */
.teaser{
  background:var(--card);
  padding:1rem;
  border-radius:8px;
  border:1px solid var(--thin-rule);
  box-shadow:var(--shadow);
  display:grid;
  grid-template-columns: 1fr 360px; /* narrower image column => wider text column */
  gap:1.25rem;
  align-items:center;
  overflow: hidden;
}

/* Content column (left) */
.teaser-content { display:flex; flex-direction:column; gap:.6rem; }
.teaser-title{
  margin: 0 0 .25rem 0;
  font-size: 1.6rem;
  font-family: var(--font-serif);
  line-height: 1.18;
  letter-spacing: -0.4px;
  color: #081426;
  font-weight: 800;
}
.teaser-title a{ color:inherit; text-decoration:none; }
.teaser-lede{ margin:0; color:#374151; font-size:1.02rem; max-width:48ch; }
.teaser-meta{ margin: .5rem 0 0 0; color:var(--muted); font-size:.92rem; }
.teaser-author{ margin: .15rem 0 0 0; font-weight:700; color:#111827; }

/* Media column (right) */
.teaser-media{ margin:0; display:block; overflow:hidden; border-radius:6px; }
.teaser-media img{
  display:block;
  width:100%;
  height:420px;
  object-fit:cover;
  object-position:center;
  border-radius:6px;
}

/* Mobile / narrow screens: stack with image below content and smaller image height */
@media (max-width: 999px) {
  .teaser{
    grid-template-columns: 1fr;
  }
  .teaser-media img{
    height:220px;
    width:100%;
  }
}

/* Smaller devices: tighter padding */
@media (max-width: 599px) {
  .teaser{ padding:.75rem; gap:.75rem; }
  .teaser-title{ font-size:1.25rem; }
  .teaser-lede{ font-size:.95rem; }
  .teaser-media img{ height:180px; }
}

/* Lead story: make first teaser big and prominent when inside .article-list */
.article-list > .teaser:first-child{
  grid-column: 1 / -1;
  display:block;
  padding:1.25rem;
  border-radius:10px;
  background: var(--card);
  box-shadow:0 24px 60px rgba(11,17,26,0.08);
  border:1px solid rgba(11,17,26,0.04);
}
.article-list > .teaser:first-child .teaser-title{
  font-family: var(--font-serif);
  font-size:2rem;
  letter-spacing:-1px;
  margin:.25rem 0;
}
.article-list > .teaser:first-child .teaser-excerpt{
  font-size:1.05rem;
  color:#111827;
}

/* Reduce lead story image height so the featured image isn't overwhelming */
.article-list > .teaser:first-child .teaser-media img{
  height:320px;
  width:100%;
  object-fit:cover;
  object-position:center;
  border-radius:6px;
}

/* Slightly larger on wide screens but still smaller than the default 420px */
@media (min-width: 1000px) {
  .article-list > .teaser:first-child .teaser-media img{
    height:360px;
  }
}
/* teaser internals */
/* teaser-title is defined earlier for the homepage layout; avoid duplicate overrides here */
.teaser-title a{ color:inherit; }
.teaser-meta{ margin:0; color:var(--muted); font-size:.85rem; }
.teaser-excerpt{ margin:.5rem 0; color:#2b3036; flex:1; }

/* Media within teasers (if present in future) */
.teaser img{ width:100%; height:auto; border-radius:6px; object-fit:cover; }

/* 'Read' link as small pill and section indicator on the side */
.read-more{
  align-self:flex-start;
  background:transparent;
  color:var(--accent);
  border:1px solid rgba(198,40,40,0.12);
  padding:.35rem .6rem;
  border-radius:6px;
  font-weight:700;
  text-decoration:none;
  font-size:.9rem;
}
.read-more:hover{ background:rgba(198,40,40,0.04); }

/* Article view (single article) - featured masthead layout */
.article{
  padding:2rem 0;
  margin:0;
}
/* Center article content (title, hero image, body) and constrain width for readable measure */
.article-header,
.article-hero,
.article-body{
  max-width:var(--reading-width);
  margin:0 auto;
  width:100%;
  padding:0 1rem; /* small horizontal padding on narrow screens */
}
.article-title{
  text-align:center;
  font-family:var(--font-serif);
  font-size:2.25rem;
  line-height:1.05;
  margin-bottom:1rem;
}

.article-hero img{
  display:block;
  width:100%;
  height:auto;
  border-radius:8px;
  margin:1rem auto; /* center horizontally within the hero container */
  max-width:100%;
}
.article-hero .credit{
  font-size:.8rem;
  color: black;
  text-align:center;
  margin-top:.5rem;
}
.article-masthead{
  background: #0b0b0b;
  color: #fff;
  padding: 3rem 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.masthead-grid{
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
  align-items: center;
}
.masthead-left{
  padding-right: 1rem;
}
/* Masthead headline (used only when .article-masthead is present) */
.article-masthead .article-title{
  font-family: var(--font-serif);
  font-size: 3rem;
  margin: 0 0 1rem 0; /* Increased bottom margin */
  line-height: 1;
  font-weight: 900;
  color: #fff;
}
.article-body{
  margin: 0 auto 3rem auto;
  padding: 0 1rem;
  text-align: left; /* keep readable left-aligned text while container is centered */
  color: #222;
  line-height:1.75;
  max-width:var(--reading-width);
}
.article-body img{
  display:block;
  margin: 1rem auto;
  max-width:100%;
  height:auto;
}
 
/* Default article page title styling (for standard article layout) */
.article-header .article-title{
  font-family: var(--font-serif);
  font-size: 2.25rem;
  line-height: 1.06;
  font-weight: 700;
  color: #081426; /* dark title color for readability */
}
.article-lede{
  color: #cbd5d9;
  font-size: 1.125rem;
  max-width: 48ch;
  margin-bottom: 1rem;
}
.article-meta{
  color: #464a52;
  font-size: .95rem;
  margin: 0;
  display: flex;
  gap: .5rem;
  align-items: center;
  flex-wrap: wrap;
}

/* Masthead image column */
.masthead-right{
  display:flex;
  align-items:center;
  justify-content:center;
}
.masthead-right img{
  width:100%;
  height:auto;
  max-height:420px;
  object-fit:cover;
  border-radius:4px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.4);
}
.credit{ color:#9ca3af; font-size:.85rem; margin-top:.5rem; }

/* Larger layout: left text column + wide image on the right */
@media (min-width: 1000px) {
  .masthead-grid{
    grid-template-columns: 1fr 620px;
  }
  .article-title{ font-size: 3.5rem; }
  .article-lede{ font-size: 1.25rem; }
}
 
/* Section headers */
.lead{
  font-family: var(--font-serif);
  font-size: 2.2rem;
  font-weight: 900;
  letter-spacing: -0.8px;
  margin: 1.5rem 0 1rem 0;
  color: #081426;
}
.ep-title{
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 900;
  letter-spacing: -0.5px;
  margin: 0 0 .75rem 0;
  color: #081426;
}

/* article hero image treatment */
/* Fixed-height container; image scales by height (width:auto) and centers */
.article-hero{
  margin:1rem auto;                 /* center the hero container */
  border-radius:6px;
  height:320px;                     /* fixed visual height */
  display:flex;
  align-items:center;
  justify-content:center;           /* center hero image horizontally */
  overflow:hidden;                  /* hide any overflow so image centers cleanly */
  max-width:var(--reading-width);   /* constrain to reading column */
  width:100%;
}

.article-hero img{
  height:100%;               /* fill container height */
  width:auto;                /* keep natural aspect ratio */
  max-width:100%;
  border-radius:6px;
  display:block;
  margin:1.5rem auto;        /* more vertical breathing room; center horizontally */
  flex: 0 0 auto;            /* prevent flex-based shrinking/growing */
  object-fit: contain;       /* preserve aspect without cropping */
  align-self: center;
}

/* Larger hero on wide screens */
@media (min-width: 1000px) {
  .article-hero{ height:420px; }
  .article-hero img{ height:100%; width:auto; }
}

/* Smaller hero on narrow screens */
@media (max-width: 599px) {
  .article-hero{ height:220px; }
  .article-hero img{ height:100%; width:auto; }
}

/* Article body: readable measure and slightly larger type */
.article-body{
  max-width:var(--reading-width);
  color:#0b1220;
  font-size:1.05rem;
}
.article-body p{ margin:0 0 1rem 0; }
.article-body h2{ margin-top:1.2rem; margin-bottom:.5rem; font-family:var(--font-serif); }
.article-body blockquote{
  border-left:4px solid rgba(11,17,26,0.08);
  margin:1rem 0;
  padding:.5rem 1rem;
  background:rgba(11,17,26,0.02);
  border-radius:4px;
}

/* Tags and byline */
.tags a{
  background: var(--card);
  color:#0b1220;
  border:1px solid rgba(11,17,26,0.04);
  padding:.2rem .45rem;
  border-radius:6px;
  font-size:.85rem;
  text-decoration:none;
}

/* Editor's Picks (sidebar) */
.editors-picks{
  background:var(--card);
  border:1px solid var(--thin-rule);
  padding: .75rem;
  border-radius:8px;
  box-shadow: var(--shadow);
}

/* Title + list */
.ep-title{ margin:0 0 .5rem 0; font-size:1.05rem; font-weight:700; }
.ep-list{ list-style:none; padding:0; margin:0; display:flex; flex-direction:column; gap:.6rem; }

/* Each item: clickable row with optional thumbnail */
.ep-item { margin:0; }
.ep-link{
  display:flex;
  align-items:center;
  text-decoration:none;
  color:inherit;
  border-radius:6px;
  overflow: hidden; /* Ensure content within the link is contained */
}
.ep-link:hover{ background: rgba(11,17,26,0.02); transform:translateY(-1px); }

/* Thumbnail */
.ep-thumb{
  margin: 10px; /* Removed default margins from figure element */
  width:96px;
  height:72px;
  flex: 0 0 96px;
  overflow:hidden;
  border-radius:6px;
  background:var(--thin-rule);
  display:block;
}
.ep-thumb img{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
}

/* Text next to the thumbnail */
.ep-text{
  display:flex;
  flex-direction:column;
  gap:0.15rem;
  flex: 1; /* Allow text to take up remaining space */
  min-width: 0; /* Prevent flex item from overflowing */
  text-align: left;
}
.ep-item-title{
  font-weight:700;
  color:#0b1220;
  line-height:1.1;
  font-size:0.95rem;
  display:block;
  /* Removed max-width to allow flex:1 on parent to control width */
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ep-item .small{ color:var(--muted); font-size:.82rem; margin-top:.15rem; }

/* Responsive: smaller thumbs on very narrow sidebars */
@media (max-width: 999px) {
  .ep-thumb{ width:72px; height:54px; flex:0 0 72px; }
  /* Removed max-width for ep-item-title here as well */
}

/* Sidebar small adjustments */
.sidebar{ padding:0; }

/* Footer - denser like a newspaper bottom */
.site-footer{
  padding:1rem 0 2rem 0;
  color:var(--muted);
  font-size:.9rem;
  text-align:center;
  border-top:1px solid var(--thin-rule);
  margin-top:2rem;
}

/* Misc utilities */
.center{text-align:center;}
.muted{ color:var(--muted); }
.small{ font-size:.85rem; color:var(--muted); }
 
/* Image credit styling */
.credit{
  color:var(--muted);
  font-size:.8rem; /* Slightly smaller font size */
  font-style:italic; /* Italicized text */
  margin-top:.5rem;
  text-align:center; /* Center align credit text */
}
 
/* Accessibility focus */
a:focus{ outline:3px solid rgba(198,40,40,0.14); outline-offset:3px; border-radius:6px; }
 
/* End */