/*
Theme Name: PARC
Theme URI: https://palomararc.org
Author: Palomar Amateur Radio Club
Description: Block theme for the Palomar Amateur Radio Club (W6NWG). Colors and fonts are set in theme.json and can be changed under Appearance > Editor > Styles.
Version: 0.1.0
Requires at least: 6.6
Requires PHP: 8.1
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: parc
*/

/* Most styling lives in theme.json. Only things theme.json can't express go here. */

:where(.wp-site-blocks) :focus-visible {
	outline: 3px solid var(--wp--preset--color--accent);
	outline-offset: 2px;
}

/* Tables (repeaters, nets): readable on phones without squashing columns. */
.wp-block-table {
	overflow-x: auto;
}
.wp-block-table table {
	border-collapse: collapse;
	width: 100%;
}
.wp-block-table th,
.wp-block-table thead th {
	background: var(--wp--preset--color--ink);
	color: var(--wp--preset--color--white);
	font-weight: 600;
	text-align: left !important;
}
.wp-block-table th,
.wp-block-table td {
	border: 1px solid var(--wp--preset--color--line);
	padding: 0.5em 0.75em;
	vertical-align: top;
}
.wp-block-table tbody tr:nth-child(even) {
	background: var(--wp--preset--color--paper);
}

/* Header: logo shrinks on small screens. */
.parc-header .wp-block-site-logo img {
	width: clamp(56px, 12vw, 84px);
	height: auto;
}
.parc-header .wp-block-site-title a {
	text-decoration: none;
}

/* PayPal and mailing-list forms (markup comes from PayPal/DreamHost; only styled here). */
.parc-paypal table,
.parc-paypal td {
	border: 0;
	padding: 0;
}
.parc-paypal td {
	display: block;
	padding-bottom: 0.35rem;
}
.parc-paypal select,
.parc-paypal input[type="text"],
.parc-list-form input[type="email"],
.parc-list-form input[inputmode="email"] {
	font: inherit;
	width: 100%;
	max-width: 28rem;
	padding: 0.45em 0.6em;
	border: 1px solid var(--wp--preset--color--muted);
	border-radius: 4px;
	background: var(--wp--preset--color--white);
	box-sizing: border-box;
}
.parc-join label {
	display: block;
	font-weight: 600;
}
.parc-join p {
	margin: 0 0 0.9rem;
}
.parc-join-hint {
	display: block;
	font-size: 0.9rem;
	color: var(--wp--preset--color--muted);
}
.parc-join-pay {
	margin: 1.5rem 0 0.5rem;
	padding: 1rem 1.25rem;
	max-width: 36rem;
	border: 1px solid var(--wp--preset--color--muted);
	border-radius: 6px;
}
.parc-join-pay legend {
	font-weight: 700;
	padding: 0 0.4rem;
}
.parc-join .parc-join-choice {
	display: flex;
	gap: 0.6rem;
	align-items: flex-start;
	font-weight: 400;
	margin: 0.5rem 0;
	cursor: pointer;
}
.parc-join-choice input {
	margin-top: 0.3rem;
	flex: 0 0 auto;
}
.parc-join-auto {
	margin: 0.75rem 0 0 1.6rem;
	padding: 0.75rem 1rem;
	border-left: 6px solid var(--wp--preset--color--accent);
	background: var(--wp--preset--color--paper);
}
.parc-join-auto p {
	margin: 0 0 0.5rem;
}
.parc-paypal button,
.parc-list-form button {
	margin-top: 0.5rem;
	cursor: pointer;
}
.parc-list-form label {
	display: block;
	font-weight: 600;
}
.parc-link-button {
	background: none;
	border: 0;
	color: var(--wp--preset--color--primary);
	text-decoration: underline;
	font: inherit;
}

/* Scope index: year column stays narrow. */
.parc-scope-index th[scope="row"] {
	width: 4.5rem;
	background: var(--wp--preset--color--sky-light);
	color: var(--wp--preset--color--ink);
}

/* Partner logos: same visual height, natural aspect ratio. */
.wp-block-image.parc-partner-logo img {
	height: 72px;
	width: auto;
	max-width: 100%;
	object-fit: contain;
	object-position: left center;
}

/* Scope archive years: compact buttons instead of a long table. */
.parc-year-chips {
	list-style: none;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
}
.parc-year-chips li {
	border: 1px solid var(--wp--preset--color--line);
	border-radius: 4px;
	padding: 0.3rem 0.6rem;
	background: var(--wp--preset--color--sky-light);
}
.parc-year-chips small {
	color: var(--wp--preset--color--muted);
}
.parc-year-chips .is-missing {
	color: var(--wp--preset--color--muted);
}

/* Scouting America brand rule: clear space at least the height of the
   fleur-de-lis (about 0.38 x logo height) on all sides. The PNG has some
   built-in margin; this adds the rest below, where the caption sits. */
.wp-block-image.parc-logo-clearspace {
	margin-bottom: 28px;
}
.parc-store-photos {
	max-width: 32rem;
}
.parc-badge-form {
	max-width: 36rem;
}
.parc-badge-form fieldset {
	border: 1px solid var(--wp--preset--color--muted);
	border-radius: 6px;
	padding: 0.75rem 1.25rem 0.25rem;
	margin: 0 0 1.25rem;
}
.parc-badge-form legend {
	font-weight: 700;
	padding: 0 0.4rem;
}
.parc-badge-form p {
	margin: 0 0 0.9rem;
}
.parc-badge-form label,
.parc-badge-label {
	display: block;
	font-weight: 600;
}
.parc-badge-form input[type="text"],
.parc-badge-form input[type="email"],
.parc-badge-form input[type="tel"],
.parc-badge-form select,
.parc-badge-form textarea {
	font: inherit;
	width: 100%;
	padding: 0.45em 0.6em;
	border: 1px solid var(--wp--preset--color--muted);
	border-radius: 4px;
	background: var(--wp--preset--color--white);
	box-sizing: border-box;
}
.parc-badge-form select {
	width: auto;
}
/* Show what the order will say: the server does the same. */
#pb-call,
#pj-call {
	text-transform: uppercase;
}
#pb-badge-name,
#pb-city {
	text-transform: capitalize;
}
.parc-badge-note {
	display: block;
	font-size: 0.9rem;
	margin-bottom: 0.25rem;
}
.parc-badge-form .parc-badge-choice {
	font-weight: 400;
	display: flex;
	gap: 0.5rem;
	align-items: center;
	cursor: pointer;
}
.parc-badge-row {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 0 1rem;
}
@media (max-width: 480px) {
	.parc-badge-row {
		grid-template-columns: 1fr;
	}
}
.parc-badge-hint {
	font-size: 0.9rem;
	color: var(--wp--preset--color--muted);
}
.parc-badge-error,
.parc-badge-done {
	padding: 0.75rem 1rem;
	border-left: 6px solid var(--wp--preset--color--accent);
	background: var(--wp--preset--color--paper);
}
