/* Home page: the two swappable blocks (the letter and the "Come to Salem" card) and the language picker.
   Loaded after main.css and letter.css. Which block comes first is set by homeTopSlot in content/site.json:
   the first slot is the indigo band, the second the dark angled band, whatever is in them. */

/* letter.css's self-hosted fonts (no Google Fonts request). The page stays Elms Sans, as before; the card is Public Sans. */
body.home-page {
	--font-body: "Public Sans", "OST Noto Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
	--font-display: "Elms Sans", "OST Noto Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
	font-family: var(--font-display);
}

/* Language picker, top right over the photo. */
#banner .home-lang { position: absolute; top: 1rem; right: 1rem; z-index: 5; }
@media (min-width: 737px) { #banner .home-lang { top: 1.5rem; right: 2rem; } }
#banner .review-note { margin: 0 0 1.5rem; padding: 0; font-size: 0.95rem; max-width: none; }
#banner .demo-banner { margin: 0; }

/* Events: a dark band between the photo and the first slot, with the photo's angle along both edges.
   It sits under the photo's angled bottom (z-index 0, below the banner's 1) and over the first slot's top. */
#events {
	position: relative; z-index: 0;
	background: var(--section-dark);
	clip-path: polygon(0 0, 100% 0, 100% calc(100% - var(--angle)), 0 100%);
	margin-bottom: calc(-1 * var(--angle));
	padding: calc(2.5rem + var(--angle)) 0 calc(2.5rem + var(--angle));
	font-family: var(--font-body);
}
/* "Show up and stand together": big, like the photo's title. */
#events .events-headline {
	margin: 0 0 1.5rem; font-family: var(--font-display); font-size: clamp(1.9rem, 6vw, 2.75rem); font-weight: 900;
	line-height: 1.05; letter-spacing: -0.01em; text-transform: none; color: #fff; text-wrap: balance;
}
.events-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0.5rem 1.5rem; margin: 0 0 1.25rem; padding-bottom: 1rem; border-bottom: solid 2px var(--line); }
.events-head h3 { margin: 0; font-size: 1.25rem; line-height: 1.4; font-family: var(--font-display); }
.events-full { font-size: 0.9375rem; font-weight: 600; }
/* The days: a row of tabs that scrolls sideways when it doesn't fit. */
.events-days {
	display: flex; gap: 0.5rem; overflow-x: auto; scroll-snap-type: x proximity;
	margin: 0 -1rem; padding: 0.25rem 1rem 0.5rem; scrollbar-width: thin;
	/* Snapping and scrollIntoView keep the page margin, so the first day lines up with the text above. */
	scroll-padding-inline: 1rem;
}
#events .events-day {
	/* position: its hidden "2 events" text then scrolls with it instead of widening the page. */
	position: relative; flex: 0 0 auto; scroll-snap-align: start;
	display: flex; flex-direction: column; align-items: center; gap: 0.125rem;
	width: auto; min-width: 4.75rem; height: auto; padding: 0.5rem 0.625rem 0.4375rem;
	font-family: var(--font-body); font-size: 0.875rem; font-weight: 600; letter-spacing: 0; text-transform: none; line-height: 1.25;
	color: #fff; background: transparent; border: solid 2px var(--line); border-radius: 5px;
}
#events .events-day:hover { background: rgba(255, 255, 255, 0.075); }
#events .events-day[aria-selected="true"] { background: #fff; color: var(--section-dark); border-color: #fff; }
.events-dow { font-weight: 700; }
.events-date { font-weight: 400; white-space: nowrap; }
.events-dot { width: 0.4375rem; height: 0.4375rem; margin-top: 0.1875rem; border-radius: 50%; background: var(--success); }
.events-dot.is-empty { background: transparent; }
.events-day[aria-selected="true"] .events-dot:not(.is-empty) { background: var(--section-dark); }
/* The chosen day */
.events-panel { margin-top: 1rem; }
.events-panel:focus-visible { outline-offset: 4px; }
#events .events-day-title { margin: 0 0 0.75rem; font-family: var(--font-body); font-size: 1rem; font-weight: 700; letter-spacing: 0; text-transform: none; color: #fff; }
.events-status { margin: 0 0 0.75rem; }
.events-list { list-style: none; margin: 0; padding: 0; }
.event { display: grid; grid-template-columns: 10rem 1fr; gap: 0.25rem 1.25rem; padding: 0.875rem 0; border-top: solid 1px var(--line); }
.event:first-child { border-top: 0; padding-top: 0.25rem; }
.event-time { margin: 0; color: #fff; font-size: 0.9375rem; font-weight: 600; font-variant-numeric: tabular-nums; }
/* "Happening now" / "Event has ended", under the time. */
.event-tag {
	display: inline-block; margin: 0.375rem 0 0; padding: 0.1875rem 0.5rem; border-radius: 4px;
	font-size: 0.6875rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; line-height: 1.4;
}
.event.is-now .event-tag { background: var(--success); color: var(--section-dark); }
.event.is-ended .event-tag { border: solid 1px rgba(255, 255, 255, 0.35); color: rgba(255, 255, 255, 0.6); }
#events .event.is-ended :is(.event-time, .event-title, .event-place, .event-description) { color: rgba(255, 255, 255, 0.5); }
:lang(zh-Hans) .event-tag, :lang(zh-Hant) .event-tag { letter-spacing: 0.02em; }
#events .event-title { margin: 0; font-family: var(--font-body); font-size: 1rem; font-weight: 700; letter-spacing: 0; text-transform: none; line-height: 1.4; color: #fff; }
.event-place { margin: 0.125rem 0 0; font-size: 0.9375rem; }
.event-details summary { cursor: pointer; list-style: none; position: relative; padding-right: 1.75rem; }
.event-details summary::-webkit-details-marker { display: none; }
/* A small chevron that turns when the details open. */
.event-details summary::after {
	content: ""; position: absolute; top: 0.375rem; right: 0.25rem; width: 0.5rem; height: 0.5rem;
	border-right: solid 2px currentColor; border-bottom: solid 2px currentColor; transform: rotate(45deg); transition: transform 0.15s;
}
.event-details[open] summary::after { transform: translateY(0.25rem) rotate(225deg); }
.event-details summary:hover .event-title { text-decoration: underline; text-underline-offset: 3px; }
.event-description { margin: 0.5rem 0 0; font-size: 0.9375rem; white-space: pre-line; overflow-wrap: anywhere; }
#events .events-next {
	width: auto; height: auto; min-height: 2.75rem; padding: 0.5rem 1.25rem;
	font-family: var(--font-body); font-size: 0.9375rem; font-weight: 600; letter-spacing: 0; text-transform: none; color: #fff;
}
#events .events-next::after { content: " \2192"; }
/* "Add to Google Calendar", under the events */
.events-add { margin: 1.75rem 0 0; }
@media (max-width: 600px) {
	.events-add .button { width: 100%; }
	.event { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { .event-details summary::after { transition: none; } }

/* First slot: the indigo band (what the carpool section was). */
#slot-1 {
	background: var(--section);
	padding: calc(4rem + var(--angle)) 0 calc(5rem + var(--angle));
}
/* Second slot: the dark angled band (what "Civic action details" was). */
#slot-2 {
	position: relative;
	background: var(--section-dark);
	clip-path: polygon(0 var(--angle), 100% 0, 100% 100%, 0 100%);
	margin-top: calc(-1 * var(--angle));
	padding: calc(4rem + var(--angle)) 0 4rem;
}

/* "United for Oregon's Public Schools": the text and list in the body face (Public Sans); the heading stays Elms Sans. */
#why p, #why .asks li { font-family: var(--font-body); }

/* The letter */
.petition-cta h2 {
	font-size: 1.25rem; line-height: 1.4;
	margin: 0 0 1.25rem; padding-bottom: 1.25rem;
	border-bottom: solid 2px var(--line);
}
.petition-cta p { margin: 0 0 2rem; }
.petition-cta .letter-cta { margin: 0; }

/* "Come to Salem with PPS families" */
.salem-card {
	/* As wide as the letter block above it (the section's .inner). */
	background: #fff; color: #474c5e;
	font-family: var(--font-body); font-size: 1rem; line-height: 1.5; text-wrap: pretty;
}
/* The header takes the other band's blue, so it stands apart from the band the card sits on. */
.salem-head { padding: 1rem 1.25rem; background: var(--section); }
#slot-1 .salem-head { background: var(--section-dark); }
.salem-head h2 { margin: 0; font-size: 1.0625rem; font-weight: 700; line-height: 1.3; letter-spacing: 0.1em; text-transform: uppercase; color: #fff; }
.salem-body { display: grid; padding: 1.25rem; }
/* Both steps share one grid cell, so the card keeps one height. */
.salem-step { grid-area: 1 / 1; display: flex; flex-direction: column; gap: 0.875rem; }
.salem-step[aria-hidden="true"] { visibility: hidden; }
.salem-intro { display: flex; flex-direction: column; gap: 0.5rem; margin-bottom: 0.25rem; }
.salem-intro p { margin: 0; font-size: 0.9375rem; }
.salem-card .salem-question { margin: 0; font-size: 1.375rem; font-weight: 700; line-height: 1.25; color: var(--bg); text-wrap: balance; }
.salem-field { display: flex; flex-direction: column; gap: 0.375rem; }
.salem-card label {
	margin: 0; font-family: var(--font-body); font-size: 0.9375rem; font-weight: 700;
	text-transform: none; letter-spacing: 0; color: var(--bg);
}
.salem-card input[type="text"], .salem-card input[type="email"] {
	width: 100%; max-width: 320px; height: 3rem; padding: 0 0.875rem;
	font: inherit; font-size: 1rem; color: var(--bg); background: #fff;
	border: 2px solid #767c93; border-radius: 5px;
}
.salem-card input:focus { outline: none; border-color: var(--bg); box-shadow: 0 0 0 3px rgba(76, 92, 150, 0.45); }
.salem-card input[aria-invalid="true"] { border-color: #b3261e; }
.salem-error { margin: 0; color: #b3261e; font-weight: 600; font-size: 0.9375rem; }
.salem-error:empty { display: none; }
.salem-error::before { content: "! "; font-weight: 900; }
.salem-note { margin: 0.375rem 0 0; font-size: 0.8125rem; line-height: 1.45; }
.salem-card .salem-submit {
	align-self: flex-end; width: auto; height: auto; min-height: 3rem; padding: 0 1.5rem;
	background: var(--bg); color: #fff; border: 0; border-radius: 5px;
	font-family: var(--font-display); font-size: 0.8125rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
}
.salem-card .salem-submit:hover { background: #474c5e; }
.salem-card :focus-visible { outline-color: rgba(76, 92, 150, 0.6); }
.salem-card #salem-turnstile:empty { display: none; }
.salem-check { display: flex; align-items: center; justify-content: center; width: 3.5rem; height: 3.5rem; border-radius: 50%; background: var(--success); }
.salem-check svg { width: 1.875rem; height: 1.875rem; fill: none; stroke: var(--bg); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.salem-done-text { margin: 0; max-width: 360px; font-size: 0.9375rem; }
.salem-done-text strong { color: var(--bg); overflow-wrap: anywhere; }
/* After joining: the confirmation on top, then "Spread the word about December 2" with the letter's share buttons. */
.salem-done { justify-content: flex-start; align-items: stretch; text-align: left; gap: 1.25rem; }
.salem-done-head { display: flex; flex-direction: column; align-items: center; gap: 0.75rem; text-align: center; }
.salem-done-head .salem-done-text { align-self: center; }
.salem-share { padding-top: 1.25rem; border-top: solid 1px #d9dce6; }
.salem-share-title { margin: 0 0 0.5rem; font-size: 1.05rem; font-weight: 700; line-height: 1.4; color: #1c1e26; }
.salem-share-text { margin: 0; font-size: 0.9375rem; }
.salem-card .share { margin-top: 1rem; }
.salem-card .button { color: var(--bg); border-color: #767c93; }
.salem-card .button:hover { background: #f1f2f8; }
.salem-card .button.primary { background: var(--bg); border-color: var(--bg); color: #fff; }
.salem-card .button.primary:hover { background: var(--section-dark); }
/* Chinese: no uppercase or wide tracking (letter.css does this for headings and buttons already). */
:lang(zh-Hans) .salem-head h2, :lang(zh-Hant) .salem-head h2 { letter-spacing: 0.02em; }

@media (max-width: 480px) {
	.salem-body { padding: 1.25rem 1rem; }
	.salem-card .salem-submit { width: 100%; }
}
