/* ==========================================================================
   Front page
   ========================================================================== */

/* Vertical rhythm between the front-page rows. GeneratePress zeroes the
   margins of direct children of .site-main, so be explicit and specific. */
body.fcs-front .site-main > .fcs-section,
body.fcs-front .site-main > .fcs-home__grid,
body.fcs-front .site-main > .fcs-hero-row { margin-top: var(--fcs-space-7); margin-bottom: 0; }
body.fcs-front .site-main > .fcs-hero-row { margin-top: 0; }
body.fcs-front .fcs-section { margin-block: 0; }

/* Two-column rows: content + right rail (rail hides under 1024) */
.fcs-hero-row,
.fcs-home__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--fcs-sidebar);
  gap: var(--fcs-space-5);
  align-items: start;
}
@media (max-width: 1023px) {
  .fcs-hero-row, .fcs-home__grid { grid-template-columns: minmax(0, 1fr); }
  .fcs-rail--hero, .fcs-rail--latest { display: none; }
}

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */
.fcs-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: var(--fcs-space-5);
  align-items: center;
  min-height: 380px;
  padding: clamp(1.5rem, 3vw, 2.5rem);
  border-radius: var(--fcs-radius-lg);
  background:
    radial-gradient(60% 80% at 85% 20%, rgba(37, 99, 235, 0.35), transparent 60%),
    linear-gradient(135deg, #0b1220 0%, #111a2e 60%, #0f1a33 100%);
  color: #e5e9f2;
  box-shadow: var(--fcs-shadow-lg);
  overflow: hidden;
}
.fcs-hero__body { display: flex; flex-direction: column; align-items: flex-start; gap: var(--fcs-space-4); }
.fcs-hero__eyebrow {
  display: inline-block;
  padding: 0.2rem 0.65rem;
  border-radius: var(--fcs-radius-pill);
  background: var(--fcs-accent);
  color: #fff;
  font-size: var(--fcs-text-xs);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.fcs-hero__title {
  font-size: var(--fcs-text-4xl);
  font-weight: 800;
  line-height: 1.12;
  margin: 0;
  color: #fff;
}
.fcs-hero__title a { color: inherit; }
.fcs-hero__title a:hover { color: #bfdbfe; }
.fcs-hero__excerpt { margin: 0; color: #c7d0e0; font-size: var(--fcs-text-md); max-width: 52ch; }
.fcs-hero__meta { color: #94a3b8; }
.fcs-hero__meta strong, .fcs-hero__meta a { color: #e5e9f2; }
.fcs-hero__meta > * + *::before { color: #475569; }
.fcs-hero__cta { margin-top: 0.25rem; }
.fcs-hero__media { align-self: stretch; display: flex; }
.fcs-hero__media .fcs-thumb {
  width: 100%;
  height: 100%;
  min-height: 240px;
  object-fit: cover;
  border-radius: var(--fcs-radius);
  box-shadow: 0 20px 50px -20px rgba(0, 0, 0, 0.7);
}
.fcs-hero__media .fcs-thumb--fallback { display: grid; place-items: center; background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.08); }
@media (max-width: 800px) {
  .fcs-hero { grid-template-columns: 1fr; min-height: 0; }
  .fcs-hero__media { order: -1; }
  .fcs-hero__media .fcs-thumb { min-height: 0; aspect-ratio: 16 / 9; }
}

/* --------------------------------------------------------------------------
   Browse by topic
   -------------------------------------------------------------------------- */
.fcs-topics__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: var(--fcs-space-3);
}
@media (max-width: 1100px) { .fcs-topics__list { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 700px) { .fcs-topics__list { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 480px) { .fcs-topics__list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.fcs-topic {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-height: 56px;
  padding: 0.6rem 0.8rem;
  border: 1px solid var(--fcs-border);
  border-radius: var(--fcs-radius);
  background: var(--fcs-surface);
  color: var(--fcs-text);
  font-size: var(--fcs-text-sm);
  font-weight: 600;
  transition: border-color var(--fcs-dur) var(--fcs-ease), box-shadow var(--fcs-dur) var(--fcs-ease), transform var(--fcs-dur) var(--fcs-ease);
}
.fcs-topic:hover { border-color: var(--fcs-accent); box-shadow: var(--fcs-shadow); color: var(--fcs-text); transform: translateY(-1px); }
.fcs-topic__name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fcs-topic__count { color: var(--fcs-text-3); font-size: var(--fcs-text-xs); font-weight: 500; }

.fcs-badge {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: var(--fcs-badge-size, 36px);
  height: var(--fcs-badge-size, 36px);
  border-radius: 8px;
  background: var(--fcs-badge-bg);
  color: var(--fcs-badge-fg);
  font-family: var(--fcs-font-mono);
  font-size: var(--fcs-badge-font, 12px);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1;
}

/* --------------------------------------------------------------------------
   Popular this week + newsletter
   -------------------------------------------------------------------------- */
.fcs-popular__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--fcs-space-5);
  align-items: start;
}
/* Two columns only when the newsletter box is present */
@media (min-width: 861px) { .fcs-popular__grid:has(.fcs-newsletter) { grid-template-columns: minmax(0, 1.4fr) minmax(280px, 1fr); } }

.fcs-rows { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.25rem; counter-reset: none; }
.fcs-row {
  display: grid;
  grid-template-columns: 1.5rem 88px minmax(0, 1fr);
  gap: 0.9rem;
  align-items: center;
  padding: 0.6rem 0.6rem;
  border-radius: var(--fcs-radius);
  transition: background var(--fcs-dur) var(--fcs-ease);
}
.fcs-row:hover { background: var(--fcs-surface); }
.fcs-row__rank { font-size: var(--fcs-text-lg); font-weight: 700; color: var(--fcs-text-3); text-align: center; }
.fcs-row__media .fcs-thumb { width: 88px; height: 56px; border-radius: var(--fcs-radius-sm); object-fit: cover; }
.fcs-row__title { font-size: var(--fcs-text-sm); font-weight: 600; line-height: 1.4; margin: 0 0 0.3rem; }
.fcs-row__title a { color: var(--fcs-text); }
.fcs-row__title a:hover { color: var(--fcs-accent); }
.fcs-row__meta { font-size: 0.72rem; }
.fcs-row__meta .fcs-chip { font-size: 0.66rem; padding-block: 0.02rem; }
@media (max-width: 480px) {
  .fcs-row { grid-template-columns: 1.25rem 72px minmax(0, 1fr); gap: 0.6rem; }
  .fcs-row__media .fcs-thumb { width: 72px; height: 46px; }
}

.fcs-newsletter {
  padding: var(--fcs-space-6) var(--fcs-space-5);
  border-radius: var(--fcs-radius-lg);
  background: var(--fcs-info-soft);
  border: 1px solid color-mix(in srgb, var(--fcs-accent) 25%, var(--fcs-border));
  text-align: center;
}
.fcs-newsletter__icon {
  display: inline-grid; place-items: center;
  width: 56px; height: 56px;
  border-radius: var(--fcs-radius);
  background: var(--fcs-surface);
  color: var(--fcs-accent);
  box-shadow: var(--fcs-shadow-sm);
  margin-bottom: var(--fcs-space-4);
}
.fcs-newsletter__title { font-size: var(--fcs-text-xl); margin: 0 0 0.35rem; }
.fcs-newsletter__text { color: var(--fcs-text-2); font-size: var(--fcs-text-sm); margin: 0 0 var(--fcs-space-4); }
.fcs-newsletter__form { display: flex; flex-direction: column; gap: 0.6rem; }
.fcs-newsletter__form .fcs-btn { width: 100%; }
.fcs-newsletter__note {
  display: flex; align-items: center; justify-content: center; gap: 0.35rem;
  margin: 0.25rem 0 0;
  font-size: var(--fcs-text-xs);
  color: var(--fcs-text-3);
}
.fcs-newsletter__note .fcs-icon { color: var(--fcs-success); }
.fcs-newsletter__note.is-error { color: #b91c1c; }
:root[data-theme="dark"] .fcs-newsletter__note.is-error { color: #fca5a5; }
/* Jetpack subscription form inside the box */
.fcs-newsletter__jetpack .wp-block-jetpack-subscriptions__container form { display: flex; flex-direction: column; gap: 0.6rem; }
.fcs-newsletter__jetpack .wp-block-jetpack-subscriptions__container p { margin: 0; }
.fcs-newsletter__jetpack input[type="email"] { width: 100%; }
.fcs-newsletter__jetpack .fcs-btn { width: 100%; margin: 0 !important; }
.fcs-newsletter__jetpack .jetpack-sub-notification .error { color: #b91c1c; font-size: var(--fcs-text-xs); margin: 0.4rem 0 0; }
.fcs-newsletter__jetpack .jetpack-sub-notification .success { color: var(--fcs-success); font-size: var(--fcs-text-sm); font-weight: 600; margin: 0.4rem 0 0; }
:root[data-theme="dark"] .fcs-newsletter__jetpack .jetpack-sub-notification .error { color: #fca5a5; }
.fcs-newsletter__form.is-done input, .fcs-newsletter__form.is-done .fcs-btn { display: none; }
.fcs-newsletter__form.is-done .fcs-newsletter__note { font-size: var(--fcs-text-sm); color: var(--fcs-success); font-weight: 600; }
