/*
Theme Name: Fusion Taekwondo
Description: Licence-free block theme for fusiontkd.com, built on Twenty Twenty-Four.
             No subscription, no licence key, no renewal date.
Template: twentytwentyfour
Version: 0.1.0
Requires at least: 6.6
Tested up to: 7.1
Requires PHP: 7.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: fusion-block
*/

/* --- Safety rules. These stop a fixed pixel width set in the editor from
       overflowing a phone screen, which Divi's layout did routinely. --- */

.wp-block-image img {
	max-width: 100%;
	height: auto;
}

.wp-block-table {
	overflow-x: auto;
}

.wp-block-details summary {
	cursor: pointer;
}

.wp-block-details summary:focus-visible {
	outline: 2px solid var(--wp--preset--color--accent);
	outline-offset: 2px;
}

/* --- Gallery: stop an incomplete final row stretching to fill the width.
       WordPress sets flex-grow:1 on gallery images, so a 13th photo in a
       4-column grid blows up to four times the size of its neighbours.
       The extra class and :not(#individual-image) match core's own
       specificity so this reliably wins. --- */

.wp-block-gallery.has-nested-images.is-cropped figure.wp-block-image:not(#individual-image) {
	flex-grow: 0;
}

/* --- Browser surfaces. Selection, focus rings and underline offset ship with
       defaults that belong to no design system. Theming them from the palette
       is the cheapest signal that a page was built rather than assembled. --- */

::selection {
	background-color: var(--wp--preset--color--accent);
	color: var(--wp--preset--color--base);
}

:where(a, button, summary, input, [tabindex]):focus-visible {
	outline: 2px solid var(--wp--preset--color--accent);
	outline-offset: 3px;
	border-radius: 2px;
}

a {
	text-underline-offset: 0.18em;
	text-decoration-thickness: 1px;
}

/* --- The contact bar adds height, so give the logo back room on small
       screens rather than pushing content further down the fold. --- */

@media (max-width: 599px) {
	.wp-block-site-logo img {
		width: 124px;
	}
}

/* --- Active navigation state. Divi marked the current page in red; the block
       nav ships no visual active state at all, so the visitor never knows
       where they are. WordPress sets aria-current once the links reference
       real pages rather than raw URLs. --- */

.wp-block-navigation .wp-block-navigation-item__content[aria-current="page"] {
	color: var(--wp--preset--color--red);
	text-decoration: underline;
	text-decoration-thickness: 2px;
	text-underline-offset: 0.32em;
}

/* --- Touch targets. The block navigation ships a 24x24 hamburger and 24px
       overlay links; WCAG 2.5.5 wants 44x44. Inline links inside prose are
       exempt under 2.5.8 and are deliberately left alone so body text keeps
       its rhythm. --- */

.wp-block-navigation__responsive-container-open,
.wp-block-navigation__responsive-container-close {
	min-width: 44px;
	min-height: 44px;
	padding: 10px;
}

.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item__content {
	display: block;
	/* Core hardcodes padding:0 on overlay links, so this override needs the
	   weight. Without it the links stay 24px tall against a 44px floor. */
	padding-block: 11px !important;
}

/* is-style-outline resets the button padding set in theme.json to 8.6px,
   leaving outline buttons 43px. A min-height holds the floor whichever
   padding wins. */
.wp-block-button__link {
	min-height: 44px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

.wp-block-details summary {
	padding-block: 9px;
}

/* --- Testimonial cards were bottom-ragged: the three name/role blocks sat at
       different heights because the quotes differ in length. Push the
       attribution to a common baseline. --- */

.wp-block-columns .wp-block-column.has-border-color {
	display: flex;
	flex-direction: column;
}

.wp-block-columns .wp-block-column.has-border-color > p:nth-last-child(2) {
	margin-top: auto;
}

/* --- The Fighter's Checklist is used away from a desk at 6am. Make it
       print cleanly instead of carrying site chrome onto paper. --- */

@media print {
	header,
	footer,
	#wpadminbar,
	.wp-block-navigation {
		display: none !important;
	}

	body {
		font-size: 11pt;
		color: #000;
	}

	a::after {
		content: " (" attr(href) ")";
		font-size: 9pt;
		word-break: break-all;
	}

	a[href^="/"]::after,
	a[href^="#"]::after {
		content: "";
	}

	.wp-block-details > *:not(summary) {
		display: block !important;
	}

	details:not([open]) > *:not(summary) {
		display: block !important;
	}
}

/* Contact page: live Google map. aspect-ratio keeps it responsive with no fixed
   height, so the frame never letterboxes or overflows on a phone. */
.fusion-map {
	position: relative;
	aspect-ratio: 16 / 11;
	border: 1px solid var(--wp--preset--color--hairline);
	border-radius: 4px;
	overflow: hidden;
	background-color: var(--wp--preset--color--shade);
}

.fusion-map iframe {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
	display: block;
}

@media (max-width: 781px) {
	.fusion-map { aspect-ratio: 4 / 3; }
}

@media print {
	.fusion-map { display: none; }
}

/* Social icons: core ships 36px, below the 44px touch floor the rest of the
   site holds to. */
.wp-block-social-links .wp-block-social-link {
	width: 44px;
	height: 44px;
}

.wp-block-social-links .wp-block-social-link-anchor {
	width: 100%;
	height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
}

/* Logos-only icons (the dark footer) keep the 44px touch box but sit flush left,
   so the glyph lines up with the text above it instead of looking indented. */
.wp-block-social-links.is-style-logos-only .wp-block-social-link-anchor {
	justify-content: flex-start;
}
