/* ==========================================================================
   MM Portfolio — custom.css
   All custom styles for the child theme.

   Animation classes (add via block Advanced → Additional CSS class):
     .anim-fade-up   — fade in + slide up on scroll
     .anim-fade-in   — fade in on scroll (no movement)
     .anim-stagger   — animate direct children in sequence on scroll
     .anim-hero      — CSS-only load animation (for hero elements, no JS needed)
   ========================================================================== */


/* --------------------------------------------------------------------------
   1. SECTION COLOUR VARIATIONS
   Defined here (not relying on theme.json CSS generation) so they always
   work on the frontend and in the Site Editor via add_editor_style().
   Applied to Group, Columns and Column blocks via the Styles panel.
   -------------------------------------------------------------------------- */

:root :where(.wp-block-group.is-style-section-1),
:root :where(.wp-block-columns.is-style-section-1),
:root :where(.wp-block-column.is-style-section-1) {
	background-color: var(--wp--preset--color--accent-5);
	color: var(--wp--preset--color--contrast);
}

:root :where(.wp-block-group.is-style-section-2),
:root :where(.wp-block-columns.is-style-section-2),
:root :where(.wp-block-column.is-style-section-2) {
	background-color: var(--wp--preset--color--accent-2);
	color: var(--wp--preset--color--contrast);
}

:root :where(.wp-block-group.is-style-section-3),
:root :where(.wp-block-columns.is-style-section-3),
:root :where(.wp-block-column.is-style-section-3) {
	background-color: var(--wp--preset--color--accent-1);
	color: var(--wp--preset--color--contrast);
}

:root :where(.wp-block-group.is-style-section-4),
:root :where(.wp-block-columns.is-style-section-4),
:root :where(.wp-block-column.is-style-section-4) {
	background-color: var(--wp--preset--color--accent-3);
	color: var(--wp--preset--color--accent-2);
}

:root :where(.wp-block-group.is-style-section-5),
:root :where(.wp-block-columns.is-style-section-5),
:root :where(.wp-block-column.is-style-section-5) {
	background-color: var(--wp--preset--color--contrast);
	color: var(--wp--preset--color--base);
}


/* --------------------------------------------------------------------------
   2. BASE
   -------------------------------------------------------------------------- */

html {
	scroll-behavior: smooth;
}

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

/* Remove default link underline thickness override from parent
   (we handle links in theme.json) */
a {
	text-decoration-thickness: 1px !important;
	text-underline-offset: 0.1em;
}


/* --------------------------------------------------------------------------
   2. NAVIGATION
   -------------------------------------------------------------------------- */

.wp-block-navigation-item__content {
	transition: color 0.25s ease;
	text-decoration: none;
}

/* Kill the global-styles hover rule that adds a static underline back,
   which doubles up with our animated ::after underline below. */
:root :where(.wp-block-navigation a:where(:not(.wp-element-button)):hover) {
	text-decoration: none;
}

/* Animated underline on nav links */
.wp-block-navigation-item__content {
	position: relative;
}

.wp-block-navigation-item__content::after {
	content: '';
	position: absolute;
	bottom: -2px;
	left: 0;
	width: 0;
	height: 1px;
	background: currentColor;
	transition: width 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.wp-block-navigation-item:hover .wp-block-navigation-item__content::after,
.wp-block-navigation-item.current-menu-item .wp-block-navigation-item__content::after {
	width: 100%;
}

/* Site title hover */
:root :where(.wp-block-site-title a:where(:not(.wp-element-button))) {
	transition: color 0.25s ease;
}

:root :where(.wp-block-site-title a:where(:not(.wp-element-button)):hover) {
	text-decoration: none;
	color: var(--wp--preset--color--accent-1);
}


/* --------------------------------------------------------------------------
   3. BUTTONS
   -------------------------------------------------------------------------- */

.wp-block-button__link {
	transition: opacity 0.2s ease, background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.wp-element-button:hover,
.wp-block-button__link:hover {
	opacity: 0.88;
}

/* Outline variant: hover handled via theme.json css property */


/* --------------------------------------------------------------------------
   4. ACCORDION
   -------------------------------------------------------------------------- */

/* Remove hover underline */
.wp-block-accordion-heading button:hover .wp-block-accordion-heading__toggle-title {
	text-decoration: none;
	color: var(--wp--preset--color--accent-1);
}

.wp-block-accordion-heading button .wp-block-accordion-heading__toggle-title {
	transition: color 0.3s ease;
}

/* Icon: rotate + → × on open */
.wp-block-accordion-heading__toggle-icon {
	font-weight: 300;
	transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}

button[aria-expanded="true"] .wp-block-accordion-heading__toggle-icon {
	transform: rotate(45deg);
}

/* Smooth open/close — height animation handled by JS (MutationObserver).
   display:block !important overrides WordPress's display:none on [inert] panels.
   Padding is zeroed here (it causes height:0 to render at 40px) and moved
   to first/last children so the animation truly starts from 0. */
.wp-block-accordion-panel {
	display: block !important;
	overflow: hidden;
	height: 0;
	opacity: 0;
	padding-top: 0 !important;
	padding-bottom: 0 !important;
}

.wp-block-accordion-panel > *:first-child {
	margin-top: var(--wp--preset--spacing--30);
}

.wp-block-accordion-panel > *:last-child {
	margin-bottom: var(--wp--preset--spacing--30);
}


/* --------------------------------------------------------------------------
   5. FOCUS STYLES
   -------------------------------------------------------------------------- */

:where(.wp-site-blocks *:focus) {
	outline-width: 0;
	outline-style: inherit;
}


/* --------------------------------------------------------------------------
   6. ACCENT COLOR GLOW
   -------------------------------------------------------------------------- */

.has-accent-1-color {
	text-shadow: 0 0 4px #ff4f0011;
}


/* --------------------------------------------------------------------------
   7. SCROLL ANIMATIONS
   All three classes start hidden; JS adds .anim-visible when in viewport.
   .anim-hero runs on load via CSS keyframe (no JS needed).
   -------------------------------------------------------------------------- */

.anim-fade-up {
	opacity: 0;
	transform: translateY(28px);
	transition:
		opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
		transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

.anim-fade-in {
	opacity: 0;
	transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

.anim-fade-up.anim-visible,
.anim-fade-in.anim-visible {
	opacity: 1;
	transform: translateY(0);
}

/* Stagger: children animate in sequence */
.anim-stagger > * {
	opacity: 0;
	transform: translateY(20px);
	transition:
		opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1),
		transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.anim-stagger.anim-visible > *:nth-child(1) { transition-delay: 0.05s; }
.anim-stagger.anim-visible > *:nth-child(2) { transition-delay: 0.12s; }
.anim-stagger.anim-visible > *:nth-child(3) { transition-delay: 0.19s; }
.anim-stagger.anim-visible > *:nth-child(4) { transition-delay: 0.26s; }
.anim-stagger.anim-visible > *:nth-child(5) { transition-delay: 0.33s; }
.anim-stagger.anim-visible > *:nth-child(6) { transition-delay: 0.40s; }
.anim-stagger.anim-visible > * {
	opacity: 1;
	transform: translateY(0);
}

/* Hero: CSS-only, runs on page load, no JS */
.anim-hero {
	animation: mmHeroFadeUp 0.9s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.anim-hero:nth-child(2) { animation-delay: 0.12s; }
.anim-hero:nth-child(3) { animation-delay: 0.22s; }
.anim-hero:nth-child(4) { animation-delay: 0.32s; }

@keyframes mmHeroFadeUp {
	from {
		opacity: 0;
		transform: translateY(22px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
	.anim-fade-up,
	.anim-fade-in,
	.anim-stagger > *,
	.anim-hero {
		animation: none !important;
		transition: none !important;
		opacity: 1 !important;
		transform: none !important;
	}
}


/* --------------------------------------------------------------------------
   8. HEADING STYLE VARIATIONS
   Add via block Advanced → Additional CSS class, or use the Styles panel.
   .is-style-display    — oversized, light weight, for hero headings
   .is-style-subtitle   — muted grey, body-scale, for secondary headings
   .is-style-annotation — tiny, uppercase, wide tracking, for labels/eyebrows
   -------------------------------------------------------------------------- */

:root :where(.wp-block-heading.is-style-text-display) {
	font-size: var(--wp--preset--font-size--xx-large);
	font-weight: 300;
	letter-spacing: -0.04em;
	line-height: 1.08;
}

:root :where(.wp-block-heading.is-style-text-subtitle) {
	font-size: var(--wp--preset--font-size--large);
	font-weight: 400;
	letter-spacing: -0.01em;
	line-height: 1.4;
	color: var(--wp--preset--color--accent-3);
}

:root :where(.wp-block-heading.is-style-text-annotation) {
	font-size: var(--wp--preset--font-size--small);
	font-weight: 400;
	letter-spacing: 0.12em;
	line-height: 1.5;
	text-transform: uppercase;
	color: var(--wp--preset--color--accent-3);
}


/* --------------------------------------------------------------------------
   9. PROJECT CARD — IMAGE HOVER
   Add class "project-card-image" to the Cover block in the card template.
   The Cover block's link option (toolbar → chain icon) points to the project.
   -------------------------------------------------------------------------- */

/* Works with Image block — add class "project-card-image" to the block.
   Set the link via toolbar → chain icon → Custom URL → project page URL. */

.project-card-image.wp-block-image {
	position: relative;
	overflow: hidden;
	display: block; /* ensures ::after is positioned against the figure */
}

.project-card-image.wp-block-image a {
	display: block;
	overflow: hidden;
	border-radius: inherit;
}

/* Zoom the image */
.project-card-image.wp-block-image img {
	display: block;
	width: 100%;
	transition: transform 0.9s cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* "View" pill — appears centred on hover */
.project-card-image.wp-block-image::after {
	content: 'View';
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%) scale(0.82);
	opacity: 0;
	background: rgba(255, 255, 255, 0.8);
	color: var(--wp--preset--color--contrast);
	border-radius: 100px;
	padding: 14px 28px;
	font-family: var(--wp--preset--font-family--tt-hoves);
	font-size: var(--wp--preset--font-size--small);
	font-weight: 500;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	white-space: nowrap;
	pointer-events: none;
	z-index: 20;
	transition:
		opacity 0.35s ease,
		transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.project-card-image.wp-block-image:hover::after {
	opacity: 1;
	transform: translate(-50%, -50%) scale(1);
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
	.project-card-image.wp-block-image img {
		transition: none;
	}
	.project-card-image.wp-block-image::after {
		transition: none;
	}
}

/* Project card title link — add class "project-title-link" to the heading block */
.project-title-link a {
	color: var(--wp--preset--color--contrast);
	text-decoration: none;
	transition: color 0.9s ease; /* slow out — cursor leaving */
}

.project-title-link a:hover {
	color: var(--wp--preset--color--accent-1);
	text-decoration: none;
	transition: color 0.25s ease; /* fast in — cursor entering */
}


/* --------------------------------------------------------------------------
   10. ROUNDED VIDEO
   Add class "rounded-video" to the Video block via Advanced → Additional CSS class.
   -------------------------------------------------------------------------- */

.rounded-video.wp-block-video {
	border-radius: 32px;
	overflow: hidden; /* clips the video element to the rounded corners */
}

.rounded-video.wp-block-video video {
	border-radius: 32px; /* belt-and-braces for browsers that need it on the element too */
	display: block; /* removes the inline gap below the video */
}


/* --------------------------------------------------------------------------
   11. CONTACT FORM 7
   -------------------------------------------------------------------------- */

/* Outer wrapper: fluid, fills any column width */
.wpcf7 {
	width: 100%;
}

/* Labels as block wrappers with gap between fields */
.wpcf7-form label {
	display: block;
	width: 100%;
	margin-bottom: 12px;
}

/* CF7 control wrap span — must be block for width: 100% to work */
.wpcf7-form .wpcf7-form-control-wrap {
	display: block;
	width: 100%;
}

/* Text, email, textarea fields */
.wpcf7-form input[type="text"],
.wpcf7-form input[type="email"],
.wpcf7-form textarea {
	width: 100%;
	box-sizing: border-box;
	background: var(--wp--preset--color--accent-5);
	border: none;
	border-radius: 14px;
	padding: 24px 28px;
	font-family: var(--wp--preset--font-family--tt-hoves);
	font-size: var(--wp--preset--font-size--large);
	font-weight: 400;
	color: var(--wp--preset--color--contrast);
	outline: none;
	-webkit-appearance: none;
	appearance: none;
	transition: background 0.2s ease;
}

.wpcf7-form input[type="text"]::placeholder,
.wpcf7-form input[type="email"]::placeholder,
.wpcf7-form textarea::placeholder {
	color: var(--wp--preset--color--accent-3);
}

.wpcf7-form input[type="text"]:focus,
.wpcf7-form input[type="email"]:focus,
.wpcf7-form textarea:focus {
	background: #ebebeb;
}

.wpcf7-form textarea {
	resize: none;
	min-height: 200px;
}

/* Submit button */
.wpcf7-form input[type="submit"] {
	display: block;
	width: 100%;
	box-sizing: border-box;
	background: var(--wp--preset--color--contrast);
	color: #ffffff;
	border: none;
	border-radius: 14px;
	padding: 28px 32px;
	font-family: var(--wp--preset--font-family--tt-hoves);
	font-size: var(--wp--preset--font-size--large);
	font-weight: 400;
	cursor: pointer;
	-webkit-appearance: none;
	appearance: none;
	transition: opacity 0.2s ease;
	margin-top: 4px;
}

.wpcf7-form input[type="submit"]:hover {
	opacity: 0.85;
}

/* Privacy notice */
.wpcf7-form .privacy-notice {
	font-size: var(--wp--preset--font-size--small);
	color: var(--wp--preset--color--accent-3);
	margin-bottom: 12px;
}

/* CF7 wraps contents in a <p> — flex goes here, not on the div */
.wpcf7-form .privacy-notice p {
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 0;
}

.wpcf7-form .privacy-notice img {
	width: 24px;
	height: 24px;
	flex-shrink: 0;
}

.wpcf7-form .privacy-notice a {
	color: var(--wp--preset--color--accent-3);
	text-decoration: underline;
	text-underline-offset: 0.1em;
}
