/*
Theme Name: ater.architects
Author: 7am.agency
Description: Custom theme for ater.architects, ported from the Squarespace site.
Version: 2.5.0
Requires at least: 6.5
Requires PHP: 8.1
Text Domain: ater
*/

@font-face { font-family: "Figtree"; font-weight: 400; font-display: swap; src: url(assets/fonts/figtree-latin-400.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Figtree"; font-weight: 400; font-display: swap; src: url(assets/fonts/figtree-latin-ext-400.woff2) format("woff2"); unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Figtree"; font-weight: 700; font-display: swap; src: url(assets/fonts/figtree-latin-700.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Figtree"; font-weight: 700; font-display: swap; src: url(assets/fonts/figtree-latin-ext-700.woff2) format("woff2"); unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Archivo Black"; font-weight: 400; font-display: swap; src: url(assets/fonts/archivo-black-latin-400.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Archivo Black"; font-weight: 400; font-display: swap; src: url(assets/fonts/archivo-black-latin-ext-400.woff2) format("woff2"); unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

/* Cyrillic: Figtree and Archivo Black have none — Onest (Ukrainian-designed, similar geometry) fills in for Cyrillic only. */
@font-face { font-family: "Figtree"; font-weight: 400; font-display: swap; src: url(assets/fonts/onest-cyrillic-400.woff2) format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Figtree"; font-weight: 700; font-display: swap; src: url(assets/fonts/onest-cyrillic-700.woff2) format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Archivo Black"; font-weight: 400; font-display: swap; src: url(assets/fonts/onest-cyrillic-900.woff2) format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }

:root {
	--gutter: 22px;
	--gap: 20px;
	--block-gap: 34px;
	--section-gap: 72px;
	--photo-h: 88vh;
	--text: #2b2b2b;
	--muted: #d9d9d9;
	--quiet: #707070;
	--line: #ececec;
	--placeholder: #f3f1ee;
	--font-body: "Figtree", system-ui, sans-serif;
	--font-display: "Archivo Black", "Figtree", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: #fff; color: var(--text); font: 400 15px/1.65 var(--font-body); -webkit-font-smoothing: antialiased; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
.screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(1px, 1px, 1px, 1px); white-space: nowrap; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between; padding: 18px var(--gutter); background: rgba(255, 255, 255, .94); backdrop-filter: blur(8px); }
.site-logo img { width: 117px; }
.site-header__right { display: flex; align-items: center; gap: 28px; }
.lang-switch { display: flex; gap: 8px; margin: 0; padding: 0; list-style: none; font: 700 12px/1 var(--font-body); letter-spacing: .08em; }
.lang-switch a { text-decoration: none; color: var(--muted); transition: color .2s; }
.lang-switch a:hover, .lang-switch .is-current a { color: #000; }
.site-nav ul { display: flex; gap: 15px; margin: 0; padding: 0; list-style: none; }
.site-nav a { font: 700 20px/1 var(--font-body); letter-spacing: .02em; text-transform: uppercase; text-decoration: none; color: var(--muted); transition: color .2s; }
.site-nav a:hover, .site-nav .is-current a { color: #000; }

.site-main { padding: 0 var(--gutter) var(--section-gap); }
.single-project .site-main { padding-bottom: 0; }

/* Footer: one quiet line */
.site-footer { display: flex; align-items: center; justify-content: space-between; gap: 16px 32px; padding: 26px var(--gutter) 28px; border-top: 1px solid var(--line); font-size: 11px; line-height: 1.4; letter-spacing: .1em; text-transform: uppercase; color: var(--quiet); }
.site-footer a { color: inherit; text-decoration: none; transition: color .2s; }
.site-footer a:hover { color: #000; }
.site-footer__mail { color: #000 !important; }
.site-footer__social { display: flex; gap: 22px; margin: 0; padding: 0; list-style: none; }
.site-footer__legal { margin: 0; }

/* Home: project grid */
.project-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--gap); }
.project-card { position: relative; display: block; aspect-ratio: 2 / 3; overflow: hidden; background: var(--card-bg, var(--placeholder)); }
.project-card img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s cubic-bezier(.2, .7, .2, 1); }
.project-card:hover img { transform: scale(1.025); }
.project-card__title { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; margin: 0; padding: 20px; text-align: center; font: 400 25px/1.1 var(--font-display); text-transform: uppercase; color: #fff; background: rgba(0, 0, 0, .22); opacity: 0; transition: opacity .3s; }
.project-card:hover .project-card__title, .project-card:focus-visible .project-card__title { opacity: 1; }

/* Content flow */
.entry > * { margin-top: 0; margin-bottom: var(--block-gap); }
.entry img { background: var(--placeholder); }
.entry strong { font-weight: 700; color: #000; }

/* Text: a readable column instead of full-width lines. */
.entry > p { max-width: 680px; margin-left: auto; margin-right: auto; margin-bottom: 1em; }
.entry > :not(p) + p { margin-top: calc(var(--section-gap) - var(--block-gap)); }
.entry > p + :not(p) { margin-top: calc(var(--section-gap) - 1em); }
.entry a { text-underline-offset: 3px; }

/* Single photos: never taller than the screen, centred. The first one is the hero. */
.entry .wp-block-image { margin-left: 0; margin-right: 0; }
.entry > .wp-block-image img { width: auto; max-height: var(--photo-h); margin-inline: auto; }
.entry > .wp-block-image:first-child img { width: 100%; max-height: var(--photo-h); object-fit: cover; }

/* Galleries: 2/3/4 per row, 2:3 portrait crop, a pair always fits on one screen. */
.entry .wp-block-gallery.has-nested-images { --wp--style--unstable-gallery-gap: var(--gap); gap: var(--gap); margin-inline: auto; justify-content: center; }
.entry .wp-block-gallery.has-nested-images > figure.wp-block-image { flex: 0 0 auto; aspect-ratio: 2 / 3; margin: 0; }
.entry .wp-block-gallery.has-nested-images > figure.wp-block-image img { width: 100%; height: 100%; object-fit: cover; }
.entry .wp-block-gallery.has-nested-images.columns-2 { max-width: calc(var(--photo-h) * 4 / 3 + var(--gap)); }
.entry .wp-block-gallery.has-nested-images.columns-3 { max-width: calc(var(--photo-h) * 2 + 2 * var(--gap)); }
.entry .wp-block-gallery.has-nested-images.columns-4 { max-width: calc(var(--photo-h) * 8 / 3 + 3 * var(--gap)); }
.entry .wp-block-gallery.has-nested-images.columns-2 > figure.wp-block-image { width: calc(50% - var(--gap) / 2); }
.entry .wp-block-gallery.has-nested-images.columns-3 > figure.wp-block-image { width: calc((100% - 2 * var(--gap)) / 3); }
.entry .wp-block-gallery.has-nested-images.columns-4 > figure.wp-block-image { width: calc((100% - 3 * var(--gap)) / 4); }

/* Project header: title + details beside the floor plan. */
.project-head { display: grid; grid-template-columns: minmax(260px, 1fr) 2fr; gap: 48px; align-items: center; padding: calc(var(--section-gap) - var(--block-gap)) 0; }
.project-head__title { margin: 0 0 32px; font: 400 clamp(36px, 4.4vw, 64px)/1 var(--font-display); text-transform: uppercase; letter-spacing: -.01em; color: #000; }
.project-meta { display: grid; gap: 10px; margin: 0; font-size: 13px; }
.project-meta > div { display: grid; grid-template-columns: 110px 1fr; gap: 12px; padding-top: 10px; border-top: 1px solid var(--line); }
.project-meta dt { color: var(--quiet); text-transform: uppercase; letter-spacing: .08em; font-size: 11px; line-height: 1.9; }
.project-meta dd { margin: 0; color: #000; }
.project-meta a { text-decoration: none; border-bottom: 1px solid currentColor; }
.project-head__plan .wp-block-image { margin: 0; }
.project-head__plan img { width: auto; max-height: 75vh; margin-left: auto; background: none; }

/* Next project */
.next-project { margin-top: var(--section-gap); border-top: 1px solid var(--line); }
.next-project a { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 64px 0; text-decoration: none; }
.next-project__label { color: var(--quiet); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; }
.next-project__title { font: 400 clamp(32px, 4vw, 56px)/1 var(--font-display); text-transform: uppercase; transition: opacity .2s; }
.next-project a:hover .next-project__title { opacity: .55; }

/* Info page: photo with dark text card, second photo beside it. */
.info-layout { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap); align-items: start; margin-top: 0; }
.info-layout > * { margin: 0; }
.info-layout .project-intro { position: relative; display: grid; align-items: center; }
.info-layout .project-intro > .wp-block-image { grid-area: 1 / 1; margin: 0; }
.info-layout .project-intro__card { grid-area: 1 / 1; justify-self: end; width: 80%; padding: 48px; background: #000; color: #fff; }
.info-layout .project-intro__card > * { margin: 0; }
.info-layout .project-intro__card h2 { margin-bottom: 20px; font: 400 28px/1.1 var(--font-display); }
.info-layout .project-intro__card p { font-size: 14px; line-height: 1.7; }
.info-layout .project-intro__card p + p { margin-top: 1em; }
.info-layout .project-intro__card strong { color: #fff; font-weight: 400; }
.info-layout .project-intro__card a { color: #fff; text-decoration: none; }
.info-layout .project-intro__card a:hover { text-decoration: underline; }
.info-layout .project-intro__card p:last-child a { margin-right: 12px; text-transform: uppercase; font-weight: 700; font-size: 12px; letter-spacing: .06em; }
.info-layout img { width: 100%; }

/* Contact form (Info page) */
.contact { display: grid; grid-template-columns: minmax(260px, 1fr) 2fr; gap: 48px; margin-top: var(--section-gap); padding-top: var(--section-gap); border-top: 1px solid var(--line); }
.contact__title { margin: 0 0 16px; font: 400 clamp(28px, 3vw, 40px)/1.05 var(--font-display); text-transform: uppercase; color: #000; }
.contact__intro p { margin: 0 0 1em; max-width: 360px; }
.contact__direct a { text-decoration: none; border-bottom: 1px solid var(--line); }
.contact__form { display: grid; gap: 18px; max-width: 760px; }
.contact__row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.contact__field { display: grid; gap: 6px; }
.contact__field span { color: var(--quiet); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
.contact__field input, .contact__field select, .contact__field textarea { width: 100%; padding: 10px 0; border: 0; border-bottom: 1px solid #cfcfcf; border-radius: 0; background: transparent; font: inherit; color: #000; transition: border-color .2s; }
.contact__field textarea { resize: vertical; min-height: 120px; }
.contact__field :focus { outline: none; border-bottom-color: #000; }
.contact__consent { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; color: var(--quiet); }
.contact__consent input { margin-top: 3px; accent-color: #000; }
.contact__submit { justify-self: start; padding: 14px 28px; border: 1px solid #000; background: #000; color: #fff; font: 700 13px/1 var(--font-body); letter-spacing: .08em; text-transform: uppercase; cursor: pointer; transition: background .2s, color .2s; }
.contact__submit:hover { background: #fff; color: #000; }
.contact__submit[disabled] { opacity: .5; cursor: wait; }
.contact__notice { margin: 0; padding: 14px 16px; background: var(--placeholder); color: #000; }
.contact__notice--error { background: #fbeaea; }
.contact__hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* Plain text pages (privacy policy) */
.entry.type-page:not(:has(.info-layout)) { padding-top: 40px; }
.entry h1.wp-block-heading:not(.screen-reader-text) { max-width: 680px; margin: 0 auto 32px; font: 400 clamp(32px, 4vw, 48px)/1.05 var(--font-display); text-transform: uppercase; color: #000; }
.entry > h2.wp-block-heading { max-width: 680px; margin: 40px auto 12px; font-size: 17px; color: #000; }
.entry > ul { max-width: 680px; margin-left: auto; margin-right: auto; padding-left: 1.2em; }

/* About (Info page) */
.about { padding-top: 24px; }
.about > section, .about > header { margin-bottom: calc(var(--section-gap) * 1.5); }
.about__intro { max-width: 1100px; }
.about__lead { margin: 0; font: 400 clamp(30px, 4.2vw, 64px)/1.08 var(--font-body); letter-spacing: -.02em; color: #000; }
.about__since { margin: 20px 0 0; color: var(--quiet); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; }
.about__studio { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: clamp(32px, 6vw, 96px); align-items: end; }
.about__portrait { margin: 0; }
.about__portrait img { width: 100%; aspect-ratio: 2 / 3; object-fit: cover; background: var(--placeholder); }
.about__portrait figcaption { margin-top: 10px; color: var(--quiet); font-size: 12px; }
.about__text p { max-width: 560px; margin: 0 0 1em; font-size: 17px; line-height: 1.6; color: #111; }
.about__facts { max-width: 560px; margin-top: 40px; }
.about__h2 { margin: 0 0 32px; color: var(--quiet); font: 400 11px/1 var(--font-body); letter-spacing: .12em; text-transform: uppercase; }
.about__step-num { display: block; margin-bottom: 28px; color: var(--quiet); font-size: 12px; letter-spacing: .08em; }
.about__contact { display: grid; grid-template-columns: minmax(260px, 1fr) 2fr; gap: 48px; padding-top: 32px; border-top: 1px solid var(--line); margin-bottom: 0 !important; }
.about__write { margin: 0 0 24px; max-width: 340px; }
.about__email { display: inline-block; font-size: clamp(20px, 2vw, 26px); color: #000; text-decoration: none; border-bottom: 1px solid var(--line); }
.about__phone { display: block; margin-top: 10px; color: #000; text-decoration: none; }
.about__social { display: flex; flex-wrap: wrap; gap: 10px 20px; margin: 32px 0 0; padding: 0; list-style: none; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; }
.about__social a, .about__legal a { text-decoration: none; color: var(--quiet); transition: color .2s; }
.about__social a:hover, .about__legal a:hover { color: #000; }
.about__legal { margin: 32px 0 0; color: var(--quiet); font-size: 12px; }
.contact__form-wrap .contact__form { max-width: none; }
.js .reveal-block { opacity: 0; transform: translateY(10px); transition: opacity .5s ease, transform .5s cubic-bezier(.2, .7, .2, 1); }
.js .reveal-block.is-in { opacity: 1; transform: none; }

/* Reveal on scroll (site.js). Hidden only when JS runs; one consistent, quick fade. */
@media (prefers-reduced-motion: no-preference) {
	.js .entry > *, .js .project-card, .js .next-project { opacity: 0; transform: translateY(10px); transition: opacity .5s ease, transform .5s cubic-bezier(.2, .7, .2, 1); }
	.js .entry > .is-in, .js .project-card.is-in, .js .next-project.is-in { opacity: 1; transform: none; }
}

@media (max-width: 767px) {
	:root { --gutter: 16px; --gap: 10px; --block-gap: 10px; --section-gap: 40px; }
	body { font-size: 15px; }
	.site-header { padding: 14px var(--gutter); }
	.site-logo img { width: 90px; }
	.site-nav a { font-size: 16px; }
	.site-header__right { gap: 16px; }
	.lang-switch { font-size: 11px; gap: 6px; }
	.project-grid { grid-template-columns: 1fr; gap: 16px; }
	.project-card__title { opacity: 1; background: linear-gradient(transparent 60%, rgba(0, 0, 0, .35)); align-items: flex-end; justify-content: flex-start; font-size: 20px; }

	.entry > .wp-block-image img, .entry > .wp-block-image:first-child img { width: 100%; max-height: none; }
	.entry .wp-block-gallery.has-nested-images { max-width: none !important; }
	/* Core gallery widths use an ID selector, so these need !important. 3 in a row → one wide + a pair; an odd last photo goes full width. */
	.entry .wp-block-gallery.has-nested-images > figure.wp-block-image { width: calc(50% - var(--gap) / 2) !important; }
	.entry .wp-block-gallery.has-nested-images > figure.wp-block-image:last-child:nth-child(odd):not(:first-child) { width: 100% !important; aspect-ratio: 4 / 5; }
	.entry .wp-block-gallery.has-nested-images.columns-3 > figure.wp-block-image:first-child { width: 100% !important; aspect-ratio: 4 / 5; }
	.entry .wp-block-gallery.has-nested-images.columns-3 > figure.wp-block-image:nth-child(3):last-child { width: calc(50% - var(--gap) / 2) !important; aspect-ratio: 2 / 3; }

	.project-head { grid-template-columns: 1fr; gap: 28px; padding: 24px 0; }
	.project-head__title { margin-bottom: 20px; }
	.project-meta > div { grid-template-columns: 100px 1fr; }
	.project-head__plan img { max-height: none; width: 100%; margin: 0; }

	.info-layout { grid-template-columns: 1fr; }
	.info-layout .project-intro { display: block; }
	.info-layout .project-intro__card { width: auto; padding: 32px 24px; }

	.contact, .contact__row { grid-template-columns: 1fr; gap: 24px; }
	.about__studio, .about__contact { grid-template-columns: 1fr; }
	.about__studio { gap: 28px; }
		.about__text p { font-size: 16px; }
	.site-footer { flex-direction: column; align-items: flex-start; gap: 14px; padding: 24px var(--gutter) 28px; }
	.site-footer__social { gap: 16px; }
}
