/* ==========================================================================
   Phase 1 improvements — Peaceful Dragon School
   Loaded after the parent/child theme styles.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Item 1: Mobile & tablet navigation
   -------------------------------------------------------------------------- */

/* Header sits above the donate/alert banner so nothing can cover the menu button */
.pds-alerts-container { position: relative; z-index: 1; }
#header-wrapper { position: relative; z-index: 20; }
#header { position: relative; }

.pds-nav-toggle {
	display: none;
	-webkit-appearance: none;
	appearance: none;
	cursor: pointer;
	font: inherit;
}

@media only screen and (max-width: 767px) {
	.pds-nav-toggle {
		display: inline-flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
		position: absolute;
		top: 0;
		right: 12px;
		z-index: 1001;
		min-width: 56px;
		min-height: 56px;            /* well above the 44px minimum tap target */
		padding: 6px 8px 4px;
		margin: 0;
		border: 0;
		border-radius: 6px;
		background: #f36557;
		color: #1a212c;               /* 4.8:1 on coral */
		line-height: 1;
		box-shadow: 0 1px 3px rgba(0, 0, 0, .35);
		touch-action: manipulation;
	}
	.pds-nav-toggle svg { display: block; width: 28px; height: 28px; }
	.pds-nav-toggle__label {
		display: block;
		margin-top: 2px;
		font-size: 12px;
		font-weight: 700;
		letter-spacing: .04em;
		text-transform: uppercase;
	}
	.pds-nav-toggle:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }

	/* Leave room so the logo/header contact never sit under the button */
	#header #logo { max-width: calc(100% - 80px); }
	.header-contact { clear: both; float: none; text-align: left; padding: 0; margin: 1em 0 0; }

	/* Donate bar: keep the button in normal flow instead of absolutely positioned */
	.pds-alerts-container .pds-alert.inset-banner .pds-alert-content { padding: .75em 1em; overflow: hidden; }
	.pds-alerts-container .pds-alert.inset-banner .pds-alert-button,
	.pds-alert.inset-banner .pds-alert-button {
		position: static !important;
		transform: none !important;
		display: inline-block;
		width: auto;
		min-height: 44px;
		line-height: 44px;
		padding: 0 1em;
		margin: .5em 0 0;
	}

	/* Off-canvas menu: readable colours (were ~2.5:1) and comfortable tap targets */
	#navigation { background: #2b313b; box-shadow: inset -1.618em 0 1.618em -1em #1a1f27; }
	#navigation ul.nav li a {
		color: #f5f5f4;
		text-shadow: none;
		min-height: 44px;
		padding-top: .75em;
		padding-bottom: .75em;
		border-top-color: #3a414d;
		border-bottom-color: #1f242c;
	}
	#navigation ul.nav ul li a { color: #e6e7e9; }
	#navigation ul.nav li.current-menu-item > a { color: #fff; background: #3a414d; }
	#navigation .nav-heading {
		margin: 0;
		padding: .382em 1em;
		font-size: .857em;
		text-transform: uppercase;
		color: #fff;
		background: #4a515c;
	}
	#navigation .nav-close,
	#navigation .nav-home { min-width: 44px; min-height: 44px; }
}

/* Old FontAwesome-4 font glyphs never load; replace them with plain characters */
#navigation .nav-close:after,
#navigation .nav-home:after {
	font-family: inherit !important;
	color: #fff !important;
	width: 44px !important;
	height: 44px !important;
	line-height: 44px !important;
	font-size: 1.4em !important;
}
#navigation .nav-close:after { content: "\2715" !important; }   /* ✕ */
#navigation .nav-home:after { content: "\2302" !important; }    /* ⌂ */
#navigation ul.nav li.current-menu-item > a:after { font-family: inherit !important; content: "\203A" !important; }
@media only screen and (min-width: 768px) {
	#navigation .nav-heading { display: none; }
	#navigation ul.nav > li.parent > a:after { font-family: inherit !important; content: "\25BE" !important; text-align: center; }

	/* Desktop dropdowns: solid dark panel, light text (item 7) */
	#navigation ul.nav ul li { background: #181c23; }
	#navigation ul.nav li ul a,
	#navigation ul.nav li ul ul li a { color: #f5f5f4 !important; }
	#navigation ul.nav li ul a:hover,
	#navigation ul.nav li ul a:focus { color: #fff !important; text-decoration: underline; }
	#navigation ul.nav > li > a { color: #e6e7e9; }
	/* Keyboard users can open dropdowns too */
	ul.nav li:focus-within > ul { visibility: visible; opacity: 1; }
}

/* Header phone (was an <h4>) */
.header-contact .header-phone { margin: 0; font-size: 1.2em; font-weight: 700; }
.header-contact .header-phone a,
.header-contact address { color: #fff; }

/* Site title/tagline are now <p> instead of <h1>/<h2>; keep them hidden as before */
#header .site-header .site-title,
#header .site-header .site-description { display: none; }

/* --------------------------------------------------------------------------
   Item 4: Footer widgets (Calendar / Events / Cart) no longer overlap
   -------------------------------------------------------------------------- */
#footer-widgets { color: #d0d3d8; }
#footer-widgets a { color: #fbb4ad; }
#footer-widgets a:hover, #footer-widgets a:focus { color: #fff; }
#footer-widgets .wrapper .block { min-width: 0; overflow-wrap: anywhere; }
#footer-widgets table { width: 100%; max-width: 100%; table-layout: fixed; border-collapse: collapse; }
#footer-widgets table td,
#footer-widgets table th { padding: .3em .1em; text-align: center; word-wrap: break-word; }

@media only screen and (min-width: 768px) {
	#footer-widgets .wrapper.fix {
		display: grid;
		grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
		gap: 2.5em;
		align-items: start;
	}
	#footer-widgets .wrapper.fix:before,
	#footer-widgets .wrapper.fix:after { display: none !important; content: none !important; }
	#footer-widgets .wrapper .block {
		float: none !important;
		display: block !important;
		width: auto !important;
		margin: 0 !important;
	}
}
@media only screen and (max-width: 767px) {
	#footer-widgets .wrapper .block { float: none; width: 100%; margin: 0 0 2em; }
}

/* --------------------------------------------------------------------------
   Item 6: Footer contact details
   -------------------------------------------------------------------------- */
.pds-footer-contact {
	text-align: center;
	color: #e6e7e9;
	margin: 0 auto 1.618em;
	line-height: 1.7;
}
.pds-footer-contact p { margin: 0 0 .4em; text-align: center; }
.pds-footer-contact__name { font-weight: 700; color: #fff; }
.pds-footer-contact address { font-style: normal; margin: 0 0 .4em; }
.pds-footer-contact a { color: #fbb4ad; text-decoration: underline; }
.pds-footer-contact a:hover, .pds-footer-contact a:focus { color: #fff; }
#footer #copyright, #footer #copyright p { color: #c3c6cb; }

/* --------------------------------------------------------------------------
   Item 5: Heading structure — keep the original look after re-levelling
   -------------------------------------------------------------------------- */
.pds-h1-style { font-size: 2.244em; line-height: 1.387em; margin: 0 0 .327em; }
.home-section header.section-title h2 {
	font-size: 1.618em;
	text-transform: uppercase;
	font-weight: 700;
	margin: 0 0 .327em;
}
#testimonials header h2 { color: #fff; }
#intro-message h1 {
	font-size: 7em;
	font-family: P22DaVinciForward, 'Cabin', sans-serif;
	font-weight: normal;
	line-height: 1.1em;
	margin: 0;
	color: #fff;
}
@media only screen and (max-width: 400px) {
	#intro-message h1 { font-size: 4em; }
}

/* --------------------------------------------------------------------------
   Item 7: Text contrast (WCAG 2.1 AA, 4.5:1 for body text)
   -------------------------------------------------------------------------- */
body { color: #55595f; }                         /* was #84878c (3.6:1) → 7:1 */
a { color: #b8382b; }                            /* was #f36557 (2.9:1) → 5.8:1 on white */
a:hover, a:focus { color: #8e2a20; }
#header a, #footer a, #footer-widgets a, #intro-message a.button, .pds-alert a { color: inherit; }
#header .header-contact a { color: #fff; }
.home-section header.section-title .heading { color: #6b6e73; }   /* was #b9babd */
#testimonials .home-section header.section-title .heading,
#testimonials header.section-title .heading { color: #f5f5f4; }

/* Coral buttons with white text were ~2.9:1 — use dark text on coral (4.8:1) */
.wp-block-button__link[style*="f36557"],
.wp-block-button__link.has-background[style*="#f36557"],
a.button, .button, input[type="submit"], button.button,
.woo-sc-button {
	color: #1a212c !important;
}
.wp-block-button__link:hover, .wp-block-button__link:focus { text-decoration: underline; }

/* Visible keyboard focus everywhere */
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
	outline: 3px solid #1a5fb4;
	outline-offset: 2px;
}

/* --------------------------------------------------------------------------
   Item 2: Responsive class schedule on Ongoing Classes
   -------------------------------------------------------------------------- */
.pds-schedule { margin: 0 0 2em; }
.pds-schedule table { width: 100%; border-collapse: collapse; font-size: 1em; }
.pds-schedule caption { text-align: left; font-weight: 700; margin-bottom: .5em; color: #1a212c; }
.pds-schedule th,
.pds-schedule td { border: 1px solid #d5d7da; padding: .6em .75em; text-align: left; vertical-align: top; color: #33373d; }
.pds-schedule thead th { background: #222832; color: #fff; }
.pds-schedule tbody th { background: #f5f5f4; color: #1a212c; }
.pds-schedule td a { font-weight: 700; }

@media only screen and (max-width: 640px) {
	.pds-schedule table, .pds-schedule tbody, .pds-schedule tr, .pds-schedule th, .pds-schedule td { display: block; width: 100%; box-sizing: border-box; }
	.pds-schedule thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
	.pds-schedule tr { margin: 0 0 1em; border: 1px solid #d5d7da; }
	.pds-schedule tbody th { border: 0; border-bottom: 1px solid #d5d7da; }
	.pds-schedule td { border: 0; padding: .35em .75em; }
	.pds-schedule td:before { content: attr(data-label) ": "; font-weight: 700; color: #1a212c; }
}
