/* Final homepage-only responsive overrides. */
.home-page .home-intro {
  display: flex;
  width: 100%;
  justify-content: center;
}
.home-page .home-intro h1 {
  width: 100%;
  text-align: center;
}
.home-page .home-mobile-today-rail { display: none; }

/* Desktop: a compact, full-width lead with text sized to its available space. */
@media (min-width: 761px) {
  .home-page .home-section-heading { margin-bottom: 14px; }
  .home-page .home-lead-carousel,
  .home-page .home-lead-carousel > .home-lead {
    width: 100% !important;
    height: 330px;
    min-height: 330px;
    margin-inline: 0 !important;
  }
  .home-page .home-lead-carousel { overflow: hidden; }
  .home-page .home-lead-carousel > .home-lead {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    column-gap: 24px;
  }
  .home-page .home-lead-art {
    grid-column: span 2;
    min-height: 330px;
    background: transparent;
  }
  .home-page .home-lead-art img {
    min-height: 330px;
    background: transparent;
    transform: none;
  }
  .home-page .home-lead-copy {
    display: grid;
    grid-column: span 2;
    grid-template-rows: auto auto minmax(0, 1fr) auto;
    min-width: 0;
    min-height: 330px;
    padding: 20px 0;
  }
  .home-page .home-lead h2 {
    margin: 5px 0 9px;
    font-size: clamp(30px, 3vw, 46px);
    -webkit-line-clamp: 3;
  }
  .home-page .home-lead p { -webkit-line-clamp: 4; }
  .home-page .home-lead .source { align-self: end; margin-top: 0; }
  .home-page .home-rail { gap: 24px; margin-top: 24px; }
}

@media (min-width: 761px) {
  main:has(.contact-page), main:has(.about-page) { max-width: 1120px; min-height: 100vh; padding: 34px 28px 64px; }
  main:has(.contact-page) .nav-links .contact, main:has(.about-page) .nav-links .contact { color: #18231f; }
  .contact-page, .about-page { margin: 54px auto 0; text-align: center; }
  .contact-page h1, .about-page h1 { margin: 0 auto; color: #18231f; font: 700 clamp(44px, 6vw, 64px)/.98 Georgia, "Times New Roman", serif; letter-spacing: -.055em; }
  .contact-page .page-copy { max-width: 620px; margin: 14px auto 0; color: #58645e; font: 22px/1.45 Arial, sans-serif; }
  .contact-page .contact-gate, .contact-page .contact-form { max-width: 620px; margin: 38px auto 0; padding: 0; border: 0; background: transparent; text-align: left; }
  .contact-page .contact-form label:first-child { margin-top: 0; }
  .about-page { max-width: 760px; }
  .about-page h1 { margin-bottom: 20px; }
  .about-page .intro,
  .about-page .draft-copy,
  .about-page .draft-copy p {
    display: inline;
    margin: 0;
    color: #f6f4ef;
    font: 21px/1.5 Arial, sans-serif;
    letter-spacing: normal;
  }
  .about-page .intro::after { content: " "; white-space: pre; }
  .about-page .draft-copy p:not(:last-child)::after { content: " "; white-space: pre; }
}

@media (min-width: 761px) {
  body:has(.big-ideas-desktop) { background: #fff0df; }
  main:has(.big-ideas-desktop) { max-width: 1120px; min-height: 100vh; padding: 34px 28px 64px; background: #fff0df; }
  main:has(.big-ideas-desktop) .nav-links .contact { color: #18231f; }
  .ideas-intro { margin: 54px 0 42px; }
  .ideas-intro h1 { margin: 0; color: #18231f; font: 700 clamp(44px, 6vw, 64px)/.98 Georgia, "Times New Roman", serif; letter-spacing: -.055em; }
  .ideas-intro p { max-width: 620px; margin: 14px 0 0; color: #58645e; font: 22px/1.35 Arial, sans-serif; }
  .ideas-desktop-list { display: grid; gap: 16px; }
  .idea-desktop-card { display: grid; grid-template-columns: minmax(280px, 37%) minmax(0, 1fr); min-height: 236px; color: inherit; text-decoration: none; border: 1px solid #b9aa99; }
  .idea-desktop-art { display: block; min-height: 236px; overflow: hidden; background: #263d35; }
  .idea-desktop-art img { display: block; width: 100%; height: 100%; object-fit: cover; }
  .idea-desktop-copy { display: grid; align-content: center; justify-items: start; gap: 10px; padding: 30px 38px; }
  .idea-desktop-copy .label { color: #d35d34; }
  .idea-desktop-copy h2 { margin: 0; color: #18231f; font: 400 clamp(28px, 3vw, 40px)/1.04 Georgia, "Times New Roman", serif; letter-spacing: -.04em; }
  .idea-desktop-summary { display: -webkit-box; max-width: 670px; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 3; color: #58645e; font: 16px/1.45 Arial, sans-serif; }
  .idea-desktop-link { color: #d35d34; font: 700 13px/1.2 Arial, sans-serif; }
  .idea-desktop-card:hover h2, .idea-desktop-card:focus-visible h2 { color: #d35d34; text-decoration: underline; text-underline-offset: .12em; }
  main:has(.big-ideas-desktop) .byteview-footer, main:has(.big-ideas-desktop) .byteview-footer__copyright { border-color: #b9aa99; }
}

/* Desktop News uses a consistent daily card grid. Mobile keeps its dedicated swipe rails. */
@media (min-width: 761px) {
  main:has(.news-archive) {
    max-width: 1120px;
    padding: 34px 28px 64px;
  }

  main:has(.news-archive) .home-intro {
    margin: 54px 0 38px;
  }

  main:has(.news-archive) .home-intro h1 {
    margin: 0;
    color: #18231f;
    font: 700 clamp(44px, 6vw, 64px)/.98 Georgia, "Times New Roman", serif;
    letter-spacing: -.055em;
  }

  main:has(.news-archive) .nav-links .contact { color: #18231f; }

  .news-archive { margin-top: 0; }
  .news-day + .news-day { margin-top: 52px; }
  .news-day-label {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 0 18px;
    padding-bottom: 12px;
    border-bottom: 1px solid #d9d4c9;
    color: #18231f;
  }

  .news-day-label::before {
    width: 24px;
    height: 3px;
    flex: 0 0 auto;
    background: #d35d34;
    content: "";
  }

  .news-desktop-grid {
    display: grid;
    gap: 24px 0;
  }

  .news-desktop-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
  }

  .news-desktop-row--pair {
    width: calc((100% - 48px) * 2 / 3 + 24px);
    margin-inline: auto;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .news-desktop-card {
    display: grid;
    min-width: 0;
    color: inherit;
    text-decoration: none;
  }

  .news-desktop-art {
    display: block;
    height: 170px;
    overflow: hidden;
    background: #263d35;
  }

  .news-desktop-art img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  .news-desktop-copy { padding-top: 12px; }
  .news-desktop-copy .label { display: block; color: #d35d34; font-size: 10px; line-height: 1.25; }
  .news-desktop-copy h3 {
    margin: 8px 0;
    color: #18231f;
    font: 400 21px/1.08 Georgia, "Times New Roman", serif;
    letter-spacing: -.03em;
  }

  .news-desktop-summary {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    color: #58645e;
    font: 14px/1.42 Arial, sans-serif;
  }

  .news-desktop-card:hover h3,
  .news-desktop-card:focus-visible h3 {
    color: #d35d34;
    text-decoration: underline;
    text-underline-offset: .12em;
  }
}

/* The call to action belongs below the Ideas cards at every viewport. */
.home-page .home-explains-all {
  display: block;
  width: max-content;
  margin: 30px auto 0;
}

@media (max-width: 760px) {
  .home-page .home-intro h1 {
    white-space: nowrap;
    font-size: clamp(30px, 9vw, 44px);
    letter-spacing: -.06em;
  }
  /* Mobile Today in Tech is one five-story swipe rail, without a featured card. */
  .home-page .home-section-heading .home-rail-controls,
  .home-page .home-lead-carousel,
  .home-page .home-rail { display: none; }
  .home-page .home-mobile-today-rail {
    display: flex;
    gap: 16px;
    margin: 0;
    padding: 0 0 8px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
  }
  .home-page .home-mobile-today-rail::-webkit-scrollbar { display: none; }
  .home-page .home-mobile-today-card {
    display: block;
    flex: 0 0 78%;
    min-width: 0;
    color: inherit;
    text-decoration: none;
    scroll-snap-align: start;
  }
  .home-page .home-mobile-today-card .home-rail-art {
    width: 100%;
    height: 170px;
    margin-bottom: 10px;
  }
  .home-page .home-mobile-today-card .home-card-label { margin: 0 0 7px; }
  .home-page .home-mobile-today-card h3 {
    margin: 0 0 7px;
    color: #18231f;
    font: 400 20px/1.1 Georgia, "Times New Roman", serif;
    letter-spacing: -.025em;
  }
  .home-page .home-mobile-today-card p {
    display: -webkit-box;
    overflow: hidden;
    margin: 0;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
  }
  .home-page .home-all-news { margin-top: 18px; }
}

/* Mobile Ideas cards use the image and category as a left rail. */
@media (max-width: 760px) {
  .home-page .home-explains-card .home-explains-art {
    grid-column: 1;
    grid-row: 1;
  }
  .home-page .home-explains-card .home-card-label {
    grid-column: 1;
    grid-row: 2;
    align-self: start;
    margin: 8px 0 0;
  }
  .home-page .home-explains-card .home-explains-copy {
    display: block;
    grid-column: 2;
    grid-row: 1 / span 2;
    align-self: start;
    min-width: 0;
  }
  .home-page .home-explains-card .home-explains-copy h3 { margin-top: 0; }
}

/* Desktop lead: two exact story columns, with a stable editorial crop. */
@media (min-width: 761px) {
  main:has(.home-page) .nav-links .contact {
    color: #18231f;
    font: inherit;
    letter-spacing: inherit;
  }

  .home-page .home-lead-carousel,
  .home-page .home-lead-carousel > .home-lead {
    min-height: 0;
  }

  .home-page .home-lead-carousel {
    height: 390px;
  }

  .home-page .home-lead-carousel > .home-lead {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    grid-template-rows: auto;
    column-gap: 24px;
    height: 100%;
  }

  .home-page .home-lead-art {
    grid-column: 1 / span 2;
    grid-row: 1;
    width: 100%;
    min-height: 0;
    height: 100%;
  }

  .home-page .home-lead-art img {
    width: 100%;
    height: 100%;
    min-height: 0;
    object-fit: cover;
    object-position: center 60%;
  }

  .home-page .home-lead-copy {
    grid-column: 3 / -1;
    grid-row: 1;
    min-height: 0;
    padding: 20px 0 20px 30px;
    justify-content: space-between;
  }

  .home-page .home-lead h2 { -webkit-line-clamp: 4; }
  .home-page .home-lead p { -webkit-line-clamp: 5; }

  .home-page .home-section-heading .home-rail-controls {
    align-items: center;
    gap: 8px;
  }

  .home-page .home-section-heading .home-rail-controls .home-carousel-control {
    display: grid;
    width: 34px;
    height: 34px;
    padding: 0;
    place-items: center;
    border: 1px solid #c9c4b7;
    border-radius: 50%;
    background: transparent;
    color: #18231f;
  }

  .home-page .home-section-heading .home-rail-controls .home-carousel-control svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.5;
  }

  .home-page .home-section-heading .home-rail-controls .home-carousel-control:hover,
  .home-page .home-section-heading .home-rail-controls .home-carousel-control:focus-visible {
    border-color: #d35d34;
    background: #d35d34;
    color: #fffdf8;
  }
}
