/* Karate-Do London — small additions to theme.json */

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

:where(body) { -webkit-font-smoothing: antialiased; }

/* Header */
.kdl-header { border-bottom: 1px solid var(--wp--preset--color--line); }
.kdl-header .wp-block-site-logo img,
.kdl-header .kdl-logo img { width: 64px; height: auto; }
.kdl-header .wp-block-navigation__responsive-container.is-menu-open { padding: 1.5rem; }
@media (max-width: 781px) {
	.kdl-header .kdl-header-cta { display: none; }
}

/* Eyebrow heading: small red label above section titles */
.is-style-eyebrow {
	font-size: 0.9375rem !important;
	letter-spacing: 0.14em !important;
	color: var(--wp--preset--color--accent);
	display: flex;
	align-items: center;
	gap: 0.6em;
}
.is-style-eyebrow::before {
	content: "";
	width: 0.7em;
	height: 0.7em;
	border-radius: 50%;
	background: var(--wp--preset--color--accent);
	flex: none;
}
.has-text-align-center.is-style-eyebrow { justify-content: center; }
.has-ink-background-color .is-style-eyebrow,
.has-ink-soft-background-color .is-style-eyebrow,
.wp-block-cover .is-style-eyebrow { color: #fff; }

/* Hero */
.kdl-hero.wp-block-cover { min-height: min(86vh, 760px); }
.kdl-hero .wp-block-cover__background { background: linear-gradient(90deg, rgba(14,26,43,.92) 0%, rgba(14,26,43,.72) 45%, rgba(14,26,43,.15) 100%) !important; opacity: 1 !important; }
@media (max-width: 781px) {
	.kdl-hero.wp-block-cover { min-height: 78vh; align-items: flex-end; }
	.kdl-hero .wp-block-cover__background { background: linear-gradient(0deg, rgba(14,26,43,.95) 0%, rgba(14,26,43,.75) 55%, rgba(14,26,43,.2) 100%) !important; }
}
.kdl-hero h1 { text-wrap: balance; }

/* Trust strip */
.kdl-trust p { margin: 0; }
.kdl-trust strong { font-family: var(--wp--preset--font-family--heading); font-weight: 400; text-transform: uppercase; letter-spacing: .03em; font-size: 1.25rem; display: block; color: var(--wp--preset--color--ink); }

/* Cards */
.is-style-card {
	background: var(--wp--preset--color--white);
	border-radius: 8px;
	box-shadow: var(--wp--preset--shadow--card);
	overflow: hidden;
	height: 100%;
}
.is-style-card > .wp-block-image { margin: 0; }
.is-style-card > .wp-block-image img { border-radius: 0; aspect-ratio: 4 / 3; object-fit: cover; width: 100%; }
.is-style-card > :not(.wp-block-image):not(.wp-block-post-featured-image) { padding-left: 1.5rem; padding-right: 1.5rem; }
.is-style-card > .wp-block-post-featured-image:first-child { margin-top: 0; }
.is-style-card > :last-child { padding-bottom: 1.5rem; }
.wp-block-columns.kdl-cards > .wp-block-column { display: flex; }
.wp-block-columns.kdl-cards > .wp-block-column > .is-style-card { width: 100%; }

/* Timetable */
.wp-block-table.is-style-timetable table { border-collapse: collapse; width: 100%; background: var(--wp--preset--color--white); border-radius: 8px; overflow: hidden; box-shadow: var(--wp--preset--shadow--card); }
.wp-block-table.is-style-timetable th,
.wp-block-table.is-style-timetable td { border: 0; border-bottom: 1px solid var(--wp--preset--color--line); padding: 1rem 1.25rem; text-align: left; vertical-align: top; }
.wp-block-table.is-style-timetable thead th { background: var(--wp--preset--color--brand-dark); color: #fff; font-family: var(--wp--preset--font-family--heading); font-weight: 500; text-transform: uppercase; letter-spacing: .05em; font-size: .9375rem; }
.wp-block-table.is-style-timetable thead { border: 0; }
.wp-block-table.is-style-timetable td:first-child { font-family: var(--wp--preset--font-family--heading); font-weight: 400; text-transform: uppercase; white-space: nowrap; }
.wp-block-table.is-style-timetable tr:last-child td { border-bottom: 0; }
@media (max-width: 640px) {
	.wp-block-table.is-style-timetable thead { display: none; }
	.wp-block-table.is-style-timetable tr { display: block; padding: .9rem 1.1rem; border-bottom: 1px solid var(--wp--preset--color--line); }
	.wp-block-table.is-style-timetable td { display: block; border: 0; padding: .1rem 0; }
	.wp-block-table.is-style-timetable td:first-child { color: var(--wp--preset--color--accent); }
}

/* Quote band */
.kdl-quote .wp-block-quote { margin: 0; padding: 0; }
.kdl-quote .wp-block-quote cite { font-family: var(--wp--preset--font-family--body); text-transform: none; font-size: 1rem; letter-spacing: 0; opacity: .8; font-style: normal; }

/* Gallery */
.wp-block-gallery.has-nested-images figure.wp-block-image img { border-radius: 6px; }

/* Patron logos */
.kdl-patrons img { max-height: 110px; width: auto !important; object-fit: contain; }

/* Contact form 7 */
.wpcf7 input[type="text"],
.wpcf7 input[type="email"],
.wpcf7 input[type="tel"],
.wpcf7 textarea {
	width: 100%;
	font: inherit;
	padding: .8rem 1rem;
	border: 1px solid var(--wp--preset--color--line);
	border-radius: 4px;
	background: #fff;
	color: var(--wp--preset--color--ink);
	margin-bottom: .9rem;
	box-sizing: border-box;
}
.wpcf7 textarea { min-height: 140px; }
.wpcf7 input:focus, .wpcf7 textarea:focus { outline: 2px solid var(--wp--preset--color--brand); outline-offset: 1px; }
.wpcf7 input[type="submit"] {
	background: var(--wp--preset--color--accent);
	color: #fff;
	border: 0;
	border-radius: 4px;
	padding: .85em 1.8em;
	font-family: var(--wp--preset--font-family--heading);
	font-size: 1.0625rem;
	text-transform: uppercase;
	letter-spacing: .04em;
	cursor: pointer;
	margin-top: .75rem;
}
.wpcf7 input[type="submit"]:hover { background: #A50D26; }
.wpcf7 .wpcf7-acceptance { font-size: .9375rem; }
.has-ink-background-color .wpcf7 .wpcf7-acceptance,
.has-ink-background-color .wpcf7-response-output { color: #fff; }

/* Footer */
.kdl-footer a { color: #fff; text-decoration: none; }
.kdl-footer a:hover { text-decoration: underline; color: #fff; }
.kdl-footer .kdl-logo img { width: 110px; height: auto; }
/* Footer: logo beside the club description, top-aligned with its first line */
.kdl-footer-brand > .kdl-logo { flex: none; margin: .3rem 0 0; }
.kdl-footer-brand > .wp-block-group { flex: 1 1 auto; min-width: 0; }
.kdl-footer-brand .wp-block-social-links { margin-top: .9rem; }
@media (max-width: 600px) { .kdl-footer .kdl-logo img { width: 88px !important; } }
@media (max-width: 781px) { .kdl-footer .wp-block-columns { row-gap: 2.25rem; } }
/* Long email addresses wrap instead of being cut off */
.kdl-footer a[href^="mailto:"] { overflow-wrap: anywhere; }
.kdl-footer p { margin: 0 0 .35rem; }

@media (max-width: 600px) {
	.wp-block-columns.is-not-stacked-on-mobile.kdl-trust-cols { flex-wrap: wrap !important; row-gap: 1rem; }
	.wp-block-columns.is-not-stacked-on-mobile.kdl-trust-cols > .wp-block-column { flex-basis: calc(50% - .5rem) !important; flex-grow: 0 !important; }
}

.kdl-form-card { border-radius: 8px; box-shadow: var(--wp--preset--shadow--card); scroll-margin-top: 2rem; }

/* Full-width sections sit flush against each other and the header/footer */
.wp-site-blocks > * + * { margin-block-start: 0; }
.wp-block-post-content > .alignfull + .alignfull,
.wp-block-post-content > .alignfull:first-child { margin-block-start: 0; }
.wp-block-post-content > .alignfull:last-child { margin-block-end: 0; }
.kdl-quote.wp-block-cover { min-height: 0; }
main:has(> .wp-block-post-content > .alignfull:last-child) { padding-bottom: 0 !important; }

/* Lightbox: dark backdrop so photos stand out */
.wp-lightbox-overlay .scrim { background-color: rgba(255, 255, 255, .97) !important; }
.wp-lightbox-overlay .wp-lightbox-close-button,
.wp-lightbox-overlay .wp-lightbox-navigation-button { color: var(--wp--preset--color--ink) !important; fill: var(--wp--preset--color--ink) !important; }
.wp-lightbox-overlay button svg { fill: currentColor; }

/* Fixed-background covers: desktop only. Touch devices handle fixed backgrounds
   badly, and people who prefer reduced motion get a normal scrolling image. */
@media (prefers-reduced-motion: reduce), (hover: none), (pointer: coarse) {
	.wp-block-cover.has-parallax,
	.wp-block-cover__image-background.has-parallax { background-attachment: scroll !important; }
}

/* News */
.kdl-news-card .wp-block-post-featured-image { margin: 0; }
.kdl-news-card .wp-block-post-featured-image img { border-radius: 0; }
.kdl-news-card .wp-block-post-date { margin-top: 1.25rem; }
.kdl-news-card .wp-block-post-title a { text-decoration: none; }
.kdl-news-card .wp-block-post-title a:hover { text-decoration: underline; }
.kdl-news-card .wp-block-post-excerpt__more-link { font-weight: 600; }
/* Homepage "Latest news" stays hidden until there is at least one post */
.kdl-latest:not(:has(.wp-block-post)) { display: none; }
.wp-block-post-navigation-link { max-width: 48%; }
.wp-block-post-navigation-link .post-navigation-link__label { display: block; font-size: .875rem; text-transform: uppercase; letter-spacing: .06em; color: var(--wp--preset--color--muted); }

/* Bright split hero */
.kdl-hero-split { min-height: min(80vh, 680px); }
.kdl-hero-split .wp-block-media-text__content { padding: var(--wp--preset--spacing--60) clamp(1rem, 5vw, 4rem) var(--wp--preset--spacing--60) max(clamp(1rem, 4vw, 2rem), calc((100vw - 1200px) / 2)); }
.kdl-hero-split h1 { text-wrap: balance; }
@media (max-width: 600px) {
	.kdl-hero-split { min-height: 0; }
	.kdl-hero-split .wp-block-media-text__media { min-height: 260px; }
	.kdl-hero-split .wp-block-media-text__content { padding: 2rem 1rem 2.5rem; }
}
.kdl-patrons { border-top: 1px solid var(--wp--preset--color--line); }
.kdl-footer .wp-block-separator { opacity: 1; }

/* The Events Calendar: brand colours and fonts (set on body so they win over the calendar's own :root values) */
body {
	--tec-color-accent-primary: var(--wp--preset--color--brand-dark);
	--tec-color-accent-primary-hover: #005A8C;
	--tec-color-accent-primary-active: #005A8C;
	--tec-color-accent-primary-background: var(--wp--preset--color--sky);
	--tec-color-accent-secondary: var(--wp--preset--color--accent);
	--tec-color-link-accent: var(--wp--preset--color--brand-dark);
	--tec-color-button-primary: var(--wp--preset--color--accent);
	--tec-color-button-primary-hover: #A50D26;
	--tec-color-button-primary-active: #A50D26;
	--tec-color-background-events-bar-submit-button: var(--wp--preset--color--accent);
	--tec-color-background-events-bar-submit-button-hover: #A50D26;
	--tec-color-background-events-bar-submit-button-active: #A50D26;
	--tec-color-text-primary: var(--wp--preset--color--ink);
	--tec-font-family-sans-serif: var(--wp--preset--font-family--body);
	--tec-font-family-base: var(--wp--preset--font-family--body);
	--tec-border-radius-default: 4px;
}
.tribe-common .tribe-common-h1, .tribe-common .tribe-common-h2, .tribe-common .tribe-common-h3,
.tribe-common .tribe-common-h4, .tribe-common .tribe-common-h5, .tribe-common .tribe-common-h6,
.tribe-events-single-event-title, .tribe-events .tribe-events-calendar-list__event-title {
	font-family: var(--wp--preset--font-family--heading) !important;
	font-weight: 400 !important;
	text-transform: uppercase;
	letter-spacing: .01em;
}
.tribe-events .tribe-events-c-search__button,
.tribe-common .tribe-common-c-btn { font-family: var(--wp--preset--font-family--heading); text-transform: uppercase; letter-spacing: .04em; }
.kdl-events-intro { padding: var(--wp--preset--spacing--50) 0 var(--wp--preset--spacing--40); margin-bottom: 1rem; }
.kdl-events-intro h1 { margin: 0 0 .5rem; }
.kdl-events-intro p { margin: 0; color: #4A5565; }
.tribe-events-c-subscribe-dropdown__container, .tribe-events-schedule { font-family: var(--wp--preset--font-family--body); }

/* Eight menu items: use the menu button below 1100px, not just on phones */
@media (min-width: 600px) and (max-width: 1239px) {
	.kdl-header .wp-block-navigation__responsive-container-open:not(.always-shown) { display: flex; }
	.kdl-header .wp-block-navigation__responsive-container:not(.hidden-by-default):not(.is-menu-open) { display: none; }
	.kdl-header .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-close { display: flex; }
	.kdl-header .wp-block-navigation__responsive-container.is-menu-open { display: flex; position: fixed; inset: 0; padding: 1.5rem; z-index: 100000; }
	.kdl-header .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__container { flex-direction: column; align-items: flex-start; gap: 1.25rem; }
}

/* Open menu overlay (phones and the 600–1100px range) */
.kdl-header .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content { align-items: flex-start !important; padding: 3.5rem 1.5rem 2rem; }
.kdl-header .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__container { align-items: flex-start !important; gap: 1.25rem; font-size: 1.375rem; }

/* Homepage "Upcoming events": hidden until there is at least one event */
.kdl-upcoming:not(:has(.kdl-event-card)) { display: none; }
.kdl-upcoming .kdl-events-grid { max-width: var(--wp--style--global--wide-size) !important; margin-inline: auto !important; }
.kdl-events-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr)); gap: var(--wp--preset--spacing--40); }
.kdl-event-card { display: flex; flex-direction: column; }
.kdl-event-card__image img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 0; }
.is-style-card.kdl-event-card > .kdl-event-card__image { padding: 0; }
.kdl-event-card__body { display: flex; gap: 1rem; align-items: flex-start; padding: 1.25rem 1.5rem 1.5rem !important; }
.kdl-event-card__date { flex: none; width: 3.5rem; text-align: center; border-radius: 6px; background: var(--wp--preset--color--sky); padding: .4rem 0 .35rem; line-height: 1; }
.kdl-event-card__day { display: block; font-family: var(--wp--preset--font-family--heading); font-size: 1.75rem; font-weight: 500; color: var(--wp--preset--color--accent); }
.kdl-event-card__month { display: block; font-size: .8125rem; text-transform: uppercase; letter-spacing: .08em; color: var(--wp--preset--color--ink); margin-top: .2rem; }
.kdl-event-card__title { margin: 0 0 .35rem; font-size: var(--wp--preset--font-size--large); }
.kdl-event-card__title a { color: var(--wp--preset--color--ink); text-decoration: none; }
.kdl-event-card__title a:hover { text-decoration: underline; }
.kdl-event-card__meta { margin: 0; font-size: var(--wp--preset--font-size--small); color: var(--wp--preset--color--muted); }
.wp-block-table.is-style-timetable td:nth-child(2) { white-space: nowrap; }

/* Footer training times: one line per class */
.kdl-footer-times { font-size: .96875rem; }
.kdl-footer-times .kdl-nowrap { white-space: nowrap; }
@media (max-width: 370px) { .kdl-footer-times .kdl-nowrap { white-space: normal; } }
/* Tablets: logo + description on their own row, times and contact side by side */
@media (min-width: 782px) and (max-width: 1060px) {
	.kdl-footer .wp-block-columns { flex-wrap: wrap !important; row-gap: 2.25rem; }
	.kdl-footer .wp-block-columns > .wp-block-column:first-child { flex-basis: 100% !important; }
	.kdl-footer .wp-block-columns > .wp-block-column:not(:first-child) { flex-basis: calc(50% - 2rem) !important; flex-grow: 1; }
	.kdl-footer-brand > .wp-block-group { max-width: 34rem; }
}
/* The calendar's grid gutters can poke a couple of pixels past narrow screens */
.tribe-common.tribe-events { overflow-x: clip; }
/* Header tagline stays on one line on phones */
@media (max-width: 600px) {
	.kdl-header .wp-block-site-title + p { font-size: .6875rem !important; letter-spacing: .03em !important; white-space: nowrap; }
}

/* Sticky header: large logo at the top of the page, compact bar once scrolled */
.wp-site-blocks > header.wp-block-template-part {
	position: sticky;
	top: var(--wp-admin--admin-bar--height, 0px);
	z-index: 1000;
}
@media (max-width: 600px) {
	.wp-site-blocks > header.wp-block-template-part { top: 0; } /* the admin bar scrolls away on phones */
}
.kdl-header { transition: padding .25s ease, box-shadow .25s ease; }
.kdl-header .kdl-logo img { width: 130px !important; transition: width .25s ease; }
.kdl-header.is-scrolled { padding-top: .4rem !important; padding-bottom: .4rem !important; box-shadow: 0 2px 14px rgba(14, 26, 43, .12); }
.kdl-header.is-scrolled .kdl-logo img { width: 64px !important; }
@media (max-width: 600px) {
	.kdl-header .kdl-logo img { width: 76px !important; }
	.kdl-header.is-scrolled .kdl-logo img { width: 52px !important; }
}
@media (prefers-reduced-motion: reduce) {
	.kdl-header, .kdl-header .kdl-logo img { transition: none; }
}
/* In-page links (#timetable, #trial) stop below the sticky header */
[id] { scroll-margin-top: 110px; }
.kdl-header:not(.is-scrolled) { padding-top: .6rem !important; padding-bottom: .6rem !important; }

/* Header with the large logo: keep each item on one line */
.kdl-header .kdl-logo { flex: none; }
.kdl-header .wp-block-site-title + p { white-space: nowrap; }
.kdl-header .wp-block-navigation__container { flex-wrap: nowrap; gap: 1.15rem !important; }
.kdl-header .wp-block-navigation-item__content { white-space: nowrap; }
.kdl-header .kdl-header-cta .wp-block-button__link { white-space: nowrap; }
