/*
Theme Name: DeckScale
Theme URI: https://sahal.dev/
Author: SahalDecoder
Author URI: https://sahal.dev/
Description: Block theme for deck builder and outdoor living marketing sites. Design tokens live in theme.json; sections are built from core blocks and patterns.
Version: 9.1.0
Requires at least: 6.6
Tested up to: 7.1
Requires PHP: 8.0
License: GPL-2.0-or-later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: deckscale
Tags: block-patterns, full-site-editing, custom-colors, editor-style, wide-blocks
*/

/* ---------- Global defaults (zero specificity on purpose) ----------
   Headings, paragraphs and links get their design defaults through :where() so that any
   block style, pattern CSS or editor-chosen value always wins. theme.json element styles
   would outrank plain type selectors and fight section CSS. */
:where(h1, h2, h3, h4, h5, h6) {
	color: inherit;
	font-weight: 700;
	letter-spacing: -0.02em;
	line-height: 1.14;
}

:where(h1) {
	font-size: var(--wp--preset--font-size--h1);
	line-height: 1.06;
}

:where(h2) {
	font-size: var(--wp--preset--font-size--h2);
	line-height: 1.14;
}

:where(h3) {
	font-size: var(--wp--preset--font-size--h3);
	line-height: 1.25;
	font-weight: 600;
	letter-spacing: -0.01em;
}

:where(h4) {
	font-size: var(--wp--preset--font-size--h4);
	line-height: 1.3;
	font-weight: 600;
	letter-spacing: -0.01em;
}

:where(p) {
	color: var(--wp--preset--color--muted);
}

:where(a:not(.wp-element-button)) {
	color: var(--wp--preset--color--blue);
}

:where(a:not(.wp-element-button)):hover {
	color: var(--wp--preset--color--cyan-dark);
}

:where(a:not(.wp-element-button)):focus-visible {
	outline: 2px solid var(--wp--preset--color--blue);
	outline-offset: 2px;
}

/* ---------- Page frame ---------- */
html {
	scroll-behavior: smooth;
	scroll-padding-top: 92px;
}

body {
	overflow-x: hidden;
	-webkit-font-smoothing: antialiased;
}

.wp-site-blocks>*+* {
	margin-block-start: 0;
}

.wp-site-blocks>header.wp-block-template-part {
	z-index: 100;
}

@media (prefers-reduced-motion: reduce) {
	html {
		scroll-behavior: auto;
	}

	*,
	*::before,
	*::after {
		transition-duration: 0.01ms !important;
		animation-duration: 0.01ms !important;
	}
}

/* ---------- Buttons (gradient primary, outline secondary) ---------- */
.wp-block-button .wp-block-button__link {
	box-shadow: 0 4px 18px rgba(37, 99, 235, 0.25);
	transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.wp-block-button .wp-block-button__link:hover {
	transform: translateY(-2px);
}

.wp-block-button.is-style-outline .wp-block-button__link {
	background: transparent;
	color: var(--wp--preset--color--ink);
	border: 1px solid var(--wp--preset--color--border);
	box-shadow: none;
}

.wp-block-button.is-style-outline .wp-block-button__link:hover {
	border-color: var(--wp--preset--color--cyan);
	color: var(--wp--preset--color--cyan-dark);
}

/* Header presentation is maintained in assets/css/header.css. */

/* ---------- Footer ---------- */
.ds-footer {
	position: relative;
	overflow: hidden;
	background: linear-gradient(180deg, #0a1220 0%, #07101e 100%);
	color: var(--wp--preset--color--dark-muted);
	padding-inline: clamp(16px, 4vw, 32px);
	box-sizing: border-box;
}

.ds-footer::before {
	content: "";
	position: absolute;
	width: 620px;
	height: 620px;
	right: -280px;
	top: 70px;
	border-radius: 50%;
	background: radial-gradient(circle, rgba(6, 182, 212, 0.11), transparent 68%);
	pointer-events: none;
}

.ds-footer>* {
	position: relative;
}

.ds-footer>.alignwide {
	max-width: 1440px;
	margin-inline: auto;
	width: 100%;
	box-sizing: border-box;
}

.ds-footer a {
	color: var(--wp--preset--color--dark-muted);
	text-decoration: none;
	transition: color 0.2s ease;
}

.ds-footer a:hover {
	color: #5fc7e7;
}

.ds-footer h2,
.ds-footer h3,
.ds-footer h4 {
	color: #fff;
}

.ds-footer__newsletter {
	padding: 64px 0 30px;
}

.ds-footer__card {
	position: relative;
	overflow: hidden;
	padding: 36px 40px;
	border: 1px solid rgba(113, 146, 197, 0.28);
	border-radius: 20px;
	background: linear-gradient(120deg, rgba(24, 37, 65, 0.96), rgba(12, 26, 48, 0.96));
	box-shadow: 0 24px 70px rgba(0, 0, 0, 0.24);
	gap: 30px;
}

.ds-footer__card h3 {
	font-size: clamp(1.55rem, 2.5vw, 2.25rem);
	line-height: 1.12;
	letter-spacing: -0.04em;
	max-width: 620px;
	margin: 0;
}

.ds-footer__card p {
	margin: 0;
}

.ds-eyebrow {
	display: inline-flex;
	align-items: center;
	gap: 9px;
	margin-bottom: 12px !important;
	color: #70d9ec;
	font-size: 0.7rem;
	font-weight: 700;
	letter-spacing: 0.12em;
	text-transform: uppercase;
}

.ds-eyebrow::before {
	content: "";
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: var(--wp--preset--color--cyan);
	box-shadow: 0 0 0 5px rgba(6, 182, 212, 0.12);
}

.ds-footer__lead {
	font-size: 0.88rem;
	color: #a9b7cd;
	max-width: 650px;
	margin-top: 9px !important;
	line-height: 1.6;
}

.ds-footer__note {
	font-size: 0.68rem;
	color: #7788a3;
	margin-top: 10px !important;
}

.ds-footer .wp-block-button__link {
	color: #fff;
}

.ds-footer__main {
	padding: 56px 0 28px;
}

.ds-footer__grid {
	display: grid;
	grid-template-columns: 1.5fr 1.25fr 1fr 1fr 1fr;
	gap: 36px;
	align-items: start;
}

.ds-footer__brand {
	padding-right: 16px;
}

.ds-footer__brand .wp-block-site-title,
.ds-footer__brand .wp-block-site-title a {
	color: #fff;
	font-size: 1.35rem;
	font-weight: 800;
	letter-spacing: -0.03em;
	margin: 0 0 10px;
	text-decoration: none;
}

.ds-footer__tagline {
	max-width: 260px;
	font-size: 0.84rem;
	line-height: 1.7;
	color: #94a3b8;
	margin: 0;
}

.ds-footer__col h4 {
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 0 0 18px;
	color: #7e94b1;
	font-size: 0.6875rem;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	font-weight: 700;
}

.ds-footer__col h4::before {
	content: "";
	width: 12px;
	height: 2px;
	border-radius: 99px;
	background: #06b6d4;
}

.ds-footer__links {
	font-size: 0.8125rem;
	line-height: 1.55;
}

.ds-footer__links .wp-block-navigation__container {
	gap: 6px;
}

.ds-footer__links .wp-block-navigation-item__content {
	padding: 4px 0;
	display: inline-block;
	color: #94a3b8;
}

.ds-footer__links a {
	color: #94a3b8;
	text-decoration: none;
	transition: color 0.2s ease;
}

.ds-footer__links a:hover {
	color: #fff;
}

.ds-footer__bottom {
	padding: 24px 0 28px;
	border-top: 1px solid rgba(255, 255, 255, 0.08);
	gap: 16px;
	margin-top: 12px;
}

.ds-footer__bottom p,
.ds-footer__bottom a {
	font-size: 0.75rem;
	color: #7789a2;
	margin: 0;
	text-decoration: none;
	transition: color 0.2s ease;
}

.ds-footer__bottom a:hover {
	color: #fff;
}

.ds-footer__legal {
	gap: 22px;
}

.ds-footer__legal a {
	display: inline-block;
	padding: 4px 0;
}

/* Responsive adjustments across screen sizes */
@media (max-width: 1200px) {
	.ds-footer__grid {
		grid-template-columns: 1.4fr 1.2fr 1fr 1fr 1fr;
		gap: 24px;
	}

	.ds-footer__brand {
		padding-right: 10px;
	}
}

@media (max-width: 1024px) {
	.ds-footer__grid {
		grid-template-columns: repeat(4, minmax(0, 1fr));
		gap: 32px 24px;
	}

	.ds-footer__brand {
		grid-column: 1 / -1;
		grid-row: auto;
		padding-right: 0;
		padding-bottom: 24px;
		border-right: none;
		border-bottom: 1px solid rgba(93, 118, 157, 0.22);
		display: flex;
		flex-direction: row;
		align-items: center;
		justify-content: space-between;
		flex-wrap: wrap;
		gap: 16px;
	}

	.ds-footer__tagline {
		max-width: 480px;
		margin: 0;
	}
}

@media (max-width: 768px) {
	.ds-footer {
		padding-inline: 20px;
	}

	.ds-footer__newsletter {
		padding: 36px 0 16px;
	}

	.ds-footer__card {
		padding: 28px 22px;
		border-radius: 16px;
		flex-direction: column;
		align-items: stretch;
		gap: 24px;
	}

	.ds-footer__card h3 {
		font-size: 1.5rem;
	}

	.ds-footer__card .wp-block-buttons {
		width: 100%;
	}

	.ds-footer__card .wp-block-button {
		width: 100%;
	}

	.ds-footer__card .wp-block-button__link {
		width: 100%;
		justify-content: center;
		text-align: center;
		min-height: 48px;
		font-size: 0.95rem;
		box-sizing: border-box;
	}

	.ds-footer__main {
		padding: 36px 0 20px;
	}

	.ds-footer__grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 28px 20px;
	}

	.ds-footer__brand {
		grid-column: 1 / -1;
		flex-direction: column;
		align-items: flex-start;
		padding: 0 0 22px;
		border-right: 0;
		border-bottom: 1px solid rgba(93, 118, 157, 0.22);
	}

	.ds-footer__tagline {
		max-width: 100%;
	}

	.ds-footer__bottom {
		flex-direction: column;
		align-items: flex-start;
		gap: 16px;
		padding: 24px 0 32px;
	}

	.ds-footer__legal {
		flex-wrap: wrap;
		gap: 10px 18px;
	}
}

@media (max-width: 520px) {
	.ds-footer {
		padding-inline: 16px;
	}

	.ds-footer__card {
		padding: 22px 18px;
	}

	.ds-footer__card h3 {
		font-size: 1.3rem;
	}

	.ds-footer__grid {
		grid-template-columns: 1fr;
		gap: 26px;
	}

	.ds-footer__col {
		padding-bottom: 4px;
	}

	.ds-footer__col h4 {
		margin-bottom: 12px;
		font-size: 0.72rem;
	}

	.ds-footer__links a {
		font-size: 0.875rem;
		padding: 6px 0;
	}

	.ds-footer__bottom p,
	.ds-footer__bottom a {
		font-size: 0.8rem;
		line-height: 1.5;
	}
}

/* Production template fields and inherited query cards. */
.ds-detail>.wp-block-post-title,
.ds-detail>.wp-block-post-featured-image {
	max-width: 1200px;
	margin: 40px auto;
	padding-inline: 24px
}

.ds-detail-fields {
	padding: 24px
}

.ds-field {
	margin-block: 32px
}

.ds-field h2 {
	font-size: clamp(24px, 3vw, 34px);
	margin-bottom: 16px
}

.ds-field p,
.ds-field li {
	line-height: 1.7
}

.ds-results {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 16px
}

.ds-result {
	padding: 24px;
	border: 1px solid #d7e4f0;
	background: #eef6fc;
	border-radius: 12px
}

.ds-result strong {
	display: block;
	font-size: clamp(24px, 4vw, 42px);
	color: #2563eb;
	overflow-wrap: anywhere
}

.ds-result span {
	display: block;
	margin-top: 8px
}

.ds-sample-notice {
	max-width: 1200px;
	margin: 24px auto !important;
	padding: 16px 24px;
	border-left: 4px solid #2563eb;
	background: #eef6fc;
	color: #0b1526
}

.ds-field details {
	padding: 18px;
	border-bottom: 1px solid #d7e4f0
}

.ds-field summary {
	cursor: pointer;
	font-weight: 600
}

.ds-archive .wp-block-post-template>li {
	border: 1px solid #d7e4f0;
	border-radius: 14px;
	padding: 20px;
	overflow: hidden
}

.ds-main .wp-block-post-template {
	gap: 24px
}

.ds-main .wp-block-post-template img {
	width: 100%;
	height: auto
}

.ds-main .wp-block-post-template h3 {
	font-size: 24px
}

.ds-main .wp-block-query-pagination {
	margin-block: 32px
}

.ds-main .wp-block-post-content:has(.deckscale-ref-preview),
.ds-main .wp-block-post-content:has(.deckscale-home-preview) {
	max-width: none
}

.ds-nav .wp-block-navigation-item__content {
	white-space: normal
}

.ds-geo-nav {
	align-self: stretch
}

.ds-geo-nav>details>summary {
	min-height: 44px;
	display: flex;
	align-items: center;
	gap: 8px
}

.ds-geo-nav>details>summary:after {
	content: '⌄'
}

.ds-geo-nav .ds-geo-menu h2,
.ds-geo-nav .ds-geo-menu h3 {
	line-height: 1.25
}

.ds-geo-menu a {
	font-size: 14px
}

.ds-geo-state>summary,
.ds-geo-county>summary {
	min-height: 44px;
	box-sizing: border-box
}

.ds-geo-menu [hidden] {
	display: none !important
}

.ds-main img {
	max-width: 100%
}

.ds-field a {
	overflow-wrap: anywhere
}

@media(max-width:782px) {
	.ds-results {
		grid-template-columns: 1fr
	}

	.ds-main .wp-block-post-template.is-layout-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr))
	}
}

@media(max-width:540px) {
	.ds-main .wp-block-post-template.is-layout-grid {
		grid-template-columns: 1fr
	}

	.ds-detail-fields {
		padding: 16px
	}

	.ds-detail>.wp-block-post-title {
		font-size: 36px
	}
}

@media(prefers-reduced-motion:reduce) {
	html {
		scroll-behavior: auto
	}

	.deckscale-home-preview *,
	.deckscale-ref-preview * {
		animation: none !important;
		transition: none !important
	}

	.deckscale-home-preview .rise {
		opacity: 1 !important;
		transform: none !important
	}
}

.ds-live-section {
	padding: 80px 24px;
	background: #eef6fc
}

.ds-live-container {
	max-width: 1280px;
	margin: auto
}

.ds-live-container>h2 {
	max-width: 850px;
	font-size: clamp(32px, 4vw, 50px);
	margin-bottom: 24px
}

.ds-live-container>p {
	max-width: 850px;
	line-height: 1.7;
	margin-bottom: 32px
}

.ds-location-explorer>ul {
	list-style: none;
	padding: 0;
	margin: 24px 0
}

.ds-location-explorer .ds-geo-menu {
	position: static;
	max-height: 650px
}

.ds-location-explorer>.ds-geo-card {
	margin-top: 16px
}

.ds-location-explorer .ds-geo-nav>details>summary {
	font-weight: 600
}

.ds-location-explorer~.ds-geo-cards {
	margin-top: 24px
}

@media(max-width:600px) {
	.ds-live-section {
		padding: 48px 16px
	}
}

.ds-skip-link {
	position: fixed;
	left: 12px;
	top: -100px;
	z-index: 10001;
	background: #fff;
	color: #0b1526;
	padding: 12px 20px;
	box-shadow: 0 3px 12px #0003
}

.ds-skip-link:focus {
	top: 12px
}

.ds-service-nav {
	position: relative
}

.ds-service-nav summary {
	display: flex;
	align-items: center;
	gap: 8px;
	cursor: pointer;
	min-height: 44px;
	list-style: none
}

.ds-service-nav>details>ul {
	list-style: none;
	position: absolute;
	top: 100%;
	left: 0;
	width: 300px;
	max-width: 80vw;
	margin: 0;
	padding: 12px;
	background: white;
	border: 1px solid #d7e4f0;
	border-radius: 12px;
	box-shadow: 0 12px 32px #10213a26;
	z-index: 1000
}

.ds-service-nav a {
	display: block;
	padding: 10px;
	color: #0b1526;
	font-size: 14px
}

.ds-service-nav a:hover {
	background: #eef6fc
}

.ds-service-nav summary:focus-visible {
	outline: 2px solid #2563eb;
	outline-offset: 3px
}

@media(max-width:1180px) {
	.ds-service-nav>details>ul {
		position: static;
		width: auto;
		max-width: none;
		box-shadow: none
	}

	.ds-service-nav {
		width: 100%
	}
}

/* Backdrop filters create a containing block for fixed descendants. The mobile
   Navigation dialog must cover the viewport, rather than the header's height. */
@media(max-width:1180px) {
	.ds-header {
		-webkit-backdrop-filter: none;
		backdrop-filter: none
	}

	.ds-nav .wp-block-navigation__responsive-container.is-menu-open {
		background: #fff;
		color: #0b1526;
		min-height: 100dvh
	}

	.ds-nav .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__container {
		width: 100%;
		align-items: stretch
	}

	.ds-nav .wp-block-navigation__responsive-container.is-menu-open .ds-geo-nav {
		width: 100%
	}
}

.ds-detail>.wp-block-post-content:not(:has(.deckscale-ref-preview)):not(:has(.deckscale-home-preview)) {
	max-width: 1200px;
	margin: 32px auto;
	padding: 0 24px;
	box-sizing: border-box
}

.ds-detail>.wp-block-post-content:not(:has(.deckscale-ref-preview)) h2 {
	margin-block: 28px 16px
}

.ds-nav .wp-block-navigation__responsive-container.is-menu-open {
	box-sizing: border-box
}

/* WordPress kebab-cases numeric preset slugs (h1 → h-1). Keep aliases for the
   original theme's saved references so existing typography controls still work. */
:root {
	--wp--preset--font-size--h1: var(--wp--preset--font-size--h-1, clamp(2.5rem, 4.6vw, 4.1rem));
	--wp--preset--font-size--h2: var(--wp--preset--font-size--h-2, clamp(1.8rem, 3.2vw, 2.7rem));
	--wp--preset--font-size--h3: var(--wp--preset--font-size--h-3, 1.35rem);
	--wp--preset--font-size--h4: var(--wp--preset--font-size--h-4, 1.08rem)
}

.has-h1-font-size {
	font-size: var(--wp--preset--font-size--h1) !important
}

.has-h2-font-size {
	font-size: var(--wp--preset--font-size--h2) !important
}

.has-h3-font-size {
	font-size: var(--wp--preset--font-size--h3) !important
}

.has-h4-font-size {
	font-size: var(--wp--preset--font-size--h4) !important
}

@media(min-width:1181px) {
	.ds-header:has(.ds-geo-nav>details[open]) {
		-webkit-backdrop-filter: none;
		backdrop-filter: none
	}

	.admin-bar .ds-geo-nav .ds-geo-menu {
		max-height: calc(100dvh - var(--wp--custom--header-height, 76px) - 56px)
	}
}