/*
Theme Name: SailFun
Theme URI: https://sailfun.co.uk/
Description: SailFun's block theme, a Twenty Twenty-Five child: signal-flag identity and an events-first homepage.
Author: Fullworks
Author URI: https://fullworks.net/
Template: twentytwentyfive
Version: 1.0.0-alpha.2
Requires at least: 6.7
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: sailfun
*/

/* Headlines in the condensed, heavy cut of Archivo, like sail numbers. */
h1, h2, h3,
.wp-block-site-title,
.sailfun-condensed {
	font-stretch: 72%;
}

/* Signal flags: white flags get a hairline edge on light backgrounds only. */
.sailfun-flags {
	display: block;
	width: 100%;
	height: auto;
}
.sailfun-flags .w {
	stroke: var(--wp--preset--color--contrast);
	stroke-width: 0.6;
}
.has-contrast-background-color .sailfun-flags .w {
	stroke: none;
}

/* Header: flags + wordmark lockup. */
.sailfun-brand {
	gap: 0.75rem;
	text-decoration: none;
}
.sailfun-brand .sailfun-flags {
	width: 150px;
}

/* Hero: the flags hang from a halyard line. */
.sailfun-hoist {
	position: relative;
	max-width: 760px;
	padding-top: 14px;
}
.sailfun-hoist::before {
	content: "";
	position: absolute;
	left: -100vw;
	right: -8px;
	top: 0;
	border-top: 2px solid rgb(255 255 255 / 0.55);
}
.sailfun-hoist .sailfun-flags {
	filter: drop-shadow(0 6px 0 rgb(0 0 0 / 0.18));
}

/* Hero headline sits large and tight. */
.sailfun-hero h1 {
	line-height: 0.92;
	letter-spacing: -0.01em;
}

/*
 * Events grid. DEE's own wrappers are flattened with display: contents so
 * its event cards and our "Your club's event here?" panel share one grid.
 */
.sailfun-events {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
	gap: 1.5rem;
}
.sailfun-events > .wp-block-widget-for-eventbrite-api-display-eventbrite-events,
.sailfun-events section.wfea {
	display: contents;
}
.sailfun-events .wfea-grid_event {
	display: flex;
	flex-direction: column;
	width: auto;
	max-width: none;
	margin: 0;
	padding: 0;
	background: var(--wp--preset--color--base);
	border: 1px solid var(--wp--preset--color--accent-2);
	border-radius: 6px;
	overflow: hidden;
	font-family: inherit;
	color: var(--wp--preset--color--contrast);
}
.sailfun-events .wfea-group {
	flex: 1;
}
.sailfun-events .wfea-grid-hero,
.sailfun-events .entry-header {
	background: none;
}
.sailfun-events .wfea-grid-hero-thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}
.sailfun-events .entry-header {
	padding: 1.25rem 1.25rem 0;
}
/* The date leads, set like a sail number. */
.sailfun-events .wfea-grid__head-date,
.sailfun-events .wfea-grid__head-date time {
	display: inline;
	font-size: var(--wp--preset--font-size--x-large);
	font-weight: 800;
	font-stretch: 72%;
	line-height: 1;
	color: var(--wp--preset--color--contrast);
}
.sailfun-events .wfea-header__title {
	margin: 0.5rem 0 0;
	font-size: var(--wp--preset--font-size--large);
	font-weight: 700;
	font-stretch: 100%;
	line-height: 1.2;
}
.sailfun-events .wfea-header__title a {
	color: var(--wp--preset--color--contrast);
	text-decoration: none;
}
.sailfun-events .wfea-header__title a:hover,
.sailfun-events .wfea-header__title a:focus-visible {
	text-decoration: underline;
}
/* The long date repeats the one above; the time shows in the details. */
.sailfun-events .wfea-grid__meta {
	display: none;
}
.sailfun-events .wfea-grid__venue_name {
	padding: 0.35rem 1.25rem 0;
	font-size: var(--wp--preset--font-size--small);
	font-weight: 600;
	color: var(--wp--preset--color--accent-4);
}
.sailfun-events .wfea-grid__content {
	padding: 0.75rem 1.25rem 0;
	font-size: var(--wp--preset--font-size--small);
	line-height: 1.5;
}
.sailfun-events .wfea-modal-view-details {
	display: inline;
	margin: 0.5rem 0 0;
	padding: 0;
	background: none;
	border: 0;
	font: inherit;
	font-weight: 600;
	color: var(--wp--preset--color--accent-3);
	text-decoration: underline;
	cursor: pointer;
	float: none;
}
.sailfun-events .wfea-grid__booknow {
	padding: 1rem 1.25rem 1.25rem;
	background: none;
}
.sailfun-events .wfea-grid__booknow .wfea-button {
	display: inline-block;
	width: auto;
	padding: 0.6rem 1.1rem;
	border: 2px solid var(--wp--preset--color--contrast);
	border-radius: 4px;
	background: var(--wp--preset--color--base);
	color: var(--wp--preset--color--contrast);
	font-weight: 700;
	text-decoration: none;
}
.sailfun-events .wfea-grid__booknow .wfea-button:hover,
.sailfun-events .wfea-grid__booknow .wfea-button:focus-visible {
	background: var(--wp--preset--color--contrast);
	color: var(--wp--preset--color--base);
}

/*
 * DEE's grey theme sets these with element-qualified selectors, some
 * !important; match them so the cards take SailFun's palette.
 */
body .sailfun-events section.wfea .wfea-banner {
	background-color: transparent;
}
.sailfun-events section.wfea.grid article .wfea-group .wfea-grid-hero {
	height: auto;
}
.sailfun-events section.wfea.theme-gray article .eaw-time {
	color: var(--wp--preset--color--contrast);
}
.sailfun-events section.wfea.theme-gray article .wfea-header__title a {
	color: var(--wp--preset--color--contrast) !important;
}
.sailfun-events section.wfea.theme-gray article .booknow a {
	background: var(--wp--preset--color--base) !important;
	color: var(--wp--preset--color--contrast) !important;
}
.sailfun-events section.wfea.theme-gray article .booknow a:hover,
.sailfun-events section.wfea.theme-gray article .booknow a:focus-visible {
	background: var(--wp--preset--color--contrast) !important;
	color: var(--wp--preset--color--base) !important;
}
.sailfun-events section.wfea.grid .wfea-grid__booknow {
	margin-top: auto;
}
.sailfun-events section.wfea.theme-gray article .booknow a.wfea-button {
	border: 2px solid var(--wp--preset--color--contrast) !important;
	width: auto;
}
.sailfun-events section.wfea .wfea-modal-view-details {
	display: block;
	float: none;
	margin-left: 0;
	text-align: left;
}

/* "Your club's event here?" panel, the last cell of the grid. */
.sailfun-empty-slot {
	border: 2px dashed var(--wp--preset--color--accent-4);
	justify-content: center;
	min-height: 18rem;
}

/* Club guide index: plain three-column list of names. */
.sailfun-club-index .wp-block-post-template {
	column-gap: 2rem;
}
.sailfun-club-index .wp-block-post-title a {
	text-decoration: none;
}
.sailfun-club-index .wp-block-post-title a:hover,
.sailfun-club-index .wp-block-post-title a:focus-visible {
	text-decoration: underline;
}

/* Visible keyboard focus everywhere. */
:where(a, button, .wp-element-button):focus-visible {
	outline: 3px solid var(--wp--preset--color--accent-3);
	outline-offset: 2px;
}
.has-contrast-background-color :where(a, .wp-element-button):focus-visible {
	outline-color: var(--wp--preset--color--accent-1);
}

/* Club names read as a compact A-Z list, not headlines. */
.sailfun-club-index .wp-block-post-title {
	margin: 0;
	font-stretch: 100%;
	line-height: 1.35;
}
@media (max-width: 600px) {
	.sailfun-club-index .wp-block-post-template.is-layout-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

/* Footer links sit apart without separator characters. */
.sailfun-footer-links a + a {
	margin-left: 1.25rem;
}

/* ---------- Inner pages ---------- */

/* Title band: the page's name, its section above, and dates or positions below. */
.sailfun-band {
	border-bottom: 1px solid var(--wp--preset--color--accent-2);
}
.sailfun-band > *,
.sailfun-rows,
.alignfull > .sailfun-article__body {
	margin-left: max(0px, calc((100% - 1200px) / 2)) !important;
}
.sailfun-band__title {
	max-width: 20em;
	margin-top: 0.25rem;
	font-size: var(--wp--preset--font-size--xx-large);
	line-height: 0.98;
}
.sailfun-band__lede {
	max-width: 36em;
	font-size: var(--wp--preset--font-size--large);
	line-height: 1.45;
	color: var(--wp--preset--color--accent-4);
}
.sailfun-band__lede p {
	margin: 0;
}
.sailfun-kicker {
	margin: 0;
	font-size: var(--wp--preset--font-size--small);
	font-weight: 700;
}
.sailfun-kicker a {
	color: var(--wp--preset--color--accent-3);
	text-decoration: none;
}
.sailfun-kicker a:hover,
.sailfun-kicker a:focus-visible {
	text-decoration: underline;
}
.sailfun-band__date {
	margin-top: 0.75rem;
	color: var(--wp--preset--color--accent-4);
}

/* A club's position, set like a chart reference. */
.sailfun-position {
	margin-top: 0.75rem;
	font-size: var(--wp--preset--font-size--large);
	font-weight: 700;
	font-stretch: 72%;
	font-variant-numeric: tabular-nums;
	letter-spacing: 0.02em;
}

/* Body column on the left, club details beside it on wide screens. */
.sailfun-article {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: var(--wp--preset--spacing--60);
}
@media (min-width: 960px) {
	.sailfun-article:has(.sailfun-club-card, .sailfun-nearby) {
		grid-template-columns: minmax(0, 680px) minmax(260px, 340px);
		justify-content: space-between;
	}
}
.sailfun-article > *,
.sailfun-article__body {
	margin-top: 0;
	max-width: 680px;
}
.sailfun-article__aside {
	display: flex;
	flex-direction: column;
	gap: var(--wp--preset--spacing--50);
}
.sailfun-article__aside:not(:has(*)) {
	display: none;
}
.sailfun-article__image {
	margin-bottom: var(--wp--preset--spacing--50);
}
.sailfun-article__image img {
	border-radius: 6px;
}

/* Old posts were pasted from Word; let the theme's type and colours win. */
.sailfun-prose [style*="font-family"],
.sailfun-prose [style*="color"],
.sailfun-prose [style*="background"] {
	font-family: inherit !important;
	color: inherit !important;
	background: none !important;
}
.sailfun-prose [style*="justify"] {
	text-align: left !important;
}
.sailfun-prose img {
	max-width: 100%;
	height: auto;
}
.sailfun-prose h2,
.sailfun-prose h3 {
	margin-top: var(--wp--preset--spacing--50);
}
.sailfun-prose h2:empty,
.sailfun-prose h3:empty,
.sailfun-prose p:empty {
	display: none;
}

/* Find-the-club card. */
.sailfun-club-card {
	padding: var(--wp--preset--spacing--50);
	background: var(--wp--preset--color--accent-5);
	border-top: 4px solid var(--wp--preset--color--accent-1);
	border-radius: 6px;
}
.sailfun-club-card h2,
.sailfun-nearby h2 {
	margin: 0 0 0.75rem;
	font-size: var(--wp--preset--font-size--large);
}
.sailfun-club-card p {
	margin: 0.75rem 0 0;
	font-size: var(--wp--preset--font-size--small);
}
.sailfun-club-card__website .wp-element-button {
	display: inline-block;
	text-decoration: none;
}
.sailfun-club-card__maps a {
	margin-left: 0.5rem;
	white-space: nowrap;
}

/* Nearest clubs, with how far away they are. */
.sailfun-nearby ul {
	margin: 0;
	padding: 0;
	list-style: none;
}
.sailfun-nearby li {
	display: flex;
	justify-content: space-between;
	gap: 1rem;
	padding: 0.5rem 0;
	border-top: 1px solid var(--wp--preset--color--accent-2);
	font-size: var(--wp--preset--font-size--small);
}
.sailfun-nearby a {
	font-weight: 600;
}
.sailfun-nearby__miles {
	flex-shrink: 0;
	color: var(--wp--preset--color--accent-4);
	font-variant-numeric: tabular-nums;
}

/* Previous and next post. */
.sailfun-post-nav {
	margin-top: var(--wp--preset--spacing--60);
	padding-top: var(--wp--preset--spacing--40);
	border-top: 1px solid var(--wp--preset--color--accent-2);
	gap: 1rem 2rem;
}
.sailfun-post-nav > * {
	max-width: 32em;
	font-weight: 600;
}
.sailfun-post-nav .post-navigation-link-next {
	margin-left: auto;
	text-align: right;
}

/* Post lists: one row per post, dated, divided by hairlines. */
.sailfun-rows {
	max-width: 760px;
}
.sailfun-rows .wp-block-post-template > li {
	margin-top: 0;
}
.sailfun-row {
	padding: var(--wp--preset--spacing--40) 0;
	border-bottom: 1px solid var(--wp--preset--color--accent-2);
}
.sailfun-row__meta {
	color: var(--wp--preset--color--accent-4);
}
.sailfun-row__meta > * {
	margin: 0;
}
.sailfun-row .wp-block-post-title {
	margin: 0.25rem 0 0;
	font-stretch: 100%;
	font-weight: 700;
	line-height: 1.25;
}
.sailfun-row .wp-block-post-title a {
	color: var(--wp--preset--color--contrast);
	text-decoration: none;
}
.sailfun-row .wp-block-post-title a:hover,
.sailfun-row .wp-block-post-title a:focus-visible {
	text-decoration: underline;
}
.sailfun-row .wp-block-post-excerpt {
	margin-top: 0.5rem;
}
.sailfun-row .wp-block-post-excerpt__excerpt {
	margin: 0;
}
.sailfun-rows .wp-block-query-pagination {
	margin-top: var(--wp--preset--spacing--50);
	font-weight: 600;
}

/* Search box in the title band. */
.sailfun-search {
	max-width: 32rem;
	margin-top: var(--wp--preset--spacing--40);
}
.sailfun-search .wp-block-search__input {
	border: 2px solid var(--wp--preset--color--contrast);
	border-radius: 4px;
	background: var(--wp--preset--color--base);
}
.sailfun-links {
	font-size: var(--wp--preset--font-size--large);
	font-weight: 600;
}
.sailfun-search .wp-block-search__button {
	border-radius: 4px;
}

/* Full-width bands meet the footer with no gap. */
.wp-site-blocks > footer {
	margin-block-start: 0;
}
