/*
Theme Name: HD Web Mobile
Theme URI: https://hdwebmobile.com
Author: hdwebmobile
Author URI: https://profiles.wordpress.org/htrxuan/
Description: A mobile-first WordPress block theme for the hdwebmobile WooCommerce plugin showcase. Standalone (no parent theme).
Requires at least: 6.5
Tested up to: 6.7
Requires PHP: 7.4
Version: 1.1.0
License: GNU General Public License v2 or later
License URI: LICENSE
Text Domain: hdwebmobile
Tags: full-site-editing, block-patterns, e-commerce, one-column, custom-colors, custom-logo, translation-ready
*/

/* Skip link */
.skip-link {
	position: absolute;
	left: -9999px;
	top: 0;
	z-index: 999999;
	padding: 12px 20px;
	background: var(--wp--preset--color--forest-dark);
	color: var(--wp--preset--color--cream);
	border-radius: 0 0 8px 0;
}
.skip-link:focus {
	left: 0;
}

/* Icon badge used for the site mark and plugin card icons */
.icon-badge {
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	border-radius: 50%;
	border: 2px solid rgba(255, 255, 255, 0.4);
	background: var(--wp--preset--gradient--badge);
}
.icon-badge svg {
	width: 56%;
	height: 56%;
	display: block;
}

/* Plugin card */
.plugin-card {
	transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
	border: 1px solid var(--wp--preset--color--cream-dim);
}
.plugin-card:hover,
.plugin-card:focus-within {
	transform: translateY(-2px);
	box-shadow: 0 12px 24px rgba(15, 61, 46, 0.12);
	border-color: var(--wp--preset--color--emerald);
}
.plugin-card .plugin-card__link {
	font-weight: 700;
	color: var(--wp--preset--color--emerald);
}

/* Header: "Get started" button hidden on small screens, shown once nav goes inline.
   !important is needed because WP's own layout support outputs "body .is-layout-flex
   { display: flex; }", which outranks a plain single-class selector. */
.header-cta {
	display: none !important;
}
@media (min-width: 782px) {
	.header-cta {
		display: inline-flex !important;
	}
}

/* Site title should never wrap and crowd the hamburger/logo on narrow screens */
.wp-block-site-title,
.wp-block-site-title a {
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

/* Navigation overlay (mobile hamburger menu).
   WP wraps nav items in .wp-block-navigation__responsive-dialog at every width;
   it's only an actual full-screen modal when aria-modal="true" (menu open on
   mobile). By default it's just position:relative inside the header's own
   padded row, so it renders as an inset box instead of a true full-screen
   takeover — position:fixed + inset:0 here escapes that. */
.wp-block-navigation__responsive-dialog[aria-modal="true"] {
	position: fixed !important;
	inset: 0 !important;
	width: 100% !important;
	max-width: none !important;
	height: 100vh !important;
	height: 100dvh !important;
	margin: 0 !important;
	box-sizing: border-box;
	background: var(--wp--preset--color--forest-dark);
	z-index: 999999;
}
.wp-block-navigation__responsive-dialog[aria-modal="true"] .wp-block-navigation__responsive-container-content {
	display: flex;
	flex-direction: column;
	/* Override: the nav block's own "justifyContent: right" (meant for the
	   desktop inline layout) otherwise leaks in here as align-items:flex-end,
	   shrink-wrapping the whole menu to a narrow box pinned to the right. */
	align-items: stretch !important;
	justify-content: center;
	height: 100%;
	padding: 32px;
	box-sizing: border-box;
}
.wp-block-navigation__responsive-dialog[aria-modal="true"] .wp-block-navigation__container {
	display: flex !important;
	flex-direction: column !important;
	align-items: stretch !important;
	width: 100% !important;
	gap: 4px;
}
.wp-block-navigation__responsive-dialog[aria-modal="true"] .wp-block-navigation-item {
	/* The <li> itself is display:flex with its own right-justification
	   (inherited from the same desktop "justifyContent: right" setting) —
	   override so the link inside it stretches full width and sits left. */
	width: 100% !important;
	justify-content: flex-start !important;
}
.wp-block-navigation__responsive-dialog[aria-modal="true"] .wp-block-navigation-item__content {
	display: block;
	width: 100%;
	padding: 16px 4px !important;
	border-bottom: 1px solid rgba(247, 243, 233, 0.14);
	font-family: var(--wp--preset--font-family--heading);
	font-size: clamp(1.5rem, 1.1rem + 3vw, 2rem);
	font-weight: 700;
	color: var(--wp--preset--color--cream) !important;
	transition: opacity var(--motion-fast, 180ms) ease;
}
.wp-block-navigation__responsive-dialog[aria-modal="true"] .wp-block-navigation-item:last-child .wp-block-navigation-item__content {
	border-bottom: none;
}
.wp-block-navigation__responsive-dialog[aria-modal="true"] .wp-block-navigation-item__content:hover,
.wp-block-navigation__responsive-dialog[aria-modal="true"] .wp-block-navigation-item__content:active {
	opacity: 0.7;
}
.wp-block-navigation__responsive-dialog[aria-modal="true"] .wp-block-navigation-item__label {
	color: var(--wp--preset--color--cream) !important;
}
.wp-block-navigation__responsive-dialog[aria-modal="true"] .wp-block-navigation__responsive-container-close {
	position: absolute;
	top: 24px;
	right: 24px;
	color: var(--wp--preset--color--cream) !important;
}
.wp-block-navigation__responsive-dialog[aria-modal="true"] .wp-block-navigation__responsive-container-close svg {
	fill: var(--wp--preset--color--cream);
}

/* Hero: single column on mobile, two-column with a floating illustration on desktop */
.hero-illustration {
	display: none;
}
@media (min-width: 1024px) {
	.hero-grid {
		display: grid !important;
		grid-template-columns: 1.15fr 1fr;
		gap: 48px;
		align-items: center;
	}
	.hero-copy {
		max-width: none;
	}
	.hero-illustration {
		display: block;
		position: relative;
		height: 320px;
	}
}
.hero-illustration__card {
	position: absolute;
	background: var(--wp--preset--color--cream);
	border-radius: 18px;
	padding: 20px;
	box-shadow: 0 14px 28px rgba(0, 0, 0, 0.18);
}
.hero-illustration__card--primary {
	top: 10px;
	left: 10px;
	width: 260px;
}
.hero-illustration__card--secondary {
	bottom: 30px;
	right: 0;
	width: 190px;
}

/* Generic content cards used across About/Services/Projects/Landing pages */
.feature-card {
	border: 1px solid var(--wp--preset--color--cream-dim);
	transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.feature-card:hover {
	transform: translateY(-2px);
	box-shadow: 0 12px 24px rgba(15, 61, 46, 0.1);
	border-color: var(--wp--preset--color--emerald);
}

.skill-chip {
	display: inline-flex;
	align-items: center;
	font-family: var(--wp--preset--font-family--body);
	font-weight: 700;
	font-size: 12.5px;
	color: var(--wp--preset--color--forest-dark);
	background: var(--wp--preset--color--cream);
	border: 1px solid var(--wp--preset--color--cream-dim);
	border-radius: 999px;
	padding: 8px 16px;
}

.step-num {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	border-radius: 50%;
	background: var(--wp--preset--gradient--badge);
	color: var(--wp--preset--color--cream);
	font-family: var(--wp--preset--font-family--heading);
	font-weight: 700;
	font-size: 14px;
	flex-shrink: 0;
}

.demo-card img,
.gallery-card img,
.project-card img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}
.gallery-card {
	border-radius: 16px;
	overflow: hidden;
	aspect-ratio: 4 / 3;
	background: var(--wp--preset--color--cream-dim);
}
.demo-card,
.project-card {
	border: 1px solid var(--wp--preset--color--cream-dim);
	border-radius: 16px;
	overflow: hidden;
	background: var(--wp--preset--color--cream);
}
.demo-card__shot,
.project-card__shot {
	aspect-ratio: 16 / 10;
	background: var(--wp--preset--color--cream-dim);
	overflow: hidden;
}

.contact-tile {
	display: flex;
	align-items: flex-start;
	gap: 14px;
	padding: 20px;
	border-radius: 16px;
	background: var(--wp--preset--color--cream);
	border: 1px solid var(--wp--preset--color--cream-dim);
}
.contact-tile .icon-badge {
	width: 44px;
	height: 44px;
}

.contact-form {
	display: flex;
	flex-direction: column;
	gap: 14px;
}
.contact-form label {
	display: flex;
	flex-direction: column;
	gap: 6px;
	font-family: var(--wp--preset--font-family--body);
	font-weight: 700;
	font-size: 13px;
	color: var(--wp--preset--color--forest-dark);
}
.contact-form input[type="text"],
.contact-form input[type="email"],
.contact-form textarea {
	font-family: var(--wp--preset--font-family--body);
	font-weight: 400;
	font-size: 15px;
	color: var(--wp--preset--color--forest-dark);
	background: var(--wp--preset--color--white);
	border: 1px solid var(--wp--preset--color--cream-dim);
	border-radius: 10px;
	padding: 12px 14px;
	resize: vertical;
}
.contact-form input:focus,
.contact-form textarea:focus {
	outline: 2px solid var(--wp--preset--color--emerald);
	outline-offset: 1px;
}
.contact-form button {
	font-family: var(--wp--preset--font-family--body);
	font-weight: 700;
	font-size: 14px;
	color: var(--wp--preset--color--cream);
	background: var(--wp--preset--color--emerald);
	border: none;
	border-radius: 10px;
	padding: 13px 22px;
	cursor: pointer;
	align-self: flex-start;
}
.contact-form button:hover {
	background: var(--wp--preset--color--forest-light);
}
.contact-form__honeypot {
	position: absolute;
	left: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}
.contact-form__notice {
	display: none;
	border-radius: 10px;
	padding: 12px 16px;
	font-size: 13.5px;
	font-weight: 600;
}
.contact-form__notice.is-visible {
	display: block;
}
.contact-form__notice--success {
	background: rgba(22, 163, 74, 0.12);
	color: var(--wp--preset--color--forest-dark);
}
.contact-form__notice--error {
	background: rgba(220, 38, 38, 0.1);
	color: #9d1c1c;
}

/* Trust strip icons */
.trust-item {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 8px;
	text-align: center;
}
.trust-item svg {
	width: 22px;
	height: 22px;
}
@media (min-width: 782px) {
	.trust-item {
		flex-direction: row;
		gap: 10px;
	}
}

/* ==========================================================================
   Motion — tasteful, restrained: fade+rise entrances, scroll reveals, and
   subtle hover lift. Respects prefers-reduced-motion throughout.
   ========================================================================== */
:root {
	--motion-fast: 180ms;
	--motion-base: 550ms;
	--motion-ease: cubic-bezier(0.16, 1, 0.3, 1);
}

/* Buttons and links: a small lift on hover, settle on press */
.wp-element-button,
.wp-block-button__link,
.plugin-card__link,
a.contact-tile {
	transition: transform var(--motion-fast) var(--motion-ease), background-color var(--motion-fast) var(--motion-ease), box-shadow var(--motion-fast) var(--motion-ease);
}
.wp-element-button:hover,
.wp-block-button__link:hover {
	transform: translateY(-1px);
}
.wp-element-button:active,
.wp-block-button__link:active {
	transform: translateY(0);
}

/* Hero: fade + rise on load, small stagger across the eyebrow/heading/copy/buttons */
.hero-copy > * {
	opacity: 0;
	transform: translateY(16px);
	animation: hdwebmobile-rise var(--motion-base) var(--motion-ease) forwards;
}
.hero-copy > *:nth-child(1) { animation-delay: 60ms; }
.hero-copy > *:nth-child(2) { animation-delay: 150ms; }
.hero-copy > *:nth-child(3) { animation-delay: 240ms; }
.hero-copy > *:nth-child(4) { animation-delay: 330ms; }
.hero-illustration {
	opacity: 0;
	transform: translateY(16px);
	animation: hdwebmobile-rise var(--motion-base) var(--motion-ease) forwards;
	animation-delay: 280ms;
}

@keyframes hdwebmobile-rise {
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

/* Scroll reveal: cards and section headings fade + rise into place once,
   as they cross into view. Content is visible by default (safe if JS fails
   to load or run); only .has-motion (set by motion.js, before it hides
   anything) switches .u-reveal to its hidden starting state, so a real
   visitor never gets stuck with invisible content. */
.has-motion .u-reveal {
	opacity: 0;
	transform: translateY(20px);
	transition: opacity var(--motion-base) var(--motion-ease), transform var(--motion-base) var(--motion-ease);
}
.u-reveal.is-visible {
	opacity: 1;
	transform: translateY(0);
}
/* Small extra stagger for cards sharing a row on wider screens */
.wp-block-columns .wp-block-column:nth-child(2) > .u-reveal,
.wp-block-columns .wp-block-column:nth-child(2).u-reveal {
	transition-delay: 70ms;
}
.wp-block-columns .wp-block-column:nth-child(3) > .u-reveal,
.wp-block-columns .wp-block-column:nth-child(3).u-reveal {
	transition-delay: 140ms;
}

@media (prefers-reduced-motion: reduce) {
	.hero-copy > *,
	.hero-illustration,
	.u-reveal {
		animation: none !important;
		transition: none !important;
		opacity: 1 !important;
		transform: none !important;
	}
	.wp-element-button:hover,
	.wp-block-button__link:hover {
		transform: none;
	}
}
