/* ==========================================================================
   Future Technology - homepage styles
   Mobile-first (375px). Dark premium publication look.
   Pair with homepage_generator.py. Ship as /assets/homepage.css.
   ========================================================================== */

:root {
  --bg: #070b18;
  --ink: #f4f6fb;
  --ink-soft: rgba(255, 255, 255, 0.72);
  --ink-mute: rgba(255, 255, 255, 0.5);
  --ink-faint: rgba(255, 255, 255, 0.35);
  --hairline: rgba(255, 255, 255, 0.06);
  --accent: #22d3ee;
  --cat-ai: #a78bfa;
  --cat-security: #f87171;
  --cat-computing: #34d399;
  --cat-science: #fbbf24;
  --cat-technology: #22d3ee;
  --radius-lg: 12px;
  --radius-md: 8px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
          "Helvetica Neue", Arial, sans-serif;
}

/* --------------------------------------------------------------------------
   Base
   -------------------------------------------------------------------------- */

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

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

.home {
  max-width: 680px;
  margin: 0 auto;
  padding: 16px 16px 56px;
}

/* Section labels ("TRENDING", "LATEST", "MORE FROM...") ------------------- */

.section-label {
  margin: 0 0 14px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.section-label--latest {
  padding-left: 10px;
  border-left: 3px solid var(--accent);
}

.section-label--trending::before {
  content: "\1F525"; /* fire */
  margin-right: 6px;
  font-size: 11px;
}

/* Category chips ---------------------------------------------------------- */

.chip {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: 1;
  white-space: nowrap;
}

.chip--sm { padding: 3px 7px; font-size: 9px; }

.chip--ai         { color: var(--cat-ai);         background: rgba(167, 139, 250, 0.14); }
.chip--security   { color: var(--cat-security);   background: rgba(248, 113, 113, 0.14); }
.chip--computing  { color: var(--cat-computing);  background: rgba(52, 211, 153, 0.14); }
.chip--science    { color: var(--cat-science);    background: rgba(251, 191, 36, 0.14); }
.chip--technology { color: var(--cat-technology); background: rgba(34, 211, 238, 0.14); }

/* --------------------------------------------------------------------------
   1. Hero - the cover image IS the hero. Title lives on the image.
   -------------------------------------------------------------------------- */

.hero { margin: 8px 0 0; }

.hero__link { display: block; }

.hero__media {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: #0c1226; /* while image loads */
}

.hero__img {
  width: 100%;
  height: 220px;
  object-fit: cover;
}

.hero__img--fallback { background: #0c1226; }
.hero__img--ai         { background: linear-gradient(160deg, #171236, #0c1226); }
.hero__img--security   { background: linear-gradient(160deg, #2b1220, #0c1226); }
.hero__img--computing  { background: linear-gradient(160deg, #0a2420, #0c1226); }
.hero__img--science    { background: linear-gradient(160deg, #2a2010, #0c1226); }
.hero__img--technology { background: linear-gradient(160deg, #0a2230, #0c1226); }

/* Gradient shade: transparent at 40%, solid page colour at the bottom edge
   so the image dissolves into the layout. */
.hero__shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(7, 11, 24, 0) 38%,
    rgba(7, 11, 24, 0.62) 68%,
    rgba(7, 11, 24, 0.94) 100%
  );
}

.hero__media > .chip {
  position: absolute;
  top: 12px;
  left: 12px;
  backdrop-filter: blur(4px);
}

.hero__text {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 0 14px 14px;
}

.hero__title {
  margin: 0;
  font-size: 19px;
  line-height: 1.32;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: #fff;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.hero__meta {
  margin: 6px 0 0;
  font-size: 12px;
  color: var(--ink-mute);
}

/* --------------------------------------------------------------------------
   2. Secondary stories - quiet text list under the hero.
   -------------------------------------------------------------------------- */

.stories { margin-top: 20px; }

.stories__list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.stories__item {
  padding: 12px 0;
  border-bottom: 1px solid var(--hairline);
}

.stories__item:last-child { border-bottom: none; }

.stories__top {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.stories__time {
  font-size: 11px;
  color: var(--ink-faint);
}

.stories__title {
  margin: 0;
  font-size: 16px;
  line-height: 1.38;
  font-weight: 600;
  color: var(--ink);
}

.stories__link:active .stories__title { color: var(--accent); }

/* --------------------------------------------------------------------------
   3. Trending - numbered, compact.
   -------------------------------------------------------------------------- */

.trending { margin-top: 40px; }

.trending__list {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: trend;
}

.trending__item {
  display: flex;
  align-items: baseline;
  gap: 14px;
  padding: 9px 0;
}

.trending__num {
  flex: 0 0 26px;
  font-size: 24px;
  font-weight: 800;
  line-height: 1;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  opacity: 0.85;
}

.trending__body {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 8px;
  min-width: 0;
}

.trending__title {
  font-size: 15px;
  line-height: 1.35;
  font-weight: 600;
  color: var(--ink);
}

.trending__title:active { color: var(--accent); }

/* --------------------------------------------------------------------------
   4. Newsletter - dark card, one gradient allowed on the button.
   -------------------------------------------------------------------------- */

.signup {
  margin-top: 48px;
  padding: 22px 18px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-lg);
}

.signup__title {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.signup__sub {
  margin: 6px 0 16px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink-mute);
}

.signup__form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.signup__input {
  width: 100%;
  padding: 12px 14px;
  font-size: 15px;
  font-family: inherit;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  outline: none;
  -webkit-appearance: none;
}

.signup__input::placeholder { color: var(--ink-faint); }

.signup__input:focus {
  border-color: rgba(34, 211, 238, 0.5);
  background: rgba(255, 255, 255, 0.08);
}

.signup__btn {
  padding: 12px 14px;
  font-size: 14px;
  font-weight: 700;
  font-family: inherit;
  letter-spacing: 0.02em;
  color: #04121a;
  background: linear-gradient(135deg, #22d3ee, #0ea5c4);
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
}

.signup__btn:active { filter: brightness(0.92); }

/* --------------------------------------------------------------------------
   5. Latest + "More from Future Technology" - shared horizontal cards.
   -------------------------------------------------------------------------- */

.latest { margin-top: 44px; }

.latest__list { display: block; }

.home .card,
.related .card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--hairline);
}

.latest__list .card:first-child { padding-top: 4px; }
.latest__list .card:last-child { border-bottom: none; }

.card__thumb {
  flex: 0 0 72px;
  width: 72px;
  height: 72px;
  border-radius: var(--radius-md);
  object-fit: cover;
  background: #0c1226;
}

/* Cover missing: category-tinted tile with the category initial. */
.card__thumb--fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 800;
}

.card__thumb--ai         { color: var(--cat-ai);         background: rgba(167, 139, 250, 0.12); }
.card__thumb--security   { color: var(--cat-security);   background: rgba(248, 113, 113, 0.12); }
.card__thumb--computing  { color: var(--cat-computing);  background: rgba(52, 211, 153, 0.12); }
.card__thumb--science    { color: var(--cat-science);    background: rgba(251, 191, 36, 0.12); }
.card__thumb--technology { color: var(--cat-technology); background: rgba(34, 211, 238, 0.12); }

.card__body { min-width: 0; }

.card__title {
  margin: 6px 0 0;
  font-size: 15px;
  line-height: 1.35;
  font-weight: 600;
  color: var(--ink);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.home .card:active .card__title,
.related .card:active .card__title { color: var(--accent); }

.card__meta {
  margin: 5px 0 0;
  font-size: 11px;
  color: var(--ink-faint);
}

/* "More from Future Technology" on article pages: identical cards,
   slightly tighter top margin and a hairline above to sit after body copy. */
.related {
  margin-top: 40px;
  padding-top: 28px;
  border-top: 1px solid var(--hairline);
}

/* --------------------------------------------------------------------------
   Footer tightening (existing footer markup, spacing only)
   -------------------------------------------------------------------------- */

.site-footer {
  margin-top: 40px;
  padding: 24px 16px 32px;
  border-top: 1px solid var(--hairline);
  font-size: 12px;
  line-height: 1.6;
  color: var(--ink-faint);
  text-align: center;
}

.site-footer p { margin: 0 0 6px; }

.site-footer a { color: var(--ink-mute); }

/* --------------------------------------------------------------------------
   Larger screens - modest adjustments, still a single column.
   -------------------------------------------------------------------------- */

@media (min-width: 480px) {
  .hero__img { height: 260px; }
  .hero__title { font-size: 21px; }
  .signup__form { flex-direction: row; }
  .signup__input { flex: 1; }
  .signup__btn { flex: 0 0 auto; padding: 12px 22px; }
}

@media (min-width: 680px) {
  .home { padding-top: 24px; }
  .hero__img { height: 320px; }
  .hero__text { padding: 0 20px 18px; }
  .hero__title { font-size: 24px; }
}

/* Reduce motion / no fancy effects to disable - kept intentionally calm. */
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
