/* Calendar additions on the Rails site: the "no upcoming events" note and the past-events gallery */
.no-upcoming-events { padding: 2rem 0 5rem; }
.no-upcoming-events .h1-style { margin-bottom: 1.25rem; }

.past-events { padding-bottom: 4rem; }
.past-events-title { text-align: center; margin: 0 0 2.5rem; }
.item.events-item.past-event { margin-bottom: 3rem; }
.past-event img { display: block; width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; margin-bottom: 1rem; }
.past-event-title { margin-bottom: 0.25rem; }
.past-event .event-date { color: #FF00C8; font-weight: 600; font-size: 0.8125rem; }
/* Saved message on a card page: same line as "Back to Directory", right-aligned, white on the card colour */
.card-nav-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.card-saved { margin: 0; color: #000; /* N56: white was ~3:1 on orange, coral and magenta; black clears 5:1 on all four card colours */ text-align: right; }

/* A plain line of news above the directory (e.g. "Your login isn't linked to a directory card yet.") */
.directory-notice { text-align: center; color: #FF00C8; margin: 0 auto; padding: 1.5rem 1rem 0; }

/* Filter lists: a closed list is out of the Tab order, not just out of sight */
.btn-filter-toggle + .btn-cluster { visibility: hidden; }
.btn-filter-toggle.open + .btn-cluster { visibility: visible; }

/* Gallery note, small desktops: the pink note sits in a gap one row high; with the full padding its text wrapped to five lines and ran into the next row */
@media (min-width: 64em) and (max-width: 80em) {
  .gallery-grid .callout-box { padding: 1.5rem 4.5rem 1.5rem 1.75rem; }
  .gallery-grid .callout-box:after { right: 1.25rem; }
}

/* Footer logo on very narrow phones: 326px fixed made every page scroll sideways at 320 */
.site-footer .site-title { max-width: 100%; }
/* A long unbroken name or place ("Chaloemtiarana") on a half-width card at 320 pushed the page sideways; it may now break */
.people-item .item-content-wrapper, .books-item .item-content-wrapper { overflow-wrap: anywhere; }

/* Calendar tabs on a phone: side by side each label wrapped to two lines beside its dot; one tab per line, each a 44px-high target */
@media (max-width: 47.9375em) {
  .faux-radio-filter, .faux-radio-filter:last-child { float: none; display: block; width: auto; padding-top: 0.5rem; padding-bottom: 0.5rem; }
}

/* Phone tap targets (ruling R1-7): every link and button a thumb has to hit is at least 44px tall, by padding alone.
   Inline links: vertical padding never moves a line. Block links: padding with equal negative margin keeps every pixel where it was. */
@media (max-width: 47.9375em) {
  .site-footer .logout-link a, .exchange-tags a, .people-item .h2-style a,
  .books-item .h1-style a, .books-item .h2-style a, .people-content-box p a, .update-link a,
  .callout-box a, .item-content-wrapper .label-sm, .no-upcoming-events a { padding-block: 12px; }
  /* the footer links carry their own underline, which padding would move: an invisible extension of the link does the job */
  .site-footer .footer-navigation ul li a { position: relative; }
  .site-footer .footer-navigation ul li a::after { content: ""; position: absolute; left: 0; right: 0; top: -10px; bottom: -13px; }
  .primary-menu li a, #logout-primary a { padding-block: 9.5px; margin-block: -9.5px; }
  .back-link { padding-block: 12px; margin-block: -12px; }
  .menu-toggle, .menu-close, .menu-close:hover, .menu-toggle:hover { box-sizing: content-box; padding: 6.5px 0 6.5px 2px; background-origin: content-box; margin-top: -6.5px; }
}

/* K4: clickable things that aren't links still show the pointing hand */
.menu-toggle, .menu-close, .btn-filter-toggle, .btn-filter, .view-filter, .faux-radio-filter, button { cursor: pointer; }

/* L59: an uploaded event photo that is not square fills the circle (cropped) instead of squashing into an oval */
.item.events-item img { aspect-ratio: 1; object-fit: cover; }

/* L80: the "where" line reads as part of the description (regular, same size), not a second heading */
.item.events-item .venue { margin: 0 0 0.25rem; }

/* N04: alum and Support photos are always a centred square, so the circle is a circle whatever was uploaded */
.item.people-item img, .single-people .people-content-box img, .page-item .page-thumbnail img { width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; }

/* N09: a list in a centred zone keeps its bullet beside its text, not at the far left of the column */
.page-overview ul, .page-overview ol, .content-block-text ul, .content-block-text ol { list-style-position: inside; margin-left: 0; }
.page-overview li > p:first-child, .content-block-text li > p:first-child { display: inline; }

/* N11: the closed menu is off screen; its links must not be Tab stops until it opens (the delay lets the close animation finish) */
header .open-menu-containing-column { visibility: hidden; transition: width 0.3s ease-in-out, height 0.3s ease-in-out, visibility 0s linear 0.3s; }
header .open-menu-containing-column.open { visibility: visible; transition-delay: 0s; }
/* The pink opens first, then its contents fade in, so nothing reflows in view. Closing fades them out first, then folds the pink away. */
header .open-menu-containing-column { transition: width 0.3s ease-in-out 0.12s, height 0.3s ease-in-out 0.12s, visibility 0s linear 0.42s; }
header .open-menu-containing-column.open { transition: width 0.3s ease-in-out, height 0.3s ease-in-out, visibility 0s; }
header .open-menu-containing-column > .container-fluid { opacity: 0; transition: opacity 0.12s ease-out; }
header .open-menu-containing-column.open > .container-fluid { opacity: 1; transition: opacity 0.25s ease-in 0.3s; }
@media (prefers-reduced-motion: reduce) {
  header .open-menu-containing-column, header .open-menu-containing-column.open, header .open-menu-containing-column > .container-fluid { transition: none; }
}

/* N29: the rest of the phone tap targets (R1-7). An invisible extension of each control reaches 44px; nothing visible moves. */
@media (max-width: 47.9375em) {
  .btn-filter-toggle, .view-filter.order-by-icon, .site-footer .site-title a, .post-navigation .nav-links a { position: relative; }
  .btn-filter-toggle::after, .view-filter.order-by-icon::after, .site-footer .site-title a::after, .post-navigation .nav-links a::after { content: ""; position: absolute; left: 0; right: 0; top: -8px; bottom: -8px; }
  .view-filter.order-by-icon::after { left: -3px; right: -3px; top: -3px; bottom: -3px; }
  .site-footer .site-title a::after { top: -14px; bottom: -14px; }
}

/* T04: a title with no spaces in it (a pasted address) breaks at the edge instead of widening the page and pushing the Edit pill off screen */
.events-item .item-content-wrapper, .events-item h2, .events-item h3, .past-event-title, .past-event .event-date { overflow-wrap: anywhere; min-width: 0; }
.events-item .col { min-width: 0; }

/* T22: "Back to Directory" stays on one line at 320; the arrow is placed against the left edge, so a wrapped second line ran under it. Tighter tracking and a shorter arrow below 360px. */
.label-sm.back-link { white-space: nowrap; }
@media (max-width: 22.5em) {
  .label-sm.back-link { letter-spacing: 2px; padding-left: 60px; }
  .label-sm.back-link:before { width: 44px; background-size: 44px auto; }
}

/* T49: the photo page Previous/Next sat inside a nav that clips overflow, so the invisible 44px extension (N29) never reached a thumb; the welcome video dot gets one too. Nothing visible moves. */
@media (max-width: 47.9375em) {
  .single-photos .post-navigation { overflow: visible; }
  .surprise-dot a.block-link { top: -12px; bottom: -12px; left: -12px; right: -12px; }
}

/* T64: a sentence ("Editing your own profile is switched off...") reads as a sentence: its own line under "Back to ...", left-aligned, plain case and tracking. The short "Profile updated" stays a tracked label on the right. */
.card-saved.card-saved--note { flex: 1 0 100%; text-align: left; text-transform: none; letter-spacing: 0.02em; font-size: 1.0625rem; line-height: 1.5; font-weight: 400; margin-top: 0.5rem; }

/* T71: on a page with the plain logo (a profile) at tablet width the wordmark is 640px wide and its last letters sat 8px under the menu icon; other pages leave about 50px. Drop it below the icon. */
@media (min-width: 48em) and (max-width: 63.9375em) {
  #closed-container .site-title { margin-top: 3.25rem; }
}

/* Sign-in sent: its own step under the big white heading, with a quiet way back to the form */
.page.page-login p.login-sent { margin: 1.5rem auto 0; max-width: 32rem; }
.page.page-login p.login-sent a { color: #fff; text-decoration: underline; }
.page.page-login p.login-change { text-align: center; margin: 3.75rem 0 0; }
/* "Use a different address" was 21px tall on a phone (round 3, T20). It is
   an inline link, so padding brings it to 44px (R1-7) and moves no line. */
@media (max-width: 47.9375em) { .page.page-login p.login-change a { padding-block: 12px; } }
/* Resend, on that step. Every button on the site is a brand-pink circle, and this page's
   background is that same pink — the sign-in button only shows because #loginform inverts
   it to white. This form is not #loginform, so it needs the inversion too, scoped here
   rather than borrowing the form rule, which also absolutely-positions the button for the
   sign-in layout. (Neal, Oct 9) */
.page.page-login .login-resend { margin: 3rem 0 0; }
.page.page-login .login-resend input[type=submit] { background-color: #fff !important; color: #000 !important; }
.page.page-login .login-resend input[type=submit]:hover { background-color: #000 !important; color: #fff !important; }
/* iPhone Safari zooms into any field under 16px when tapped; the sign-in field is 15px in the original */
@media (max-width: 63.9375em) { #loginform input[type=email] { font-size: 16px; } }

/* The line that says what a year means in the directory. Not .label-sm: that uppercases with wide
   tracking, which is right for a one-word filter button and shouts over two lines of explanation.
   (army round 2, R-1) */
.cohort-note { text-transform: none; letter-spacing: 0; font-size: 0.95rem; line-height: 1.5;
  color: #555; margin: 0 0 1.5rem; max-width: 46rem; }

/* THE DIRECTORY'S SEARCH BOX (round 3, S2).
   Dressed as the filter toggles beside it: full width of its column, the same
   pink 3px rule underneath, the same padding. A magnifying glass on the right
   where those carry their chevron, so the row reads as four controls of one
   kind rather than a form that wandered in.
   16px on the type because iPhone Safari zooms into any field under that when
   it is tapped, which on this page would throw the grid off screen. */
.people-search { position: relative; }
.people-search input[type=search] {
  width: 100%;
  border: 0;
  border-bottom: 3px solid #FF00C8;
  border-radius: 0;
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='22' height='22' viewBox='0 0 24 24' fill='none' stroke='%23FF00C8' stroke-width='3'><circle cx='11' cy='11' r='6'/><path d='M16 16l5 5'/></svg>") no-repeat right center;
  padding: 0.35rem 28px 0.35rem 0;
  font-size: 16px;
  letter-spacing: 2px;
  text-transform: uppercase;
  -webkit-appearance: none;
  appearance: none;
}
.people-search input[type=search]::placeholder { color: #000; opacity: 1; }
/* Focus is the rule under it going black and twice as thick, drawn with a
   box-shadow so the extra weight sits outside the border rather than moving
   the text.
   A 2px outline box around the whole field was heavier than anything else on
   the row and read as an error state. A colour change on its own was the
   opposite problem: a keyboard pass found this was the only control on the
   page with no perceptible focus state, which is the sort of thing you only
   notice if you put the mouse down. */
.people-search input[type=search]:focus { outline: 0; border-bottom-color: #000; }
.people-search input[type=search]:focus-visible {
  outline: 0;
  border-bottom-color: #000;
  box-shadow: 0 3px 0 0 #000;
}
/* Safari draws its own clear button over ours */
.people-search input[type=search]::-webkit-search-cancel-button { -webkit-appearance: none; }
/* The filter columns stack on a phone and this one needs the same air under it */
@media (max-width: 47.9375em) { .people-search { margin-bottom: 1.5rem; } }

/* THE NAME, BEFORE THE MEGABYTE (round 3, S1 and S4).
   The front page's wordmark is drawn by a runtime that is 125KB of script plus
   an 850KB wasm, and until those land the landing page is a tagline over white
   space. The plain SVG is 5KB. It sits over the canvas and goes when Rive says
   it has drawn.
   Absolutely positioned inside the box the canvas already reserves, so the
   swap moves nothing: there is no layout shift, only a change of picture. */
.rive-stage { position: relative; }
.rive-standin {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: min(78%, 1100px);
  height: auto;
  opacity: 1;
  transition: opacity 0.25s ease-out;
}
.rive-stage.rive-ready .rive-standin { opacity: 0; }
/* Nothing to fade to if the animation never arrives, so it simply stays. */
@media (prefers-reduced-motion: reduce) { .rive-standin { transition: none; } }

/* THE WAY IN IS THE PINK BOX (The Current, round 7, R33, Nov 25).
   One pink box on Alumni Activity: "Up to something? Send it in" is the
   callout box itself (its section, column, padding, cut corner and arrow
   come from the box's own rules), and the whole box is the link. These
   only make a link read as the box: white words, no underline, a plain
   underline on hover, and a ring a keyboard can see (inside the box,
   since the cut corner clips anything drawn outside it). */
.the-current-box a.callout-box { display: block; color: #fff; text-decoration: none; }
.the-current-box a.callout-box:hover .label-sm { text-decoration: underline; text-underline-offset: 0.25em; }
.the-current-box a.callout-box:focus-visible { outline: none; box-shadow: inset 0 0 0 3px #000; }
/* Under the box for editors while hidden: the box keeps its 5rem below, the line tucks up into it */
.the-current-box .the-current-preview { margin: -3.5rem auto 4rem; }
/* While The Current is hidden, the line that tells an editor only editors see it (round 7, R31). Also on the form. */
.the-current-preview { max-width: 36rem; margin: 1.5rem auto 0; padding: 0.875rem 1.125rem; border: 1px dashed #FF00C8; font-size: 0.9375rem; line-height: 1.5; text-align: center; }
.the-current-page .the-current-preview { margin: 0 0 1.5rem; text-align: left; }

/* NEWS, KEPT LIGHT (round 1, R7): a small circle, the title and one line.
   The title wears the site's linked-title bar (as the directory's names
   do); the rest of the words are on the item's own page. */
.news-items { padding-bottom: 3rem; }
.site-main ul.news-list { list-style: none; margin: 0; padding: 0; }
.site-main ul.news-list > li { margin: 0; padding: 0; }
.news-item { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 2.5rem; align-items: center; padding: 1.25rem 0; }
.news-item__photo { display: block; width: 140px; height: 140px; }
.news-item__photo img { display: block; width: 140px; height: 140px; border-radius: 50%; object-fit: cover; }
.news-item__photo--empty { border-radius: 50%; background: #FFE3F8; }
.news-item__text { min-width: 0; overflow-wrap: anywhere; }
.news-item__title { display: inline-block; margin: 0 0 0.75rem; border-bottom: 4px solid #000; padding: 0 0.625rem 0.35rem; }
.news-item__title a { color: inherit; text-decoration: none; }
.news-item__title:hover { border-color: #FF00C8; }
.news-item__title:hover a { color: #FF00C8; }
.news-item:has(.news-item__photo:hover) .news-item__title { border-color: #FF00C8; }
.news-item:has(.news-item__photo:hover) .news-item__title a { color: #FF00C8; }
.news-item__line { margin: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
/* No disc at desktop for news with no photo (round 2, M14): a first batch of
   mostly photo-less news read as a column of identical pale pink blobs that
   outweighed the titles. The title starts the row. The phone keeps its 88px
   circle, where it reads calmer and keeps the words in one column. */
@media (min-width: 48em) {
  .news-item--no-photo { grid-template-columns: minmax(0, 1fr); }
  .news-item--no-photo .news-item__photo--empty { display: none; }
}
@media (max-width: 47.9375em) {
  .site-main ul.news-list > li { container-type: inline-size; }
  .news-item { grid-template-columns: 88px minmax(0, 1fr); gap: 1.25rem; align-items: start; }
  .news-item__photo, .news-item__photo img { width: 88px; height: 88px; }
  .news-item__title { padding-inline: 0 0.5rem; }
  /* 44px tall to a thumb (round 3, T17; it was 38): the extra 3px each way
     is taken back by the margin, so nothing on the row moves. */
  .news-item__title a { display: inline-block; padding-block: 9px; margin-block: -3px; }
}
/* LARGE TEXT ON A PHONE: THE CIRCLE GOES ABOVE THE WORDS (The Current round 6,
   W12). At 320 with 200% text the 88px circle left the words a 141px column,
   and ordinary words split ("Jeremi / ah", "Remove / d"). The row is measured
   in its own text size, so this happens only when the type is large for the
   width; at 100% nothing changes. A news item with no photo drops its pale
   circle here, as it does on a laptop, rather than stack an empty disc.
   13em, not 12 (army round 8, G8): at 360 with 150% text a row is 12.6em, the
   circle stayed beside and "Extraordinary" split in a 185px column. */
@container (max-width: 13em) {
  .news-item { grid-template-columns: minmax(0, 1fr); gap: 1rem; }
  .news-item--no-photo .news-item__photo--empty { display: none; }
}

/* An alumni event's title and photo open its page (R7); the title is the
   site's linked-title bar from .grid, and the photo lights it the way a
   directory photo lights the name. */
.events-item:has(.col-md-5 > a:hover) .h1-style:has(a) { border-color: #FF00C8; }
.events-item:has(.col-md-5 > a:hover) .h1-style a { color: #FF00C8; }
.events-item .col-md-5 > a { display: block; }
.alumni-item-line { margin: 0 0 1rem; }
/* PHONE TAP TARGETS ON ALUMNI ACTIVITY (round 3, T17, after R1-7). An
   event's title link was 33px tall a line and the sender's name on an item
   page 22px. Both are inline, so padding reaches 44px without moving a line. */
@media (max-width: 47.9375em) {
  .events-item .h1-style a.alumni-item-title { padding-block: 6px; }
  .alumni-item__from a { padding-block: 11px; }
}
.past-event-title a { color: inherit; text-decoration: none; }
.past-event-title a:hover { color: #FF00C8; }

/* ONE ITEM ON ITS OWN PAGE (round 1, R7), every word in one centred column.
   THE HERO (round 2, R10, R12): a photo opens the page, as wide as the page
   up to 1200px (the widest size wp_hero offers on a laptop), cropped by the
   page and never by the file: 3:2 on a phone, about 2:1 on a laptop (R15,
   below), centred.
   A square or tall photo is shown whole instead, no taller than most of the
   screen, so an album cover or a flyer keeps its edges. */
.alumni-item-wrapper { padding: 1.5rem 0 3rem; }
.alumni-item { margin-bottom: 2rem; }
.alumni-item__hero { margin: 0 auto 2.5rem; max-width: 1200px; }
.alumni-item__hero img { display: block; width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: cover; object-position: center; }
.alumni-item__hero--whole img { aspect-ratio: auto; width: auto; max-width: 100%; max-height: min(80vh, 900px); margin: 0 auto; object-fit: contain; }
.alumni-item__words { overflow-wrap: anywhere; min-width: 0; }
.alumni-item__words > :not(h1) { max-width: 40rem; }
/* THE FIRST SCREEN SAYS WHAT, WHEN AND WHERE (round 3, R15, T14 and T15).
   On a laptop the page opened on the picture alone: a 1200x675 photo from
   y=400, the title at y=1115, below a 900px screen, and the way back, the
   photo and the words on three different left edges.
   Now the way back, the photo and the words share one column (show.html.erb)
   and one left edge. On a laptop the header's 120px gap above the way back
   comes in to 40px, the photo is cropped about 2:1, and its height is what
   the screen has left once the header and the words are counted: --item-fold
   is the screen less 34rem, the room the header, a two-line title, the date
   and the place take, with a little air under the place. The title may run
   the column's full width; the words under it keep a 40rem measure.
   The column is as wide as that photo (between 2:1 and 2.25:1, no wider
   than 1200px, never narrower than 36rem), so on a 1280x800
   or 1440x900 laptop the photo is smaller and the title, date and place are
   on the first screen; on a big screen it opens at the full 1200x600.
   A square or tall photo (an album, a flyer) is still shown whole. Under
   the words' column it was a thumbnail beside empty white, so on a laptop
   it stands at the column's left edge with the words beside it, the title
   level with its top: the photo can then be as tall as the screen allows
   (the screen less 22rem, up to 40rem, no wider than 28rem) and the title,
   date and place are on the first screen whatever its shape. With no photo
   the column is the 40rem the words take, centred.
   The title is set a step larger than the list's, with its lines balanced
   so a last word is not left alone ("porch"); at 1.25 it takes no more
   height than the list's looser size. The phone is unchanged. */
@media (min-width: 64em) {
  .single-event header .logo-nav-container { padding-bottom: 2.5rem; }
  .alumni-item-page {
    --item-fold: max(15rem, calc(100svh - 34rem));
    --item-w: min(100%, 75rem, max(36rem, calc(var(--item-fold) * 2.25)));
  }
  .alumni-item-page--no-photo { --item-w: min(100%, 40rem); }
  .alumni-item-page--whole { --item-w: min(100%, 64rem); }
  .alumni-item-page--whole .alumni-item { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 3rem; align-items: start; }
  .alumni-item-column { width: var(--item-w); margin-inline: auto; }
  .alumni-item-wrapper { padding-top: 1rem; }
  .alumni-item__hero { margin: 0 0 1.5rem; max-width: none; }
  .alumni-item__hero img { aspect-ratio: 2 / 1; max-height: var(--item-fold); }
  .alumni-item__hero.alumni-item__hero--whole { margin: 0; }
  .alumni-item__hero--whole img { aspect-ratio: auto; width: auto; max-width: 28rem; max-height: min(40rem, max(15rem, calc(100svh - 22rem))); margin: 0; }
  .alumni-item__words h1 { font-size: 2rem; line-height: 1.25; text-wrap: balance; }
}
.alumni-item__words h1 { margin: 0 0 1rem; }
.alumni-item__words .event-date { color: #FF00C8; margin: 0 0 1rem; }
.alumni-item__words .venue { margin: 0 0 1.5rem; }
.alumni-item__body { margin-bottom: 1.5rem; }
.alumni-item__link { margin: 0 0 1.5rem; }
.alumni-item__from { margin: 2.5rem 0 0; padding-top: 1rem; border-top: 1px solid #000; }
.alumni-item__from a { text-decoration: underline; text-underline-offset: 3px; }
.alumni-item__from a:hover { color: #FF00C8; }
/* "Back to Alumni Activity" may wrap (round 2, M12). Even with the tighter
   tracking below it was 13px too wide at 320 and ran to x=541 at 390 with
   text at 200%. As a block the arrow's padding holds for both lines, so a
   second line sits beside the arrow, never under it (T22's worry). */
.single-event .label-sm.back-link { display: inline-block; max-width: 100%; box-sizing: border-box; white-space: normal; }
@media (max-width: 47.9375em) {
  /* "Back to Alumni Activity" is longer than "Back to Directory" and ran off
     a phone; the same tighter tracking and shorter arrow T22 uses at 320. */
  .single-event .label-sm.back-link { letter-spacing: 2px; padding-left: 60px; }
  .single-event .label-sm.back-link:before { width: 44px; background-size: 44px auto; }
  .alumni-item__hero { margin-bottom: 2rem; }
  .alumni-item__link a { display: inline-block; padding-block: 12px; }
}

/* A TAKEN-DOWN ITEM'S OLD LINK (round 2, R14): one quiet line at the top of
   the list, in the page's own words size, centred like the filters above. */
.taken-down { padding: 1.5rem 0 0.5rem; }
.taken-down__line { margin: 0; text-align: center; }
