/*
Theme Name: GSCC
Theme URI: https://greaterseattlechessclub.com
Description: Greater Seattle Chess Club — child of Twenty Twenty-Five. Black/white/grey with a rose accent, dark by default.
Author: Greater Seattle Chess Club
Template: twentytwentyfive
Version: 0.14.0
Requires at least: 6.7
Tested up to: 7.0
License: GPL-2.0-or-later
Text Domain: gscc
*/

/* Design lives in theme.json. This file holds only what theme.json can't express. */

/* Light text on black renders heavier than the same weight on white. Antialiasing
   pulls it back to the intended weight on WebKit/Blink; without it Manrope's body
   text looks a notch bolder than it should. */
body {
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	text-rendering: optimizeLegibility;
}

/* ---------- Scrollbar & native UI ---------- */

/* Tells the browser this is a dark surface, so native widgets — form controls,
   and the scrollbar on anything not covered below — render dark instead of
   light-on-dark. Worth setting independently of the custom styling. */
:root {
	color-scheme: dark;
}

/* Standard property. Chrome 121+, Firefox, Safari 18+ honour this and ignore the
   ::-webkit- rules below, so the two blocks are alternatives, not duplicates. */
html {
	scrollbar-color: var(--wp--preset--color--accent) #101010;
	scrollbar-width: thin;
}

/* Fallback for older WebKit/Blink. Also covers scrollable panes inside the page,
   such as the calendar on narrow screens. */
::-webkit-scrollbar {
	height: 10px;
	width: 10px;
}

::-webkit-scrollbar-track {
	background: #101010;
}

::-webkit-scrollbar-thumb {
	background: var(--wp--preset--color--accent);
	border: 2px solid #101010;
	border-radius: 6px;
}

::-webkit-scrollbar-thumb:hover {
	background: var(--wp--preset--color--contrast);
}

::-webkit-scrollbar-corner {
	background: #101010;
}

/* ---------- Header ---------- */

/* The trimmed logo is 730x483; left at the block's default it dominated the
   header. Cap by height so the wordmark stays legible without towering. */
.wp-block-site-logo img,
.wp-block-site-logo.is-default-size img {
	height: auto;
	max-height: 44px;
	width: auto;
	display: block;
}

/* ---------- Mobile navigation ---------- */

/* WordPress ships a bare two-line icon with no tap target. Both buttons get a
   44px box — the minimum comfortable touch size — and a visible border so the
   control reads as a control. */
.wp-block-navigation__responsive-container-open,
.wp-block-navigation__responsive-container-close {
	align-items: center;
	background: transparent;
	border: 1px solid #2a2a2a;
	border-radius: 2px;
	color: var(--wp--preset--color--contrast);
	display: flex;
	height: 44px;
	justify-content: center;
	padding: 0;
	transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
	width: 44px;
}

.wp-block-navigation__responsive-container-open:hover,
.wp-block-navigation__responsive-container-open:focus-visible,
.wp-block-navigation__responsive-container-close:hover,
.wp-block-navigation__responsive-container-close:focus-visible {
	background: var(--wp--preset--color--accent);
	border-color: var(--wp--preset--color--accent);
	color: var(--wp--preset--color--base);
}

/* Swap the stock two-line glyph for three even bars. One pseudo-element draws
   all three: the box is the middle bar, box-shadow clones it above and below. */
.wp-block-navigation__responsive-container-open svg {
	display: none;
}

.wp-block-navigation__responsive-container-open::before {
	background: currentColor;
	box-shadow: 0 -6px 0 currentColor, 0 6px 0 currentColor;
	content: "";
	height: 2px;
	width: 20px;
}

/* Overlay */

.wp-block-navigation__responsive-container.is-menu-open {
	padding: var(--wp--preset--spacing--30);
}

.wp-block-navigation__responsive-container.is-menu-open
	.wp-block-navigation__responsive-container-content {
	align-items: flex-start;
	justify-content: center;
	padding-bottom: var(--wp--preset--spacing--60);
}

.wp-block-navigation__responsive-container.is-menu-open
	.wp-block-navigation__container {
	gap: 0;
	width: 100%;
}

/* Full-width rows with hairline rules: easier to hit than centred text links,
   and the list reads as a menu rather than a stack of words. */
.wp-block-navigation__responsive-container.is-menu-open
	.wp-block-navigation-item {
	border-bottom: 1px solid #1c1c1c;
	width: 100%;
}

.wp-block-navigation__responsive-container.is-menu-open
	.wp-block-navigation-item:first-child {
	border-top: 1px solid #1c1c1c;
}

.wp-block-navigation__responsive-container.is-menu-open
	.wp-block-navigation-item__content {
	display: block;
	font-size: var(--wp--preset--font-size--x-large);
	font-weight: 800;
	letter-spacing: -0.02em;
	padding: 0.7rem 0.2rem;
	text-decoration: none;
	width: 100%;
}

.wp-block-navigation__responsive-container.is-menu-open
	.wp-block-navigation-item__content:hover,
.wp-block-navigation__responsive-container.is-menu-open
	.wp-block-navigation-item__content:focus-visible {
	color: var(--wp--preset--color--accent);
}

/* The current page should be obvious once the menu is open. */
.wp-block-navigation__responsive-container.is-menu-open
	.current-menu-item .wp-block-navigation-item__content {
	color: var(--wp--preset--color--accent);
}

/* ---------- Full-width bands ---------- */

/* Alternating black/surface sections must butt against each other. The root
   blockGap would otherwise leave a black seam between two bands, which reads
   as a misaligned edge rather than deliberate spacing. Each band's own padding
   supplies the vertical rhythm. */
.wp-block-post-content > .alignfull {
	margin-block: 0;
}

/* Pages that open with a full-bleed band start flush against the header — the
   band's own padding is the spacing. Pages that open with a bare heading would
   otherwise collide with the header, so those get breathing room here. Doing it
   this way rather than padding <main> keeps the two cases independent. */
.wp-block-post-content > :first-child:not(.alignfull) {
	margin-block-start: var(--wp--preset--spacing--40);
}

/* ---------- Utilities ---------- */

/* Grey is 2.44:1 on white and 4.6:1 on black — safe here only because the
   site ground is black. Never reuse it for body text on a light section. */
.gscc-meta {
	color: var(--wp--preset--color--grey);
	font-size: var(--wp--preset--font-size--small);
	letter-spacing: 0.06em;
	text-transform: uppercase;
}

.screen-reader-text {
	border: 0;
	clip-path: inset(50%);
	height: 1px;
	margin: -1px;
	overflow: hidden;
	padding: 0;
	position: absolute;
	white-space: nowrap;
	width: 1px;
}

/* ---------- Calendar ---------- */

.gscc-cal-next {
	display: flex;
	flex-wrap: wrap;
	gap: var(--wp--preset--spacing--20);
	list-style: none;
	margin: 0 0 var(--wp--preset--spacing--50);
	padding: 0;
}

.gscc-cal-next__item {
	border: 1px solid #2a2a2a;
	border-radius: 2px;
	display: flex;
	flex-direction: column;
	gap: 0.25rem;
	flex: 1 1 8rem;
	padding: var(--wp--preset--spacing--30);
}

.gscc-cal-next__item.is-next {
	border-color: var(--wp--preset--color--accent);
}

.gscc-cal-next__date {
	font-size: var(--wp--preset--font-size--large);
	font-weight: 700;
}

/* Month navigation */

.gscc-cal__nav {
	align-items: center;
	display: flex;
	gap: var(--wp--preset--spacing--30);
	justify-content: space-between;
	margin-bottom: var(--wp--preset--spacing--30);
}

.gscc-cal__title {
	font-size: var(--wp--preset--font-size--large);
	margin: 0;
	text-align: center;
}

.gscc-cal__navbtn {
	border: 1px solid #2a2a2a;
	border-radius: 2px;
	color: var(--wp--preset--color--contrast);
	font-size: var(--wp--preset--font-size--small);
	padding: 0.45rem 0.8rem;
	text-decoration: none;
	white-space: nowrap;
}

.gscc-cal__navbtn:hover,
.gscc-cal__navbtn:focus-visible {
	background: var(--wp--preset--color--accent);
	border-color: var(--wp--preset--color--accent);
	color: var(--wp--preset--color--base);
}

.gscc-cal__today-link {
	font-size: var(--wp--preset--font-size--small);
	margin-top: var(--wp--preset--spacing--30);
	text-align: center;
}

/* Month grid */

.gscc-cal__grid {
	display: grid;
	gap: 2px;
	grid-template-columns: repeat(7, minmax(0, 1fr));
}

.gscc-cal__dow {
	color: var(--wp--preset--color--grey);
	font-size: 0.7rem;
	letter-spacing: 0.06em;
	padding-bottom: 0.35rem;
	text-align: center;
	text-transform: uppercase;
}

.gscc-cal__day,
.gscc-cal__pad {
	border-radius: 2px;
	min-height: 5.5rem;
	padding: 0.3rem;
}

.gscc-cal__day {
	background: #101010;
	display: flex;
	flex-direction: column;
	gap: 0.25rem;
}

.gscc-cal__num {
	color: var(--wp--preset--color--grey);
	font-size: 0.75rem;
	font-weight: 700;
}

.gscc-cal__day.is-past .gscc-cal__num {
	color: #4a4a4a;
}

.gscc-cal__day.is-past {
	opacity: 0.55;
}

.gscc-cal__day.is-today {
	outline: 2px solid var(--wp--preset--color--contrast);
	outline-offset: -2px;
}

.gscc-cal__day.is-today .gscc-cal__num {
	color: var(--wp--preset--color--contrast);
}

/* Event chips */

.gscc-cal__events {
	display: flex;
	flex-direction: column;
	gap: 2px;
	list-style: none;
	margin: 0;
	padding: 0;
}

/* Every chip carries a text label and a left border weight, so type is never
   communicated by hue alone. */
.gscc-chip {
	border-left: 3px solid var(--wp--preset--color--grey);
	border-radius: 1px;
	display: block;
	font-size: 0.7rem;
	line-height: 1.25;
	padding: 0.2rem 0.3rem;
}

.gscc-chip a {
	color: inherit;
	display: block;
	text-decoration: none;
}

.gscc-chip a:hover .gscc-chip__title,
.gscc-chip a:focus-visible .gscc-chip__title {
	text-decoration: underline;
}

.gscc-chip__title {
	display: block;
	font-weight: 700;
}

.gscc-chip__time {
	display: block;
	opacity: 0.75;
}

.gscc-chip.is-club-night {
	background: rgba(255, 194, 194, 0.16);
	border-left-color: var(--wp--preset--color--accent);
	color: var(--wp--preset--color--accent);
}

.gscc-chip.is-tournament {
	background: rgba(255, 255, 255, 0.14);
	border-left-color: var(--wp--preset--color--contrast);
	color: var(--wp--preset--color--contrast);
}

.gscc-chip.is-social {
	background: rgba(166, 166, 166, 0.16);
	border-left-color: var(--wp--preset--color--grey);
	color: #d6d6d6;
}

.gscc-chip.is-cancelled {
	background: transparent;
	border-left-color: #5a5a5a;
	color: #8a8a8a;
	text-decoration: line-through;
}

/* Legend */

.gscc-cal-legend {
	display: flex;
	flex-wrap: wrap;
	gap: var(--wp--preset--spacing--30);
	list-style: none;
	margin: var(--wp--preset--spacing--40) 0 0;
	padding: 0;
}

.gscc-legend__item {
	align-items: center;
	color: var(--wp--preset--color--grey);
	display: flex;
	font-size: var(--wp--preset--font-size--small);
	gap: 0.45rem;
}

.gscc-legend__item .gscc-chip {
	height: 0.9rem;
	padding: 0;
	width: 1.6rem;
}

/* On narrow screens a seven-column grid cannot hold readable chip text, so the
   cells shrink to markers and the "next up" list above carries the detail. */
@media (max-width: 600px) {
	.gscc-cal__day,
	.gscc-cal__pad {
		min-height: 3rem;
	}

	.gscc-chip__time {
		display: none;
	}

	.gscc-chip__title {
		overflow: hidden;
		text-overflow: ellipsis;
		white-space: nowrap;
	}

	.gscc-chip {
		font-size: 0.6rem;
	}
}

/* ---------- Gallery ---------- */

/* Core ships the gallery's sizing rules (width calc, flex-grow, is-cropped) in a
   linked stylesheet, but the `display:flex` container itself comes from
   WordPress's per-block layout support — which is only generated when the block
   has a `layout` attribute. This gallery's markup is hand-authored and has none,
   so the sizing rules land with nothing to lay them out and every figure stacks.
   Supplying that one missing declaration rather than a competing layout system:
   grid or multi-column on top of core's flex collapses figures to ~120px and
   stretches cropped images to 1500px tall. */
.wp-block-gallery.has-nested-images {
	display: flex;
	flex-wrap: wrap;

	/* Core's per-figure width is calc(33.33% - var(--gap)); keep that variable
	   and the actual gap in step or the last tile in each row wraps early. */
	--wp--style--unstable-gallery-gap: 10px;
	gap: 10px;
}

/* Core sets flex-grow:1, so a final row holding two portrait shots stretches
   them to fill the width — and at 9:16 that means ~1000px tall tiles. Pinning
   the tile to a fixed ratio and stopping the grow keeps every cell identical
   and lets a short last row simply leave a gap. */
.wp-block-gallery.has-nested-images figure.wp-block-image {
	aspect-ratio: 4 / 3;
	flex-grow: 0;
}

.wp-block-gallery.has-nested-images figure.wp-block-image img {
	border-radius: 2px;
	height: 100%;
	object-fit: cover;
	transition: opacity 0.15s ease;
	width: 100%;
}

.wp-block-gallery.has-nested-images figure.wp-block-image img:hover {
	opacity: 0.85;
}

/* ---------- Instagram feed ---------- */

.gscc-instagram {
	min-height: 300px;
}

/* ---------- Registration form ---------- */

.gscc-form {
	max-width: 30rem;
}

.gscc-field {
	display: flex;
	flex-direction: column;
	gap: 0.35rem;
	margin-bottom: var(--wp--preset--spacing--30);
}

.gscc-field legend,
.gscc-field > label {
	font-size: var(--wp--preset--font-size--small);
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

.gscc-field__row {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
}

.gscc-field__row input {
	flex: 1 1 7rem;
	min-width: 0;
}

.gscc-field__row select {
	flex: 1 1 9rem;
	min-width: 0;
}

/* box-sizing matters here: WordPress sets no global border-box reset, so
   width:100% plus padding plus border overflows the container — which on a
   narrow screen pushes the fields wider than the page. */
.gscc-form input[type="text"],
.gscc-form input[type="tel"],
.gscc-form input[type="email"],
.gscc-form input[type="date"],
.gscc-form select {
	background: #101010;
	border: 1px solid #2a2a2a;
	border-radius: 2px;
	box-sizing: border-box;
	color: var(--wp--preset--color--contrast);
	font-family: inherit;
	max-width: 100%;
	padding: 0.65rem 0.7rem;
	width: 100%;

	/* Never inherit the body size here. Fluid typography clamps `medium` down to
	   0.875rem on narrow viewports, and iOS Safari force-zooms the page whenever
	   a focused input is under 16px. The max() floor keeps that from happening
	   regardless of what the fluid scale does. */
	font-size: max(16px, 1.0625rem);
}

/* Safari on iOS renders date inputs at an intrinsic width that ignores the
   declared one unless the appearance is reset. */
.gscc-form input[type="date"] {
	-webkit-appearance: none;
	appearance: none;
	min-height: 2.9rem;
}

.gscc-form input:focus-visible,
.gscc-form select:focus-visible {
	border-color: var(--wp--preset--color--accent);
	outline: 2px solid var(--wp--preset--color--accent);
	outline-offset: 1px;
}

.gscc-req {
	color: var(--wp--preset--color--accent);
}

.gscc-hint {
	color: var(--wp--preset--color--grey);
	font-size: 0.8rem;
	line-height: 1.4;
}

.gscc-field--check label {
	align-items: flex-start;
	display: flex;
	gap: 0.6rem;
	line-height: 1.4;
}

.gscc-field--check input {
	accent-color: var(--wp--preset--color--accent);
	height: 1.15rem;
	margin-top: 0.1rem;
	width: 1.15rem;
}

/* Honeypot. Hidden from people without display:none, which some bots detect. */
.gscc-hp {
	height: 0;
	left: -9999px;
	overflow: hidden;
	position: absolute;
	width: 0;
}

.gscc-form__privacy {
	border-left: 2px solid #2a2a2a;
	color: var(--wp--preset--color--grey);
	font-size: 0.85rem;
	line-height: 1.5;
	margin: var(--wp--preset--spacing--40) 0;
	padding-left: 0.8rem;
}

.gscc-form__result {
	border-left: 3px solid var(--wp--preset--color--grey);
	margin-bottom: var(--wp--preset--spacing--40);
	padding: var(--wp--preset--spacing--30);
}

.gscc-form__result.is-error {
	background: rgba(201, 110, 110, 0.14);
	border-left-color: #c96e6e;
}

.gscc-form__result.is-success {
	background: rgba(255, 194, 194, 0.14);
	border-left-color: var(--wp--preset--color--accent);
}

.gscc-form__result ul {
	margin: 0.4rem 0 0;
	padding-left: 1.1rem;
}

/* ---------- Announcements ---------- */

.gscc-post-list {
	list-style: none;
	margin: 0;
	padding: 0;
}
