/*
Theme Name: FinanFidem
Theme URI: https://example.com
Author: FinanFidem
Description: Custom theme with MarketWatch-style header, homepage, markets module, and footer.
Version: 2.0
*/

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ff-c-ink);
  background: var(--color-white);
  font-family: var(--ff-font-sans);
  font-size: 15px;
  font-weight: 400;
  line-height: 1.45;
  letter-spacing: 0;
}

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

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

a:hover {
  color: var(--color-link-hover);
}

button,
input {
  font-family: inherit;
}

/* -------------------------------------------------------------------------
   Sitewide container — identical gutters on every section
   ------------------------------------------------------------------------- */
.ff-wrap {
  width: 100%;
  max-width: var(--ff-container);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--ff-gutter);
  padding-right: var(--ff-gutter);
}

@media (max-width: 767px) {
  .ff-wrap {
    padding-left: var(--ff-gutter-sm);
    padding-right: var(--ff-gutter-sm);
  }

  .ff-util,
  .site-header {
    width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    box-sizing: border-box;
  }

  .ff-util .ff-wrap,
  .site-header .ff-wrap {
    max-width: var(--ff-container);
    margin-left: auto;
    margin-right: auto;
    padding-left: var(--ff-gutter-sm);
    padding-right: var(--ff-gutter-sm);
  }

  .site-header {
    --header-padding-y: 16px;
  }

  .ff-latest__hed {
    max-width: 100%;
  }

  .ff-gcard__hed,
  .ff-feat-card__hed,
  .ff-textlist__hed,
  .ff-sublist__hed,
  .ff-latest__hed {
    overflow-wrap: break-word;
    word-break: break-word;
  }

  .ff-gcard__hed a,
  .ff-feat-card__hed a,
  .ff-textlist__hed a,
  .ff-sublist__hed a,
  .ff-latest__hed a {
    overflow-wrap: break-word;
    word-break: break-word;
  }
}

/* -------------------------------------------------------------------------
   Header
   ------------------------------------------------------------------------- */
#site-header-wrap {
  position: sticky;
  top: 0;
  z-index: var(--header-z-index);
  width: 100%;
  overflow-x: hidden;
}

.admin-bar #site-header-wrap {
  top: 32px;
}

@media screen and (max-width: 782px) {
  .admin-bar #site-header-wrap {
    top: 46px;
  }
}

.ff-util {
  background: var(--color-white);
  border-bottom: 1px solid var(--ff-c-line);
  min-height: var(--util-bar-height);
  flex-shrink: 0;
  position: relative;
  z-index: calc(var(--header-z-index) + 1);
  width: 100%;
}

.ff-util__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: var(--util-bar-height);
  font-family: var(--ff-font-sans);
  font-size: 11px;
  font-weight: 500;
  color: var(--ff-c-muted);
}

.ff-util__links {
  display: flex;
  gap: 20px;
}

.ff-util__links a:hover {
  color: var(--ff-c-ink);
}

.ff-util__tag--mob {
  display: none;
}

@media (max-width: 639px) {
  .ff-util__tag--desk {
    display: none;
  }
  .ff-util__tag--mob {
    display: inline;
  }
}

.site-header {
  position: relative;
  background: var(--color-navy);
  padding-top: var(--header-padding-y);
  padding-bottom: var(--header-padding-y);
  transition: padding 0.3s ease;
  width: 100%;
}

.site-header .site-logo span,
.site-header .site-nav a,
.site-header .site-icons svg {
  transition: none;
}

.site-header.scrolled {
  padding-top: calc(var(--header-padding-y) * 0.5);
  padding-bottom: calc(var(--header-padding-y) * 0.5);
}

.site-header.scrolled .site-logo span {
  font-size: var(--logo-size);
}

.site-header.scrolled .site-nav a {
  font-size: var(--header-nav-size);
}

.site-header.scrolled .site-icons svg {
  width: var(--header-icon-size);
  height: var(--header-icon-size);
}

.site-header__inner {
  display: flex;
  align-items: center;
  gap: 28px;
}

.site-logo {
  text-decoration: none;
  flex-shrink: 0;
}

.site-logo span {
  color: var(--brand-green);
  font-family: var(--font-logo);
  font-weight: 700;
  font-size: var(--logo-size);
  line-height: 1;
  letter-spacing: -0.02em;
  white-space: nowrap;
  display: block;
}

.site-nav {
  display: none;
  flex: 1;
  min-width: 0;
}

.site-nav.is-overflow {
  display: none !important;
}

@media (min-width: 1024px) {
  .site-nav {
    display: flex;
  }
}

@media (max-width: 1023px) {
  .site-nav {
    display: none;
  }
}

.site-nav ul {
  display: flex;
  list-style: none;
  gap: 22px;
  margin: 0;
  padding: 0;
  align-items: center;
}

.site-nav a {
  position: relative;
  display: inline-block;
  color: var(--color-white);
  text-transform: uppercase;
  font-family: var(--font-headline);
  font-weight: 600;
  font-size: var(--header-nav-size);
  line-height: 1;
  letter-spacing: 0.8px;
  white-space: nowrap;
}

.site-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -7px;
  height: 2px;
  width: 100%;
  background: var(--ff-brand);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.2s ease;
}

.site-nav a:hover::after,
.site-nav a:focus-visible::after {
  transform: scaleX(1);
}

.site-icons {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}

.site-icons button {
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-white);
  flex-shrink: 0;
}

.site-icons button:hover,
.site-icons button.is-active {
  color: var(--ff-brand);
}

.site-icons svg {
  width: var(--header-icon-size);
  height: var(--header-icon-size);
}

#menu-toggle {
  display: flex;
}

.ff-search {
  background: var(--color-surface-dark);
  border-top: 1px solid var(--color-border-dark);
  padding: 12px 0;
}

.ff-search[hidden] {
  display: none !important;
}

.ff-search__inner {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ff-search__label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.ff-search input {
  flex: 1;
  height: 36px;
  border: 1px solid var(--color-border-mid);
  background: var(--color-text-dark);
  color: var(--color-white);
  padding: 0 12px;
  font-size: 14px;
}

.ff-search button {
  height: 36px;
  padding: 0 14px;
  background: var(--brand-green);
  color: var(--color-surface-darker);
  border: 0;
  font-family: var(--ff-font-cond);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  cursor: pointer;
}

.mobile-nav {
  display: none;
  background: var(--color-navy);
  border-top: 1px solid var(--color-border-dark);
}

.mobile-nav.is-open {
  display: block;
}

@media (min-width: 1024px) {
  .mobile-nav {
    display: none !important;
  }
}

.mobile-nav a {
  display: block;
  padding: 12px var(--ff-gutter);
  color: var(--color-white);
  text-transform: uppercase;
  font-family: var(--font-headline);
  font-weight: 600;
  font-size: var(--header-nav-size);
  letter-spacing: 0.8px;
}

.mobile-nav a:hover {
  color: var(--ff-brand);
}

/* -------------------------------------------------------------------------
   Type utilities
   ------------------------------------------------------------------------- */
.ff-eyebrow {
  margin: 0 0 8px;
  font-family: var(--ff-font-meta);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: var(--ff-c-ink);
}

.ff-eyebrow--live {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ff-c-news);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 1.6px;
}

.ff-live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ff-c-news);
  animation: ff-pulse 1.4s ease-in-out infinite;
  flex-shrink: 0;
}

@keyframes ff-pulse {
  0% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.4);
    opacity: 0.4;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.ff-hed-xl {
  margin: 0 0 14px;
  font-family: var(--ff-font-display);
  font-weight: 800;
  font-size: calc(36px * var(--headline-scale));
  line-height: 1.08;
  letter-spacing: -0.02em;
  color: var(--ff-c-ink);
}

.ff-hed-md {
  margin: 0 0 14px;
  font-family: var(--ff-font-display);
  font-weight: 700;
  font-size: calc(22px * var(--headline-scale));
  line-height: 1.12;
  letter-spacing: -0.015em;
  color: var(--ff-c-ink);
}

.ff-meta {
  display: block;
  margin-top: 8px;
  font-family: var(--ff-font-meta);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.9px;
  text-transform: uppercase;
  color: var(--ff-c-muted);
}

/* -------------------------------------------------------------------------
   Ads
   ------------------------------------------------------------------------- */
.ff-ad {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 16px auto;
}

.ff-ad__label {
  font-family: var(--ff-font-meta);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 1.8px;
  text-transform: uppercase;
  color: var(--ff-c-ad);
}

.ff-ad__box {
  display: none;
  background: var(--ff-c-ad-bg);
  border: 1px dashed #d5d5d5;
  max-width: 100%;
}

.ff-ad__box--desktop {
  display: block;
}

@media (max-width: 1023px) {
  .ff-ad__box--desktop {
    display: none;
  }
  .ff-ad__box--tablet {
    display: block;
  }
}

@media (max-width: 767px) {
  .ff-ad__box--tablet {
    display: none;
  }
  .ff-ad__box--mobile {
    display: block;
  }
}

.ff-ad--leaderboard {
  margin: 18px auto 8px;
}

.ff-ad--mid {
  margin: 28px auto;
}

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

.ff-home-rail .ff-ad {
  width: 100%;
  align-items: stretch;
  margin: 0;
}

.ff-home-rail .ff-ad__box {
  width: 100% !important;
  max-width: 100%;
  height: auto !important;
  min-height: 0;
}

.ff-home-rail .ff-ad:first-of-type .ff-ad__box--desktop {
  aspect-ratio: 300 / 600;
}

.ff-home-rail .ff-ad:last-of-type .ff-ad__box--desktop {
  aspect-ratio: 300 / 250;
}

.ff-ad--pair {
  margin: 0;
}

.ff-ad--anchor {
  margin: 0;
}

.ff-ad--anchor .ff-ad__box {
  display: block !important;
}

/* -------------------------------------------------------------------------
   Markets
   ------------------------------------------------------------------------- */
.ff-markets {
  padding: 4px 0 18px;
}

.ff-markets__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 4px;
}

.ff-markets__head h2 {
  margin: 0;
  font-family: var(--font-headline);
  font-size: calc(16px * var(--headline-scale));
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.ff-markets__head span {
  font-family: var(--ff-font-meta);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.4px;
  color: var(--ff-c-meta);
}

.ff-markets__tabs {
  display: flex;
  gap: 0;
  overflow-x: auto;
  border-bottom: 1px solid var(--ff-c-line);
  margin-bottom: 10px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.ff-markets__tabs::-webkit-scrollbar {
  display: none;
}

.ff-markets__tabs button {
  background: none;
  border: 0;
  border-bottom: 2px solid transparent;
  padding: 8px 14px 9px;
  font-family: var(--ff-font-cond);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: #555;
  cursor: pointer;
  white-space: nowrap;
}

.ff-markets__tabs button.is-active {
  color: var(--ff-c-ink);
  border-bottom-color: var(--ff-c-ink);
}

.ff-markets__body {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
  gap: 32px;
  align-items: start;
}

.ff-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.ff-table {
  width: 100%;
  min-width: 440px;
  border-collapse: collapse;
  font-size: 13px;
}

.ff-table th {
  text-align: right;
  font-family: var(--ff-font-cond);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.9px;
  text-transform: uppercase;
  color: var(--ff-c-meta);
  padding: 0 10px 8px;
}

.ff-table th:first-child,
.ff-table td:first-child {
  text-align: left;
  padding-left: 0;
}

.ff-table td {
  padding: 7px 10px;
  border-top: 1px solid var(--ff-c-line-soft);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
  font-family: var(--ff-font-mono);
  font-size: 13px;
  font-weight: 400;
  white-space: nowrap;
}

.ff-table td:first-child {
  font-family: var(--ff-font-sans);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.02em;
}

.ff-up {
  color: var(--ff-c-green);
}

.ff-down {
  color: var(--ff-c-red);
}

.ff-chart-panel {
  min-width: 0;
}

.ff-chart-ranges {
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  gap: 0;
  margin-bottom: 8px;
  scrollbar-width: none;
}

.ff-chart-ranges::-webkit-scrollbar {
  display: none;
}

.ff-chart-ranges button {
  background: none;
  border: 0;
  padding: 4px 9px;
  font-family: var(--ff-font-cond);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: #666;
  cursor: pointer;
  white-space: nowrap;
}

.ff-chart-ranges button.is-active {
  color: var(--ff-c-ink);
  box-shadow: inset 0 -2px 0 var(--ff-c-ink);
}

.ff-chart {
  width: 100%;
  height: 168px;
  display: block;
  background: #fafafa;
  border: 1px solid var(--ff-c-line-soft);
}

.ff-chart polyline {
  fill: none;
  stroke: var(--ff-c-green);
  stroke-width: 2;
}

.ff-chart .ff-chart__area {
  fill: rgba(10, 125, 44, 0.08);
  stroke: none;
}

.ff-chart.is-down polyline {
  stroke: var(--ff-c-red);
}

.ff-chart.is-down .ff-chart__area {
  fill: rgba(192, 0, 0, 0.08);
}

@media (max-width: 1023px) {
  .ff-markets__body {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .ff-chart {
    height: 140px;
  }
}

/* -------------------------------------------------------------------------
   Top hero — 3-column market news
   ------------------------------------------------------------------------- */
.ff-top-wrap {
  padding-top: 4px;
}

.ff-top {
  display: grid;
  /* Proportional columns so the middle text rail never collapses to 0px */
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, var(--sidebar-width));
  gap: var(--gutter);
  padding: 8px 0 28px;
  align-items: start;
}

.ff-top__col-main {
  min-width: 0;
}

.ff-top__label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--brand-red);
}

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--brand-red);
  display: inline-block;
  flex-shrink: 0;
  animation: pulse 2.25s ease infinite;
}

@keyframes pulse {
  0% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.4);
    opacity: 0.5;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.ff-top .ff-hed-xl {
  margin: 0 0 14px;
  max-width: var(--content-column-width);
  font-family: var(--font-headline);
  font-size: clamp(33px, 4.3vw, 55px);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.01em;
  color: var(--color-text-dark);
}

.ff-top .ff-hed-md {
  margin: 0 0 16px;
  min-width: 0;
  max-width: 100%;
  font-family: var(--font-headline);
  font-size: clamp(22px, 2.8vw, 36px);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -0.01em;
  color: var(--color-text-dark);
}

.ff-hero__img {
  display: block;
  position: relative;
  aspect-ratio: 3 / 2;
  overflow: hidden;
  background: var(--color-surface-gray);
  margin-top: 0;
}

.ff-hero__img img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ff-hero__time {
  display: block;
  margin-top: 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-text-meta);
}

.ff-mid {
  min-width: 0;
  padding-top: 28px;
}

.ff-sublist {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.ff-sublist__item {
  padding: 14px 0;
  border-bottom: 1px solid var(--color-line);
}

.ff-sublist__item:first-of-type {
  padding-top: 0;
}

.ff-sublist__item:last-child {
  border-bottom: 0;
}

.ff-top .ff-sublist__hed {
  margin: 0;
  min-width: 0;
  max-width: 100%;
  font-family: var(--font-headline);
  font-size: clamp(14px, 1.65vw, 21px);
  font-weight: 400;
  line-height: 1.3;
  color: var(--color-text-body);
}

.ff-sublist__hed a:hover {
  color: var(--color-link-hover);
}

.ff-latest {
  width: 100%;
  max-width: var(--sidebar-width);
  border: 1px solid var(--color-line);
  background: var(--color-white);
  justify-self: end;
}

.ff-latest__head {
  padding: 14px 16px 12px;
  border-bottom: 1px solid var(--color-line);
}

.ff-latest__head h2 {
  margin: 0;
  font-family: var(--font-headline);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--color-text-dark);
}

.ff-latest__head p {
  margin: 4px 0 0;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

.ff-latest__list {
  max-height: 500px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--color-border-light) transparent;
}

.ff-latest__item {
  padding: 12px 16px;
  border-bottom: 1px solid var(--color-line-soft);
}

.ff-latest__item:last-child {
  border-bottom: 0;
}

.ff-latest__hed {
  display: block;
  max-width: 288px;
  font-family: var(--font-headline);
  font-size: clamp(14px, 1.65vw, 21px);
  font-weight: 400;
  line-height: 1.3;
  color: var(--color-text-body);
}

.ff-latest__hed:hover {
  color: var(--color-link-hover);
}

.ff-latest__time {
  display: block;
  margin-top: 6px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.02em;
  color: var(--color-text-meta);
}

@media (max-width: 1024px) {
  .ff-top {
    grid-template-columns: 1fr;
    gap: 28px;
    padding-bottom: 24px;
  }

  .ff-top__col-main {
    max-width: none;
  }

  .ff-mid {
    padding-top: 0;
  }

  .ff-latest {
    max-width: none;
    justify-self: stretch;
  }

  .ff-latest__list {
    max-height: none;
    overflow-y: visible;
  }
}

/* -------------------------------------------------------------------------
   Homepage body — main column + persistent right rail
   ------------------------------------------------------------------------- */
.ff-home-body {
  padding: 4px 0 20px;
}

.ff-home-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, var(--sidebar-width));
  gap: var(--gutter);
  align-items: start;
}

.ff-home-main {
  min-width: 0;
  max-width: var(--content-column-width);
}

.ff-home-rail {
  width: 100%;
  max-width: var(--sidebar-width);
}

/* Part A — 6-article grid (3×2) */
.ff-six-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-auto-rows: 1fr;
  gap: 24px 18px;
  padding-bottom: 28px;
}

.ff-gcard {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.ff-gcard__media {
  flex-shrink: 0;
}

.ff-gcard__hed {
  margin: 0 0 10px;
  font-family: var(--font-headline);
  font-size: clamp(16px, 1.9vw, 22px);
  font-weight: 600;
  line-height: 1.2;
  color: var(--color-text-dark);
  flex-grow: 1;
  min-height: 0;
}

.ff-gcard__eyebrow {
  margin: 0 0 6px;
  font-family: var(--font-headline);
  font-size: clamp(11px, 1.1vw, 13px);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  flex-shrink: 0;
}

.ff-gcard__media,
.ff-feat-card__media {
  display: block;
  position: relative;
  overflow: hidden;
  background: var(--color-surface-gray);
  aspect-ratio: 3 / 2;
  margin-bottom: 8px;
}

.ff-gcard__media img,
.ff-feat-card__media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ff-gcard__time,
.ff-feat-card__time,
.ff-textlist__time {
  display: block;
  margin-top: 6px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-text-meta);
  flex-shrink: 0;
}

.ff-feat-card__time {
  color: var(--color-text-muted);
}

/* Part B — category sections */
.ff-cat-section {
  padding: 0 0 24px;
}

.ff-sec-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-top: 1px solid var(--color-line);
  padding-top: 14px;
  margin-bottom: 16px;
}

.ff-sec-head__title {
  margin: 0;
  font-family: var(--font-headline);
  font-size: clamp(18px, 2.2vw, 22px);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-text-dark);
}

.ff-see-all {
  display: inline-block;
  padding: 5px 10px 4px;
  border: 1px solid var(--color-border-btn);
  font-family: var(--font-headline);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-text-dark);
  background: var(--color-white);
  white-space: nowrap;
}

.ff-see-all:hover {
  border-color: var(--color-text-dark);
  color: var(--color-text-dark);
}

.ff-cat-block {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.ff-cat-block__cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.ff-feat-card__hed,
.ff-textlist__hed {
  margin: 0;
  font-family: var(--font-headline);
  font-size: clamp(16px, 1.65vw, 21px);
  font-weight: 400;
  line-height: 1.28;
  color: var(--color-text-body);
}

.ff-feat-card__hed {
  margin-top: 8px;
}

.ff-cat-block__list {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.ff-textlist__item {
  min-width: 0;
  padding: 12px 0;
  border-bottom: 1px solid var(--color-line);
}

.ff-textlist__hed,
.ff-textlist__hed a {
  min-width: 0;
  max-width: 100%;
}

.ff-textlist__item:first-child {
  padding-top: 0;
}

.ff-textlist__item:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

/* Part C — News You Might Like */
.ff-nyml-section {
  padding-bottom: 8px;
}

.ff-nyml {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.ff-nyml__cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.ff-nyml__list {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* Right rail */
.ff-rail-sticky {
  position: sticky;
  top: 128px;
}

.ff-home-rail .ff-ad--rail + .ff-ad--rail,
.ff-home-rail .ff-rail-ticker + .ff-ad--rail {
  margin-top: 16px;
}

.ff-rail-ticker {
  padding: 12px 14px;
  border: 1px solid var(--color-line);
  background: var(--color-white);
  width: 100%;
  box-sizing: border-box;
}

.ff-rail-ticker__label {
  margin: 0 0 8px;
  font-family: var(--font-headline);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-text-dark);
}

.ff-rail-ticker__table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-mono);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.ff-rail-ticker__table th {
  text-align: left;
  font-weight: 600;
  padding: 4px 6px 4px 0;
  color: var(--color-text-dark);
}

.ff-rail-ticker__table td {
  text-align: right;
  padding: 4px 0;
  white-space: nowrap;
}

.ff-rail-ticker__table td:last-child {
  padding-left: 8px;
  min-width: 48px;
}

.ff-rail-ticker__note {
  margin: 8px 0 0;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 400;
  color: var(--color-text-meta);
}

@media (max-width: 1024px) {
  .ff-home-layout {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .ff-home-main {
    max-width: none;
  }

  .ff-home-rail {
    max-width: none;
    justify-self: stretch;
  }

  .ff-rail-sticky {
    position: static;
  }

  .ff-six-grid {
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: 1fr;
    gap: 24px;
  }

  .ff-cat-block {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .ff-cat-block__cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ff-nyml {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .ff-nyml__cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 600px) {
  .ff-cat-block__cards,
  .ff-nyml__cards {
    grid-template-columns: 1fr;
  }

  .ff-six-grid {
    grid-template-columns: 1fr;
    grid-auto-rows: 1fr;
    gap: 24px;
  }
}

/* Legacy card helpers (other templates) */
.ff-card__media {
  display: block;
  position: relative;
  overflow: hidden;
  background: var(--color-surface-gray);
  aspect-ratio: 3 / 2;
  margin-bottom: 10px;
}

.ff-card__media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ff-card__hed {
  margin: 0;
  font-family: var(--font-headline);
  font-weight: 600;
  font-size: clamp(16px, 1.65vw, 21px);
  line-height: 1.2;
  color: var(--color-text-dark);
}

/* -------------------------------------------------------------------------
   Footer
   ------------------------------------------------------------------------- */
.ff-prefooter {
  background: var(--color-surface-gray);
  padding: 22px 0 18px;
  border-top: 1px solid var(--color-line);
}

.ff-prefooter__ads {
  display: flex;
  justify-content: center;
  gap: 24px;
  flex-wrap: wrap;
}

.ff-ad--footer-break {
  width: 100%;
  display: flex;
  justify-content: center;
}

.ff-btt-wrap {
  background: var(--color-surface-gray);
  padding: 0 0 10px;
}

.ff-btt-wrap__inner {
  display: flex;
  justify-content: flex-end;
}

.ff-btt {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--color-white);
  color: var(--color-text-dark);
  border: 1px solid var(--color-border-light);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
  padding: 8px 12px 7px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.ff-btt:hover {
  color: var(--color-text-dark);
}

.ff-btt__icon {
  font-size: 9px;
  line-height: 1;
}

.ff-footer {
  background: var(--color-footer-bg);
  color: var(--color-footer-text);
  padding: 36px 0 0;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 400;
}

.ff-footer__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 32px 28px;
  padding-bottom: 28px;
}

.ff-footer__col h2 {
  margin: 0 0 12px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-white);
}

.ff-footer__col ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.ff-footer__col a {
  display: block;
  padding: 4px 0;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.02em;
  text-transform: none;
  color: var(--color-footer-link);
}

.ff-footer__col a:hover,
.ff-footer__legal a:hover {
  color: var(--color-white);
}

.ff-footer__disclaimer {
  margin: 0;
  padding: 16px 0 20px;
  border-top: 1px solid var(--color-border-dark);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.5;
  color: var(--color-footer-muted);
}

.ff-footer__strip {
  background: var(--color-surface-darker);
  border-top: 1px solid var(--color-border-dark);
}

.ff-footer__strip-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 44px;
  padding-top: 8px;
  padding-bottom: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.02em;
  color: var(--color-footer-strip);
}

.ff-footer__copy {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 400;
  color: var(--color-footer-copy);
}

.ff-footer__legal {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 400;
  color: var(--color-footer-link);
}

.ff-footer__legal a {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 400;
  color: var(--color-footer-link);
}

/* -------------------------------------------------------------------------
   Mobile anchor ad
   ------------------------------------------------------------------------- */
.ff-anchor {
  display: none;
}

@media (max-width: 767px) {
  .ff-anchor {
    display: flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 60;
    background: #fff;
    border-top: 1px solid var(--ff-c-line);
    padding: 8px 28px 8px 8px;
  }

  .ff-anchor[hidden] {
    display: none !important;
  }

  body.has-anchor-ad {
    padding-bottom: 74px;
  }

  .ff-anchor__close {
    position: absolute;
    right: 6px;
    top: 6px;
    background: none;
    border: 0;
    font-size: 18px;
    line-height: 1;
    color: #666;
    cursor: pointer;
  }
}

@media (min-width: 768px) {
  .ff-anchor {
    display: none !important;
  }
}

/* -------------------------------------------------------------------------
   Tablet / iPad (portrait and small landscape — not stretched mobile)
   ------------------------------------------------------------------------- */
@media (min-width: 768px) and (max-width: 1023px) {
  .site-header {
    --header-padding-y: 20px;
  }

  .ff-latest__hed {
    max-width: 100%;
  }

  .ff-gcard__hed,
  .ff-feat-card__hed,
  .ff-textlist__hed,
  .ff-sublist__hed,
  .ff-latest__hed {
    overflow-wrap: break-word;
    word-break: break-word;
  }

  .ff-gcard__hed a,
  .ff-feat-card__hed a,
  .ff-textlist__hed a,
  .ff-sublist__hed a,
  .ff-latest__hed a {
    overflow-wrap: break-word;
    word-break: break-word;
  }

  .ff-footer__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 28px 32px;
  }

  .ff-prefooter__ads {
    flex-wrap: nowrap;
    justify-content: center;
  }

  .ff-markets__head {
    flex-wrap: wrap;
  }
}

/* -------------------------------------------------------------------------
   Mobile
   ------------------------------------------------------------------------- */
@media (max-width: 767px) {
  .ff-footer__grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .ff-footer__strip-inner {
    flex-direction: column;
    align-items: flex-start;
    padding-top: 10px;
    padding-bottom: 10px;
  }

  .ff-gcard__hed,
  .ff-card__hed,
  .ff-feat-card__hed {
    font-size: clamp(18px, 4.5vw, 22px);
  }

  .ff-markets__head span {
    font-size: 10px;
  }

  .ff-btt-wrap__inner {
    justify-content: flex-end;
  }

  .ff-prefooter__ads {
    flex-direction: column;
    align-items: center;
  }
}

.site-main {
  max-width: var(--ff-container);
  margin: 0 auto;
  padding: 24px var(--ff-gutter);
}

.site-main article {
  margin-bottom: 32px;
  padding-bottom: 32px;
  border-bottom: 1px solid #e5e5e5;
}

.site-main h2 {
  margin: 0 0 8px;
  font-family: var(--ff-font-display);
  font-size: 1.5rem;
}

.site-main p {
  margin: 0;
  color: #444;
  line-height: 1.6;
}

/* -------------------------------------------------------------------------
   Single article
   ------------------------------------------------------------------------- */
.ff-article__eyebrow {
  margin: 0 0 10px;
  font-family: var(--font-headline);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

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

.ff-article__title {
  margin: 0 0 12px;
  font-family: var(--font-headline);
  font-size: clamp(28px, 3.5vw, 44px);
  font-weight: 600;
  line-height: 1.12;
  color: var(--color-text-dark);
}

.ff-article__meta {
  margin-bottom: 14px;
}

.ff-article__time {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-text-meta);
}

.ff-share {
  display: flex;
  gap: 10px;
  margin-bottom: 18px;
}

.ff-share__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--color-line);
  color: var(--color-text-dark);
  background: var(--color-white);
}

.ff-share__btn:hover {
  border-color: var(--color-text-dark);
  color: var(--color-link-hover);
}

.ff-article__figure {
  margin: 0 0 24px;
}

.ff-article__img {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
  background: var(--color-surface-gray);
}

.ff-article__body {
  font-family: var(--font-body);
  font-size: 18px;
  line-height: 1.6;
  color: var(--color-text-body);
}

.ff-article__body p {
  margin: 0 0 1.2em;
}

.ff-article__body a {
  color: var(--color-link-hover);
  text-decoration: underline;
}

/* -------------------------------------------------------------------------
   Category archive + pagination
   ------------------------------------------------------------------------- */
.ff-pagination {
  padding: 24px 0 8px;
}

.ff-pagination .nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 12px;
}

.ff-pagination .page-numbers {
  display: inline-block;
  padding: 6px 10px;
  border: 1px solid var(--color-line);
  color: var(--color-text-dark);
}

.ff-pagination .page-numbers.current {
  background: var(--color-navy);
  border-color: var(--color-navy);
  color: var(--color-white);
}

.ff-empty {
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--color-text-muted);
}

/* -------------------------------------------------------------------------
   404 page
   ------------------------------------------------------------------------- */
.ff-notfound__inner {
  max-width: 560px;
  margin: 48px auto 64px;
  text-align: center;
}

.ff-notfound__code {
  margin: 0 0 8px;
  font-family: var(--font-headline);
  font-size: clamp(48px, 8vw, 72px);
  font-weight: 600;
  line-height: 1;
  color: var(--color-accent);
}

.ff-notfound__title {
  margin: 0 0 12px;
  font-family: var(--font-headline);
  font-size: clamp(24px, 3vw, 32px);
  font-weight: 600;
  color: var(--color-text-dark);
}

.ff-notfound__text {
  margin: 0 0 24px;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  color: var(--color-text-muted);
}

.ff-notfound__btn {
  display: inline-block;
  padding: 10px 18px;
  border: 1px solid var(--color-border-btn);
  font-family: var(--font-headline);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-text-dark);
  background: var(--color-white);
}

.ff-notfound__btn:hover {
  border-color: var(--color-text-dark);
}

@media (max-width: 1024px) {
  .ff-single .ff-home-layout,
  .ff-archive .ff-home-layout {
    grid-template-columns: 1fr;
  }

  .ff-single .ff-home-rail,
  .ff-archive .ff-home-rail {
    max-width: none;
  }
}

@media (max-width: 820px) {
  .ff-footer__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
