/*
 * DigiTemplates base styles: reset, accessibility helpers, navigation mechanics and
 * WordPress content basics. Every template adds its own look in templates/<template>/style.css.
 *
 * Templates set these variables (colour ones may be overridden from the admin):
 *   --dt-primary --dt-secondary --dt-accent --dt-text --dt-background
 *   --dt-font-body --dt-font-heading --dt-container --dt-radius --dt-focus
 */

:root {
	--dt-primary: #1f2937;
	--dt-secondary: #4b5563;
	--dt-accent: #2563eb;
	--dt-text: #111827;
	--dt-background: #ffffff;
	--dt-font-body: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	--dt-font-heading: var(--dt-font-body);
	--dt-container: 1200px;
	--dt-gutter: clamp(1rem, 4vw, 2rem);
	--dt-radius: 0;
	--dt-focus: var(--dt-accent);
	--dt-header-height: 80px;
}

/* Reset */
*,
*::before,
*::after {
	box-sizing: border-box;
}

html {
	-webkit-text-size-adjust: 100%;
	text-size-adjust: 100%;
	scroll-behavior: smooth;
}

body {
	margin: 0;
	min-height: 100vh;
	background: var(--dt-background);
	color: var(--dt-text);
	font-family: var(--dt-font-body);
	font-size: 1rem;
	line-height: 1.65;
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
	overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
	margin: 0 0 0.5em;
	font-family: var(--dt-font-heading);
	line-height: 1.15;
	overflow-wrap: break-word;
	hyphens: auto;
}

p, ul, ol, dl, figure, blockquote {
	margin: 0 0 1em;
}

img, svg, video {
	display: block;
	max-width: 100%;
	height: auto;
}

a {
	color: inherit;
	text-underline-offset: 0.18em;
}

button, input, select, textarea {
	font: inherit;
	color: inherit;
}

button {
	cursor: pointer;
}

address {
	font-style: normal;
}

dd {
	margin: 0;
}

/* Accessibility */
.screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.skip-link {
	position: fixed;
	top: 0.75rem;
	left: 0.75rem;
	z-index: 1000;
	padding: 0.75rem 1.25rem;
	background: #000;
	color: #fff;
	font-weight: 700;
	text-decoration: none;
	transform: translateY(-200%);
	transition: transform 0.2s;
}

.skip-link:focus {
	transform: none;
}

:focus-visible {
	outline: 3px solid var(--dt-focus);
	outline-offset: 3px;
}

.site-main:focus {
	outline: none;
}

@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
		scroll-behavior: auto !important;
	}
}

/* Layout helpers */
.container {
	width: 100%;
	max-width: calc(var(--dt-container) + 2 * var(--dt-gutter));
	margin-inline: auto;
	padding-inline: var(--dt-gutter);
}

.container--narrow {
	max-width: calc(780px + 2 * var(--dt-gutter));
}

.site-main {
	display: block;
}

/* Icons */
.icon {
	width: 1.5em;
	height: 1.5em;
	flex-shrink: 0;
}

/* Navigation mechanics (appearance is up to each template).
   Below 1024px the menu collapses behind the toggle button. */
.nav-toggle {
	display: none;
	align-items: center;
	gap: 0.6rem;
	padding: 0.6rem 0.8rem;
	background: none;
	border: 0;
}

.nav-toggle__bars {
	display: grid;
	gap: 5px;
	width: 22px;
}

.nav-toggle__bars span {
	display: block;
	height: 2px;
	background: currentColor;
	border-radius: 2px;
	transition: transform 0.25s, opacity 0.25s;
}

.nav-toggle[aria-expanded="true"] .nav-toggle__bars span:nth-child(1) {
	transform: translateY(7px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .nav-toggle__bars span:nth-child(2) {
	opacity: 0;
}

.nav-toggle[aria-expanded="true"] .nav-toggle__bars span:nth-child(3) {
	transform: translateY(-7px) rotate(-45deg);
}

.primary-nav .menu,
.primary-nav .sub-menu {
	margin: 0;
	padding: 0;
	list-style: none;
}

.primary-nav .menu-item {
	position: relative;
}

.submenu-toggle {
	display: inline-grid;
	place-items: center;
	width: 2rem;
	height: 2rem;
	padding: 0;
	background: none;
	border: 0;
	vertical-align: middle;
}

.submenu-toggle .icon {
	width: 1rem;
	height: 1rem;
	transition: transform 0.2s;
}

.submenu-toggle[aria-expanded="true"] .icon {
	transform: rotate(45deg);
}

@media (min-width: 1024px) {
	.primary-nav .menu {
		display: flex;
		align-items: center;
	}

	.primary-nav .sub-menu {
		position: absolute;
		top: 100%;
		left: 0;
		z-index: 50;
		min-width: 240px;
		visibility: hidden;
		opacity: 0;
		transform: translateY(6px);
		transition: opacity 0.2s, transform 0.2s, visibility 0.2s;
	}

	.primary-nav .menu-item:hover > .sub-menu,
	.primary-nav .menu-item:focus-within > .sub-menu,
	.primary-nav .menu-item.is-open > .sub-menu {
		visibility: visible;
		opacity: 1;
		transform: none;
	}
}

@media (max-width: 1023.98px) {
	.nav-toggle {
		display: inline-flex;
	}

	.nav-panel {
		display: none;
	}

	.primary-nav.is-open .nav-panel {
		display: block;
	}

	.primary-nav .sub-menu {
		display: none;
	}

	.primary-nav .menu-item.is-open > .sub-menu {
		display: block;
	}

	body.nav-open {
		overflow: hidden;
	}
}

/* Sticky header helper: templates add position:sticky styles on .site-header */
.has-sticky-header .site-header {
	position: sticky;
	top: 0;
	z-index: 100;
}

.admin-bar.has-sticky-header .site-header {
	top: var(--wp-admin--admin-bar--height, 32px);
}

@media (max-width: 600px) {
	.admin-bar.has-sticky-header .site-header {
		top: 0;
	}
}

/* FAQ (native details) */
.faq__item > summary {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	cursor: pointer;
	list-style: none;
}

.faq__item > summary::-webkit-details-marker {
	display: none;
}

.faq__item > summary .icon {
	transition: transform 0.25s;
}

.faq__item[open] > summary .icon {
	transform: rotate(45deg);
}

/* Reveal on scroll (added by main.js; content is visible without JS) */
.js [data-reveal] {
	opacity: 0;
	transform: translateY(24px);
	transition: opacity 0.7s ease, transform 0.7s ease;
}

.js [data-reveal].is-visible {
	opacity: 1;
	transform: none;
}

@media (prefers-reduced-motion: reduce) {
	.js [data-reveal] {
		opacity: 1;
		transform: none;
	}
}

/* Lists used by helpers */
.social-links,
.legal-links {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem 1rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.social-links a {
	display: inline-grid;
	place-items: center;
	width: 2.5rem;
	height: 2.5rem;
}

.social-links .icon {
	width: 1.25rem;
	height: 1.25rem;
}

.contact-list {
	display: grid;
	gap: 1rem;
	margin: 0;
}

.contact-list__row {
	display: grid;
	grid-template-columns: auto 1fr;
	column-gap: 0.85rem;
	align-items: start;
}

.contact-list__row .icon {
	grid-row: span 2;
	margin-top: 0.15rem;
}

.contact-list dt {
	font-size: 0.8rem;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	opacity: 0.7;
}

.opening-hours {
	margin: 0;
}

.opening-hours > div {
	display: flex;
	justify-content: space-between;
	gap: 1rem;
	padding: 0.5rem 0;
	border-bottom: 1px solid rgba(127, 127, 127, 0.25);
}

/* WordPress content (legal pages, services, projects) */
.entry-content > * + * {
	margin-top: 1em;
}

.entry-content h2 {
	margin-top: 2em;
	font-size: 1.6rem;
}

.entry-content h3 {
	margin-top: 1.6em;
	font-size: 1.25rem;
}

.entry-content ul,
.entry-content ol {
	padding-left: 1.3em;
}

.entry-content li + li {
	margin-top: 0.35em;
}

.entry-content blockquote {
	margin-inline: 0;
	padding-left: 1.25rem;
	border-left: 3px solid var(--dt-accent);
	font-size: 1.15em;
}

.entry-content img {
	border-radius: var(--dt-radius);
}

.alignwide {
	margin-inline: calc(-1 * min(8vw, 120px));
}

.aligncenter {
	margin-inline: auto;
}

.wp-block-image figcaption,
.wp-caption-text {
	font-size: 0.85rem;
	opacity: 0.75;
}

.entry-updated {
	margin-top: 3rem;
	font-size: 0.875rem;
	opacity: 0.7;
}

/* Pagination */
.pagination .nav-links {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin-top: 3rem;
}

.pagination .page-numbers {
	display: inline-grid;
	place-items: center;
	min-width: 2.75rem;
	height: 2.75rem;
	padding: 0 0.75rem;
	border: 1px solid currentColor;
	text-decoration: none;
}

.pagination .page-numbers.current {
	background: var(--dt-primary);
	border-color: var(--dt-primary);
	color: #fff;
}

/* Generic shared views (templates restyle these) */
.page-header {
	padding: clamp(3rem, 8vw, 6rem) 0 clamp(2rem, 5vw, 3.5rem);
}

.page-header__title {
	font-size: clamp(2.2rem, 5vw, 3.5rem);
}

.page-header__text {
	max-width: 46rem;
	font-size: 1.15rem;
}

.page-body {
	padding-bottom: clamp(3rem, 8vw, 6rem);
}

.post-list {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
	gap: 2rem;
}

.post-card__media img {
	width: 100%;
	aspect-ratio: 4 / 3;
	object-fit: cover;
}

.post-card__title {
	font-size: 1.3rem;
}

.post-card__title a {
	text-decoration: none;
}

.not-found {
	padding: clamp(4rem, 12vw, 9rem) 0;
	text-align: center;
}

.not-found__code {
	margin: 0;
	font-family: var(--dt-font-heading);
	font-size: clamp(5rem, 18vw, 10rem);
	font-weight: 800;
	line-height: 1;
	color: var(--dt-primary);
	opacity: 0.15;
}

.not-found__actions {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 0.75rem;
	margin-top: 2rem;
}

/* Cover images */
.cover {
	position: relative;
	overflow: hidden;
}

.cover > img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/* Print */
@media print {
	.site-header,
	.site-footer,
	.nav-toggle,
	.skip-link {
		display: none !important;
	}
}
