/*
  Home refinements (edition and launch states). Loaded after responsive.css; site.css stays untouched.
  Mobile first: compact cards, one-row topic chips, short "how we choose" items.
  CSP: no inline styles anywhere.

  0. Vertical rhythm       3. Sponsor band            5. Topics, criteria, newsletter, footer gap
  1. Hero                  4. (reserved)              6. Motion
  2. Cards
*/

/* 0. Vertical rhythm: one scale for every home section ------------------------------------------------ */
:root {
  --space-section: 5rem;   /* between home sections, and above the footer */
  --space-block: 3rem;     /* between a section's heading row and a large group, or hero and cards */
  --space-tight: 1.25rem;  /* inside a section: rule to heading, heading to content */
}
@media (max-width: 760px) {
  :root { --space-section: 3.5rem; --space-block: 2rem; --space-tight: 1rem; }
}

/* 1. Hero ---------------------------------------------------------------------------------------------- */
/* Moderate band: headline, lead and edition sticker with room above and below; no side index, no ribbon. */
.hero-home, .hero-launch { padding-block: clamp(24px, 2.4vw, 34px) clamp(26px, 2.6vw, 36px); }
.hero-home .hero-grid, .hero-launch .hero-grid { padding-bottom: 0; align-items: end; }
.hero-home .hero-main { grid-column: 1 / span 9; }
.hero-home .hero-main .hero-lead { margin-top: 14px; }
.hero-home .edition-meta, .hero-launch .launch-note { position: static; transform: rotate(-2deg); align-self: flex-start; margin: 0 0 4px 2px; }
.hero-home .edition-meta { margin-top: 12px; }
@media (max-width: 760px) {
  .hero-home, .hero-launch { padding-block: 28px 32px; }
  .hero-launch .hero-aside { margin-top: 18px; }
}

/* 2. Cards --------------------------------------------------------------------------------------------- */
@media (max-width: 760px) {
  .today-grid { row-gap: 40px; margin-top: calc(var(--space-block) + 12px); }
  /* Same shorter crop for every card, including the featured first one. */
  .today-grid > .discovery-card:nth-child(n) img { aspect-ratio: 16 / 10; }
  .today-grid .card-body { padding: 14px 16px 6px; }
  .today-grid .discovery-card h2 { margin: 8px 0 6px; font-size: 21px; }
  .today-grid .description {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    overflow: hidden;
    margin: 0;
    font-size: 15px;
  }
  .today-grid .discovery-card .text-link { padding-top: 4px; }
}

/* Wider screens: the three finds weigh the same, so no card is featured over the others. site.css gives
   the first card a 7-column span and a tall image; flatten that into three equal columns. */
@media (min-width: 761px) {
  .today-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 52px clamp(16px, 2vw, 28px); margin-top: calc(var(--space-block) + 12px); }
  .today-grid > .discovery-card:nth-child(n) { grid-area: auto; grid-column: auto; }
  .today-grid > .discovery-card:nth-child(n) .image-link { flex: none; min-height: 0; position: relative; }
  .today-grid > .discovery-card:nth-child(n) img { aspect-ratio: 4 / 3; height: auto; position: static; }
  .today-grid > .discovery-card:nth-child(n) .card-body { padding-bottom: 6px; }
  .today-grid > .discovery-card:nth-child(n) h2 { letter-spacing: -.02em; font-size: clamp(19px, 0.9rem + 0.9vw, 28px); font-weight: 400; }
  .today-grid > .discovery-card:nth-child(n) .card-number { padding: 8px 12px 6px; font-size: clamp(30px, 2.4vw, 40px); top: -26px; left: 20px; right: auto; }
}

/* 3. Topics and criteria ------------------------------------------------------------------------------- */
@media (max-width: 760px) {
  .topic-strip { gap: 10px; }
  .topic-strip h2 { font-size: 18px; }
  /* One scrollable row that bleeds to the screen edges; links stay keyboard reachable. */
  .topic-strip .chip-list {
    flex-wrap: nowrap;
    overflow-x: auto;
    scroll-snap-type: x proximity;
    scroll-padding-inline: var(--gutter);
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    margin-inline: calc(-1 * var(--gutter));
    padding: 4px var(--gutter);
  }
  .topic-strip .chip-list::-webkit-scrollbar { display: none; }
  .topic-strip .chip-list li { flex: none; scroll-snap-align: start; }
  .topic-strip .chip { white-space: nowrap; }

  .criteria-compact { gap: var(--space-tight); }
  .criteria-compact > h2 { font-size: 28px; }
  .criteria-compact .criteria-list { gap: 0; }
  .criteria-compact .criteria-list li { grid-template-columns: 44px 1fr; column-gap: 10px; padding: 12px 0; }
  .criteria-compact .criteria-list li:last-child { padding-bottom: 0; }
  .criteria-compact .criteria-list li:before { font-size: 24px; }
  .criteria-compact .criteria-list h3 { margin-bottom: 2px; font-size: 17px; }
  .criteria-compact .criteria-list p { font-size: 15px; }
}


/* 3. Sponsor band ------------------------------------------------------------------------------------- */
/* Paid placements are what the publication sells, so they sit right under the hero, before the editorial
   cards, as a real band of equal white tiles. Always labelled "Patrocinado" and separated from the cards
   by a full section gap and their own "Con el apoyo de" heading. */
.sponsors { margin-top: var(--space-block); }
.sponsors .section-heading { margin-bottom: var(--space-tight); padding-top: var(--space-tight); }
.sponsors .section-heading h2 { font-size: 22px; font-weight: 400; margin: 0; }
.sponsor-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-tight); }
.sponsor-item { display: grid; grid-template-columns: 96px minmax(0, 1fr); column-gap: 18px; align-items: start; min-width: 0; padding: 16px; background: var(--card); border: 1px solid var(--ink); border-radius: var(--radius); }
.sponsor-item img, .sponsor-mark { width: 96px; height: 96px; min-height: 0; object-fit: cover; border: 0; border-radius: 4px; }
.sponsor-mark { display: grid; place-items: center; background: var(--orange); color: var(--ink); font-family: var(--display); font-weight: 300; font-size: 40px; line-height: 1; }
.sponsor-copy { display: flex; flex-direction: column; align-items: flex-start; min-width: 0; }
.sponsor-item .sponsor-label { display: block; padding: 0; border: 0; background: none; color: var(--muted); font-size: 12px; line-height: 1.3; }
.sponsor-item h3 { margin: 4px 0 4px; font-size: 20px; font-weight: 400; line-height: 1.2; }
.sponsor-item .sponsor-description {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
}
.sponsor-item .text-link { margin-top: 6px; font-size: 15px; }
/* The cards keep a full section gap from the paid band so the two never read as one block. */
.wrap:has(> .sponsors) + .wrap .today-grid { margin-top: calc(var(--space-section) + 12px); }
/* Below 1000px: one compact tile per row, image left and text right. */
@media (max-width: 1000px) {
  .sponsor-grid { grid-template-columns: 1fr; gap: 10px; }
}
@media (max-width: 760px) {
  .sponsors .section-heading h2 { font-size: 19px; }
  .sponsor-item { grid-template-columns: 76px minmax(0, 1fr); column-gap: 14px; padding: 8px 12px; }
  .sponsor-item .sponsor-label { line-height: 1.2; }
  .sponsor-item img, .sponsor-mark { width: 76px; height: 76px; }
  .sponsor-mark { font-size: 32px; }
  .sponsor-item h3 { margin: 1px 0 0; font-size: 18px; line-height: 1.15; }
  .sponsor-item .sponsor-description { font-size: 14px; -webkit-line-clamp: 1; line-clamp: 1; }
  .sponsor-item .text-link { margin-top: 0; font-size: 14px; }
}

/* 5. Topics, criteria, newsletter and the gap above the footer ---------------------------------------- */
.topic-strip { margin-top: var(--space-section); padding-top: var(--space-tight); }
.criteria-compact, .launch .criteria { margin-top: var(--space-section); padding: var(--space-tight) 0 0; row-gap: var(--space-block); }
.criteria-compact .contact-line { margin-top: 0; }
.launch > .wrap > .contact-line { margin: var(--space-section) 0 0; padding-top: var(--space-tight); }
main .nl-band { margin-top: var(--space-section); }
/* Room before the footer on the home page only. */
main:has(> .edition), main:has(> .launch) { padding-bottom: var(--space-section); }
@media (max-width: 760px) {
  main .nl-band { gap: 12px; padding: 18px 16px; }
  main .nl-band h2 { margin-bottom: 4px; font-size: 20px; }
  main .nl-band p { font-size: 15px; }
}

/* 6. Motion -------------------------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .topic-strip .chip-list { scroll-behavior: auto; }
}
