/* Events page: header, the Upcoming and Past switch, and Host an event with us. Built on styles.css and v2/v2.css. */

/* Header */
.v2 .section.ev-head { padding-block: clamp(3.5rem, 8vw, 6.5rem) clamp(2.5rem, 5vw, 4rem); }
.ev-head h1 { margin: 0 0 1rem; font-size: clamp(2.8rem, 7vw, 5.5rem); line-height: 1; letter-spacing: -0.045em; font-weight: 500; }

/* The switch: the same look as How we work on the home page */
.v2 .section.ev-list { padding-block: 2rem clamp(3rem, 5vw, 4.5rem); }
.ev-switch { position: relative; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 26rem; margin-bottom: clamp(1.75rem, 3vw, 2.5rem); padding: 5px; border-radius: 999px; background: rgba(14, 37, 27, .07); }
.ev-thumb { position: absolute; top: 5px; bottom: 5px; left: 5px; width: calc((100% - 10px) / 2); border-radius: 999px; background: var(--ink); transition: transform 280ms var(--ease-out); }
.ev-switch[data-on="1"] .ev-thumb { transform: translateX(100%); }
.ev-switch button { position: relative; padding: .75rem 1rem; border: 0; border-radius: 999px; background: none; color: var(--text-muted); font: inherit; font-weight: 500; cursor: pointer; transition: color 200ms var(--ease-out); }
.ev-switch button span { margin-left: .2rem; font-weight: 400; opacity: .7; }
.ev-switch button[aria-selected="true"] { color: var(--paper); }
.ev-switch button:focus-visible { outline: 2px solid var(--forest); outline-offset: 3px; }
@media (hover: hover) { .ev-switch button:not([aria-selected="true"]):hover { color: var(--ink); } }
.ev-empty { margin: 0; font-size: 1.2rem; color: var(--text-muted); }
.ev-empty a { color: var(--forest); text-decoration: underline; text-underline-offset: 3px; }

/* Upcoming with no events: a terminal whose lines appear one at a time */
.ev-term { max-width: 680px; border-radius: var(--radius); background: var(--window); overflow: hidden; }
.ev-term-bar { display: flex; gap: 6px; padding: 12px 14px; border-bottom: 1px solid rgba(247, 243, 234, .1); }
.ev-term-bar i { width: 10px; height: 10px; border-radius: 50%; background: rgba(247, 243, 234, .22); }
.ev-term pre { margin: 0; padding: 1.25rem 1.4rem 1.4rem; font: 400 clamp(.88rem, 1.3vw, 1rem)/1.8 "Geist Mono", ui-monospace, monospace; color: rgba(247, 243, 234, .82); white-space: pre-wrap; }
.ev-term pre span { opacity: 0; animation: ev-line 1ms linear var(--d, 0s) forwards; }
@keyframes ev-line { to { opacity: 1; } }
.ev-term b { font-weight: 400; color: var(--mint); }
.ev-term .ev-term-mint { color: var(--mint); }
.ev-term u { display: inline-block; width: .6em; height: 1.05em; vertical-align: -.15em; background: var(--mint); text-decoration: none; animation: ev-blink 1.1s steps(1) infinite; }
@keyframes ev-blink { 50% { opacity: 0; } }
.ev-term-after { margin: 1.1rem 0 0; color: var(--text-muted); }
.ev-term-after .ev-link { font-size: 1rem; }

/* Upcoming */
.ev-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.ev-grid li { display: flex; flex-direction: column; gap: .5rem; padding: clamp(1.25rem, 2.5vw, 2rem); border: 1px solid var(--line); border-radius: var(--radius); background: var(--white); }
.ev-grid h3 { margin: 0; font-size: clamp(1.35rem, 2.2vw, 1.75rem); letter-spacing: -0.025em; font-weight: 500; line-height: 1.15; }
.ev-grid p { margin: 0; color: var(--text-muted); }
.ev-grid .ev-date { color: var(--forest); font-weight: 500; }
.ev-foot { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; margin-top: auto; padding-top: 1.25rem; font-size: .96rem; }
.ev-link { display: inline-flex; align-items: center; gap: .35em; font-size: .92rem; font-weight: 500; color: var(--forest); white-space: nowrap; }
.ev-link svg { width: 1em; height: 1em; fill: none; stroke: currentColor; stroke-width: 2; transition: transform 200ms var(--ease-out); }
@media (hover: hover) { .ev-link:hover svg { transform: translateX(3px); } }

/* One event takes the full width, with its details on the right */
.ev-grid:has(> li:only-child) { grid-template-columns: minmax(0, 1fr); }
.ev-grid > li:only-child { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .5rem 3rem; }
.ev-grid > li:only-child > :not(.ev-foot) { grid-column: 1; }
.ev-grid > li:only-child .ev-foot { grid-column: 2; grid-row: 1 / span 3; flex-direction: column; align-items: flex-start; justify-content: space-between; margin: 0; padding: 0; }

/* Past */
.ev-past { display: grid; grid-template-columns: 19rem minmax(0, 1fr); gap: 2.5rem; align-items: start; }
.ev-pick { display: grid; border-top: 1px solid var(--line); }
.ev-pick button { display: grid; gap: .15rem; padding: 1rem .9rem; border: 0; border-bottom: 1px solid var(--line); background: none; color: var(--ink); font: inherit; text-align: left; cursor: pointer; transition: background-color 200ms var(--ease-out); }
.ev-pick b { font-weight: 500; font-size: 1.08rem; letter-spacing: -0.015em; line-height: 1.25; }
.ev-pick span { font-size: .88rem; color: var(--text-muted); }
.ev-pick button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.ev-pick button[aria-pressed="true"] span { color: rgba(247, 243, 234, .78); } /* v2 remaps the on-dark tokens on paper */
.ev-pick button:focus-visible, .ev-thumb-img:focus-visible { outline: 2px solid var(--forest); outline-offset: 2px; }
.ev-mosaic { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-rows: clamp(90px, 10.5vw, 150px); gap: 8px; }
.ev-thumb-img { position: relative; display: block; width: 100%; padding: 0; border: 0; background: none; border-radius: var(--radius-sm); overflow: hidden; cursor: zoom-in; }
.ev-thumb-img:first-child { grid-column: span 2; grid-row: span 2; }
.ev-thumb-img img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform 300ms var(--ease-out); }
.ev-thumb-img span { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(14, 37, 27, .72); color: var(--paper); font-size: 1.15rem; font-weight: 500; }
@media (hover: hover) { .ev-thumb-img:hover img { transform: scale(1.03); } }
.ev-about { margin-bottom: 1.5rem; max-width: 66ch; }
.ev-about h3 { margin: 0 0 .4rem; font-size: clamp(1.5rem, 2.6vw, 2.1rem); line-height: 1.1; letter-spacing: -0.03em; font-weight: 500; }
.ev-about p { margin: .75rem 0 0; color: var(--text-muted); }
.ev-about .ev-lead { margin-top: 0; font-size: 1.15rem; font-weight: 500; color: var(--ink); }

/* Host an event with us */
.ev-host-head { display: grid; grid-template-columns: 1.1fr 1fr; gap: 1rem 4rem; align-items: end; margin-bottom: clamp(2rem, 4vw, 3rem); }
.ev-host-head h2 { margin: 0; max-width: none; font-size: clamp(2.4rem, 5vw, 4rem); line-height: 1.02; letter-spacing: -0.045em; font-weight: 500; text-wrap: balance; }
.ev-host-head p { margin: 0; font-size: 1.1rem; color: var(--on-dark-muted); max-width: 40ch; }
.ev-offers { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.ev-offer { display: flex; flex-direction: column; justify-content: space-between; gap: 2.5rem; min-height: 400px; padding: clamp(1.5rem, 3vw, 2.5rem); border-radius: var(--radius); background: var(--white); color: var(--ink); }
.ev-offer h3 { margin: 0 0 1rem; font-size: clamp(1.9rem, 3.4vw, 2.75rem); line-height: 1.05; letter-spacing: -0.04em; font-weight: 500; color: var(--ink); }
.ev-offer p { margin: 0; max-width: 44ch; color: var(--ink); }
.ev-offer .ev-who { margin-bottom: .6rem; font-size: .95rem; color: var(--text-muted); }
.ev-offer .ev-gets { margin-bottom: 1.25rem; }
.ev-gets b { display: block; margin-bottom: .3rem; font-weight: 500; }

/* Photo viewer */
.ev-box { width: fit-content; min-width: min(480px, calc(100vw - 32px)); max-width: min(1100px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); padding: 0; border: 0; border-radius: var(--radius); background: var(--window); color: var(--paper); overflow: hidden; }
.ev-box[open] { animation: ev-in 220ms var(--ease-out); }
.ev-box::backdrop { background: rgba(10, 28, 20, .82); }
@keyframes ev-in { from { opacity: 0; transform: scale(.98); } }
.ev-box > img { display: block; max-width: 100%; max-height: calc(100dvh - 104px); margin-inline: auto; object-fit: contain; }
.ev-box-bar { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .7rem 1rem; }
.ev-box-bar p { margin: 0; font-size: .95rem; }
.ev-box-bar b { font-weight: 500; margin-right: .75rem; }
.ev-box-bar span { color: rgba(247, 243, 234, .78); white-space: nowrap; }
.ev-box-bar div { display: flex; gap: 4px; flex: none; }
.ev-box-bar button { display: grid; place-items: center; width: 40px; height: 40px; padding: 0; border: 0; border-radius: var(--radius-sm); background: rgba(247, 243, 234, .08); color: var(--paper); cursor: pointer; }
.ev-box-bar button:focus-visible { outline: 2px solid var(--mint); outline-offset: 1px; }
.ev-box-bar svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; }
@media (hover: hover) { .ev-box-bar button:hover { background: rgba(247, 243, 234, .18); } }

@media (max-width: 900px) {
  .ev-host-head, .ev-past { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  .ev-offers, .ev-grid { grid-template-columns: minmax(0, 1fr); }
  .ev-grid > li:only-child { grid-template-columns: minmax(0, 1fr); }
  .ev-grid > li:only-child .ev-foot { grid-column: 1; grid-row: auto; flex-direction: row; align-items: flex-end; padding-top: 1.25rem; }
  .ev-offer { min-height: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .ev-box[open] { animation: none; }
  .ev-term pre span { opacity: 1; animation: none; }
  .ev-term u { animation: none; }
  .ev-thumb, .ev-thumb-img img, .ev-link svg { transition: none; }
}
