/* ============================================================
   PEPTIDE DAILY — flat, modern, white column news feed
   ============================================================ */

:root {
  --bg: #ffffff;
  --bg-soft: #f4f4f4;
  --surface: #ffffff;
  --border: #e6e6e6;
  --border-strong: #cccccc;
  --text: #000000;
  --text-soft: #555555;
  --text-faint: #999999;
  --accent: #000000;
  --accent-soft: #f0f0f0;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  --col-width: 760px;
  --header-h: 76px;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #ffffff;
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

/* ---------------- Shell (shifts left when drawer opens) ---------------- */
.shell {
  transition: transform 0.34s cubic-bezier(0.22, 0.75, 0.2, 1);
  will-change: transform;
}
.shell.is-shifted { transform: translateX(-260px); }

@media (max-width: 1040px) {
  .shell.is-shifted { transform: none; }
}

/* ---------------- Header ---------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  max-width: var(--col-width);
  margin: 0 auto;
  height: var(--header-h);
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  flex-shrink: 0;
}

.brand-icon {
  font-size: 30px;
  line-height: 1;
}

.brand-text {
  font-family: "Archivo Black", "Inter", sans-serif;
  font-weight: 400;        /* Archivo Black is already ultra-heavy */
  font-size: 19px;
  line-height: 0.96;
  letter-spacing: -0.01em;
  text-transform: uppercase;
}

/* top-bar pill icon buttons */
.top-nav { display: flex; align-items: center; gap: 22px; }

.icon-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: none;
  padding: 0;
  color: var(--text);
  cursor: pointer;
  transition: opacity 0.15s ease, transform 0.1s ease;
}
.icon-pill:hover { opacity: 0.55; }
.icon-pill:active { transform: scale(0.9); }
.icon-pill.is-active { opacity: 0.55; }

/* Font Awesome icons — same size for both */
.icon-pill i {
  font-size: 21px;
  line-height: 1;
  display: block;
}

.icon-pill.is-loading .refresh-icon { animation: spin 0.8s linear infinite; }

@keyframes spin { to { transform: rotate(360deg); } }

/* expanding search row under the bar */
.search-row {
  max-width: var(--col-width);
  margin: 0 auto;
  padding: 0 20px 14px;
}
.search-row[hidden] { display: none; }

.search-input {
  width: 100%;
  height: 40px;
  padding: 0 16px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--bg-soft);
  font-size: 14px;
  color: var(--text);
  outline: none;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.search-input:focus { border-color: var(--accent); background: #fff; }

/* ---------------- Hero ---------------- */
/* ---------------- Feed ---------------- */
.feed-wrap {
  max-width: var(--col-width);
  margin: 0 auto;
  padding: 24px 20px 70px;
}

.status-bar {
  min-height: 16px;
  margin: 0 0 18px;
  color: var(--text-faint);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 600;
}

/* shared meta line (SOURCE · time) */
.meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 10px;
}
.meta-dot { color: var(--border-strong); font-weight: 400; }
.meta-time { color: var(--text-faint); font-weight: 500; letter-spacing: 0.06em; }

/* ---------------- Lead / hero story ---------------- */
.lead {
  display: block;
  cursor: pointer;
  padding-bottom: 34px;
  margin-bottom: 8px;
}

.lead-img {
  /* break out of the feed-wrap's 20px side padding so the hero
     image spans the full column width, edge to edge */
  width: auto;
  margin: 0 -20px 20px;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #f0f0f0;
}
.lead-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.5s ease;
}
.lead:hover .lead-img img { transform: scale(1.025); }

.lead-title {
  margin: 0 0 12px;
  font-size: clamp(26px, 3.6vw, 36px);
  line-height: 1.12;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text);
}
.lead:hover .lead-title { text-decoration: underline; text-underline-offset: 3px; }

.lead-summary {
  margin: 0;
  color: var(--text-soft);
  font-size: 16px;
  line-height: 1.6;
  max-width: 60ch;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.lead.no-img .lead-img { display: none; }

/* ---------------- News rows ---------------- */
.rows { display: flex; flex-direction: column; }

.row {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  padding: 18px 0;
  cursor: pointer;
}

.row-body { flex: 1; min-width: 0; }

.row-title {
  margin: 0 0 7px;
  font-size: 19px;
  line-height: 1.26;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}
.row:hover .row-title { text-decoration: underline; text-underline-offset: 2px; }

.row-summary {
  margin: 0;
  color: var(--text-soft);
  font-size: 14.5px;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* fixed box so every thumbnail is the same size regardless of
   the source image's native dimensions */
.row-img {
  flex-shrink: 0;
  width: 168px;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border-radius: 10px;
  background: #f0f0f0;
}
.row-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.5s ease;
}
.row:hover .row-img img { transform: scale(1.04); }

/* image is required; hide a row whose image breaks */
.row.no-img, .lead.no-img { }
.row.no-img .row-img { display: none; }

/* ---------------- Skeleton loading ---------------- */
.skeleton { pointer-events: none; cursor: default; }
.skeleton .sk {
  background: linear-gradient(90deg, #ececec 25%, #f6f6f6 37%, #ececec 63%);
  background-size: 400% 100%;
  animation: shimmer 1.4s ease infinite;
  border-radius: 4px;
  display: block;
}
.skeleton .sk-meta { width: 130px; height: 11px; margin-bottom: 12px; }
.skeleton .sk-lead-img { width: 100%; aspect-ratio: 16 / 9; margin-bottom: 18px; }
.skeleton .sk-lead-title { width: 90%; height: 30px; margin-bottom: 14px; }
.skeleton .sk-row-img { width: 150px; aspect-ratio: 4 / 3; flex-shrink: 0; }
.skeleton .sk-title { width: 85%; height: 18px; margin-bottom: 9px; }
.skeleton .sk-line { width: 100%; height: 12px; margin-bottom: 7px; }
.skeleton .sk-line.short { width: 55%; }

@keyframes shimmer {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

/* ---------------- Empty state ---------------- */
.feed-empty {
  text-align: center;
  padding: 50px 20px;
  color: var(--text-soft);
}

.link-btn {
  background: none;
  border: none;
  color: var(--accent);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  padding: 6px 4px;
}
.link-btn:hover { text-decoration: underline; }

/* ---------------- Footer ---------------- */
.site-footer {
  margin-top: 30px;
  background: var(--bg);
}

.footer-inner {
  max-width: var(--col-width);
  margin: 0 auto;
  padding: 28px 20px 40px;
  text-align: center;
}

.footer-brand {
  margin: 0 0 6px;
  font-family: "Archivo Black", "Inter", sans-serif;
  font-weight: 400;
  font-size: 18px;
  letter-spacing: -0.02em;
  text-transform: uppercase;
}

.footer-note {
  margin: 0;
  color: var(--text-faint);
  font-size: 12.5px;
}

.footer-copyright {
  margin: 18px 0 2px;
  color: var(--text-soft);
  font-size: 12.5px;
  font-weight: 500;
}

.footer-credit {
  margin: 0;
  color: var(--text-faint);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* ---------------- Responsive ---------------- */
@media (max-width: 620px) {
  .lead-title { font-size: clamp(22px, 7vw, 28px); }
  .row { gap: 14px; padding: 18px 0; }
  .row-title { font-size: 16.5px; }
  .row-img { width: 104px; }
  .row-summary { -webkit-line-clamp: 2; }
}

/* ============================================================
   Keyboard focus
   ============================================================ */
.lead:focus-visible, .row:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 3px;
}

/* ============================================================
   Reader drawer (slides in from the right)
   ============================================================ */
body.reader-open { overflow: hidden; }

.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(0, 0, 0, 0.32);
  opacity: 0;
  transition: opacity 0.3s ease;
}
.drawer-backdrop.is-open { opacity: 1; }
.drawer-backdrop[hidden] { display: none; }

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 100;
  height: 100vh;
  width: 620px;
  max-width: 100vw;
  background: var(--surface);
  border-left: 1px solid var(--border);
  box-shadow: -16px 0 50px rgba(0, 0, 0, 0.12);
  transform: translateX(100%);
  transition: transform 0.34s cubic-bezier(0.22, 0.75, 0.2, 1);
  will-change: transform;
}
.drawer.is-open { transform: translateX(0); }

.drawer-inner { position: relative; height: 100%; }

.reader-scroll {
  height: 100%;
  overflow-y: auto;
  padding: 0 0 48px;
}

/* drawer cover: real article image, full-bleed width */
.reader-cover {
  position: relative;
  width: 100%;
  height: 280px;
  background-color: var(--bg-soft);
  background-size: cover;
  background-position: center;
}
.reader-cover.is-empty { height: 0; }

.reader-content { padding: 30px 44px 0; }

.drawer-close {
  position: absolute;
  top: 16px;
  right: 18px;
  z-index: 3;
  width: 38px;
  height: 38px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  color: var(--text);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
  transition: background 0.15s ease, transform 0.1s ease;
}
.drawer-close:hover { background: #fff; }
.drawer-close:active { transform: scale(0.94); }

.reader-meta {
  display: flex;
  align-items: center;
  gap: 11px;
  font-size: 13px;
  color: var(--text-faint);
  margin-bottom: 18px;
}
.reader-meta-text { min-width: 0; }
.reader-source-name { color: var(--text); font-weight: 600; }

.reader-title {
  margin: 0 0 22px;
  font-size: clamp(24px, 4vw, 32px);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.025em;
}

.reader-body p {
  margin: 0 0 18px;
  font-size: 17px;
  line-height: 1.72;
  color: #222222;
}

.reader-source-link {
  display: inline-flex;
  align-items: center;
  margin-top: 10px;
  padding: 12px 22px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  font-size: 15px;
  transition: background 0.15s ease, transform 0.1s ease;
}
.reader-source-link:hover { background: #333333; }
.reader-source-link:active { transform: translateY(1px); }

@media (max-width: 620px) {
  .drawer { width: 100vw; border-left: none; }
  .reader-cover { height: 200px; }
  .reader-content { padding: 24px 22px 0; }
  .reader-title { font-size: clamp(22px, 7vw, 28px); }
  .reader-body p { font-size: 16px; }
}

/* ============================================================
   Side-rail "skyscraper" gutter ads
   ============================================================
   The content column is 600px. These fixed vertical banners live
   in the empty left/right margins, centered vertically, and only
   appear when the viewport is wide enough to clear the column.
   ============================================================ */
.siderail {
  position: fixed;
  top: 0;
  bottom: 0;
  z-index: 45;
  display: none;                 /* shown via media query when there's room */
  /* each rail fills the whole gutter beside the content column */
  width: calc((100vw - 760px) / 2);
  background: var(--text);       /* full black skyscraper */
  color: #fff;
  overflow: hidden;
}
.siderail-left  { left: 0; border-right: 1px solid #000; }
.siderail-right { right: 0; border-left: 1px solid #000; }

.siderail-inner {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
  max-width: 260px;
  padding: 0 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  text-align: center;
}

.siderail-kicker {
  font-size: 11px;
  letter-spacing: 0.3em;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.5);
}

.siderail-head {
  font-size: clamp(30px, 3.2vw, 52px);
  font-weight: 800;
  line-height: 0.98;
  letter-spacing: -0.03em;
}

.siderail-site {
  font-size: 14px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.72);
  word-break: break-word;
}

.siderail-codewrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
}
.siderail-codelabel {
  font-size: 11px;
  letter-spacing: 0.25em;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.5);
}
.siderail-code {
  font-size: clamp(28px, 2.6vw, 40px);
  font-weight: 800;
  letter-spacing: 0.12em;
  padding: 10px 24px;
  border: 2px dashed rgba(255, 255, 255, 0.7);
  border-radius: 12px;
}
.siderail-offer {
  font-size: 12px;
  letter-spacing: 0.14em;
  font-weight: 700;
  color: #fff;
}

.siderail-cta {
  margin-top: 10px;
  font-size: 15px;
  font-weight: 700;
  padding: 12px 26px;
  background: #fff;
  color: #000;
  border-radius: 999px;
  transition: transform 0.12s ease, opacity 0.15s ease;
}
.siderail:hover .siderail-cta { transform: translateY(-2px); }
.siderail:active .siderail-cta { transform: translateY(0); }

/* only show the full-size rails when the gutters are wide enough.
   below this, there isn't room beside the content column */
@media (min-width: 1240px) {
  .siderail { display: block; }
}

/* hide them while the reader drawer is open so nothing overlaps */
body.reader-open .siderail { opacity: 0; pointer-events: none; transition: opacity 0.2s ease; }

/* ============================================================
   Mobile ad banner
   ============================================================
   Shown only when the full-size side rails are hidden (narrow
   screens), so the peptidecoding.co.uk offer is always present.
   Sticks just under the header.
   ============================================================ */
.mobile-ad {
  display: none;                 /* shown via media query below */
  position: sticky;
  top: var(--header-h);
  z-index: 44;
  align-items: center;
  gap: 12px;
  padding: 11px 16px;
  background: var(--text);
  color: #fff;
}

.mobile-ad-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.mobile-ad-kicker {
  font-size: 9px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.5);
}
.mobile-ad-head {
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1.25;
}
.mobile-ad-head strong { font-weight: 800; }

.mobile-ad-codewrap {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 5px 10px;
  border: 1.5px dashed rgba(255, 255, 255, 0.6);
  border-radius: 8px;
}
.mobile-ad-codelabel {
  font-size: 9px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.55);
}
.mobile-ad-code {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.mobile-ad-close {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border: none;
  background: none;
  color: rgba(255, 255, 255, 0.6);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}
.mobile-ad-close:hover { color: #fff; }

/* the banner is dismissible */
.mobile-ad.is-dismissed { display: none !important; }

/* show the banner only where the side rails do NOT appear */
@media (max-width: 1239px) {
  .mobile-ad { display: flex; }
}

/* ============================================================
   Pulsing attention animation for the discount code boxes
   ============================================================ */
.pulse {
  animation: adPulse 1.6s ease-in-out infinite;
  transform-origin: center;
  border-radius: 12px;
}
@keyframes adPulse {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.06); }
}

/* respect users who prefer no motion */
@media (prefers-reduced-motion: reduce) {
  .pulse { animation: none; }
}
