/*
 * The Digi Tech Child Theme — Custom CSS
 * Warm neutral palette · Teal-slate accent · Light + Dark mode
 */

/* Hide newsletter signup section site-wide (remove this rule to bring it back) */
.newsletter-cta,
.newsletter-cta.wp-block-group {
	display: none !important;
	margin: 0 !important;
	padding: 0 !important;
	border: none !important;
}

/* Remove the default WP block gap above the footer when newsletter is hidden */
.home .wp-site-blocks > footer {
	margin-top: 0 !important;
}

/* ========================================
   CSS Custom Properties — Light Mode Base
======================================== */
:root {
	--tdt-transition:      all 0.2s ease;
	--tdt-transition-slow: all 0.4s ease;
	--tdt-shadow-sm:       0 1px 3px rgba(28, 25, 23, 0.07);
	--tdt-shadow-md:       0 4px 16px rgba(28, 25, 23, 0.09);
	--tdt-shadow-lg:       0 8px 32px rgba(28, 25, 23, 0.12);
	--tdt-radius:          0.5rem;
	--tdt-header-height:   64px;

	/* Header backdrop — warm light */
	--tdt-header-bg:       rgba(247, 245, 242, 0.88);
	--tdt-header-border:   rgba(226, 221, 216, 0.8);

	/* Icon/app thumbnail background — warm surface */
	--tdt-icon-bg:         #EFEDE9;

	/* Accent shorthand */
	--tdt-accent:          var(--wp--preset--color--accent-blue);
	--tdt-accent-dark:     var(--wp--preset--color--accent-blue-dark);
}

/* ========================================
   Dark Mode — CSS Variable Overrides
   Overrides WP preset color tokens so ALL
   block styles respond to dark mode automatically.
======================================== */
@media (prefers-color-scheme: dark) {
	:root {
		/* Core surfaces */
		--wp--preset--color--base:          #141210;
		--wp--preset--color--base-2:        #1E1C1A;
		--wp--preset--color--surface-light: #1E1C1A;
		--wp--preset--color--dark-bg:       #0E0C0B;
		--wp--preset--color--card-bg:       #252220;

		/* Text */
		--wp--preset--color--contrast:      #E7E5E0;
		--wp--preset--color--contrast-2:    #C4BFBA;
		--wp--preset--color--contrast-3:    #A8A29E;
		--wp--preset--color--muted:         #78716C;

		/* Borders */
		--wp--preset--color--border-light:  #2E2B28;

		/* Accent — slightly brighter for dark bg readability */
		--wp--preset--color--accent-blue:       #4D9BAD;
		--wp--preset--color--accent-blue-dark:  #5CB0C4;

		/* Custom properties */
		--tdt-header-bg:    rgba(20, 18, 16, 0.9);
		--tdt-header-border: rgba(46, 43, 40, 0.9);
		--tdt-icon-bg:      #252220;

		--tdt-shadow-sm:    0 1px 3px rgba(0, 0, 0, 0.3);
		--tdt-shadow-md:    0 4px 16px rgba(0, 0, 0, 0.35);
		--tdt-shadow-lg:    0 8px 32px rgba(0, 0, 0, 0.45);
	}
}

/* ========================================
   Global Resets & Base
======================================== */
*, *::before, *::after {
	box-sizing: border-box;
}

html {
	scroll-behavior: smooth;
}

body {
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	text-rendering: optimizeLegibility;
}

img {
	max-width: 100%;
	height: auto;
}

/* First heading inside a column should not have browser-default top margin
   — keeps hero heading alignment uniform across pages (About, Contact, etc.) */
.wp-block-column > .wp-block-heading:first-child {
	margin-top: 0;
}

/* ========================================
   Site Logo — Typographic Stack
======================================== */
.site-logo-stack .wp-block-site-title {
	font-size: 1.65rem !important;
	font-weight: 800;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	line-height: 1;
}

.site-logo-stack .wp-block-site-title a {
	text-decoration: none;
	color: var(--wp--preset--color--contrast) !important;
	transition: color 0.18s ease;
}

.site-logo-stack .wp-block-site-title a:hover {
	color: var(--wp--preset--color--accent-blue) !important;
}

.site-logo-byline {
	font-size: 0.75rem !important;
	letter-spacing: 0.2em;
	text-transform: uppercase;
	font-weight: 500;
	color: var(--wp--preset--color--muted);
	line-height: 1;
	margin-top: 5px !important;
	margin-bottom: 0 !important;
}

/* ========================================
   Sticky Header with Backdrop Blur
======================================== */
.site-header {
	position: sticky;
	top: 0;
	z-index: 100;
	background-color: var(--tdt-header-bg) !important;
	backdrop-filter: blur(14px);
	-webkit-backdrop-filter: blur(14px);
	border-bottom: 1px solid var(--tdt-header-border);
	transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.site-header.scrolled {
	box-shadow: var(--tdt-shadow-sm);
}


/* ========================================
   Header Search Block
======================================== */
.header-search.wp-block-search {
	flex-shrink: 0;
}

.header-search .wp-block-search__inside-wrapper {
	display: flex;
	align-items: center;
	border: 1px solid var(--wp--preset--color--border-light);
	border-radius: 0.375rem;
	background-color: transparent;
	overflow: hidden;
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
	height: 34px;
}

.header-search .wp-block-search__inside-wrapper:focus-within {
	border-color: var(--wp--preset--color--accent-blue);
	box-shadow: 0 0 0 3px rgba(61, 122, 138, 0.15);
}

.header-search .wp-block-search__input {
	border: none !important;
	background: transparent !important;
	font-size: var(--wp--preset--font-size--small);
	font-family: inherit;
	color: var(--wp--preset--color--contrast);
	padding: 0 0.625rem;
	width: 160px;
	outline: none !important;
	box-shadow: none !important;
	transition: width 0.2s ease;
}

.header-search .wp-block-search__input::placeholder {
	color: var(--wp--preset--color--muted);
}

.header-search .wp-block-search__button {
	background: transparent !important;
	border: none !important;
	padding: 0 0.625rem;
	margin: 0;
	cursor: pointer;
	color: var(--wp--preset--color--muted);
	display: flex;
	align-items: center;
	height: 100%;
	transition: color 0.18s ease;
}

.header-search .wp-block-search__button:hover {
	color: var(--wp--preset--color--accent-blue);
}

.header-search .wp-block-search__button svg {
	width: 15px;
	height: 15px;
}

/* On mobile hide the text input — icon still works as a link to search */
@media (max-width: 600px) {
	.header-search .wp-block-search__input {
		width: 0 !important;
		min-width: 0;
		padding: 0 !important;
		overflow: hidden;
		pointer-events: none;
		flex: 0 0 0px !important;
	}
	.header-search .wp-block-search__inside-wrapper {
		border: none;
		background: transparent;
	}
	.header-search .wp-block-search__inside-wrapper:focus-within {
		border: 1px solid var(--wp--preset--color--accent-blue);
	}
	.header-search .wp-block-search__inside-wrapper:focus-within .wp-block-search__input {
		width: 110px !important;
		min-width: 110px;
		padding: 0 0.5rem !important;
		pointer-events: auto;
		flex: 1 1 auto !important;
	}
}

/* ========================================
   Search Results Page
======================================== */

/* Relevanssi highlights matched terms in excerpts */
.search-highlight,
em.search-highlight {
	background: rgba(61, 122, 138, 0.12);
	color: var(--wp--preset--color--accent-blue);
	font-style: normal;
	border-radius: 2px;
	padding: 0 2px;
}

/* ========================================
   Navigation
======================================== */
.primary-navigation .wp-block-navigation__responsive-container-open,
.primary-navigation .wp-block-navigation__responsive-container-close {
	cursor: pointer;
}

.wp-block-navigation .wp-block-navigation-item__content {
	font-size: 1.05rem !important;
	transition: color 0.18s ease;
	padding-top: 0.5rem;
	padding-bottom: 0.5rem;
}

.wp-block-navigation .wp-block-navigation-item__content:hover {
	color: var(--wp--preset--color--muted);
}

/* Active nav item */
.wp-block-navigation-item.current-menu-item .wp-block-navigation-item__content {
	font-weight: 600;
	color: var(--wp--preset--color--accent-blue);
}

/*
 * Animated hamburger → X toggle
 * JS replaces the WP SVG with 3 .hamburger-bar spans.
 * When .is-open is added, the bars rotate into an X.
 */

/* Swap nav and search order in mobile so hamburger sits at far-right edge */
@media (max-width: 600px) {
	.header-right .wp-block-navigation { order: 2; }
	.header-right .header-search        { order: 1; }
}

.hamburger-toggle {
	display: none;
	flex-direction: column;
	justify-content: center;
	align-items: center;
	gap: 0;
	width: 28px;
	height: 28px;
	padding: 0 !important;
	background: none !important;
	border: none !important;
	outline: none !important;
	box-shadow: none !important;
	cursor: pointer;
	z-index: 100001 !important;
	position: relative;
}

/* Keyboard-only focus ring (accessibility) */
.hamburger-toggle:focus-visible {
	outline: 2px solid var(--wp--preset--color--accent-blue) !important;
	outline-offset: 4px;
	border-radius: 2px;
}

.hamburger-bar {
	display: block;
	width: 22px;
	height: 2px;
	background: var(--wp--preset--color--contrast);
	border-radius: 2px;
	transition: transform 0.3s ease, opacity 0.3s ease;
	position: absolute;
	left: 3px;
}

.hamburger-bar:nth-child(1) { top: 7px; }
.hamburger-bar:nth-child(2) { top: 13px; }
.hamburger-bar:nth-child(3) { top: 19px; }

/* X state */
.hamburger-toggle.is-open .hamburger-bar:nth-child(1) {
	transform: translateY(6px) rotate(45deg);
}

.hamburger-toggle.is-open .hamburger-bar:nth-child(2) {
	opacity: 0;
}

.hamburger-toggle.is-open .hamburger-bar:nth-child(3) {
	transform: translateY(-6px) rotate(-45deg);
}

/* Hide WP's default close button — our animated toggle handles closing */
.wp-block-navigation__responsive-container-close {
	display: none !important;
}

/* Show our custom hamburger toggle only on mobile */
@media (max-width: 600px) {
	.hamburger-toggle { display: flex; }
}

/*
 * Mobile nav overlay — full-screen centered, matching BVG Digital style.
 * The sticky header creates a containing block that traps
 * position:fixed children, so we force full-viewport dimensions.
 */
.wp-block-navigation__responsive-container.is-menu-open {
	background-color: var(--wp--preset--color--base) !important;
	padding: 0 !important;
	width: 100vw !important;
	height: 100vh !important;
	top: 0 !important;
	left: 0 !important;
}

.wp-block-navigation__responsive-container.is-menu-open
.wp-block-navigation__responsive-close {
	flex: 1 !important;
	display: flex !important;
	flex-direction: column !important;
}

.wp-block-navigation__responsive-container.is-menu-open
.wp-block-navigation__responsive-dialog {
	flex: 1 !important;
	display: flex !important;
	flex-direction: column !important;
}

.wp-block-navigation__responsive-container.is-menu-open
.wp-block-navigation__responsive-container-content {
	padding-top: 0;
	gap: 0 !important;
	align-items: center !important;
	justify-content: center !important;
	flex: 1 !important;
}

.wp-block-navigation__responsive-container.is-menu-open
.wp-block-navigation__container {
	justify-content: center !important;
	align-items: center !important;
}

.wp-block-navigation__responsive-container.is-menu-open
.wp-block-navigation__responsive-container-content .wp-block-navigation-item {
	width: auto;
	align-items: center !important;
	text-align: center;
}

.wp-block-navigation__responsive-container.is-menu-open
.wp-block-navigation-item__content {
	display: block;
	padding: 1rem 2rem !important;
	font-size: 1.15rem;
	font-weight: 400;
	text-transform: uppercase;
	letter-spacing: 0.2em;
	color: #ffffff !important;
	border-bottom: none;
	transition: opacity 0.2s ease;
}

.wp-block-navigation__responsive-container.is-menu-open
.wp-block-navigation-item__content:hover {
	opacity: 0.6;
}

/* Last nav item (Contact) gets a pill border */
.wp-block-navigation__responsive-container.is-menu-open
.wp-block-navigation-item:last-child .wp-block-navigation-item__content {
	border: 1px solid rgba(255, 255, 255, 0.3);
	border-radius: 50px;
	padding: 1rem 3rem !important;
	margin-top: 0.75rem;
	transition: border-color 0.2s ease, opacity 0.2s ease;
}

.wp-block-navigation__responsive-container.is-menu-open
.wp-block-navigation-item:last-child .wp-block-navigation-item__content:hover {
	border-color: rgba(255, 255, 255, 0.6);
	opacity: 1;
}

/* ========================================
   Homepage Section Backgrounds
   Alternating subtle backgrounds to visually
   separate hero / projects / newsletter.
======================================== */
.home-projects {
	background-color: var(--wp--preset--color--surface-light) !important;
}

@media (prefers-color-scheme: dark) {
	.home-projects {
		background-color: #1C1A18 !important;
	}
	/* Ensure cards pop against the section background */
	.home-projects .project-card {
		background-color: #262320 !important;
		box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
	}
	.home-projects .project-card .wp-block-post-featured-image {
		background-color: #2C2926 !important;
	}
}

/* ========================================
   Hero Section
======================================== */
.home-hero {
	display: flex;
	align-items: center;
	min-height: 70vh;
}

.hero-eyebrow {
	animation: fadeInUp 0.6s ease both;
}

.home-hero .wp-block-heading {
	animation: fadeInUp 0.6s ease 0.1s both;
}

.home-hero .hero-intro {
	animation: fadeInUp 0.6s ease 0.2s both;
}

.home-hero .wp-block-buttons {
	animation: fadeInUp 0.6s ease 0.3s both;
}

/* ========================================
   Page Hero — Archive / Listing Headers
   (Blog, Projects, and similar pages)
======================================== */
.page-hero .wp-block-heading {
	position: relative;
	padding-top: 1.75rem;
}

/* Teal accent bar above the heading */
.page-hero .wp-block-heading::before {
	content: '';
	position: absolute;
	top: 0;
	left: 0;
	width: 2.5rem;
	height: 3px;
	background: var(--wp--preset--color--accent-blue);
	border-radius: 2px;
}

/* Refine the subtitle */
.page-hero > p {
	max-width: 36rem;
	letter-spacing: 0.005em;
}

/* ========================================
   Project Cards & Blog Cards
======================================== */
.project-card {
	position: relative;
	transition: transform 0.25s ease, box-shadow 0.25s ease;
	overflow: hidden;
	cursor: pointer;
	/* Flex column so text area grows and date pins to bottom */
	display: flex;
	flex-direction: column;
	height: 100%;
	border: 1px solid var(--wp--preset--color--border-light);
	border-radius: var(--tdt-radius);
	background-color: var(--wp--preset--color--base-2);
}

/* Stretched link — makes the entire card clickable */
.project-card .wp-block-post-title a::after,
.project-card .wp-block-post-featured-image a::after {
	content: '';
	position: absolute;
	inset: 0;
	z-index: 1;
}

.project-card:hover {
	transform: translateY(-3px);
	box-shadow: var(--tdt-shadow-lg);
}

/* Text content group fills remaining card height */
.project-card > .wp-block-group {
	flex: 1;
	display: flex;
	flex-direction: column;
}

/* Date pinned to bottom of every card */
.project-card .wp-block-post-date {
	margin-top: auto;
	padding-top: var(--wp--preset--spacing--10);
}

.project-card .wp-block-post-featured-image {
	overflow: hidden;
}

.project-card .wp-block-post-featured-image img {
	transition: transform 0.4s ease;
	display: block;
	width: 100%;
	object-fit: cover;
}

.project-card:hover .wp-block-post-featured-image img {
	transform: scale(1.03);
}

/* Project archive cards — show full icon uncropped */
.projects-grid .project-card .wp-block-post-featured-image {
	background-color: var(--tdt-icon-bg);
	display: flex;
	align-items: center;
	justify-content: center;
}

.projects-grid .project-card .wp-block-post-featured-image img {
	object-fit: contain !important;
	padding: 1.5rem;
}

.projects-grid .project-card:hover .wp-block-post-featured-image img {
	transform: scale(1.05);
}

/* Project hero — icon in the header */
.project-hero .wp-block-post-featured-image img {
	width: 160px;
	height: 160px;
	object-fit: contain;
	border-radius: 1.5rem;
	display: block;
}

.project-card .wp-block-post-title a {
	text-decoration: none;
	color: var(--wp--preset--color--contrast);
	transition: color 0.18s ease;
}

.project-card .wp-block-post-title a:hover {
	color: var(--wp--preset--color--accent-blue);
}

/* Category labels — teal accent */
.project-card .wp-block-post-terms a,
.project-card .wp-block-post-terms {
	color: var(--wp--preset--color--accent-blue) !important;
	text-decoration: none;
}

/* Projects grid layout */
.projects-grid .wp-block-post,
.projects-grid-home .wp-block-post {
	display: flex;
	flex-direction: column;
}

/*  Homepage projects — adapt grid when few items
    auto-fit keeps cards at a reasonable width and
    centres them when fewer than 3 are present.       */
.home-projects .projects-grid {
	display: grid !important;
	grid-template-columns: repeat(auto-fit, minmax(240px, 300px)) !important;
	justify-content: center !important;
	gap: var(--wp--preset--spacing--30) !important;
}

/* ========================================
   Single Project Page
======================================== */
.project-hero {
	border-bottom: 1px solid var(--wp--preset--color--border-light);
}

.project-cta-button .wp-block-button__link {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	transition: var(--tdt-transition);
}

.project-cta-button .wp-block-button__link::before {
	content: '';
	display: inline-block;
	width: 16px;
	height: 16px;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 120'%3E%3Cpath fill='white' d='M60 0C26.9 0 0 26.9 0 60s26.9 60 60 60 60-26.9 60-60S93.1 0 60 0zm17 68.2L47.8 88.5c-1.4.8-3.2.8-4.7 0-1.4-.8-2.3-2.4-2.3-4V35.5c0-1.6.9-3.2 2.3-4 1.4-.8 3.2-.8 4.7 0L77 51.8c1.4.8 2.3 2.4 2.3 4s-.9 3.2-2.3 4.4z'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-size: contain;
	flex-shrink: 0;
}

/* ========================================
   Blog Post — Inline Product Images
======================================== */
/* Wrapped images in blog posts: small, left-aligned, text flows around */
.entry-content .wp-block-image.alignleft,
.wp-block-post-content .wp-block-image.alignleft {
	max-width: 260px;
	margin: 0.25rem 1.5rem 1rem 0;
	float: left;
	clear: left;
}

.entry-content .wp-block-image.alignright,
.wp-block-post-content .wp-block-image.alignright {
	max-width: 260px;
	margin: 0.25rem 0 1rem 1.5rem;
	float: right;
	clear: right;
}

/* Ensure headings clear floated images so each section starts fresh */
.entry-content h2,
.entry-content h3,
.wp-block-post-content h2,
.wp-block-post-content h3 {
	clear: both;
}

/* Border-radius on wrapped images */
.entry-content .wp-block-image.alignleft img,
.entry-content .wp-block-image.alignright img,
.wp-block-post-content .wp-block-image.alignleft img,
.wp-block-post-content .wp-block-image.alignright img {
	border-radius: 0.5rem;
	width: 100%;
	height: auto;
}

/* On small screens, stack images above text instead of wrapping */
@media (max-width: 600px) {
	.entry-content .wp-block-image.alignleft,
	.entry-content .wp-block-image.alignright,
	.wp-block-post-content .wp-block-image.alignleft,
	.wp-block-post-content .wp-block-image.alignright {
		float: none;
		max-width: 100%;
		margin: 1rem 0;
	}
}

/* ========================================
   Final Pass Feature Grid
======================================== */
.fp-feature-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	border-top: 1px solid var(--wp--preset--color--border-light);
	border-left: 1px solid var(--wp--preset--color--border-light);
	max-width: 1400px;
	margin: 0 auto;
}

.fp-feature-cell {
	padding: 2rem;
	border-right: 1px solid var(--wp--preset--color--border-light);
	border-bottom: 1px solid var(--wp--preset--color--border-light);
}

.fp-feature-num {
	display: block;
	font-size: var(--wp--preset--font-size--x-small);
	font-weight: 500;
	letter-spacing: 0.08em;
	color: var(--wp--preset--color--accent-blue);
	margin-bottom: 0.75rem;
}

.fp-feature-title {
	font-size: var(--wp--preset--font-size--medium);
	font-weight: 600;
	line-height: 1.3;
	margin: 0 0 0.5rem 0;
	color: var(--wp--preset--color--contrast);
}

.fp-feature-desc {
	font-size: var(--wp--preset--font-size--small);
	line-height: 1.7;
	color: var(--wp--preset--color--contrast-2);
	margin: 0;
}

@media (max-width: 768px) {
	.fp-feature-grid {
		grid-template-columns: 1fr;
	}
}

/* ========================================
   Gallery / Screenshots
======================================== */
.project-gallery-section .wp-block-gallery {
	gap: 1rem;
}

.project-gallery-section .wp-block-image img {
	border-radius: var(--tdt-radius);
	box-shadow: var(--tdt-shadow-sm);
	transition: box-shadow 0.25s ease, transform 0.25s ease;
}

.project-gallery-section .wp-block-image:hover img {
	box-shadow: var(--tdt-shadow-md);
	transform: translateY(-2px);
}

/* ========================================
   Blog Category Filter
======================================== */
.blog-category-filter {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	justify-content: center;
	padding: 0;
	margin: 0;
}

.category-pill {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	padding: 0.5rem 1.15rem;
	border: 1px solid var(--wp--preset--color--border-light);
	border-radius: 100px;
	background: transparent;
	color: var(--wp--preset--color--contrast-2);
	font-family: inherit;
	font-size: var(--wp--preset--font-size--small);
	font-weight: 500;
	letter-spacing: 0.01em;
	cursor: pointer;
	transition: all 0.2s ease;
	white-space: nowrap;
	-webkit-user-select: none;
	user-select: none;
}

.category-pill:hover {
	border-color: var(--wp--preset--color--accent-blue);
	color: var(--wp--preset--color--contrast);
	background: rgba(94, 189, 179, 0.06);
}

.category-pill.is-active {
	border-color: var(--wp--preset--color--accent-blue);
	background: var(--wp--preset--color--accent-blue);
	color: #ffffff;
}

.category-pill.is-active .pill-count {
	background: rgba(255, 255, 255, 0.2);
	color: #ffffff;
}

.pill-count {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 1.35rem;
	height: 1.35rem;
	padding: 0 0.35rem;
	border-radius: 100px;
	background: var(--wp--preset--color--base-2);
	color: var(--wp--preset--color--muted);
	font-size: 0.7rem;
	font-weight: 600;
	line-height: 1;
	transition: all 0.2s ease;
}

/* Post card hide/show transition for filtering */
.blog-grid .wp-block-post {
	transition: opacity 0.3s ease, transform 0.3s ease;
}

.blog-grid .wp-block-post.is-hidden {
	display: none;
}

/* "No results" message for empty filter state */
.blog-filter-empty {
	grid-column: 1 / -1;
	text-align: center;
	padding: 3rem 1rem;
	color: var(--wp--preset--color--muted);
	font-size: var(--wp--preset--font-size--medium);
}

/* ========================================
   Forms (Contact & Newsletter)
======================================== */

/* Shared form field base — replaces inline styles on all inputs */
.contact-form input,
.contact-form select,
.contact-form textarea,
.newsletter-form input[type="email"] {
	width: 100%;
	padding: 0.75rem 1rem;
	border: 1px solid var(--wp--preset--color--border-light);
	border-radius: 0.375rem;
	font-size: var(--wp--preset--font-size--small);
	font-family: inherit;
	background-color: var(--wp--preset--color--base-2);
	color: var(--wp--preset--color--contrast);
	outline: none;
	box-sizing: border-box;
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.contact-form select {
	appearance: none;
	cursor: pointer;
}

.contact-form textarea {
	resize: vertical;
}

.contact-form input:focus,
.contact-form select:focus,
.contact-form textarea:focus,
.newsletter-form input[type="email"]:focus {
	border-color: var(--wp--preset--color--accent-blue) !important;
	box-shadow: 0 0 0 3px rgba(61, 122, 138, 0.15);
}

/* Form labels */
.contact-form label {
	display: block;
	font-size: 0.8rem;
	font-weight: 500;
	letter-spacing: 0.05em;
	text-transform: uppercase;
	color: var(--wp--preset--color--muted);
	margin-bottom: 0.4rem;
}

/* Form submit buttons */
.contact-form button,
.newsletter-form button {
	padding: 0.75rem 1.5rem;
	background: var(--wp--preset--color--accent-blue);
	color: #ffffff;
	border: none;
	border-radius: 0.375rem;
	font-size: var(--wp--preset--font-size--small);
	font-weight: 500;
	cursor: pointer;
	font-family: inherit;
	letter-spacing: 0.01em;
	transition: background-color 0.2s ease, transform 0.15s ease;
}

.contact-form button:hover,
.newsletter-form button:hover {
	background: var(--wp--preset--color--accent-blue-dark);
	transform: translateY(-1px);
}

/* Stack first/last name fields on mobile */
@media (max-width: 600px) {
	.dit-form-row {
		flex-direction: column !important;
	}
}

.contact-form button:active,
.newsletter-form button:active {
	transform: translateY(0);
}

/* ========================================
   Newsletter CTA Section
======================================== */
.newsletter-cta {
	text-align: center;
	margin-top: 0 !important;
	/* Enforce consistent section padding regardless of per-page inline style */
	padding-top:    var(--wp--preset--spacing--40) !important;
	padding-bottom: var(--wp--preset--spacing--30) !important;
}

/*
 * Page templates (Contact, About, etc.) set padding-bottom: spacing|60 on <main>.
 * When the newsletter is the last element inside main, that gap appears between
 * the newsletter and the footer. Strip it — newsletter's own padding is enough.
 */
main:has(.newsletter-cta) {
	padding-bottom: 0 !important;
}

/*
 * Strip excessive bottom padding from the content group that sits
 * directly above the newsletter CTA — the CTA has its own padding.
 */
.entry-content > .wp-block-group:has(+ .newsletter-cta) {
	padding-bottom: var(--wp--preset--spacing--20) !important;
}

/* ========================================
   Legal Hub
======================================== */
.legal-toc li {
	list-style: none;
	padding: 0;
}

.legal-toc a:hover {
	color: var(--wp--preset--color--contrast) !important;
	text-decoration: underline;
}

.legal-section {
	scroll-margin-top: calc(var(--tdt-header-height) + 2rem);
}

/* ========================================
   FAQ
======================================== */
.faq-section {
	scroll-margin-top: calc(var(--tdt-header-height) + 2rem);
}

.faq-section-heading {
	color: var(--wp--preset--color--contrast);
}

.faq-item {
	transition: background-color 0.15s ease;
}

/* ========================================
   About Page
======================================== */
.about-hero-image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	aspect-ratio: 3/4;
}

/* ========================================
   Buttons
======================================== */
.wp-block-button__link {
	transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
}

.wp-block-button__link:hover {
	transform: translateY(-1px);
	box-shadow: 0 4px 14px rgba(61, 122, 138, 0.3);
}

.wp-block-button__link:active {
	transform: translateY(0);
	box-shadow: none;
}

/* Outline button style */
.wp-block-button.is-style-outline .wp-block-button__link {
	background-color: transparent;
	color: var(--wp--preset--color--accent-blue);
	border: 1.5px solid var(--wp--preset--color--accent-blue);
}

.wp-block-button.is-style-outline .wp-block-button__link:hover {
	background-color: var(--wp--preset--color--accent-blue);
	color: var(--wp--preset--color--base-2);
}

/* ========================================
   Footer
======================================== */
.footer-navigation .wp-block-navigation-item__content {
	font-size: var(--wp--preset--font-size--small);
	color: var(--wp--preset--color--muted);
	transition: color 0.18s ease;
}

.footer-navigation .wp-block-navigation-item__content:hover {
	color: var(--wp--preset--color--contrast);
}

/* ========================================
   Post / Blog
======================================== */
.wp-block-post-excerpt {
	color: var(--wp--preset--color--contrast-2);
}

.wp-block-post-title a {
	text-decoration: none;
	transition: color 0.18s ease;
}

.wp-block-post-title a:hover {
	color: var(--wp--preset--color--accent-blue);
}

.wp-block-post-date a {
	text-decoration: none;
	color: var(--wp--preset--color--muted);
}

/* ========================================
   Single Post — Category Label (left rule)
   Scoped to .single so blog cards are unaffected
======================================== */
.single .wp-block-post-terms {
	display: inline-flex;
	align-items: center;
	border-left: 2px solid var(--tdt-accent);
	padding-left: 0.625rem;
}

.single .wp-block-post-terms a {
	color: var(--wp--preset--color--accent-blue) !important;
	text-decoration: none;
	transition: opacity 0.18s ease;
}

.single .wp-block-post-terms a:hover {
	opacity: 0.75;
}

/* ========================================
   Single Post — Article Body Typography
   Hierarchy via spacing + weight, not size.
   H2/H3 are intentionally compact — let
   generous margins do the sectioning work.
======================================== */

/* Body copy — slightly softer than UI text, generous leading */
.wp-block-post-content {
	font-size: 1.0625rem;
	line-height: 1.8;
	color: var(--wp--preset--color--contrast-2);
}

/* Override WP's xx-large default for in-article H2s */
.wp-block-post-content h2.wp-block-heading {
	font-size: 1.3125rem;       /* ~21px — clear step above body, not a page title */
	font-weight: 600;
	letter-spacing: -0.01em;
	line-height: 1.3;
	color: var(--wp--preset--color--contrast);
	margin-top: 3rem;           /* generous breathing room signals new section */
	margin-bottom: 0.5rem;      /* tight to the content below it */
}

/* H3 — sub-section label, nearly body size, distinguished by weight + spacing */
.wp-block-post-content h3.wp-block-heading {
	font-size: 1.0625rem;       /* matches body size — weight does the work */
	font-weight: 600;
	letter-spacing: 0.01em;
	line-height: 1.4;
	color: var(--wp--preset--color--contrast);
	margin-top: 1.875rem;
	margin-bottom: 0.375rem;
}

/* H4 — uppercase label style for fine-grained callouts */
.wp-block-post-content h4.wp-block-heading {
	font-size: 0.75rem;
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--wp--preset--color--muted);
	margin-top: 1.5rem;
	margin-bottom: 0.25rem;
}

/* Paragraphs — even rhythm, no orphaned last margin */
.wp-block-post-content p {
	margin-bottom: 1.25rem;
}

/* Lists — indented, comfortable line spacing */
.wp-block-post-content ul,
.wp-block-post-content ol {
	padding-left: 1.5rem;
	margin-bottom: 1.25rem;
	line-height: 1.75;
}

.wp-block-post-content li {
	margin-bottom: 0.3rem;
}

/* Blockquote — teal left rule, italicised, softened */
.wp-block-post-content .wp-block-quote {
	border-left: 3px solid var(--tdt-accent);
	padding-left: 1.25rem;
	margin-left: 0;
	margin-right: 0;
	font-style: italic;
	color: var(--wp--preset--color--contrast-2);
}

.wp-block-post-content .wp-block-quote cite,
.wp-block-post-content .wp-block-quote footer {
	font-size: 0.8125rem;
	font-style: normal;
	color: var(--wp--preset--color--muted);
	margin-top: 0.5rem;
	display: block;
}

/* ========================================
   Page Layout
======================================== */
.wp-site-blocks {
	overflow-x: hidden;
}

.alignwide {
	max-width: 1400px;
}

/* ========================================
   Animations
======================================== */
@keyframes fadeInUp {
	from {
		opacity: 0;
		transform: translateY(16px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

@keyframes fadeIn {
	from { opacity: 0; }
	to   { opacity: 1; }
}

.wp-block-group[class*="-section"],
.wp-block-columns.alignwide {
	animation: fadeIn 0.5s ease both;
}

/* ========================================
   Separator
======================================== */
.wp-block-separator {
	border: none;
	border-bottom: 1px solid var(--wp--preset--color--border-light);
	height: 0;
	margin-top: 0;
	margin-bottom: 0;
}


/* ========================================
   404 Page
======================================== */
.wp-block-group.is-404 {
	min-height: 60vh;
	display: flex;
	align-items: center;
	justify-content: center;
}

/* ========================================
   Responsive — Tablet
======================================== */
@media (max-width: 1024px) {
	.legal-nav-col {
		display: none;
	}

	.wp-block-columns.alignwide {
		flex-wrap: wrap;
	}
}

/* ========================================
   Responsive — Mobile
======================================== */
@media (max-width: 768px) {
	.home-hero {
		min-height: 50vh;
		padding-top: 3rem;
		padding-bottom: 3rem;
	}

	.home-hero h1 {
		font-size: clamp(2rem, 8vw, 3rem) !important;
	}

	.projects-grid .wp-block-post,
	.projects-grid-home .wp-block-post {
		width: 100%;
	}

	.wp-block-columns {
		flex-direction: column;
	}

	.wp-block-column {
		flex-basis: 100% !important;
		width: 100%;
	}

	.newsletter-form {
		flex-direction: column !important;
	}

	.newsletter-form button {
		width: 100%;
	}

	.about-hero-image {
		margin-top: 2rem !important;
	}

	.contact-hero-image {
		display: none;
	}

	.legal-sidebar {
		display: none;
	}

	h1 {
		font-size: clamp(1.8rem, 7vw, 2.5rem) !important;
		letter-spacing: -0.02em !important;
	}

	.wp-site-blocks {
		padding-left: 1.25rem;
		padding-right: 1.25rem;
	}
}

/* ========================================
   Print Styles
======================================== */
@media print {
	.site-header,
	.newsletter-cta,
	.wp-block-navigation {
		display: none !important;
	}

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