/*
Theme Name: Nigel Clarke
Theme URI: https://nigelclarkepresenter.co.uk/
Author: Nigel Clarke
Description: Custom block theme for Nigel Clarke: presenter, dad and campaigner. Black, white and gold, with a scrolling Highlights row driven by the "Highlights" category.
Requires at least: 6.5
Tested up to: 6.9
Requires PHP: 7.4
Version: 1.0.5
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: nigelclarke
*/

/* Small eyebrow labels above headings */
.nc-eyebrow {
	font-family: var(--wp--preset--font-family--heading);
	font-weight: 700;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	font-size: 0.875rem;
}

/* Category label on cards */
.nc-cat a,
.nc-cat {
	font-size: 0.8rem;
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	text-decoration: none;
	color: var(--wp--preset--color--gold-text);
}

/* Cards: whole card is clickable via the title link */
.nc-card .wp-block-post-title a,
.nc-card-title a {
	text-decoration: none;
	color: var(--wp--preset--color--ink);
}
.nc-card .wp-block-post-title a:hover {
	text-decoration: underline;
}

/* Header */
.nc-header .wp-block-navigation a {
	text-decoration: none;
	color: var(--wp--preset--color--ink);
}
.nc-header .wp-block-navigation a:hover {
	text-decoration: underline;
}
.nc-header .wp-block-site-logo img {
	height: 52px;
	width: auto;
}

/* Highlights carousel: three across, scrolls sideways */
.nc-carousel .wp-block-post-template {
	display: flex !important;
	flex-wrap: nowrap;
	gap: 24px;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	scrollbar-width: thin;
	padding-bottom: 16px;
	margin: 0;
}
.nc-carousel .wp-block-post-template > li {
	flex: 0 0 calc((100% - 48px) / 3);
	min-width: 280px;
	scroll-snap-align: start;
	margin: 0;
}
.nc-carousel-nav {
	display: flex;
	gap: 10px;
}
.nc-carousel-nav button {
	width: 52px;
	height: 52px;
	border-radius: 50%;
	border: 2px solid var(--wp--preset--color--ink);
	background: var(--wp--preset--color--white);
	color: var(--wp--preset--color--ink);
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
}
.nc-carousel-nav button.nc-next {
	background: var(--wp--preset--color--ink);
	color: var(--wp--preset--color--white);
}
.nc-carousel-nav button:focus-visible {
	outline: 3px solid var(--wp--preset--color--gold);
	outline-offset: 3px;
}

/* Fatherhood band: photo with dark overlay */
.nc-band .wp-block-cover__inner-container {
	max-width: 1200px;
}

/* Out and about captions */
.nc-gallery figcaption {
	font-size: 0.95rem;
	font-weight: 500;
	margin-top: 0.6rem;
}

/* Instagram placeholder tiles (replace with feed plugin block) */
.nc-insta-tile {
	aspect-ratio: 1 / 1;
	border-radius: 12px;
	display: flex;
	align-items: center;
	justify-content: center;
	text-align: center;
}

/* Footer */
.nc-footer a {
	color: #CFCFCF;
}
.nc-footer a:hover {
	color: var(--wp--preset--color--gold-bright);
}

/* Long-form post body */
.single .wp-block-post-content > p,
.single .wp-block-post-content > ul,
.single .wp-block-post-content > ol {
	font-size: 1.15rem;
	line-height: 1.75;
}
.single .wp-block-post-content h2 {
	margin-top: 2.5rem;
}

@media (max-width: 600px) {
	.nc-carousel .wp-block-post-template > li {
		flex-basis: 82%;
	}
}

/* Sections sit flush against each other */
.wp-site-blocks > * + * {
	margin-block-start: 0;
}

/* Keep a comfortable gutter on every full-width section, header and footer */
.wp-site-blocks .alignfull:not(.wp-block-cover),
.nc-header,
.nc-footer {
	padding-left: var(--wp--style--root--padding-left, 1.5rem);
	padding-right: var(--wp--style--root--padding-right, 1.5rem);
}
.wp-site-blocks .wp-block-cover.alignfull {
	padding-left: var(--wp--style--root--padding-left, 1.5rem);
	padding-right: var(--wp--style--root--padding-right, 1.5rem);
}

/* Phone menu: a dropdown card over the page, not a full-screen takeover */
@media (max-width: 599px) {
	.nc-header .wp-block-navigation__responsive-container.is-menu-open {
		position: fixed;
		top: calc(12px + var(--wp-admin--admin-bar--height, 0px));
		left: 12px;
		right: 12px;
		bottom: auto;
		height: auto;
		max-height: calc(100vh - 24px - var(--wp-admin--admin-bar--height, 0px));
		overflow-y: auto;
		padding: 20px 24px 28px;
		border-radius: 16px;
		background: var(--wp--preset--color--white);
		box-shadow: 0 16px 48px rgba(0, 0, 0, 0.28);
		animation: nc-menu-drop 0.18s ease-out;
	}
	.nc-header .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content {
		padding-top: 8px;
		align-items: flex-start;
	}
	.nc-header .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__container {
		gap: 0.25rem;
		width: 100%;
	}
	.nc-header .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item {
		width: 100%;
		border-bottom: 1px solid #EAEAEA;
	}
	.nc-header .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item a {
		display: block;
		padding: 0.8rem 0;
		font-family: var(--wp--preset--font-family--heading);
		font-weight: 700;
		font-size: 1.25rem;
	}
	.nc-header .wp-block-navigation__responsive-container-close {
		top: 16px;
		right: 16px;
	}
	/* Dim the page behind so it's clear the menu is on top */
	html.has-modal-open body::after {
		content: "";
		position: fixed;
		inset: 0;
		background: rgba(0, 0, 0, 0.35);
		z-index: 99999;
		pointer-events: none;
	}
	.nc-header .wp-block-navigation__responsive-container.is-menu-open {
		z-index: 100000;
	}
}
@keyframes nc-menu-drop {
	from { opacity: 0; transform: translateY(-8px); }
	to { opacity: 1; transform: none; }
}

/* Phone header: logo, menu button and Work with me on one row */
@media (max-width: 599px) {
	.nc-header > .alignwide {
		flex-wrap: nowrap !important;
		gap: 12px;
	}
	.nc-header > .alignwide > .wp-block-group {
		flex-wrap: nowrap !important;
		gap: 12px;
		flex-direction: row-reverse;
	}
	.nc-header .wp-block-image img {
		height: 48px !important;
	}
	.nc-header .wp-block-button__link {
		padding: 0.55rem 0.9rem !important;
		font-size: 0.9rem;
		white-space: nowrap;
	}
}

/* Old posts: photos never wider than the column */
.wp-block-post-content img {
	max-width: 100%;
	height: auto;
}
.wp-block-post-content p > img {
	display: block;
	margin: 1.25rem auto;
	border-radius: 12px;
}
.wp-block-post-content .gallery {
	display: grid !important;
	grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
	gap: 12px;
	margin: 2rem 0 !important;
}
.wp-block-post-content .gallery .gallery-item {
	width: auto !important;
	margin: 0 !important;
}
.wp-block-post-content .gallery img {
	border: 0 !important;
	border-radius: 10px;
	width: 100%;
	aspect-ratio: 4 / 3;
	object-fit: cover;
}
.wp-block-post-content .gallery br {
	display: none;
}
.wp-block-post-content iframe {
	max-width: 100%;
}

/* Card photos always fit their card, whatever size the original was */
.nc-card {
	min-width: 0;
}
.nc-card .wp-block-post-featured-image {
	width: 100%;
	max-width: 100%;
	overflow: hidden;
}
.nc-card .wp-block-post-featured-image img {
	width: 100%;
	height: 100%;
	max-width: 100%;
	object-fit: cover;
}
/* Lead photo on a post never wider than the page */
.single .wp-block-post-featured-image img {
	max-width: 100%;
	height: auto;
}

/* Baby Club Diaries: the "What areas does this activity help with?" trio, three across */
.wp-block-post-content .et_pb_row {
	display: grid;
	grid-auto-flow: column;
	grid-auto-columns: 1fr;
	gap: 1.5rem;
	margin: 1.5rem 0 2rem;
}
.wp-block-post-content .et_pb_column {
	min-width: 0;
}
.wp-block-post-content .et_pb_blurb {
	text-align: center;
	background: var(--wp--preset--color--cream);
	border-radius: 14px;
	padding: 1.5rem 1.25rem;
	height: 100%;
	box-sizing: border-box;
}
.wp-block-post-content .et_pb_blurb img {
	width: 70px !important;
	height: auto;
	margin: 0 auto 0.75rem !important;
	display: block;
	border-radius: 0 !important;
}
.wp-block-post-content .et_pb_blurb h4,
.wp-block-post-content .et_pb_module_header {
	font-family: var(--wp--preset--font-family--heading);
	font-weight: 700;
	font-size: 1.15rem;
	line-height: 1.25;
	margin: 0 0 0.5rem;
}
.wp-block-post-content .et_pb_blurb_description p {
	font-size: 1rem !important;
	line-height: 1.55 !important;
	margin: 0;
}
.wp-block-post-content .et-waypoint,
.wp-block-post-content .et_had_animation {
	opacity: 1 !important;
	transform: none !important;
}
@media (max-width: 760px) {
	.wp-block-post-content .et_pb_row {
		grid-auto-flow: row;
	}
}

/* "What other objects can I use?" grid of the other diaries */
.nc-diary-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
	gap: 1rem;
	margin: 1rem 0 2rem;
}
.nc-diary {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
	text-decoration: none;
	color: var(--wp--preset--color--ink);
	font-family: var(--wp--preset--font-family--heading);
	font-weight: 700;
	line-height: 1.2;
}
.nc-diary img {
	width: 100%;
	aspect-ratio: 4 / 3;
	object-fit: cover;
	border-radius: 10px;
	margin: 0 !important;
}
.nc-diary:hover span {
	text-decoration: underline;
}

/* Bigger logo so the brand is seen */
.nc-header .wp-block-image img,
.nc-header .wp-block-site-logo img {
	height: 72px !important;
}
@media (max-width: 599px) {
	.nc-header .wp-block-image img {
		height: 48px !important;
	}
}
