/* AI History: a timeline of the gallery's pictures, month by month. */
.aih { --aih-pink: var(--accent, #ff2587); --aih-line: #2a2a33; }
.aih-hero .page-hero-copy { padding-bottom: 1.2rem; }
.aih-lede { max-width: 36ch; margin: .6rem 0 1.4rem; font-size: clamp(1.25rem, 4.6vw, 1.7rem); line-height: 1.35; color: #e7e7ee; }
.aih-stats { display: flex; flex-wrap: wrap; gap: .8rem 2.2rem; margin: 0; padding: 0; list-style: none; }
.aih-stats li { display: grid; gap: .1rem; }
.aih-stats strong { font-size: clamp(1.5rem, 6vw, 2.1rem); line-height: 1.1; color: #fff; }
.aih-stats span { font-size: 1rem; color: #a9a9b6; }

/* month chips, stuck under the menu while you scroll */
.aih-rail { position: sticky; top: 0; z-index: 20; background: rgba(8, 8, 11, .92); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); border-block: 1px solid var(--aih-line); }
.aih-rail-in { display: flex; gap: .5rem; overflow-x: auto; padding: .6rem max(1rem, env(safe-area-inset-left)); scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.aih-rail-in::-webkit-scrollbar { display: none; }
.aih-rail a { flex: none; display: inline-flex; align-items: center; min-height: 44px; padding: 0 1rem; border: 1px solid var(--aih-line); border-radius: 999px; color: #d6d6de; font-size: 1rem; font-weight: 600; text-decoration: none; white-space: nowrap; transition: background-color .2s ease, border-color .2s ease, color .2s ease; }
.aih-rail a:hover { border-color: var(--aih-pink); }
.aih-rail a.is-on { background: var(--aih-pink); border-color: var(--aih-pink); color: #fff; }
.aih-rail a.is-now { border-style: dashed; }

/* the timeline: a line down the left with a dot at each month */
.aih-line { position: relative; padding-block: 2rem 1rem; padding-left: calc(1rem + 22px); }
.aih-line::before { content: ""; position: absolute; left: calc(1rem + 5px); top: 2.4rem; bottom: 0; width: 2px; background: linear-gradient(var(--aih-pink), var(--aih-line) 12%, var(--aih-line)); }
.aih-month { position: relative; padding-bottom: 2.6rem; scroll-margin-top: 5rem; }
.aih-month-head { position: relative; margin-bottom: 1rem; }
.aih-dot { position: absolute; left: -22px; top: .55rem; width: 12px; height: 12px; border-radius: 50%; background: #08080b; border: 2px solid var(--aih-pink); box-shadow: 0 0 0 4px #08080b; transition: background-color .25s ease, box-shadow .25s ease; }
.aih-month.is-in .aih-dot, .aih-month.is-first .aih-dot { background: var(--aih-pink); box-shadow: 0 0 0 4px #08080b, 0 0 16px 2px var(--aih-pink); }
.aih-kicker { margin: 0; font-size: .95rem; letter-spacing: .12em; text-transform: uppercase; color: var(--aih-pink); font-weight: 700; }
.aih-month h2 { margin: .1rem 0; font-size: clamp(2rem, 8vw, 3.2rem); line-height: 1.05; letter-spacing: -.02em; color: #fff; }
.aih-month h2 em { font-style: normal; color: #8f8f9c; font-weight: 500; }
.aih-count { margin: .2rem 0 0; font-size: 1.05rem; color: #b6b6c2; }

/* five pictures a month: a swipeable row on a phone, five across on an iPad */
.aih-row { display: flex; gap: .6rem; margin: 0 calc(-1 * max(1rem, env(safe-area-inset-right))) 0 0; padding: 0 1rem .4rem 0; list-style: none; overflow-x: auto; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.aih-row::-webkit-scrollbar { display: none; }
.aih-row li { flex: 0 0 min(66%, 260px); scroll-snap-align: start; }
.aih-row a { display: block; color: inherit; text-decoration: none; }
.aih-row figure { position: relative; margin: 0; overflow: hidden; border-radius: 14px; background: #15151b; aspect-ratio: 1; }
.aih-row img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.aih-row a:hover img, .aih-row a:focus-visible img { transform: scale(1.05); }
.aih-row a:focus-visible { outline: 3px solid #fff; outline-offset: 3px; border-radius: 14px; }
.aih-row figcaption span { display: block; font-size: .9rem; color: #d6d6de; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.aih-row figcaption { position: absolute; inset: auto 0 0 0; padding: 1.4rem .7rem .55rem; background: linear-gradient(transparent, rgba(0, 0, 0, .75)); color: #fff; font-size: 1rem; }

.aih-now .aih-month-head { margin-bottom: 0; }
.aih-now { padding-bottom: 1.5rem; }

/* scroll reveal (only when scripts run) */
.aih-js .aih-month { opacity: 0; translate: 0 24px; transition: opacity .6s ease, translate .6s ease; }
.aih-js .aih-month.is-in { opacity: 1; translate: 0 0; }
@media (prefers-reduced-motion: reduce) { .aih-js .aih-month { opacity: 1; translate: none; transition: none; } .aih-row img { transition: none; } }

@media (min-width: 700px) {
  .aih-line { padding-left: calc(2rem + 26px); }
  .aih-line::before { left: calc(2rem + 8px); }
  .aih-dot { left: -26px; width: 14px; height: 14px; }
  .aih-row { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); overflow: visible; margin-right: 0; padding-right: 0; gap: .8rem; }
  .aih-row li { flex: none; }
  .aih-rail-in { justify-content: center; }
}
@media (min-width: 1100px) { .aih-row { gap: 1rem; } .aih-month h2 { font-size: 3.6rem; } }

/* the page wrapper clips sideways overflow; "clip" (unlike "hidden") still lets the chips stick */
main.aih.page-main { overflow: visible !important; overflow-x: clip !important; }
.aih-rail { top: 58px; }
