/*
Theme Name: Norths Juniors
Theme URI: https://northsjuniors.com.au
Author: Norths Juniors Rugby League
Description: Lightweight custom block theme for Norths Juniors Rugby League Football Club (Bishop Park, Nundah). Edit everything from Appearance > Editor or the block editor.
Version: 1.3.5
Requires at least: 6.6
Requires PHP: 8.1
License: GPL-2.0-or-later
Text Domain: norths-juniors
*/

/* Small extras that theme.json can't express. Keep this file tiny. */
:where(.wp-site-blocks) *:focus-visible { outline: 3px solid var(--wp--preset--color--gold); outline-offset: 2px; }
.skip-link:focus { background: #fff; color: #000; }

.nj-header { position: sticky; top: 0; z-index: 50; box-shadow: 0 2px 10px rgba(0,0,0,.15); }
.nj-header .wp-block-site-logo img { height: auto; }
.nj-header .wp-block-navigation__responsive-container.is-menu-open { background: var(--wp--preset--color--navy) !important; color: #fff !important; padding: 2rem; }
.nj-header .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item__content { font-size: 1.4rem; }

.nj-hero { position: relative; }
.nj-hero h1, .nj-hero h2 { text-shadow: 0 2px 12px rgba(0,0,0,.45); }

.nj-card { transition: transform .15s ease, box-shadow .15s ease; height: 100%; }
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
	.nj-card:hover { transform: translateY(-3px); box-shadow: 0 10px 24px rgba(6,7,86,.15); }
}
.nj-card .wp-block-post-featured-image img { aspect-ratio: 16/10; object-fit: cover; }

.nj-stripe { height: 6px; background: linear-gradient(90deg, var(--wp--preset--color--sky) 0 50%, var(--wp--preset--color--gold) 50% 100%); }

/* Sponsor logo grid output by [norths_sponsors] */
.nj-sponsors {
	container: sponsors / inline-size;
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	align-items: stretch;
	--card-gap: 1.25rem;
	gap: var(--card-gap);
	list-style: none;
	margin: 0;
	padding: 0;
}
.nj-sponsors li {
	--columns: 2;
	box-sizing: border-box;
	flex: 0 0 calc((100% + var(--card-gap)) / var(--columns) - var(--card-gap));
	min-width: 0;
	min-height: calc(110px + 2rem);
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 1rem;
	border-radius: 10px;
	background: #fff;
	box-shadow: 0 1px 4px rgba(0,0,0,.08);
}
/* Keep full and partial rows on the same column widths in both page layouts. */
@container sponsors (max-width: 269px) { .nj-sponsors li { --columns: 1; } }
@container sponsors (min-width: 490px) { .nj-sponsors:not(.nj-sponsors--major) li { --columns: 3; } }
@container sponsors (min-width: 640px) { .nj-sponsors--major li { --columns: 3; } }
@container sponsors (min-width: 660px) { .nj-sponsors:not(.nj-sponsors--major) li { --columns: 4; } }
@container sponsors (min-width: 830px) { .nj-sponsors:not(.nj-sponsors--major) li { --columns: 5; } }
@container sponsors (min-width: 860px) { .nj-sponsors--major li { --columns: 4; } }
@container sponsors (min-width: 1000px) { .nj-sponsors:not(.nj-sponsors--major) li { --columns: 6; } }
@container sponsors (min-width: 1080px) { .nj-sponsors--major li { --columns: 5; } }
@container sponsors (min-width: 1170px) { .nj-sponsors:not(.nj-sponsors--major) li { --columns: 7; } }
.wp-block-heading + .nj-sponsors { margin-block-start: 1rem; }
.nj-sponsors + .wp-block-heading { margin-block-start: clamp(2rem, 4vw, 3rem); }
.nj-sponsors img { max-width: 100%; max-height: 90px; width: auto; height: auto; object-fit: contain; }
.nj-sponsors--major img { max-height: 120px; }
.nj-sponsors a { display: flex; align-items: center; justify-content: center; width: 100%; }
.nj-sponsors .nj-sponsor-name { font-weight: 700; text-align: center; color: var(--wp--preset--color--navy); }

/* Tables (fees, honour board) */
.wp-block-table table { border-collapse: collapse; width: 100%; }
.wp-block-table thead { background: var(--wp--preset--color--navy); color: #fff; }
.wp-block-table td, .wp-block-table th { border: 1px solid #d9e2ec; padding: .6em .8em; }
.wp-block-table.is-style-stripes tbody tr:nth-child(odd) { background: var(--wp--preset--color--mist); }

/* Contact Form 7 */
.wpcf7 input:not([type=submit]):not([type=checkbox]), .wpcf7 textarea, .wpcf7 select { width: 100%; padding: .7em .8em; border: 1px solid #b8c4d2; border-radius: 6px; font: inherit; }
.wpcf7 input[type=submit] { background: var(--wp--preset--color--gold); color: var(--wp--preset--color--navy); border: 0; padding: .7em 1.5em; border-radius: 6px; font-family: var(--wp--preset--font-family--heading); font-weight: 800; font-size: 1.15rem; letter-spacing: .03em; text-transform: uppercase; cursor: pointer; }
.wpcf7 input[type=submit]:hover { background: var(--wp--preset--color--sky); color: var(--wp--preset--color--navy); }

.nj-notice { border-left: 5px solid var(--wp--preset--color--gold); background: #fff8e6; padding: 1rem 1.25rem; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
.nj-header .wp-block-navigation a { text-decoration: none; }
.nj-header .wp-block-navigation a:hover { color: var(--wp--preset--color--sky); }
.nj-header .wp-block-navigation__submenu-container { background: #fff !important; color: var(--wp--preset--color--navy) !important; border: 0 !important; box-shadow: 0 6px 18px rgba(0,0,0,.15); }
@media (max-width: 599px) { .nj-header .wp-block-site-logo img { width: 96px !important; } .nj-header-cta .wp-block-button__link { font-size: 1rem; } }
.nj-header-cta .wp-block-button__link { white-space: nowrap; }
@media (min-width: 600px) and (max-width: 1180px) { .nj-header .wp-block-navigation { gap: 0.9rem !important; font-size: 0.9em; } }
.nj-footer .wp-block-site-logo { background: #fff; border-radius: 10px; padding: 8px; display: inline-block; }
.wp-site-blocks > main, .wp-site-blocks > footer, .wp-site-blocks > .wp-block-template-part { margin-block-start: 0; }
main > .wp-block-post-content > .alignfull:first-child { margin-block-start: 0; }
.wp-block-post-content > .alignfull + .alignfull { margin-block-start: 0; }
@media (max-width: 599px) { .nj-sponsors li { min-height: calc(90px + 1.2rem); padding: .6rem; } .nj-sponsors--major img { max-height: 80px; } }



/* Social links — gold top bar, home band, footer */
.nj-social-bar { font-size: 0.95rem; }
.nj-social-bar-label { margin: 0; }
.nj-social-bar .wp-block-social-links { margin: 0; }
.nj-social-bar .wp-block-social-link-anchor { padding: 0.2em !important; }
.nj-social-bar .wp-social-link svg { width: 1.35rem; height: 1.35rem; }
.nj-social-bar .wp-social-link,
.nj-follow-social .wp-social-link,
.nj-footer-social .wp-social-link { transition: transform .15s ease; }
.nj-social-bar .wp-social-link:hover,
.nj-follow-social .wp-social-link:hover,
.nj-footer-social .wp-social-link:hover { transform: translateY(-2px); }
.nj-follow-band .nj-follow-social { margin-block: 0.5rem 0; }
.nj-follow-band .wp-block-social-link-anchor { padding: 0.45em !important; }
.nj-footer-social { margin-top: 0.35rem; }
@media (max-width: 599px) {
	.nj-social-bar .wp-block-group.alignwide { justify-content: center; }
	.nj-follow-band { padding-left: 1rem; padding-right: 1rem; }
}

/* WooCommerce — match Devils navy / sky / gold */
.woocommerce a.button,
.woocommerce button.button,
.woocommerce input.button,
.woocommerce #respond input#submit,
.woocommerce .widget_shopping_cart a.button,
.wc-block-components-button,
.wp-block-woocommerce-product-button .wp-element-button,
.wp-block-woocommerce-product-button .add_to_cart_button,
.woocommerce-page button.button.alt,
.woocommerce button.button.alt,
.woocommerce a.button.alt,
.wc-block-cart__submit-button,
.wc-block-checkout__actions_row .wc-block-components-checkout-place-order-button,
.woocommerce-mini-cart__footer .wc-block-components-button {
	background: var(--wp--preset--color--gold) !important;
	color: var(--wp--preset--color--navy) !important;
	border: 0 !important;
	border-radius: 6px;
	font-family: var(--wp--preset--font-family--heading);
	font-weight: 800;
	text-transform: uppercase;
	letter-spacing: 0.03em;
	text-decoration: none !important;
}
.woocommerce a.button:hover,
.woocommerce button.button:hover,
.woocommerce input.button:hover,
.woocommerce button.button.alt:hover,
.woocommerce a.button.alt:hover,
.wc-block-components-button:hover,
.wp-block-woocommerce-product-button .wp-element-button:hover,
.wc-block-cart__submit-button:hover,
.wc-block-checkout__actions_row .wc-block-components-checkout-place-order-button:hover {
	background: var(--wp--preset--color--sky) !important;
	color: var(--wp--preset--color--navy) !important;
}

.woocommerce a.button.disabled,
.woocommerce button.button.disabled,
.woocommerce button.button.alt.disabled {
	opacity: .55;
}

.nj-product-card .wp-block-woocommerce-product-image img,
.wc-block-components-product-image img {
	aspect-ratio: 1 / 1;
	object-fit: contain;
	background: #fff;
	border-radius: 10px 10px 0 0;
}
.nj-product-card .wp-block-post-title a { text-decoration: none; color: var(--wp--preset--color--navy); }
.nj-product-card .wp-block-post-title a:hover { color: var(--wp--preset--color--sky); }

.woocommerce div.product p.price,
.woocommerce div.product span.price,
.wp-block-woocommerce-product-price,
.wc-block-components-product-price {
	color: var(--wp--preset--color--navy);
	font-weight: 700;
}

.woocommerce div.product form.cart .variations select,
.woocommerce form .form-row input.input-text,
.woocommerce form .form-row textarea,
.woocommerce form .form-row select,
.wc-block-components-text-input input,
.wc-block-components-textarea,
.wc-block-components-combobox input,
.wc-block-components-select select {
	border: 1px solid #b8c4d2;
	border-radius: 6px;
	padding: .7em .8em;
	font: inherit;
}

.woocommerce-message,
.woocommerce-info,
.wc-block-components-notice-banner.is-success,
.wc-block-components-notice-banner.is-info {
	border-top-color: var(--wp--preset--color--sky);
	background: var(--wp--preset--color--mist);
	color: var(--wp--preset--color--ink);
}
.woocommerce-error,
.wc-block-components-notice-banner.is-error {
	border-top-color: #b42318;
}

.woocommerce-breadcrumb,
.wp-block-woocommerce-breadcrumbs {
	font-size: var(--wp--preset--font-size--small);
	color: #c9d4ea;
}
.nj-product-titlebar .wp-block-woocommerce-breadcrumbs a { color: var(--wp--preset--color--gold); }
.wp-block-woocommerce-breadcrumbs a { color: inherit; }

.woocommerce table.shop_table thead,
.wc-block-cart-items thead {
	background: var(--wp--preset--color--navy);
	color: #fff;
}

.wc-block-components-order-summary,
.wp-block-woocommerce-checkout-order-summary-block,
.wc-block-cart__sidebar {
	background: var(--wp--preset--color--mist);
	border-radius: 10px;
	padding: 1.25rem;
}

.woocommerce span.onsale,
.wp-block-woocommerce-product-sale-badge span,
.wc-block-components-sale-badge {
	background: var(--wp--preset--color--gold);
	color: var(--wp--preset--color--navy);
	font-family: var(--wp--preset--font-family--heading);
	font-weight: 800;
	text-transform: uppercase;
}

/* Mini-cart in the header */
.nj-header .wc-block-mini-cart__button { padding: .25rem; }
.nj-header .wc-block-mini-cart__quantity-badge { font-family: var(--wp--preset--font-family--heading); }

@media (max-width: 781px) {
	.nj-product-layout { flex-direction: column; }
}

/* Avoid a single word wrapping onto its own line */
h1, h2, h3, h4, .wp-block-button__link, summary { text-wrap: balance; }
p, li, td { text-wrap: pretty; }

.norths-sponsor-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,145px),1fr));gap:1rem}
.norths-sponsor-grid .wp-block-image{display:grid;place-items:center;margin:0;padding:1rem;min-height:110px;border:1px solid #d7e6ef}
.norths-sponsor-grid img{display:block;width:auto;max-width:100%;height:auto;max-height:75px;object-fit:contain}

/* Give the menu a single row at intermediate widths. */
@media (min-width: 600px) and (max-width: 900px) {
    .nj-header .wp-block-navigation__responsive-container-open:not(.always-shown) { display: flex; }
    .nj-header .wp-block-navigation__responsive-container:not(.is-menu-open) { display: none; }
}

.nj-enquiry {
    background: #f4f8fb;
    border: 1px solid #d1deea;
    border-top: 5px solid var(--wp--preset--color--gold);
    border-radius: 8px;
    padding: clamp(1rem, 3vw, 2rem);
}
.nj-enquiry p { margin: 0 0 1.1rem; }
.nj-enquiry p:last-child { margin-bottom: 0; }
.nj-enquiry label { display: block; font-weight: 700; color: var(--wp--preset--color--navy); }
.nj-enquiry label > span:not(.wpcf7-form-control-wrap) { font-size: .875rem; font-weight: 400; }
.nj-enquiry .wpcf7-form-control-wrap { display: block; margin-top: .3rem; }
.nj-enquiry :is(input, select, textarea) { box-sizing: border-box; max-width: 100%; background-color: #fff; color: #142747; }
.nj-enquiry textarea { resize: vertical; }
.nj-enquiry :focus-visible { outline: 3px solid #176da0; outline-offset: 2px; }
.nj-enquiry .wpcf7-not-valid-tip { font-size: .9rem; font-weight: 400; }

/* Give a heading a closer relationship to its own text than to the preceding section. */
.entry-content > :where(p, ul.wp-block-list, ol.wp-block-list, figure, .wp-block-columns, .wp-block-group, .wp-block-buttons, .nj-family-card, details) + .wp-block-heading {
	margin-block-start: clamp(1.75rem, 3vw, 2.5rem);
}
.entry-content .wp-block-heading + :where(p, ul.wp-block-list, ol.wp-block-list, figure, .wp-block-columns, .wpcf7) {
	margin-block-start: .65rem;
}
.entry-content .wp-block-list:not(.nj-section-links) > li + li { margin-block-start: .3em; }
.wp-block-table table th { text-align: start; }
.nj-family-card, .nj-card { box-sizing: border-box; }

.wp-block-columns > .nj-card {
	height: auto;
	display: flex;
	flex-direction: column;
}
.wp-block-columns > .nj-card > p:last-child { margin-block-start: auto; padding-block-start: 1rem; }

/* Give the season notice the same inset as the adjacent safety panel. */
.nj-policy-notice {
	box-sizing: border-box;
	padding: clamp(1rem, 3vw, 1.75rem);
	border-inline-start: .25rem solid var(--wp--preset--color--gold);
	border-radius: .5rem;
}
.nj-section-links {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0 1.25rem;
	list-style: none;
	padding: .25rem 0;
	border-block: 1px solid #d1deea;
}
.nj-section-links a { display: inline-flex; align-items: center; min-height: 2.75rem; font-weight: 600; }

/* Keep native disclosure controls and keyboard behaviour. */
.entry-content > details.wp-block-details {
	box-sizing: border-box;
	margin-block-start: 0;
	border-block-end: 1px solid #d1deea;
}
.entry-content > :not(details) + details.wp-block-details { margin-block-start: 1rem; border-block-start: 1px solid #d1deea; }
.entry-content > details.wp-block-details > summary {
	color: var(--wp--preset--color--navy);
	cursor: pointer;
	font-weight: 600;
	padding: .8rem .65rem;
}
.entry-content > details.wp-block-details > summary::marker { color: #17618a; }
.entry-content > details.wp-block-details[open] {
	padding-block-end: 1rem;
}
.entry-content > details.wp-block-details[open] > summary,
.entry-content > details.wp-block-details > summary:hover { background: #eef5fb; }
.entry-content > details.wp-block-details[open] > :not(summary) { margin-block-start: .85rem; }

.entry-content > .nj-honours, .entry-content > .nj-contact-columns { max-width: 60rem; }
.nj-honours { gap: clamp(1.5rem, 2.5vw, 2rem); }
.nj-honours .wp-block-heading { padding-block-start: .75rem; border-block-start: .22rem solid var(--wp--preset--color--gold); }
.nj-honours .wp-block-table table { font-variant-numeric: tabular-nums; }
.nj-honours .wp-block-table thead { background: #eef5fb; color: var(--wp--preset--color--navy); }
.nj-honours .wp-block-table :is(th, td) {
	padding: .42rem .6rem;
	vertical-align: top;
	border: 0;
	border-bottom: 1px solid #dbe5ec;
}
.nj-honours td:first-child { width: 1%; white-space: nowrap; }
.nj-enquiry textarea { height: 9rem; min-height: 7rem; }
.woocommerce-account main .woocommerce:has(form.woocommerce-form-login, form.lost_reset_password) {
	max-width: 34rem;
	margin-inline: auto;
}
.woocommerce-account .lost_reset_password .form-row-first { width: 100%; }

@media (min-width: 782px) {
	.nj-phone-links { display: none; }
	.nj-contact-columns > .wp-block-column:last-child { flex-grow: 1.5; }
}
@media (max-width: 781px) {
	.nj-hero.wp-block-cover { min-height: clamp(27rem, 65svh, 33rem) !important; }
	.nj-footer .wp-block-list {
		display: grid;
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 0 .9rem;
		list-style: none;
		padding-inline-start: 0 !important;
	}
	.nj-footer .wp-block-list a { display: inline-flex; align-items: center; min-height: 2.75rem; }
}

.entry-content > p:has(+ .nj-phone-links.nj-section-links) { max-width: 60rem; }
.has-mist-background-color .wp-block-heading.has-sky-color { color: #076d92 !important; }
.wp-block-query-title, .wp-block-post-title { overflow-wrap: anywhere; }
.wp-block-post-template .nj-card { padding-inline: 0; padding-block-start: 0; }
.wp-block-post-template .nj-card > .wp-block-group:first-child { padding-block-start: 1.25rem; }
.nj-hero .wp-block-cover__background { background-image: linear-gradient(90deg, #03043a, transparent 90%); }
@media (min-width: 600px) and (max-width: 900px) {
	.nj-footer > .wp-block-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2rem; }
}
@media (max-width: 900px) {
	.nj-header .wp-block-navigation__responsive-container-open,
	.nj-header .wp-block-navigation__responsive-container-close,
	.nj-header .wc-block-customer-account a {
		box-sizing: border-box;
		min-width: 44px;
		min-height: 44px;
		align-items: center;
		justify-content: center;
	}
}
@media (max-width: 599px) {
	.nj-section-links { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .5rem; }
	.nj-section-links a { display: flex; justify-content: center; text-align: center; line-height: 1.35; text-wrap: balance; }
	.nj-header .alignwide, .nj-header .alignwide > .wp-block-group { gap: .25rem; }
	.nj-header-cta .wp-block-button__link { padding-inline: .65em !important; min-height: 44px; box-sizing: border-box; display: inline-flex; align-items: center; }
	.nj-enquiry :is(input, select, textarea), .nj-family-card :is(input, select) { font-size: max(1em, 16px); }
}
