/*
Theme Name:  Vespa Club Groningen
Theme URI:   https://vespaclubgroningen.nl/
Description: Child theme van Blocksy voor de Vespa Club Groningen. Tokens, lokale fonts, block styles en patterns; inhoud en logica staan in de mu-plugins.
Author:      MR10
Author URI:  https://mr10.nl/
Template:    blocksy
Version:     0.2.0
Text Domain: vcg
*/

/* =========================================================
   1. Tokens (kennisbank/13-design-tokens.md)
   Palette 1–8 live in Blocksy (setup/design.php). Colours Blocksy does
   not know are defined here. All text pairs are WCAG AA (see 13).
   ========================================================= */
:root {
	--vcg-navy: var(--theme-palette-color-1, #1E3461);
	--vcg-blue: var(--theme-palette-color-2, #3F64B2);
	--vcg-ink: var(--theme-palette-color-3, #1C1A16);
	--vcg-line: var(--theme-palette-color-5, #D9CDA6);
	--vcg-khaki: var(--theme-palette-color-6, #E7DBB1);
	--vcg-ivory: var(--theme-palette-color-7, #FBF7EC);
	--vcg-white: var(--theme-palette-color-8, #FFFFFF);
	--vcg-gold: #B2975B;       /* badge gold: background/decoration only, ink text on it (6.2:1) */
	--vcg-gold-light: #CDB77F; /* gold on dark backgrounds (6.2:1 on navy) */
	--vcg-red: #B3261A;        /* CTA buttons and labels (white on it 6.5:1) */
	--vcg-flag-red: #E13522;   /* tricolour stripe only, never text */
	--vcg-bronze: #6E5620;     /* eyebrow labels (6.5:1 on ivory, 5.0:1 on khaki) */
	--vcg-muted: #4D4A42;      /* secondary text (8.3:1 on ivory) */
	--vcg-field: #7A735F;      /* form field borders (4.4:1 on ivory) */
	--vcg-overlay: rgba(28, 26, 22, .62); /* photo overlay (hero) */

	--vcg-font-head: "Zilla Slab", Georgia, serif;
	--vcg-font-body: "Atkinson Hyperlegible", system-ui, -apple-system, "Segoe UI", sans-serif;

	--vcg-radius: 10px;    /* cards, photos */
	--vcg-radius-sm: 6px;  /* buttons, fields */
	--vcg-gutter: clamp(16px, 4vw, 48px);
}

/* =========================================================
   2. Components (block styles from inc/editor.php)
   ========================================================= */

/* Tricolour stripe: Separator block style "Vlagstrook". */
.wp-block-separator.is-style-vcg-tricolor {
	height: 22px;
	max-width: none;
	width: 100%;
	margin: 0;
	border: 0;
	opacity: 1;
	background: linear-gradient(var(--vcg-flag-red) 0 33.3%, #FFFFFF 33.3% 66.6%, var(--vcg-blue) 66.6% 100%);
}

/* Crosshatch section: Group block style "Kaki arcering" (Wespennest cover). */
.is-style-vcg-hatch {
	background-color: var(--vcg-khaki);
	background-image:
		repeating-linear-gradient(45deg, rgba(28, 26, 22, .06) 0 1px, transparent 1px 7px),
		repeating-linear-gradient(-45deg, rgba(28, 26, 22, .06) 0 1px, transparent 1px 7px);
}

/* Card with navy outline: Group block style "Kaart". */
.is-style-vcg-card {
	background: var(--vcg-ivory);
	border: 2px solid var(--vcg-navy);
	border-radius: var(--vcg-radius);
	padding: 28px;
}

/* Eyebrow label: Paragraph block style "Label". */
.is-style-vcg-eyebrow {
	font-size: 16px;
	font-weight: 700;
	letter-spacing: .14em;
	text-transform: uppercase;
	color: var(--vcg-bronze);
}

/* Buttons: "Accent (rood)" and "Goud". Default buttons are navy (Blocksy palette 1). */
.wp-block-button.is-style-vcg-red .wp-block-button__link {
	background: var(--vcg-red);
	color: #FFFFFF;
	&:hover { background: var(--vcg-navy); }
}
.wp-block-button.is-style-vcg-gold .wp-block-button__link {
	background: var(--vcg-gold);
	color: var(--vcg-ink);
	&:hover { background: var(--vcg-gold-light); }
}

/* Visible focus on every background. */
:where(a, button, input, select, textarea, .wp-block-button__link):focus-visible {
	outline: 3px solid var(--vcg-blue);
	outline-offset: 3px;
}

/* =========================================================
   3. Header (setup/header-footer.php)
   ========================================================= */
.ct-header .vcg-header-login { margin: 0; }
.ct-header .vcg-header-login a { text-decoration: none; }
.ct-header [data-id="text"] + [data-id="button"] { margin-left: 20px; }
.ct-header [data-id="menu"] > ul > li > a.ct-menu-link { text-underline-offset: 8px; text-decoration-thickness: 3px; }
.ct-header [data-id="menu"] > ul > li:is(.current-menu-item, .current_page_item, .current-menu-ancestor) > a.ct-menu-link {
	text-decoration-line: underline;
	text-decoration-color: var(--vcg-gold);
}
.ct-header-trigger { min-height: 44px; }
/* Narrow desktop (1000–1199 px): keep site name on one line and the menu clear of "Inloggen"; members have one
   menu item more ("Leden"), so their menu is tighter still. */
@media (min-width: 1000px) and (max-width: 1199.98px) {
	#header [data-device="desktop"] [data-id="menu"] { --menu-items-spacing: 16px; }
	.vcg-is-lid #header [data-device="desktop"] [data-id="menu"] { --menu-items-spacing: 10px; }
}
@media (min-width: 1000px) and (max-width: 1099.98px) {
	.vcg-is-lid #header [data-device="desktop"] [data-id="menu"] { --menu-items-spacing: 8px; }
	.vcg-is-lid #header [data-device="desktop"] [data-id="menu"] > ul > li > a.ct-menu-link { font-size: 16px; }
	#header [data-device="desktop"] .site-title { font-size: 22px; white-space: nowrap; }
	#header [data-device="desktop"] [data-id="text"] + [data-id="button"] { margin-left: 12px; }
}
.ct-header-trigger .ct-label { text-transform: none; font-size: 18px; font-weight: 700; letter-spacing: 0; }

/* Transparent header over a hero (page opens with a block that has class mr10-header; inc/header.php). */
/* #header raises specificity above Blocksy's own header rules. */
body.vcg-has-hero #header.ct-header {
	position: absolute;
	inset-inline: 0;
	top: 0;
	z-index: 50;
}
body.admin-bar.vcg-has-hero #header.ct-header { top: 32px; }
@media (max-width: 782px) { body.admin-bar.vcg-has-hero #header.ct-header { top: 46px; } }
body.vcg-has-hero #header [data-row] {
	--theme-border: none;
	background: transparent;
	border-bottom-color: transparent;
	box-shadow: none;
}
body.vcg-has-hero .ct-header :is(.site-title a, [data-id="menu"] > ul > li > a, .vcg-header-login a, .ct-header-trigger) {
	--theme-link-initial-color: #FFFFFF;
	--theme-link-hover-color: var(--vcg-gold-light);
	--theme-icon-color: #FFFFFF;
	color: #FFFFFF;
}
body.vcg-has-hero .ct-header .ct-header-trigger { --theme-border-color: #FFFFFF; }
body.vcg-has-hero #header [data-id="button"] .ct-button-ghost {
	--theme-button-text-initial-color: #FFFFFF;
	border-color: var(--vcg-gold-light);
}
body.vcg-has-hero #header [data-id="button"] .ct-button-ghost:hover {
	background: var(--vcg-gold-light);
	border-color: var(--vcg-gold-light);
	color: var(--vcg-ink);
}
body.vcg-has-hero .ct-header :where(a, button):focus-visible { outline-color: var(--vcg-gold-light); }
/* The hero itself leaves room for the header. */
body.vcg-has-hero .mr10-header { padding-top: calc(88px + 40px); }
@media (max-width: 999.98px) { body.vcg-has-hero .mr10-header { padding-top: calc(76px + 32px); } }
@media (max-width: 689.98px) { body.vcg-has-hero .mr10-header { padding-top: calc(68px + 24px); } }

/* Cards in Blocksy query grids (agenda, verslagen, leden) fill the grid row: equal heights per row.
   The card is a Greenshift container inside the post template, which cannot stretch itself. */
.ct-query-template-grid > .wp-block-post { display: flex; flex-direction: column; }
.ct-query-template-grid > .wp-block-post > .gspb_container { flex: 1 1 auto; }

/* =========================================================
   4. Footer: synced pattern "Footer: Hoofdfooter" (Greenshift blocks).
   Colours, spacing and type live in the blocks; only shortcode output
   (menu list, links) needs these rules.
   ========================================================= */
.ct-footer [data-row] > .ct-container-fluid { padding-inline: 0; }
.ct-footer .ct-widget { margin: 0; width: 100%; max-width: none; }
/* The synced footer section spans the full row; Greenshift centres its content at the container width. */
.ct-footer .vcg-footer { width: 100%; max-width: none; margin-inline: 0; }
.vcg-footer a { color: #FFFFFF; text-underline-offset: 3px; }
.vcg-footer a:hover { color: var(--vcg-gold-light); }
.vcg-footer :where(a, button):focus-visible { outline-color: currentColor; }
.vcg-footer .vcg-menu-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.vcg-footer .vcg-menu-list a { text-decoration: none; }
.vcg-footer .vcg-menu-list a:hover { text-decoration: underline; }
.vcg-footer p { margin-block: 0; }

/* =========================================================
   5. Forms (Fluent Forms output; not stylable through blocks).
   Older audience: labels and fields 18 px, fields 48 px high.
   ========================================================= */
.frm-fluent-form :is(.ff-el-input--label label, .ff-el-form-check-label, .ff-el-help-message, .ff_tc_label) { font-size: 18px; line-height: 1.5; }
.frm-fluent-form .ff-el-input--label label { font-weight: 700; }
.frm-fluent-form :is(input[type="text"], input[type="email"], input[type="tel"], textarea, select).ff-el-form-control { font-size: 18px; min-height: 48px; }
.frm-fluent-form .ff-el-form-check-input { width: 20px; height: 20px; }
.frm-fluent-form .ff-el-is-error .text-danger, .frm-fluent-form .error { font-size: 17px; }
.frm-fluent-form .ff-el-section-break .ff-el-section-title { font-size: 26px; margin-top: 16px; }

/* =========================================================
   6. Block vcg/activiteit-info (server-rendered definition list).
   ========================================================= */
.vcg-facts { display: grid; gap: 10px; margin: 0; }
.vcg-facts__row { display: grid; grid-template-columns: 9.5em 1fr; gap: 16px; padding-bottom: 10px; border-bottom: 1px solid var(--vcg-line); }
.vcg-facts__row:last-child { border-bottom: 0; padding-bottom: 0; }
.vcg-facts dt { font-weight: 700; }
.vcg-facts dd { margin: 0; }
.vcg-facts__status { color: var(--vcg-red); }
@media (max-width: 689.98px) { .vcg-facts__row { grid-template-columns: 1fr; gap: 2px; } }

/* =========================================================
   7. Members' section (blocks vcg/lid-*, kennisbank 16).
   The card itself is a Greenshift container (styled in the editor);
   these rules cover the server-rendered parts.
   ========================================================= */
.vcg-lid-foto img { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; border: 2px solid var(--vcg-line); }
.vcg-lid-naam { margin: 12px 0 4px; font-size: 24px; line-height: 1.2; }
.vcg-lid-naam__achter { display: block; font-family: var(--vcg-font-body); font-size: 16px; font-weight: 400; color: var(--vcg-muted); margin-top: 2px; }
.vcg-lid-gegevens p { margin: 0 0 6px; }
.vcg-lid-gegevens__regel { color: var(--vcg-muted); }
.vcg-lid-gegevens__labels { display: flex; flex-wrap: wrap; gap: 6px; }
.vcg-lid-label { display: inline-block; padding: 2px 10px; border-radius: 999px; background: var(--vcg-gold); color: var(--vcg-ink); font-size: 16px; font-weight: 700; }
.vcg-lid-interesses { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; font-size: 0; }
.vcg-lid-interesses :is(a, span[class^="ct-term"]) { font-size: 16px; padding: 2px 10px; border: 1px solid var(--vcg-navy); border-radius: 999px; color: var(--vcg-navy); text-decoration: none; }
.vcg-lid-vespas { margin-top: 8px; }
.vcg-lid-vespas .wp-block-gallery { --wp--style--gallery-gap-default: 6px; gap: 6px; margin: 0 0 6px; }
.vcg-lid-vespas .wp-block-gallery .wp-block-image { width: 64px !important; flex-grow: 0 !important; }
.vcg-lid-vespas .wp-block-gallery img { width: 64px; height: 64px; object-fit: cover; border-radius: 6px; }
.vcg-lid-vespas__tekst { margin: 0; }
.vcg-lid-bericht__knop { margin-top: 12px; min-height: 44px; padding: 8px 16px; border: 2px solid var(--vcg-navy); border-radius: var(--vcg-radius-sm); background: transparent; color: var(--vcg-navy); font: inherit; font-weight: 700; cursor: pointer; }
.vcg-lid-bericht__knop:hover { background: var(--vcg-navy); color: #FFFFFF; }
.vcg-lid-bericht__dialoog { width: min(560px, calc(100vw - 32px)); border: 2px solid var(--vcg-navy); border-radius: var(--vcg-radius); padding: 24px; }
.vcg-lid-bericht__dialoog::backdrop { background: rgba(28, 26, 22, .55); }
.vcg-lid-bericht__dialoog :is(input, textarea) { width: 100%; font-size: 18px; }
.vcg-lid-bericht__dialoog label { display: block; font-weight: 700; }
.vcg-lid-bericht__acties { display: flex; gap: 12px; }
.vcg-lid-bericht__acties button { min-height: 44px; padding: 8px 18px; font: inherit; font-weight: 700; border-radius: var(--vcg-radius-sm); border: 2px solid var(--vcg-navy); background: var(--vcg-navy); color: #FFFFFF; cursor: pointer; }
.vcg-lid-bericht__acties .vcg-lid-bericht__annuleer { background: transparent; color: var(--vcg-navy); }
.vcg-lid-filter { display: grid; gap: 12px; margin-bottom: 32px; }
.vcg-lid-filter label { display: block; font-weight: 700; margin-bottom: 4px; }
.vcg-lid-filter input[type="search"] { width: 100%; max-width: 560px; min-height: 48px; font-size: 18px; }
.vcg-lid-filter__groep { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.vcg-lid-filter__label { font-weight: 700; margin-right: 4px; }
.vcg-chip { min-height: 40px; padding: 4px 14px; border: 2px solid var(--vcg-navy); border-radius: 999px; background: transparent; color: var(--vcg-navy); font: inherit; font-size: 17px; cursor: pointer; }
.vcg-chip[aria-pressed="true"] { background: var(--vcg-navy); color: #FFFFFF; }
.vcg-lid-filter__telling { margin: 0; color: var(--vcg-muted); }
.wp-block-post[hidden] { display: none !important; }
/* Mijn profiel (acf_form). */
.vcg-profiel .acf-label label { font-size: 18px; font-weight: 700; }
.vcg-profiel .acf-label .description, .vcg-profiel .acf-field p.description { font-size: 17px; }
.vcg-profiel :is(input[type="text"], input[type="email"], input[type="number"], textarea) { font-size: 18px; min-height: 48px; }
.vcg-profiel .acf-checkbox-list li, .vcg-profiel .acf-switch { font-size: 18px; }
.vcg-profiel__opslaan { min-height: 48px; padding: 12px 28px; border: 0; border-radius: var(--vcg-radius-sm); background: var(--vcg-navy); color: #FFFFFF; font: inherit; font-weight: 700; cursor: pointer; }
.vcg-profiel__opslaan:hover { background: var(--vcg-blue); }
/* Inloggen ([vcg_login], magic link). */
.vcg-login label { display: block; margin-bottom: 6px; font-size: 18px; font-weight: 700; }
.vcg-login input[type="email"] { width: 100%; min-height: 48px; font-size: 18px; }
.vcg-login__knop { min-height: 48px; padding: 12px 28px; border: 0; border-radius: var(--vcg-radius-sm); background: var(--vcg-navy); color: #FFFFFF; font: inherit; font-weight: 700; cursor: pointer; }
.vcg-login__knop:hover { background: var(--vcg-blue); }
.vcg-login__melding { padding: 16px 20px; border-left: 4px solid var(--vcg-gold); background: var(--theme-palette-color-7); }

/* Members list choice (vcg-core/ledenlijst.php): welcome page and the checkbox in Mijn profiel. */
.vcg-keuze__intro { font-size: 18px; }
.vcg-keuze__lid { margin: 0 0 24px; padding: 0; border: 0; }
.vcg-keuze__vraag { margin-bottom: 12px; font-family: var(--theme-font-family-headings, inherit); font-size: 22px; font-weight: 700; }
.vcg-keuze__optie { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 10px; padding: 14px 16px; border: 2px solid var(--theme-palette-color-5); border-radius: var(--vcg-radius-sm); background: #FFFFFF; font-size: 17px; cursor: pointer; }
.vcg-keuze__optie:has(input:checked) { border-color: var(--vcg-navy); }
.vcg-keuze__optie input { flex: none; width: 20px; height: 20px; margin-top: 3px; accent-color: var(--vcg-navy); }
.vcg-keuze__noot { padding: 16px 20px; border-left: 4px solid var(--vcg-gold); background: var(--theme-palette-color-7); font-size: 17px; }
.vcg-keuze__knop { min-height: 48px; padding: 12px 28px; border: 0; border-radius: var(--vcg-radius-sm); background: var(--vcg-navy); color: #FFFFFF; font: inherit; font-weight: 700; cursor: pointer; }
.vcg-keuze__knop:hover { background: var(--vcg-blue); }
.vcg-profiel .acf-field-true-false .message { font-size: 18px; font-weight: 700; }
.vcg-meer { margin-top: 6px; }
.vcg-meer summary { color: var(--vcg-navy); font-weight: 700; text-decoration: underline; cursor: pointer; }
.vcg-meer p { margin: 8px 0 0; }
/* Download button (vcg/download, Wespennest and club documents): output of a server-rendered block. */
.vcg-download { margin: 0; }
.vcg-download__knop { display: inline-flex; align-items: center; min-height: 48px; padding: 12px 24px; border-radius: var(--vcg-radius-sm); background: var(--vcg-navy); color: #FFFFFF; font-weight: 700; text-decoration: none; }
.vcg-download__knop:hover, .vcg-download__knop:focus-visible { background: var(--vcg-blue); color: #FFFFFF; }
/* In memoriam: black and white, no contact. */
.vcg-lid--overleden { filter: grayscale(1); }
.vcg-lid--overleden .vcg-lid-bericht { display: none; }

/* Credit (mr10 badge, as in the specification). */
.mr10-badge{display:inline-flex;align-items:center;gap:.5em;color:inherit;font:inherit;letter-spacing:inherit;text-transform:inherit;text-decoration:none;opacity:.8;transition:opacity .2s}
.mr10-badge:hover,.mr10-badge:focus-visible{opacity:1}
.mr10-badge__logo{display:block;flex:none;height:1.35em;width:auto}
.mr10-badge__sep{margin:0 .9em;opacity:.5}
@media (prefers-reduced-motion:reduce){.mr10-badge{transition:none}}
.mr10-badge:focus-visible{outline:2px solid currentColor;outline-offset:3px}
.ct-footer .vcg-footer-legal { margin: 0; font-size: inherit; line-height: 1.5; display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; }
@media (max-width: 999.98px) { .ct-footer .vcg-footer-legal { justify-content: flex-start; } }
.ct-footer .vcg-footer-legal > .mr10-badge__sep:first-child { display: none; } /* no Privacy link yet */
@media (max-width: 689.98px) {
	.ct-footer [data-row="bottom"] [data-column="widget-area-4"] { --text-horizontal-alignment: left; --horizontal-alignment: flex-start; }
	.vcg-footer-legal .mr10-badge__sep { display: none; }
}

/* Members/visitors visibility (vcg-core/zichtbaarheid.php): label in the editor only; the front end drops the block. */
.editor-styles-wrapper .vcg-alleen-leden, .editor-styles-wrapper .vcg-alleen-bezoekers { position: relative; outline: 2px dashed #6E5620; outline-offset: -2px; }
.editor-styles-wrapper .vcg-alleen-leden::before, .editor-styles-wrapper .vcg-alleen-bezoekers::before { position: absolute; top: 0; right: 0; z-index: 5; padding: 2px 8px; background: #6E5620; color: #FFFFFF; font: 700 13px/1.4 sans-serif; content: "Alleen leden"; }
.editor-styles-wrapper .vcg-alleen-bezoekers::before { content: "Alleen bezoekers"; }

/* Card row whose buttons line up at the bottom (class on the "Kaarten" row, e.g. members' welcome on the home). */
.vcg-kaarten--knop-onder [class*="gspb_row__col--"] { display: flex; flex-direction: column; }
.vcg-kaarten--knop-onder [class*="gspb_row__col--"] > :last-child { margin-top: auto; }
.vcg-kaarten--knop-onder .ct-query-template-grid > * { display: flex; flex-direction: column; }

/* Members' welcome on the home: two buttons with an icon (Mijn profiel, Verenigingsstukken) in the 4th column. */
.vcg-ledenknoppen { display: flex; flex-direction: column; gap: 16px; align-items: stretch; }
.vcg-ledenknoppen .gspb-buttonbox { width: 100%; justify-content: flex-start; }
.vcg-kaarten--knop-onder [class*="gspb_row__col--"] > .vcg-ledenknoppen { margin-top: 0; }
.vcg-geen-rit { margin: 0; }
.vcg-facts__afgeleid { font-style: italic; }

/* Row of buttons in a page head (Leden): wraps, with space between the buttons. */
.vcg-knoppenrij { display: flex; flex-flow: row wrap; gap: 12px 16px; align-items: center; }
.vcg-knoppenrij > * { margin: 0; }

/* In-page menu of the members' section (vcg/ledenmenu): text links in the heading font, current page underlined. */
.vcg-ledenmenu { margin-top: 24px; }
.vcg-ledenmenu__lijst { display: flex; flex-wrap: wrap; gap: 8px 28px; margin: 0; padding: 0; list-style: none; }
.vcg-ledenmenu__link { display: inline-block; padding: 6px 0; font-family: var(--vcg-font-head); font-size: 20px; font-weight: 700; color: var(--vcg-navy); text-decoration: none; text-underline-offset: 8px; text-decoration-thickness: 3px; }
.vcg-ledenmenu__link:hover, .vcg-ledenmenu__link:focus-visible { color: var(--vcg-blue); text-decoration-line: underline; text-decoration-thickness: 2px; }
/* Current page: navy underline (gold is too faint on the beige page head for a state indicator). */
.vcg-ledenmenu__link.is-actief { text-decoration-line: underline; text-decoration-color: var(--vcg-navy); }
