/*
 * HiFiSPIN Swiss — layout and components that theme.json can't express.
 * Grid: 12 columns, 20px gutters, 40px margins (20px on mobile).
 */

:root {
	--hf-ink: var(--wp--preset--color--ink);
	--hf-paper: var(--wp--preset--color--paper);
	--hf-alt: var(--wp--preset--color--paper-alt);
	--hf-line: var(--wp--preset--color--line);
	--hf-muted: var(--wp--preset--color--muted);
	--hf-accent: var(--wp--preset--color--accent);
	--hf-mono: var(--wp--preset--font-family--mono);
	--hf-gutter: var(--wp--custom--gutter, clamp(20px, 2.78vw, 40px));
	--hf-gap: 20px;
	--hf-section: clamp(96px, 11vw, 160px);
	--hf-rule: 1px solid var(--hf-ink);
}

html { scroll-behavior: smooth; }
body { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility; }
::selection { background: var(--hf-accent); color: var(--hf-paper); }
a { text-underline-offset: .18em; text-decoration-thickness: 1px; }
:focus-visible { outline: 2px solid var(--hf-accent); outline-offset: 2px; }

/* Neutralise WordPress block-gap margins inside grid containers — on the site AND in the editor. */
.hf-section-head.hf-section-head > *, .hf-hero__row.hf-hero__row > *, .hf-studio.hf-studio > *, .hf-project-intro.hf-project-intro > *,
.hf-text-offset.hf-text-offset > *, .hf-results.hf-results > *, .hf-caps.hf-caps > *, .hf-contact.hf-contact > *,
.hf-footer__cols.hf-footer__cols > *, .hf-footer__bottom.hf-footer__bottom > *, .hf-header.hf-header > * { margin-block: 0 !important; }

/* ---------- Type helpers ---------- */
.hf-display-xl { font-size: var(--wp--preset--font-size--display-xl) !important; font-weight: 700 !important; line-height: .92 !important; letter-spacing: -.05em !important; margin: 0; }
.hf-display { font-size: var(--wp--preset--font-size--display) !important; font-weight: 700 !important; line-height: .95 !important; letter-spacing: -.04em !important; }
.hf-title-l { font-size: var(--wp--preset--font-size--title-l) !important; font-weight: 700 !important; line-height: .98 !important; letter-spacing: -.03em !important; }
.hf-lead { font-size: var(--wp--preset--font-size--lead); line-height: 1.4; letter-spacing: -.005em; }
.hf-meta, .hf-index, .hf-aside, .hf-caption, .hf-tagline {
	font-family: var(--hf-mono); font-size: var(--wp--preset--font-size--meta) !important; letter-spacing: .04em; text-transform: uppercase; line-height: 1.4;
}
.hf-meta a, .hf-caption a { color: inherit; text-decoration: none; }
.hf-meta a:hover { color: var(--hf-accent); }
.hf-muted { color: var(--hf-muted); }
.hf-red, .hf-index { color: var(--hf-accent); }
.hf-aside { color: var(--hf-muted); }

/* ---------- Header ---------- */
.hf-site-header { position: sticky; top: 0; z-index: 50; background: var(--hf-paper); }
.admin-bar .hf-site-header { top: var(--wp-admin--admin-bar--height, 32px); }
.hf-header {
	display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: var(--hf-gap);
	padding: 24px var(--hf-gutter); border-bottom: 0.25px solid var(--hf-ink);
}
.hf-logo { margin: 0; display: flex; align-items: center; gap: 12px; }
.hf-logo::before { content: ""; width: 14px; height: 14px; background: var(--hf-accent); flex: none; }
.hf-logo a { text-decoration: none; color: var(--hf-ink); }
.hf-tagline { color: var(--hf-muted); text-align: center; }
.hf-nav { justify-self: end; }
.hf-nav .wp-block-navigation__container { gap: 32px; }
.hf-nav a { text-decoration: none; transition: color .15s; }
.hf-nav a:hover, .hf-nav a:focus-visible { color: var(--hf-accent) !important; }
.hf-nav .current-menu-item > a, .hf-nav a[aria-current] { color: var(--hf-accent); }
body.post-type-archive-project .hf-nav a[href$="/work/"], body.single-project .hf-nav a[href$="/work/"], body.tax-discipline .hf-nav a[href$="/work/"] { color: var(--hf-accent); }
.hf-nav .wp-block-navigation__responsive-container.is-menu-open { padding: 24px var(--hf-gutter); }
.hf-nav .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__container { gap: 8px; font-size: var(--wp--preset--font-size--title-m); }
@media (max-width: 999px) {
	.hf-header { grid-template-columns: 1fr auto; padding-block: 20px; }
	.hf-tagline { display: none; }
}

/* ---------- Main + sections ---------- */
.hf-main { padding-top: clamp(48px, 7vw, 96px); padding-bottom: var(--hf-section); }
.hf-main--project { padding-top: clamp(32px, 4.5vw, 64px); }
.hf-main > .hf-section, .hf-main > .hf-entry, .hf-main > .wp-block-shortcode, .hf-main > .hf-next { margin-block-start: var(--hf-section) !important; }
.hf-main > :first-child { margin-block-start: 0 !important; }
.hf-section > * + * { margin-block-start: 40px !important; }

.hf-section-head {
	display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--hf-gap); align-items: baseline;
	border-top: var(--hf-rule); padding-top: 20px;
}
.hf-section-head .hf-index { grid-column: 1; }
.hf-section-head .hf-section-title { grid-column: 2 / span 7; margin: 0; }
.hf-section-head .hf-aside { grid-column: 9 / -1; text-align: right; margin: 0; }
@media (max-width: 781px) {
	.hf-section-head { grid-template-columns: auto 1fr; }
	.hf-section-head .hf-index { display: none; }
	.hf-section-head .hf-section-title { grid-column: 1; }
	.hf-section-head .hf-aside { grid-column: 2; }
}

.hf-page-head > * + * { margin-block-start: 24px !important; }
.hf-page-head { padding-bottom: clamp(40px, 5vw, 64px); border-bottom: var(--hf-rule); }
.hf-page-head + * { margin-block-start: clamp(40px, 5vw, 64px) !important; }
.hf-page-head .hf-lead { max-width: 785px; }

/* ---------- Home hero ---------- */
.hf-hero > * + * { margin-block-start: clamp(40px, 5vw, 64px) !important; }
.hf-hero .hf-display-xl { max-width: 13ch; }
.hf-hero__row { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--hf-gap); align-items: end; }
.hf-hero__row .hf-lead { grid-column: 1 / span 6; margin: 0; }
.hf-hero__row .wp-block-buttons { grid-column: 10 / -1; justify-content: flex-end; }
@media (max-width: 999px) {
	.hf-hero__row { grid-template-columns: 1fr; }
	.hf-hero__row .hf-lead, .hf-hero__row .wp-block-buttons { grid-column: 1; justify-content: flex-start; }
}

/* ---------- Studio / about split ---------- */
.hf-studio { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--hf-gap); align-items: start; }
.hf-studio .hf-portrait { grid-column: 1 / span 5; margin: 0; aspect-ratio: 4 / 5; background: var(--hf-alt); overflow: hidden; }
.hf-studio .hf-portrait img { width: 100%; height: 100%; object-fit: cover; }
.hf-studio__text { grid-column: 7 / -1; }
.hf-studio__text > * + * { margin-block-start: 32px !important; }
.hf-studio__text .hf-title-l { margin: 0; }
@media (max-width: 999px) {
	.hf-studio { grid-template-columns: 1fr; gap: 40px; }
	.hf-studio .hf-portrait, .hf-studio__text { grid-column: 1; }
}

/* ---------- Capabilities + clients ---------- */
.hf-caps { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: var(--hf-gap); }
.hf-cap > * { margin: 0 !important; }
.hf-cap > * + * { margin-top: 12px !important; }
.hf-client-list { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); column-gap: var(--hf-gap); }
.hf-client-list li { padding: 14px 0; border-bottom: 1px solid var(--hf-line); font-size: var(--wp--preset--font-size--title-s); font-weight: 500; letter-spacing: -.01em; }
@media (max-width: 999px) { .hf-caps { grid-template-columns: repeat(3, 1fr); row-gap: 40px; } .hf-client-list { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .hf-caps { grid-template-columns: repeat(2, 1fr); } .hf-client-list { grid-template-columns: 1fr; } }

/* ---------- Single project ---------- */
.hf-project-head > * + * { margin-block-start: clamp(24px, 3vw, 40px) !important; }
.hf-project-head .hf-display-xl { margin-top: 32px !important; }
.hf-project-intro {
	display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--hf-gap);
	border-top: var(--hf-rule); padding-top: 24px; align-items: start;
}
.hf-project-intro .hf-project-lead { grid-column: 1 / span 7; }
.hf-project-intro .hf-project-lead p {
	margin: 0; color: var(--hf-ink); font-size: var(--wp--preset--font-size--title-m); font-weight: 500; letter-spacing: -.02em; line-height: 1.15;
}
.hf-project-intro > .wp-block-shortcode, .hf-project-intro > .hf-facts { grid-column: 9 / -1; }
@media (max-width: 999px) {
	.hf-project-intro { grid-template-columns: 1fr; gap: 40px; }
	.hf-project-intro > * { grid-column: 1 !important; }
}

/* Content blocks inside a project (and pages built from patterns) */
.hf-entry > * { margin-block: 0 !important; }
.hf-entry > * + * { margin-block-start: clamp(64px, 8vw, 120px) !important; }
.hf-entry--post > * + * { margin-block-start: 24px !important; }
.hf-entry > p:not([class]), .hf-entry > ul:not([class]), .hf-entry > ol:not([class]), .hf-entry > h2:not([class]), .hf-entry > h3:not([class]) { max-width: 785px; }
.hf-entry > p:not([class]) + p:not([class]) { margin-block-start: 1em !important; }
.hf-block > * { margin-block: 0 !important; }
.hf-block > * + * { margin-block-start: 16px !important; }
.hf-caption { display: flex; gap: var(--hf-gap); color: var(--hf-muted); margin: 0; }
.hf-caption strong { font-weight: 400; color: var(--hf-accent); flex: 0 0 auto; min-width: calc((100% - 11 * var(--hf-gap)) / 12); }
.hf-embed, .hf-img-full { margin: 0; }
.hf-embed .wp-block-embed__wrapper { background: var(--hf-ink); }
.hf-img-full img { width: 100%; height: auto; display: block; }
.wp-block-gallery.hf-gallery { gap: var(--hf-gap) !important; --wp--style--unstable-gallery-gap: var(--hf-gap); margin: 0; }
.wp-block-gallery.hf-gallery .wp-block-image img { width: 100%; height: 100%; object-fit: cover; }
.wp-block-gallery.hf-gallery--2up .wp-block-image { aspect-ratio: 3 / 2; }
.wp-block-gallery.hf-gallery--social .wp-block-image { aspect-ratio: 4 / 5; }
.wp-block-gallery.hf-gallery:empty, .hf-img-full:not(:has(img[src])) { display: none; }

.hf-text-offset { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--hf-gap); }
.hf-text-offset > * + * { margin-block-start: 0 !important; }
.hf-text-offset__label { grid-column: 1 / span 3; }
.hf-text-offset__label > * { margin: 0 0 8px !important; }
.hf-text-offset__body { grid-column: 6 / -1; max-width: 785px; }
.hf-text-offset__body > * { margin: 0 !important; }
.hf-text-offset__body > * + * { margin-top: 24px !important; }
@media (max-width: 781px) { .hf-text-offset { grid-template-columns: 1fr; } .hf-text-offset > * { grid-column: 1 !important; } }

.hf-results { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--hf-gap); border-top: var(--hf-rule); padding-top: 24px; }
.hf-results > * + * { margin-block-start: 0 !important; }
.hf-results__item > * { margin: 0 !important; }
.hf-stat { font-size: var(--wp--preset--font-size--display); font-weight: 700; letter-spacing: -.04em; line-height: 1; margin-bottom: 8px !important; }
@media (max-width: 781px) { .hf-results { grid-template-columns: 1fr; gap: 32px; } }

.hf-quote { border: 0; padding: 0; border-top: var(--hf-rule); padding-top: 24px; max-width: 1015px; }
.hf-quote p { margin: 0; }
.hf-quote cite { display: block; margin-top: 24px; font-family: var(--hf-mono); font-size: 12px; font-style: normal; letter-spacing: .04em; text-transform: uppercase; color: var(--hf-muted); }

/* ---------- Contact ---------- */
.hf-contact { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--hf-gap); }
.hf-contact__intro { grid-column: 1 / span 5; }
.hf-contact__intro > * { margin: 0 0 24px !important; }
.hf-contact__form { grid-column: 7 / -1; }
.hf-form-note { border: 1px dashed var(--hf-line); padding: 24px; color: var(--hf-muted); }
@media (max-width: 999px) { .hf-contact { grid-template-columns: 1fr; } .hf-contact > * { grid-column: 1 !important; } }
/* Form plugin fields → underlined, square, Swiss */
.hf-contact__form input:not([type=checkbox]):not([type=radio]):not([type=submit]), .hf-contact__form textarea, .hf-contact__form select {
	width: 100%; border: 0 !important; border-bottom: var(--hf-rule) !important; border-radius: 0 !important; background: transparent !important;
	padding: 8px 0 12px !important; font: inherit; font-size: var(--wp--preset--font-size--lead); color: var(--hf-ink); box-shadow: none !important;
}
.hf-contact__form input:focus, .hf-contact__form textarea:focus { outline: none; border-bottom-color: var(--hf-accent) !important; }
.hf-contact__form label { font-family: var(--hf-mono); font-size: 12px; letter-spacing: .04em; text-transform: uppercase; color: var(--hf-muted); font-weight: 400; }
.hf-contact__form button, .hf-contact__form input[type=submit] {
	background: var(--hf-ink) !important; color: var(--hf-paper) !important; border: 0 !important; border-radius: 0 !important;
	padding: 16px 24px !important; font: 500 14px/1.3 var(--wp--preset--font-family--inter); cursor: pointer;
}
.hf-contact__form button:hover, .hf-contact__form input[type=submit]:hover { background: var(--hf-accent) !important; }

/* ---------- Buttons ---------- */
.wp-block-button.is-style-text .wp-block-button__link {
	background: none !important; color: var(--hf-ink) !important; padding: 0 0 6px !important; border-bottom: var(--hf-rule); border-radius: 0;
}
.wp-block-button.is-style-text .wp-block-button__link:hover { color: var(--hf-accent) !important; border-bottom-color: var(--hf-accent); }

/* ---------- Footer ---------- */
.hf-site-footer { margin: 0; }
.hf-footer { background: var(--hf-ink); color: var(--hf-paper); padding: var(--hf-section) var(--hf-gutter) 40px; }
.hf-footer a { color: var(--hf-paper); text-decoration: none; }
.hf-footer a:hover { color: var(--hf-accent); }
.hf-footer > * + * { margin-block-start: clamp(64px, 7vw, 96px) !important; }
.hf-footer__top > * { margin: 0 !important; }
.hf-footer__top > * + * { margin-top: 32px !important; }
.hf-footer .hf-display-xl { color: var(--hf-paper); }
.hf-footer__email { font-size: var(--wp--preset--font-size--title-m); font-weight: 500; letter-spacing: -.02em; }
.hf-footer__cols { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--hf-gap); }
.hf-footer__cols .wp-block-group > * { margin: 0 !important; }
.hf-footer__cols .wp-block-group > * + * { margin-top: 12px !important; }
.hf-footer__cols .hf-meta, .hf-footer__bottom .hf-meta { color: var(--hf-muted); }
.hf-footer__bottom { display: flex; justify-content: space-between; gap: 20px; border-top: 1px solid rgba(255, 255, 255, .25); padding-top: 20px; }
@media (max-width: 781px) { .hf-footer__cols { grid-template-columns: repeat(2, 1fr); row-gap: 40px; } }

/* ---------- Blog list ---------- */
.hf-post-list .wp-block-post-template { list-style: none; padding: 0; margin: 0; }
.hf-post-item { border-top: 1px solid var(--hf-line); padding: 24px 0; }
.hf-post-item > * { margin: 0 0 8px !important; }
.hf-post-item a { text-decoration: none; }

/* ---------- Editor niceties ---------- */
.editor-styles-wrapper .hf-img-full:not(:has(img[src])), .editor-styles-wrapper .wp-block-gallery.hf-gallery:empty { display: block; }

/* Portrait placeholder until a photo is added (an empty Image block renders nothing on the front end). */
.hf-studio:not(:has(.hf-portrait))::before {
	content: "Add your portrait — 4:5"; grid-column: 1 / span 5; aspect-ratio: 4 / 5; background: var(--hf-alt);
	display: flex; align-items: flex-end; padding: 16px; box-sizing: border-box;
	font-family: var(--hf-mono); font-size: 12px; letter-spacing: .04em; text-transform: uppercase; color: var(--hf-muted);
}
.hf-studio:not(:has(.hf-portrait)) .hf-studio__text { grid-column: 7 / -1; }
@media (max-width: 999px) { .hf-studio:not(:has(.hf-portrait))::before { grid-column: 1; } .hf-studio:not(:has(.hf-portrait)) .hf-studio__text { grid-column: 1; } }

/* Hide pattern blocks whose media hasn't been added yet (front end only — they stay visible in the editor). */
body:not(.editor-styles-wrapper) .hf-block--video:not(:has(iframe, video, .wp-block-embed__wrapper)),
body:not(.editor-styles-wrapper) .hf-block--2up:not(:has(img, video)),
body:not(.editor-styles-wrapper) .hf-block--social:not(:has(img, video)),
body:not(.editor-styles-wrapper) .hf-block--full:not(:has(img[src], video)),
body:not(.editor-styles-wrapper) .hf-block--gallery:not(:has(img, video)) { display: none !important; }
/* A video dropped into an image block: hide the leftover empty gallery/image, keep the video. */
.hf-block--social:has(video) .wp-block-gallery:not(:has(img)), .hf-block--2up:has(video) .wp-block-gallery:not(:has(img)), .hf-block--full:has(video) .hf-img-full:not(:has(img[src])) { display: none !important; }
/* A caption placed straight after media sits right under it. */
.hf-entry.hf-entry > * + .hf-caption { margin-block-start: 16px !important; }

/* Archive pages: title block flows straight into the work section (one rule, not two). */
.hf-main > .hf-page-head:has(+ .hf-section) { border-bottom: 0; padding-bottom: 0; }
.hf-main > .hf-page-head + .hf-section { margin-block-start: clamp(40px, 5vw, 64px) !important; }

/* ---------- Contact details (email / phone / mail / social rows) ---------- */
.hf-contact__details { grid-column: 7 / -1; }
.hf-contact-row.hf-contact-row { display: grid; grid-template-columns: 1fr 3fr; gap: var(--hf-gap); align-items: baseline; padding: 20px 0; border-bottom: 1px solid var(--hf-line); }
.hf-contact-row:first-child { border-top: 0.25px solid var(--hf-ink); }
.hf-contact-row.hf-contact-row > * { margin: 0 !important; }
.hf-contact-row .hf-meta { color: var(--hf-muted); }
.hf-contact-big { font-size: var(--wp--preset--font-size--title-m); font-weight: 500; letter-spacing: -.02em; line-height: 1.2; }
.hf-contact-big a { color: var(--hf-ink); text-decoration: none; transition: color .15s; }
.hf-contact-big a:hover { color: var(--hf-accent); }
@media (max-width: 999px) { .hf-contact__details { grid-column: 1; } }
@media (max-width: 600px) { .hf-contact-row.hf-contact-row { grid-template-columns: 1fr; gap: 4px; } }

/* ---------- Résumé icon (footer) — white, swaps to red on hover ---------- */
.hf-resume { position: relative; display: inline-block; width: 64px; height: 81px; margin-top: 12px; }
.hf-resume img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; transition: opacity .15s; }
.hf-resume .hf-resume__hover { opacity: 0; }
.hf-resume:hover .hf-resume__hover, .hf-resume:focus-visible .hf-resume__hover { opacity: 1; }
.hf-resume:hover .hf-resume__default, .hf-resume:focus-visible .hf-resume__default { opacity: 0; }
/* Résumé icon hangs in the gutter left of the Availability text; text stays on the column line */
.hf-footer__cols > .wp-block-group:has(> .hf-resume) { position: relative; }
.hf-footer__cols > .wp-block-group:has(> .hf-resume) > .hf-resume { position: absolute; top: 0; right: calc(100% + 20px); margin: 0 !important; }
@media (max-width: 781px) {
	.hf-footer__cols > .wp-block-group:has(> .hf-resume) { display: grid; grid-template-columns: 48px minmax(0, 1fr); column-gap: 14px; align-content: start; }
	.hf-footer__cols > .wp-block-group:has(> .hf-resume) > * { grid-column: 2; margin: 0 !important; }
	.hf-footer__cols > .wp-block-group:has(> .hf-resume) > * + * { margin-top: 12px !important; }
	.hf-footer__cols > .wp-block-group:has(> .hf-resume) > .hf-resume { position: relative; right: auto; grid-column: 1; grid-row: 1 / span 2; width: 48px; height: 61px; }
}

/* ---------- Self-hosted video blocks ---------- */
.wp-block-video.hf-video { margin: 0; }
.wp-block-video.hf-video video { width: 100%; height: auto; display: block; background: var(--hf-ink); }
.wp-block-video.hf-video figcaption { display: none; }
body:not(.editor-styles-wrapper) .hf-block--video-file:not(:has(video[src], video source)) { display: none !important; }

/* =========================================================
   Motion (Appearance → Motion). Only active when <html> has .hf-motion,
   which the head script adds unless reduced motion is requested.
   ========================================================= */
.hf-motion [data-hf-reveal] {
	transition: opacity .7s cubic-bezier(.2,.7,.2,1), transform .8s cubic-bezier(.2,.7,.2,1), clip-path 1s cubic-bezier(.7,0,.2,1);
	transition-delay: var(--hf-delay, 0ms);
}
.hf-motion [data-hf-reveal="rise"]:not(.is-in) { opacity: 0; transform: translate3d(0, 32px, 0); }
.hf-motion [data-hf-reveal="fade"]:not(.is-in) { opacity: 0; }
.hf-motion [data-hf-reveal="wipe"]:not(.is-in) { clip-path: inset(0 0 100% 0); }
.hf-motion [data-hf-reveal="wipe"].is-in { clip-path: inset(0 0 0 0); }
.hf-motion [data-hf-reveal].is-in { opacity: 1; transform: none; }
/* Wipe: images inside a revealed figure settle from a slight zoom. */
.hf-motion [data-hf-reveal="wipe"] img { transition: transform 1.4s cubic-bezier(.2,.7,.2,1); transition-delay: var(--hf-delay, 0ms); }
.hf-motion [data-hf-reveal="wipe"]:not(.is-in) img { transform: scale(1.08); }

/* Scroll progress line (project pages) */
.hf-progress {
	position: fixed; left: 0; right: 0; top: 0; height: 2px; z-index: 100000;
	background: var(--hf-accent); transform-origin: 0 50%; transform: scaleX(0); pointer-events: none;
}
.admin-bar .hf-progress { top: var(--wp-admin--admin-bar--height, 32px); }

/* Parallax on full-width images */
.hf-parallax-on { overflow: hidden; }
.hf-parallax-on img { will-change: transform; transform: scale(1.14); }

/* Card hover zoom (optional) */
.hf-hoverzoom .hf-card__media img { transition: transform .6s cubic-bezier(.2,.7,.2,1), opacity .2s; }
.hf-hoverzoom .hf-card:hover .hf-card__media img { transform: scale(1.04); }

@media (prefers-reduced-motion: reduce) {
	[data-hf-reveal] { opacity: 1 !important; transform: none !important; clip-path: none !important; transition: none !important; }
	.hf-parallax-on img { transform: none !important; }
	.hf-progress { display: none; }
}
@media print { [data-hf-reveal] { opacity: 1 !important; transform: none !important; clip-path: none !important; } .hf-progress { display: none; } }

/* =========================================================
   Gallery styles — Mosaic (Swiss modular grid) and Masonry (no cropping).
   Pick them in the gallery block's Styles panel, or use the patterns.
   ========================================================= */
.wp-block-gallery.is-style-mosaic {
	display: grid !important;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	grid-auto-rows: clamp(140px, 15vw, 240px);
	grid-auto-flow: dense;
	gap: var(--hf-gap) !important;
}
.wp-block-gallery.is-style-mosaic > .wp-block-image {
	width: auto !important; margin: 0 !important; aspect-ratio: auto !important; min-height: 0; overflow: hidden;
	grid-column: span 1; grid-row: span 1;
}
.wp-block-gallery.is-style-mosaic > .wp-block-image img { width: 100% !important; height: 100% !important; object-fit: cover !important; }
/* 8-image rhythm that tiles a 4-column grid with no holes:
   [1 big][2][3] / [1 big][4 wide] / [5 wide][6][7] / [8 full-width banner] */
.wp-block-gallery.is-style-mosaic > .wp-block-image:nth-child(8n+1) { grid-column: span 2; grid-row: span 2; }
.wp-block-gallery.is-style-mosaic > .wp-block-image:nth-child(8n+4),
.wp-block-gallery.is-style-mosaic > .wp-block-image:nth-child(8n+5) { grid-column: span 2; }
.wp-block-gallery.is-style-mosaic > .wp-block-image:nth-child(8n+8) { grid-column: 1 / -1; }
/* Fill the last row when a set stops early */
.wp-block-gallery.is-style-mosaic > .wp-block-image:nth-child(8n+5):last-child { grid-column: 1 / -1; }
.wp-block-gallery.is-style-mosaic > .wp-block-image:nth-child(8n+6):last-child { grid-column: span 2; }
.wp-block-gallery.is-style-mosaic > .wp-block-image:nth-child(8n+2):last-child { grid-column: span 2; grid-row: span 2; }
.wp-block-gallery.is-style-mosaic > .wp-block-image:only-child { grid-column: 1 / -1; grid-row: span 2; }
/* Short galleries read better with fewer columns */
.wp-block-gallery.is-style-mosaic:has(> .wp-block-image:nth-child(3):last-child) { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.wp-block-gallery.is-style-mosaic:has(> .wp-block-image:nth-child(2):last-child) { grid-template-columns: 2fr 1fr; }
.wp-block-gallery.is-style-mosaic:has(> .wp-block-image:nth-child(2):last-child) > .wp-block-image { grid-column: auto; grid-row: span 2; }
@media (max-width: 781px) {
	.wp-block-gallery.is-style-mosaic { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; grid-auto-rows: 38vw; gap: 12px !important; }
	.wp-block-gallery.is-style-mosaic > .wp-block-image:nth-child(n) { grid-column: span 1; grid-row: span 1; }
	.wp-block-gallery.is-style-mosaic > .wp-block-image:nth-child(5n+1) { grid-column: span 2; grid-row: span 2; }
}

.wp-block-gallery.is-style-masonry {
	display: block !important;
	columns: 3 260px;
	column-gap: var(--hf-gap);
}
.wp-block-gallery.is-style-masonry > .wp-block-image {
	display: block !important; width: 100% !important; margin: 0 0 var(--hf-gap) !important;
	break-inside: avoid; aspect-ratio: auto !important;
}
.wp-block-gallery.is-style-masonry > .wp-block-image img { width: 100% !important; height: auto !important; object-fit: initial !important; }
@media (max-width: 600px) { .wp-block-gallery.is-style-masonry { columns: 2; column-gap: 12px; } .wp-block-gallery.is-style-masonry > .wp-block-image { margin-bottom: 12px !important; } }
