/* ==========================================================
   Inkwell stylesheet

   1. Design tokens (colours, fonts) and light/dark themes
   2. Base styles
   3. Header
   4. Article cards
   5. Advertisement placeholders
   6. Homepage sections
   7. Forms, buttons and notices
   8. Text pages (About, Privacy, Terms, Disclaimer, Contact)
   9. Footer
   10. Responsive rules
   ========================================================== */


/* ---------- 1. Design tokens ---------- */
:root {
  --paper:   #F6F7FB;   /* page background */
  --surface: #FFFFFF;   /* cards and panels */
  --ink:     #10142B;   /* main text */
  --muted:   #5B6180;   /* secondary text */
  --line:    #E3E6F0;   /* borders */
  --accent:  #3355FF;   /* links and buttons */
  --sun:     #FFB938;   /* highlight colour */

  --radius: 14px;
  --wrap-width: 1200px;

  --font-heading: 'Bricolage Grotesque', system-ui, sans-serif;
  --font-body:    'Source Serif 4', Georgia, serif;
}

:root[data-theme="dark"] {
  --paper:   #0C1022;
  --surface: #151A33;
  --ink:     #EEF0FA;
  --muted:   #9AA1C4;
  --line:    #252B4D;
  --accent:  #7C93FF;
}


/* ---------- 2. Base styles ---------- */
* {
  box-sizing: border-box;
  margin: 0;
}

body {
  background: var(--paper);
  color: var(--ink);
  font: 18px/1.65 var(--font-body);
}

h1, h2, h3, h4, small, input, button, .brand, .nav, .tag {
  font-family: var(--font-heading);
}

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

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

.wrap {
  max-width: var(--wrap-width);
  margin: 0 auto;
  padding: 0 24px;
}

section {
  padding: 48px 0;
}

.page-title {
  font-size: clamp(34px, 5vw, 56px);
  letter-spacing: -0.04em;
  line-height: 1.05;
  margin-bottom: 12px;
}

.lede {
  color: var(--muted);
  font-size: 20px;
  max-width: 60ch;
  margin-bottom: 28px;
}


/* ---------- 3. Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.bar {
  display: flex;
  align-items: center;
  gap: 24px;
  height: 68px;
}

.brand {
  font-weight: 800;
  font-size: 26px;
  letter-spacing: -0.03em;
}

.search input {
  height: 40px;
  width: 190px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
}

.icon-btn {
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  color: var(--ink);
  font-size: 18px;
  cursor: pointer;
}


/* ---------- 4. Article cards ---------- */

/* Default card: image on top, text below */
.card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.card__cover {
  display: block;
  aspect-ratio: 16 / 10;
  background-size: cover;
  background-position: center;
}

.card__body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 18px 20px 22px;
}

.card h3 {
  font-size: 21px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.card h3 a:hover {
  color: var(--accent);
}

.card p {
  color: var(--muted);
  font-size: 16px;
  line-height: 1.5;
}

.card small {
  color: var(--muted);
  font-size: 13px;
}

/* Category label */
.tag {
  align-self: flex-start;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  color: var(--tag);
  background: color-mix(in srgb, var(--tag) 12%, transparent);
}

/* Hero card: text sits on top of a full-size image */
.card--hero {
  position: relative;
  justify-content: flex-end;
  min-height: 460px;
  border: 0;
  color: #fff;
}

.card--hero .card__cover {
  position: absolute;
  inset: 0;
  aspect-ratio: auto;
}

.card--hero .card__body {
  position: relative;
  padding: 80px 32px 32px;
  background: linear-gradient(transparent, rgba(8, 10, 25, 0.82));
}

.card--hero h3 {
  font-size: clamp(28px, 4vw, 46px);
}

.card--hero p,
.card--hero small {
  color: #E5E8F8;
}

.card--hero .tag {
  background: var(--sun);
  color: #10142B;
}

/* "tall" is added to hero cards in sliders and the magazine grid: smaller text, shorter height */
.tall {
  min-height: 380px;
}

.card--hero.tall h3 {
  font-size: 24px;
}

.card--hero.tall .card__body {
  padding: 60px 22px 22px;
}

/* Compact card: small thumbnail beside the title, used in lists */
.card--compact {
  flex-direction: row;
  padding-bottom: 14px;
  background: none;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
}

.card--compact .card__cover {
  flex: none;
  width: 96px;
  aspect-ratio: 1;
  border-radius: 10px;
}

.card--compact .card__body {
  padding: 0 0 0 16px;
}

.card--compact h3 {
  font-size: 17px;
}

@media (prefers-reduced-motion: no-preference) {
  .card,
  .nav a {
    transition: border-color 0.15s, color 0.15s;
  }
  .card:hover {
    border-color: var(--accent);
  }
}


/* ---------- 5. Advertisement placeholders ---------- */
.ad {
  display: grid;
  place-content: center;
  gap: 2px;
  width: min(100%, var(--w));
  min-height: var(--h);
  margin: 24px auto;
  text-align: center;
  font: 600 13px var(--font-heading);
  color: var(--muted);
  border: 1.5px dashed var(--line);
  border-radius: 10px;
  background: repeating-linear-gradient(
    45deg,
    transparent 0 12px,
    color-mix(in srgb, var(--line) 40%, transparent) 12px 24px
  );
}

.ad b {
  font-size: 18px;
  color: var(--ink);
}


/* ---------- 6. Homepage sections ---------- */

/* Hero: one large story on the left, a "Top stories" list on the right */
.hero {
  padding: 32px 0 8px;
}

.hero__grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
}

.hero__grid > .card {
  min-height: 520px;
}

.hero__stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 20px 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.hero__stack h2 {
  font-size: 18px;
}

.hero__stack .card--compact:last-child {
  border: 0;
}

/* Trending ticker: a strip of headlines that scrolls sideways */
.ticker {
  display: flex;
  width: 100%;
  max-width: 1150px; /* Match your other sections */
  align-items: center;
  /* margin-top: 24px; */
  margin: 24px auto 0;
  overflow: hidden;
  background: var(--ink);
  color: var(--paper);
  font: 600 14px var(--font-heading);
  border-radius:10px;
}

.ticker > span {
  z-index: 1;
  padding: 12px 18px;
  white-space: nowrap;
  background: var(--sun);
  color: #10142B;
}

.ticker__track {
  display: flex;
  gap: 48px;
  padding-left: 32px;
  white-space: nowrap;
  animation: ticker-scroll 60s linear infinite;
}

.ticker__track:hover {
  animation-play-state: paused;
}

.ticker a:hover {
  text-decoration: underline;
}

@keyframes ticker-scroll {
  to { transform: translateX(-50%); }
}

@media (prefers-reduced-motion: reduce) {
  .ticker__track {
    animation: none;
    overflow-x: auto;
  }
}

/* Category sections */
.cat {
  padding: 40px 0 8px;
}

.sec-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 24px;
  padding-bottom: 10px;
  border-bottom: 3px solid var(--c);   /* --c is the category colour */
}

.sec-head h2 {
  font-size: 34px;
  letter-spacing: -0.03em;
}

.sec-head p {
  flex: 1;
  color: var(--muted);
  font-size: 16px;
}

.sec-head > a {
  font: 600 15px var(--font-heading);
  color: var(--accent);
}

/* Grid layout: three cards per row */
.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
}

/* Carousel and slider layouts: a row that scrolls sideways and snaps to each card */
.rail {
  display: flex;
  gap: 24px;
  padding-bottom: 12px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
}

.rail > .card {
  flex: 0 0 min(340px, 82%);
  scroll-snap-align: start;
}

.rail--tall > .card {
  flex-basis: min(300px, 78%);
}

.ctl {
  display: flex;
  gap: 8px;
}

.ctl button {
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  color: var(--ink);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.ctl button:hover {
  border-color: var(--accent);
}

/* Magazine layout: one large card spanning two rows, four smaller cards beside it */
.mag {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr;
  gap: 24px;
}

.mag > .card:first-child {
  grid-row: span 2;
  min-height: 100%;
}

/* Split layout: one big card on the left, a compact list on the right */
.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  align-items: start;
}

/* Bottom band: "Most read" list and newsletter signup */
.band {
  margin-top: 56px;
  padding: 56px 0;
  background: var(--surface);
  border-block: 1px solid var(--line);
}

.band__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
}

.band h2 {
  margin-bottom: 16px;
  font-size: 30px;
  letter-spacing: -0.03em;
}

.rank {
  padding: 0;
  list-style: none;
  counter-reset: rank;
}

.rank li {
  display: grid;
  grid-template-columns: 36px 1fr;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  counter-increment: rank;
}

.rank li::before {
  grid-row: span 2;
  content: counter(rank);
  font: 800 22px var(--font-heading);
  color: var(--accent);
}

.rank a {
  font: 600 18px/1.3 var(--font-heading);
}

.rank a:hover {
  color: var(--accent);
}

.rank small {
  color: var(--muted);
  font-size: 13px;
}

.news p {
  margin-bottom: 16px;
  color: var(--muted);
}

.news__form {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.news__form input {
  flex: 1;
  min-width: 200px;
}


/* ---------- 7. Forms, buttons and notices ---------- */
input,
textarea {
  padding: 12px 14px;
  font: 16px var(--font-body);
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
}

.form {
  display: grid;
  gap: 16px;
  max-width: 640px;
}

.form label {
  display: grid;
  gap: 6px;
  font: 600 15px var(--font-heading);
}

.btn {
  justify-self: start;
  padding: 12px 24px;
  font: 700 16px var(--font-heading);
  color: #fff;
  background: var(--accent);
  border: 0;
  border-radius: 10px;
  cursor: pointer;
}

:root[data-theme="dark"] .btn {
  color: #0C1022;
}

.btn:hover {
  filter: brightness(1.1);
}

/* Hidden spam-trap field: real visitors never see it, bots fill it in */
.hp {
  position: absolute;
  left: -9999px;
}

.notice {
  margin-bottom: 16px;
  padding: 12px 16px;
  font: 500 15px var(--font-heading);
  border-radius: 10px;
}

.notice.ok {
  background: color-mix(in srgb, #2BA84A 16%, transparent);
  border: 1px solid #2BA84A;
}

.notice.err {
  background: color-mix(in srgb, #E4572E 14%, transparent);
  border: 1px solid #E4572E;
}


/* ---------- 8. Text pages ---------- */
.prose {
  max-width: 70ch;
}

.prose h2 {
  margin: 32px 0 8px;
  font-size: 26px;
  letter-spacing: -0.02em;
}

.prose p {
  margin-bottom: 14px;
}

.prose a {
  color: var(--accent);
  text-decoration: underline;
}

.contact {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 56px;
}

.contact__info {
  align-self: start;
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.contact__info h2 {
  margin-bottom: 14px;
  font-size: 20px;
}

.contact__info p {
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 16px;
}

.contact__info a {
  color: var(--accent);
}


/* ---------- 9. Footer ---------- */
.site-footer {
  padding: 32px 0;
  color: var(--muted);
  font: 15px var(--font-heading);
  border-top: 1px solid var(--line);
}

.foot {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 32px;
  padding-bottom: 24px;
}

.foot h4 {
  margin-bottom: 8px;
  font-size: 15px;
  color: var(--ink);
}

.foot nav a {
  display: block;
  margin-bottom: 6px;
}

.foot nav a:hover {
  color: var(--ink);
}

.foot p {
  margin-top: 6px;
}

.copy {
  padding-top: 18px;
  font-size: 14px;
  border-top: 1px solid var(--line);
}


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

/* Tablets */
@media (max-width: 900px) {
  .hero__grid,
  .band__grid,
  .contact,
  .split {
    grid-template-columns: 1fr;
  }

  .hero__grid > .card {
    min-height: 400px;
  }

  .mag {
    grid-template-columns: 1fr 1fr;
  }

  .mag > .card:first-child {
    grid-column: span 2;
    grid-row: auto;
    min-height: 340px;
  }

  .foot {
    grid-template-columns: 1fr 1fr;
  }
}

/* Phones */
@media (max-width: 760px) {
  .search {
    display: none;
  }

  .card--hero {
    min-height: 380px;
  }
}

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

  .mag > .card:first-child {
    grid-column: auto;
  }
}


/* ==========================================================
   Phase 3: article page, archives, search, 404
   ========================================================== */

/* ---------- Two-column layout: content + sidebar ---------- */
.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 48px;
  padding-top: 8px;
  padding-bottom: 48px;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 24px;
}

.archive-head {
  padding: 24px 0 8px;
}

.empty {
  padding: 32px 0;
  color: var(--muted);
}

/* ---------- Breadcrumbs ---------- */
.breadcrumbs {
  padding: 20px 0 8px;
  font: 500 14px var(--font-heading);
  color: var(--muted);
}

.breadcrumbs ol {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0;
  list-style: none;
}

.breadcrumbs li + li::before {
  content: "/";
  margin-right: 8px;
  opacity: 0.5;
}

.breadcrumbs a:hover {
  color: var(--accent);
}

/* ---------- Reading progress bar ---------- */
.progress {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 20;
  width: 0;
  height: 4px;
  background: var(--accent);
}

/* ---------- Article ---------- */
.post-header h1 {
  margin: 14px 0 12px;
  font-size: clamp(32px, 4.6vw, 52px);
  line-height: 1.08;
  letter-spacing: -0.035em;
}

.post-excerpt {
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 21px;
  line-height: 1.5;
}

.post-meta {
  color: var(--muted);
  font: 500 15px var(--font-heading);
}

.post-meta span {
  margin: 0 4px;
}

.post-cover {
  aspect-ratio: 16 / 9;
  margin: 24px 0 32px;
  background-size: cover;
  background-position: center;
  border-radius: var(--radius);
}

.post-content {
  font-size: 20px;
  line-height: 1.8;
}

.post-content > * + * {
  margin-top: 1.1em;
}

.post-content h2 {
  margin-top: 1.8em;
  font: 800 30px/1.2 var(--font-heading);
  letter-spacing: -0.02em;
}

.post-content h3 {
  margin-top: 1.5em;
  font: 700 24px/1.25 var(--font-heading);
}

.post-content a {
  color: var(--accent);
  text-decoration: underline;
}

.post-content ul,
.post-content ol {
  padding-left: 1.4em;
}

.post-content img {
  max-width: 100%;
  height: auto;
  border-radius: 10px;
}

.post-content blockquote {
  padding: 4px 0 4px 22px;
  font-size: 24px;
  font-style: italic;
  line-height: 1.5;
  border-left: 4px solid var(--accent);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chips a {
  padding: 5px 14px;
  font: 600 14px var(--font-heading);
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
}

.chips a:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.post-tags {
  margin-top: 32px;
}

/* Share buttons */
.share {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 28px;
  padding: 16px 0;
  font-family: var(--font-heading);
  border-block: 1px solid var(--line);
}

.share a,
.share button {
  padding: 7px 16px;
  font: 600 14px var(--font-heading);
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
}

.share a:hover,
.share button:hover {
  color: var(--accent);
  border-color: var(--accent);
}

/* Author box */
.author-box {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 28px;
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.author-box__avatar {
  display: grid;
  place-items: center;
  flex: none;
  width: 52px;
  height: 52px;
  font: 800 22px var(--font-heading);
  color: #fff;
  background: var(--accent);
  border-radius: 50%;
}

.author-box strong {
  font-family: var(--font-heading);
}

.author-box p {
  color: var(--muted);
  font-size: 15px;
}

/* Previous / next article */
.post-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 28px;
}

.post-nav a {
  padding: 16px 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.post-nav a:hover {
  border-color: var(--accent);
}

.post-nav small {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.post-nav span {
  font: 700 17px/1.3 var(--font-heading);
}

.post-nav__next {
  grid-column: 2;
  text-align: right;
}

.related {
  padding-top: 0;
}

/* ---------- Sidebar ---------- */
.sidebar {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.widget {
  margin-bottom: 20px;
}

.widget h2 {
  margin-bottom: 12px;
  font-size: 18px;
  letter-spacing: -0.01em;
}

.widget__list {
  padding: 0;
  list-style: none;
}

.widget__list li {
  display: flex;
  justify-content: space-between;
  padding: 9px 0;
  font: 500 16px var(--font-heading);
  border-bottom: 1px solid var(--line);
}

.widget__list a:hover {
  color: var(--accent);
}

.widget__list span {
  color: var(--muted);
}

.sidebar .ad {
  margin: 0 auto 20px;
}

.sticky {
  position: sticky;
  top: 88px;
}

.search--wide input {
  width: 100%;
}

.search--large input {
  height: 52px;
  max-width: 560px;
  font-size: 18px;
}

/* ---------- Pagination ---------- */
.pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 40px;
  font: 600 15px var(--font-heading);
}

.pagination a,
.pagination .current,
.pagination .gap {
  min-width: 40px;
  padding: 8px 14px;
  text-align: center;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.pagination .gap {
  border: 0;
}

.pagination a {
  background: var(--surface);
}

.pagination a:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.pagination .current {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
}

:root[data-theme="dark"] .pagination .current {
  color: #0C1022;
}

/* ---------- Search results ---------- */
.result {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 22px 0;
  border-bottom: 1px solid var(--line);
}

.result h2 {
  font-size: 26px;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.result h2 a:hover {
  color: var(--accent);
}

.result p {
  color: var(--muted);
  font-size: 17px;
}

.result small {
  color: var(--muted);
  font-size: 13px;
}

mark {
  padding: 0 2px;
  color: inherit;
  background: color-mix(in srgb, var(--sun) 55%, transparent);
  border-radius: 3px;
}

/* ---------- 404 page ---------- */
.not-found {
  text-align: center;
}

.not-found .lede {
  margin-inline: auto;
}

.not-found .search {
  display: block;
  margin: 0 auto 24px;
}

.not-found .search input {
  margin: 0 auto;
}

.not-found__code {
  font: 800 clamp(90px, 18vw, 180px)/1 var(--font-heading);
  letter-spacing: -0.06em;
  color: var(--accent);
  opacity: 0.9;
}

.not-found__topics {
  justify-content: center;
}

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .sticky {
    position: static;
  }
}

@media (max-width: 760px) {
  /* The header search is hidden on phones, so keep the sidebar and page search visible */
  .search.search--wide {
    display: block;
  }

  .post-nav {
    grid-template-columns: 1fr;
  }

  .post-nav__next {
    grid-column: 1;
    text-align: left;
  }
}

/* ---------- Live ad code and draft preview banner ---------- */
.ad--live {
  min-height: 0;
  border: 0;
  background: none;
}

.preview-banner {
  padding: 10px 24px;
  text-align: center;
  font: 600 14px var(--font-heading);
  background: var(--sun);
  color: #10142B;
}

.preview-banner a {
  margin-left: 12px;
  text-decoration: underline;
}

/* ---------- Page loader ---------- */
.page-loader {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  background: var(--paper);
  transition: opacity 0.4s ease, visibility 0.4s ease;
}

.page-loader.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.page-loader__inner {
  display: grid;
  gap: 18px;
  justify-items: center;
}

.page-loader__brand {
  font: 800 clamp(28px, 5vw, 40px) var(--font-heading);
  letter-spacing: -0.03em;
}

.page-loader__bar {
  position: relative;
  width: 140px;
  height: 4px;
  overflow: hidden;
  background: var(--line);
  border-radius: 999px;
}

.page-loader__bar::after {
  content: "";
  position: absolute;
  inset: 0;
  width: 45%;
  background: var(--accent);
  border-radius: inherit;
  animation: loader-slide 1s ease-in-out infinite;
}

@keyframes loader-slide {
  from { transform: translateX(-100%); }
  to   { transform: translateX(320%); }
}

@media (prefers-reduced-motion: reduce) {
  .page-loader__bar::after {
    width: 100%;
    animation: none;
  }
}


/* ==========================================================
   Latest additions: 4-column ads, figure, comments, reading list
   ========================================================== */

/* Row of four ads: 4 columns on desktop, 2 on tablets, 1 on phones */
.ad-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin: 28px 0;
}

.ad-row .ad {
  width: 100%;
  margin: 0;
}

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

/* Featured image with caption */
.post-figure {
  margin: 24px 0 32px;
}

.post-figure img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 560px;
  object-fit: cover;
  border-radius: var(--radius);
}

.post-figure figcaption {
  margin-top: 8px;
  color: var(--muted);
  font: 500 14px var(--font-heading);
}

/* Share bar extras */
.share__count {
  margin-left: auto;
  color: var(--muted);
  font: 500 14px var(--font-heading);
}

.share button[aria-pressed="true"] {
  color: var(--accent);
  border-color: var(--accent);
}

/* Author box with a link and a short bio */
.author-box a:hover { color: var(--accent); }

/* Comments */
.comments {
  margin-top: 40px;
}

.comments h2 {
  margin-bottom: 18px;
  font-size: 26px;
  letter-spacing: -0.02em;
}

.comment-list {
  padding: 0;
  list-style: none;
}

.comment {
  display: flex;
  gap: 14px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}

.comment__avatar {
  display: grid;
  place-items: center;
  flex: none;
  width: 42px;
  height: 42px;
  font: 700 17px var(--font-heading);
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  border-radius: 50%;
}

.comment strong { font-family: var(--font-heading); }
.comment time { margin-left: 8px; color: var(--muted); font: 500 13px var(--font-heading); }
.comment p { margin-top: 4px; white-space: pre-line; }

.comment-form {
  margin-top: 28px;
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.comment-form h3 { font-size: 20px; }
.comment-form textarea { font-family: var(--font-body); }

/* Reading list page */
.reading-list { max-width: 760px; }
.reading-list__item { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.reading-list__item a { font: 700 20px/1.3 var(--font-heading); }
.reading-list__item a:hover { color: var(--accent); }
.reading-list__item small { display: block; color: var(--muted); }
.reading-list__item button { padding: 6px 14px; font: 600 14px var(--font-heading); color: var(--muted); background: none; border: 1px solid var(--line); border-radius: 999px; cursor: pointer; }


/* ---------- Image banner ads ---------- */
.ad--image {
  display: block;
  min-height: 0;
  padding: 0;
  text-align: center;
  background: none;
  border: 0;
}

.ad--image img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 10px;
}

.ad__tag {
  display: block;
  margin-bottom: 4px;
  text-align: left;
  font: 600 11px var(--font-heading);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}


/* ==========================================================
   Static pages: About, Contact, Privacy, Terms, Disclaimer
   ========================================================== */

/* ----- Page header with a soft glow ----- */
.page-hero {
  padding: 8px 0 44px;
  background:
    radial-gradient(900px 280px at 15% -20%, color-mix(in srgb, var(--accent) 18%, transparent), transparent 70%),
    radial-gradient(700px 240px at 95% 10%, color-mix(in srgb, var(--sun) 16%, transparent), transparent 70%),
    var(--paper);
  border-bottom: 1px solid var(--line);
}

.page-hero .breadcrumbs { padding-top: 22px; }

.eyebrow {
  display: inline-block;
  margin-bottom: 14px;
  padding: 4px 12px;
  font: 700 12px var(--font-heading);
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  border-radius: 999px;
}

.page-hero h1 {
  margin-bottom: 14px;
  font-size: clamp(38px, 6vw, 64px);
  line-height: 1.04;
  letter-spacing: -0.04em;
}

.page-hero .lede {
  max-width: 62ch;
  margin-bottom: 0;
}

.meta-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 24px;
}

.meta-chips span,
.meta-chips button {
  padding: 6px 14px;
  font: 600 13.5px var(--font-heading);
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
}

.meta-chips button { cursor: pointer; }
.meta-chips button:hover { color: var(--accent); border-color: var(--accent); }

.page-section { padding: 56px 0 0; }
.page-section:last-of-type { padding-bottom: 72px; }

.section-title {
  margin-bottom: 8px;
  font-size: clamp(28px, 4vw, 38px);
  letter-spacing: -0.03em;
}

.section-lede {
  max-width: 60ch;
  margin-bottom: 28px;
  color: var(--muted);
}

/* ----- Legal pages: contents list + readable text ----- */
.legal {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 56px;
  max-width: 1040px;
  margin: 0 auto;
  padding: 48px 24px 80px;
}

.legal__toc {
  position: sticky;
  top: 92px;
  align-self: start;
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.legal__toc h2 {
  margin-bottom: 8px;
  font-size: 12.5px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
}

.legal__toc ol { padding: 0; list-style: none; }

.legal__toc a {
  display: block;
  padding: 6px 10px;
  font: 500 14.5px/1.35 var(--font-heading);
  color: var(--muted);
  border-radius: 8px;
}

.legal__toc a:hover,
.legal__toc a.is-current {
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, transparent);
}

.legal__body { counter-reset: section; max-width: 72ch; }
.legal__body section { scroll-margin-top: 96px; }

.legal__body h2 {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin: 44px 0 12px;
  font-size: 26px;
  line-height: 1.2;
  letter-spacing: -0.02em;
  counter-increment: section;
}

.legal__body h2::before {
  content: counter(section, decimal-leading-zero);
  flex: none;
  font: 800 15px var(--font-heading);
  color: var(--accent);
}

.legal__body > .callout + section h2 { margin-top: 36px; }
.legal__body p { margin-bottom: 14px; }
.legal__body ul { margin: 0 0 16px 1.25em; }
.legal__body li { margin-bottom: 7px; padding-left: 4px; }
.legal__body a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }

.callout {
  padding: 20px 24px;
  background: color-mix(in srgb, var(--accent) 7%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--line));
  border-radius: var(--radius);
}

.callout strong { font-family: var(--font-heading); }
.callout--warn {
  background: color-mix(in srgb, var(--sun) 14%, var(--surface));
  border-color: color-mix(in srgb, var(--sun) 55%, var(--line));
}

.legal__cta {
  margin-top: 48px;
  padding: 26px 28px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.legal__cta h2 { display: block; margin: 0 0 6px; font-size: 22px; }
.legal__cta h2::before { content: none; }
.legal__cta p { margin-bottom: 14px; color: var(--muted); }

/* ----- About ----- */
.about-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 16px;
  margin-top: -28px;
}

.about-stat {
  padding: 22px 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 10px 30px -18px rgba(16, 20, 43, 0.35);
}

.about-stat strong { display: block; font: 800 clamp(30px, 4vw, 42px)/1.05 var(--font-heading); letter-spacing: -0.03em; }
.about-stat span { color: var(--muted); font: 500 14px var(--font-heading); }

.about-story {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: start;
}

.about-story p { margin-bottom: 14px; }
.about-story .quote { font: 700 clamp(24px, 3vw, 32px)/1.25 var(--font-heading); letter-spacing: -0.02em; }

.topic-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 18px;
}

.topic-card {
  display: block;
  padding: 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: 4px solid var(--c);
  border-radius: var(--radius);
}

.topic-card:hover { border-color: var(--c); transform: translateY(-2px); }
.topic-card h3 { margin-bottom: 6px; font-size: 21px; letter-spacing: -0.02em; }
.topic-card p { margin-bottom: 10px; color: var(--muted); font-size: 15.5px; line-height: 1.5; }
.topic-card small { color: var(--c); font-weight: 700; }

.value-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
}

.value-card {
  padding: 26px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.value-card__icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  margin-bottom: 14px;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  border-radius: 12px;
}

.value-card h3 { margin-bottom: 6px; font-size: 20px; }
.value-card p { color: var(--muted); font-size: 16px; line-height: 1.55; }

.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 18px;
}

.team-card {
  display: flex;
  gap: 16px;
  padding: 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.team-card:hover { border-color: var(--accent); }

.team-card__avatar {
  display: grid;
  place-items: center;
  flex: none;
  width: 56px;
  height: 56px;
  font: 800 22px var(--font-heading);
  color: #fff;
  background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 40%, #10142B));
  border-radius: 50%;
}

.team-card strong { display: block; font: 700 18px var(--font-heading); }
.team-card p { margin: 2px 0 4px; color: var(--muted); font-size: 15px; line-height: 1.45; }
.team-card small { color: var(--accent); font-weight: 700; }

.cta-band {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 36px 40px;
  color: #fff;
  background: linear-gradient(120deg, #10142B, #26357A);
  border-radius: 20px;
}

.cta-band h2 { font-size: clamp(24px, 3vw, 32px); letter-spacing: -0.02em; }
.cta-band p { max-width: 46ch; color: #C9CEE6; }
.cta-band__buttons { display: flex; flex-wrap: wrap; gap: 12px; }
.cta-band .btn { color: #10142B; background: var(--sun); border-color: var(--sun); }
.cta-band .btn--light { color: #fff; background: transparent; border: 1px solid rgba(255, 255, 255, 0.4); }

/* ----- Contact ----- */
.contact-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(280px, 1fr);
  gap: 36px;
  align-items: start;
  padding-top: 48px;
}

.form-card {
  padding: 34px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: 0 18px 50px -30px rgba(16, 20, 43, 0.45);
}

.form-card h2 { margin-bottom: 4px; font-size: 26px; letter-spacing: -0.02em; }
.form-card > p { margin-bottom: 22px; color: var(--muted); }
.form-card .form { max-width: none; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.form-card input,
.form-card textarea {
  width: 100%;
  padding: 13px 15px;
  font-size: 17px;
  border-radius: 12px;
}

.form-card input:focus,
.form-card textarea:focus { border-color: var(--accent); }
.form-card .btn { padding: 14px 30px; font-size: 17px; border-radius: 12px; }
.form-card .form-note { color: var(--muted); font-size: 14px; }

.info-stack { display: grid; gap: 16px; }

.info-card {
  display: flex;
  gap: 16px;
  padding: 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.info-card__icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 44px;
  height: 44px;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  border-radius: 12px;
}

.info-card h3 { margin-bottom: 2px; font-size: 17px; }
.info-card p { color: var(--muted); font-size: 15.5px; line-height: 1.5; }
.info-card a { color: var(--accent); font-weight: 600; word-break: break-word; }

.faq { max-width: 820px; margin-top: 8px; }

.faq details {
  margin-bottom: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.faq summary {
  position: relative;
  padding: 18px 54px 18px 22px;
  font: 700 18px/1.35 var(--font-heading);
  list-style: none;
  cursor: pointer;
}

.faq summary::-webkit-details-marker { display: none; }

.faq summary::after {
  content: "+";
  position: absolute;
  right: 22px;
  top: 50%;
  transform: translateY(-50%);
  font: 500 26px var(--font-heading);
  color: var(--accent);
}

.faq details[open] summary::after { content: "\2212"; }
.faq details p { padding: 0 22px 20px; color: var(--muted); }

/* ----- Responsive and print ----- */
@media (max-width: 900px) {
  .legal { grid-template-columns: 1fr; gap: 28px; padding-top: 32px; }
  .legal__toc { position: static; }
  .about-story, .contact-layout { grid-template-columns: 1fr; }
  .about-stats { margin-top: 24px; }
}

@media (max-width: 560px) {
  .form-row { grid-template-columns: 1fr; }
  .form-card { padding: 24px; }
  .cta-band { padding: 28px 24px; }
}

@media print {
  .site-header, .site-footer, .legal__toc, .meta-chips button, .legal__cta, .page-loader { display: none !important; }
  .legal { display: block; padding: 0; }
  .page-hero { background: none; border: 0; }
}


/* ==========================================================
   Header: logo, desktop menu, hamburger and flyout menu

   Wider than 1024px (desktop, laptop): the menu sits in the header bar.
   1024px and narrower (tablet, phone): a hamburger button opens a flyout panel from the right.
   ========================================================== */

.bar {
  gap: 12px;
  height: auto;            /* lets a long menu wrap onto a second line instead of scrolling */
  min-height: 68px;
  padding-block: 8px;
}

.bar__space { flex: 1; }

/* Logo */
.brand { display: inline-flex; align-items: center; flex: none; }
.brand__logo { display: block; width: auto; height: 36px; }

/* Desktop menu (hidden until the screen is wide enough, see the media query below) */
.nav {
  display: none;
  flex: 1;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px;
  margin-left: 14px;
}

.nav a {
  padding: 8px 13px;
  font: 500 15px var(--font-heading);
  white-space: nowrap;
  color: var(--muted);
  border-radius: 999px;
}

.nav a:hover { color: var(--ink); background: color-mix(in srgb, var(--ink) 6%, transparent); }
.nav a[aria-current="page"] { color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent); }

/* Hamburger button: a round icon button like the dark-mode button */
.hamburger {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 40px;
  height: 40px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 50%;
  cursor: pointer;
}

.hamburger:hover { border-color: var(--accent); }

/* The three lines are drawn with one element and its two pseudo-elements */
.hamburger__lines,
.hamburger__lines::before,
.hamburger__lines::after {
  display: block;
  width: 18px;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
}

.hamburger__lines { position: relative; }
.hamburger__lines::before,
.hamburger__lines::after { content: ""; position: absolute; left: 0; }
.hamburger__lines::before { top: -6px; }
.hamburger__lines::after { top: 6px; }

/* Dark overlay behind the flyout */
.flyout-overlay {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(8, 10, 25, 0.55);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.flyout-overlay.is-open { opacity: 1; visibility: visible; }

/* The flyout panel, on the right */
.flyout {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  width: min(380px, 88vw);
  padding: 20px 22px 24px;
  overflow-y: auto;
  background: var(--surface);
  border-left: 1px solid var(--line);
  box-shadow: -24px 0 60px -24px rgba(8, 10, 25, 0.5);
  transform: translateX(102%);
  visibility: hidden;                       /* closed: not focusable, not read by screen readers */
  transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1), visibility 0s linear 0.3s;
}

.flyout.is-open {
  transform: none;
  visibility: visible;
  transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1), visibility 0s;
}

body.menu-open { overflow: hidden; }       /* the page behind does not scroll while the menu is open */

.flyout__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.flyout__search input {
  width: 100%;
  height: 46px;
  padding: 0 18px;
  font-size: 16px;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 999px;
}

.flyout__nav {
  display: grid;
  gap: 2px;
  margin: 22px 0;
}

.flyout__nav a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 14px;
  font: 700 20px/1.2 var(--font-heading);
  letter-spacing: -0.02em;
  color: var(--ink);
  border-radius: 12px;
}

/* A small arrow at the end of each link */
.flyout__nav a::after {
  content: "";
  width: 8px;
  height: 8px;
  border-top: 2px solid currentColor;
  border-right: 2px solid currentColor;
  opacity: 0.35;
  transform: rotate(45deg);
}

.flyout__nav a:hover,
.flyout__nav a[aria-current="page"] {
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, transparent);
}

.flyout__foot {
  display: grid;
  gap: 10px;
  margin-top: auto;
  padding-top: 18px;
  font: 500 14px var(--font-heading);
  color: var(--muted);
  border-top: 1px solid var(--line);
}

.flyout__foot a:hover,
.flyout__foot button:hover { color: var(--accent); }

.flyout__foot button {
  padding: 0;
  font: inherit;
  color: inherit;
  text-align: left;
  background: none;
  border: 0;
  cursor: pointer;
}

/* ----- The switch: desktop and laptop (wider than 1024px) show the menu in the bar, with no hamburger ----- */
@media (min-width: 1025px) {
  .nav { display: flex; }
  .bar__space { display: none; }
  .hamburger, .flyout, .flyout-overlay { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .flyout, .flyout.is-open, .flyout-overlay { transition: none; }
}


/* ==========================================================
   Footer bottom bar with social icons, plain tag chips, single-column band
   ========================================================== */

/* Copyright on the left, social icons on the right */
.copy {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.copy p { margin: 0; }

.social {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.social a {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 50%;
  transition: color 0.15s, background 0.15s, border-color 0.15s, transform 0.15s;
}

.social a:hover,
.social a:focus-visible {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
  transform: translateY(-2px);
}

:root[data-theme="dark"] .social a:hover { color: #0C1022; }

/* Tablets and phones: icons on top, copyright below, both centred */
@media (max-width: 900px) {
  .copy {
    flex-direction: column-reverse;
    justify-content: center;
    text-align: center;
  }
  .social { justify-content: center; }
}

/* A tag that is not a link (when Tag pages are switched off) looks like the linked ones */
.chips span {
  padding: 5px 14px;
  font: 600 14px var(--font-heading);
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
}

/* "Most read" alone, when the newsletter box is switched off */
.band__grid--single { grid-template-columns: minmax(0, 720px); }

/* New codes */
.company-description{
  padding-top: 10px;
  line-height: 20px;
}
@media (max-width: 900px) {
  .ticker-tape{
    padding: 0 25px 0 25px;
  } 
}