/* Step 6: homepage. Ported from the approved homepage mockup (index.html). Scoped to .ai-site. */

/* Top stories: the lead and the three next stories fill the first screen.
   --above is set by home.js to the height of everything above the stories. */
.ai-site .lead-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 24px; padding-block: 16px; height: clamp(460px, calc(100svh - var(--above, 190px)), 720px); }
.ai-site .lead-story { position: relative; min-height: 0; overflow: hidden; border-radius: 3px; background: var(--ink-deep); }
.ai-site .lead-story > a { display: block; height: 100%; position: relative; color: #ffffff; text-decoration: none; }
.ai-site .lead-story img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 30%; transition: transform .7s cubic-bezier(.3,.8,.2,1); }
.ai-site .lead-story:hover img { transform: scale(1.03); }
.ai-site .lead-story .body { position: absolute; inset: auto 0 0 0; padding: 96px 28px 24px; display: grid; gap: 10px; background: linear-gradient(rgba(5,10,30,0), rgba(5,10,30,.92) 55%); }
.ai-site .lead-story .hl { color: #ffffff; font-size: clamp(24px, 2.5vw, 36px); line-height: 1.12; margin: 0; }
.ai-site .lead-story a:hover .hl, .ai-site .lead-story a:focus-visible .hl { color: #9fd6f5; }
.ai-site .lead-story .meta { color: #c9d3ea; margin: 0; }
.ai-site .lead-story .meta b { color: #ffffff; }

.ai-site .secondary { display: grid; grid-template-rows: repeat(3, 1fr); min-height: 0; }
.ai-site .secondary article { display: grid; grid-template-columns: minmax(0, 1fr) 112px; align-items: center; gap: 14px; padding-block: 12px; border-bottom: 1px solid var(--rule); min-height: 0; }
.ai-site .secondary article:first-child { padding-top: 0; }
.ai-site .secondary article:last-child { border-bottom: 0; padding-bottom: 0; }
.ai-site .secondary article > a { display: grid; gap: 4px; justify-items: start; color: inherit; text-decoration: none; min-width: 0; }
.ai-site .secondary .hl { font-size: clamp(16px, 1.45vw, 20px); line-height: 1.25; margin: 6px 0 2px; }
.ai-site .secondary .meta { margin: 0; }
.ai-site .secondary .thumb { width: 112px; height: 112px; aspect-ratio: 1; border-radius: 3px; object-fit: cover; display: block; }

.ai-site .home-page .ad-row { padding-block: 8px 32px; }

/* Latest + sidebar */
.ai-site .feed-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 40px; padding-block: 16px 48px; }
.ai-site .feed { display: grid; align-content: start; min-width: 0; }
.ai-site .feed article { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 20px; padding-block: 20px; border-bottom: 1px solid var(--rule); }
.ai-site .feed .section-head + article { padding-top: 0; }
.ai-site .feed article > a:not(.feed-thumb) { display: grid; gap: 4px; justify-items: start; align-content: start; color: inherit; text-decoration: none; min-width: 0; }
.ai-site .feed-thumb { display: block; overflow: hidden; border-radius: 3px; align-self: start; aspect-ratio: 3 / 2; background: var(--paper-2); }
.ai-site .feed-thumb .thumb { display: block; width: 100%; height: 100%; aspect-ratio: auto; transition: transform .45s cubic-bezier(.3,.8,.2,1); }
.ai-site .feed article:hover .feed-thumb .thumb { transform: scale(1.05); }
.ai-site .feed .hl { font-size: 21px; line-height: 1.25; margin: 6px 0 4px; }
.ai-site .feed time { font-variant-numeric: tabular-nums; }

.ai-site .home-page .sidebar { display: grid; gap: 28px; align-content: start; justify-items: center; }
.ai-site .home-page .sidebar > * { width: 100%; max-width: 300px; }
.ai-site .subscribe { background: var(--paper-2); border-top: 4px solid var(--sky); padding: 22px; display: grid; gap: 12px; }
.ai-site .subscribe h3 { font-family: var(--display); font-size: 22px; margin: 0; line-height: 1.2; }
.ai-site .subscribe p { margin: 0; font-size: 14px; color: var(--muted); }
.ai-site .connect { scroll-margin-top: 120px; }
.ai-site .connect-h { font-size: 15px; font-weight: 700; margin: 0 0 10px; color: var(--text); }
.ai-site .connect-p { margin: -4px 0 12px; font-size: 14px; color: var(--muted); }
.ai-site .connect ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.ai-site .connect li a { display: flex; justify-content: space-between; align-items: center; padding: 10px 12px; background: var(--paper-2); border-radius: 3px; font-size: 14px; color: var(--text); text-decoration: none; transition: background-color .2s; }
.ai-site .connect li a:hover { background: color-mix(in srgb, var(--sky) 18%, var(--paper-2)); }
.ai-site .connect li b { color: var(--link); font-weight: 700; }

/* The newspaper band */
.ai-site .editions { position: relative; isolation: isolate; overflow: hidden; color: #ffffff; padding-block: 56px; scroll-margin-top: 80px;
  background:
    radial-gradient(50% 70% at 92% 0%, rgba(77, 178, 236, .5), rgba(77, 178, 236, 0) 70%),
    radial-gradient(40% 60% at 0% 100%, rgba(77, 178, 236, .2), rgba(77, 178, 236, 0) 70%),
    linear-gradient(155deg, #1d43a8 0%, #103080 45%, #0a1d55 85%); }
.ai-site .editions::before { content: ""; position: absolute; inset: 0; z-index: -1; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .55 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); opacity: .09; mix-blend-mode: overlay; pointer-events: none; }
.ai-site .editions .intro { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 16px; margin-bottom: 28px; }
.ai-site .editions .intro h2 { font-family: var(--display); font-size: clamp(28px, 3vw, 36px); margin: 4px 0 0; color: #ffffff; }
.ai-site .editions .intro p { margin: 0; color: #c4d0ea; max-width: 44ch; }
.ai-site .edition-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.ai-site .edition { background: rgba(6, 18, 60, .35); border-radius: 6px; overflow: hidden; display: grid; align-content: start; box-shadow: 0 0 0 1px rgba(255,255,255,.1), 0 24px 48px rgba(4, 12, 40, .35); backdrop-filter: blur(6px); }
.ai-site .edition-cover { display: block; overflow: hidden; aspect-ratio: 4 / 3; background: #0a1d55; }
.ai-site .edition-cover img { width: 100%; height: 100%; object-fit: cover; object-position: top; transition: transform .5s cubic-bezier(.3,.8,.2,1); }
.ai-site .edition:hover .edition-cover img { transform: scale(1.03); }
.ai-site .edition .body { padding: 16px; display: grid; gap: 6px; }
.ai-site .edition .no { font-family: var(--display); font-size: 30px; font-weight: 700; line-height: 1; font-variant-numeric: lining-nums; }
.ai-site .edition .date { color: #c4d0ea; font-size: 14px; }
.ai-site .edition .actions { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }

/* Section rows */
.ai-site .rows { padding-block: 48px 24px; display: grid; gap: 48px; }
.ai-site .row-thumb { display: block; overflow: hidden; border-radius: 3px; aspect-ratio: 3 / 2; background: var(--paper-2); }
.ai-site .row-thumb .thumb { display: block; width: 100%; height: 100%; aspect-ratio: auto; transition: transform .45s cubic-bezier(.3,.8,.2,1); }
.ai-site .row-grid article:hover .row-thumb .thumb { transform: scale(1.05); }
.ai-site .row-grid article > a:not(.row-thumb) { color: inherit; text-decoration: none; }
.ai-site .row-thumb + .tag { margin-top: 4px; }
.ai-site .columns-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.ai-site .column-card { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 18px; padding: 20px; background: var(--paper-2); border-left: 4px solid var(--sky); }
.ai-site .column-card > a:not(.column-img) { display: grid; gap: 2px; align-content: start; color: inherit; text-decoration: none; }
.ai-site .column-img { display: block; overflow: hidden; aspect-ratio: 1; align-self: start; background: var(--paper); }
.ai-site .column-img img, .ai-site .column-img .thumb { display: block; width: 100%; height: 100%; aspect-ratio: auto; object-fit: cover; }
.ai-site .column-card .byline { font-family: var(--display); font-style: italic; font-size: 16px; color: var(--link); }
.ai-site .column-card .hl { font-size: 22px; line-height: 1.22; margin: 4px 0 8px; }
.ai-site .thumb-empty { display: block; width: 100%; aspect-ratio: 3 / 2; background: linear-gradient(135deg, var(--paper-2), color-mix(in srgb, var(--sky) 22%, var(--paper-2))); }

@media (max-width: 960px) {
  .ai-site .lead-grid { height: auto; grid-template-columns: minmax(0, 1fr); }
  .ai-site .lead-story { height: clamp(420px, calc(100svh - var(--above, 160px) - 32px), 680px); }
  .ai-site .secondary { grid-template-rows: none; }
  .ai-site .feed-grid { grid-template-columns: minmax(0, 1fr); }
  .ai-site .home-page .sidebar { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); justify-items: stretch; }
  .ai-site .home-page .sidebar > * { max-width: none; }
  .ai-site .home-page .sidebar .ad-box { justify-self: center; max-width: 300px; }
  .ai-site .row-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .ai-site .lead-story .body { padding: 80px 18px 18px; }
  .ai-site .lead-story .hl { font-size: 25px; }
  .ai-site .secondary article { grid-template-columns: minmax(0, 1fr) 96px; }
  .ai-site .secondary .thumb { width: 96px; height: 96px; }
  .ai-site .feed article { grid-template-columns: minmax(0, 1fr) 110px; gap: 14px; }
  .ai-site .feed-thumb { order: 2; }
  .ai-site .feed-thumb { aspect-ratio: 1; }
  .ai-site .feed .hl { font-size: 18px; }
  .ai-site .home-page .sidebar, .ai-site .edition-list, .ai-site .columns-grid { grid-template-columns: minmax(0, 1fr); }
  .ai-site .row-grid { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .ai-site .row-grid article { padding-block: 18px; border-top: 1px solid var(--rule); }
  .ai-site .row-grid article:first-child { padding-top: 0; border-top: 0; }
  .ai-site .row-grid article:not(:first-child) { grid-template-columns: minmax(0, 1fr) 104px; column-gap: 14px; row-gap: 6px; }
  .ai-site .row-grid article:not(:first-child) > * { grid-column: 1; }
  .ai-site .row-grid article:not(:first-child) > .row-thumb { grid-column: 2; grid-row: 1 / span 4; width: 104px; }
  .ai-site .row-grid article:not(:first-child) .row-thumb { aspect-ratio: 1; }
  .ai-site .row-grid .hl { font-size: 18px; }
  .ai-site .column-card { grid-template-columns: 90px minmax(0, 1fr); padding: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .ai-site .lead-story img, .ai-site .feed-thumb .thumb, .ai-site .row-thumb .thumb, .ai-site .edition-cover img { transition: none; }
}
