/* Village Iveria owns its full-width layout; loaded only on this detail view. */
html.has-project-motion {
    /* Village Iveria brand book, colour palette (pages 7–8). */
    --village-linen: #f6f1e8;
    --village-limestone: #e8dfcf;
    --village-cypress: #263b32;
    --village-olive: #68704b;
    --village-wine: #622e3a;
    --village-rule: #d8d1c4;
    --color-text: var(--village-cypress);
    --color-muted: var(--village-cypress);
    --color-border: var(--village-rule);
    --color-bg: var(--village-linen);
    /* Native scroll must restore synchronously while ScrollTrigger measures pins. */
    scroll-behavior: auto;
}

/* Colour-only overrides stay on this page; shared logo artwork is untouched. */
html.has-project-motion .site-header,
html.has-project-motion .site-nav,
html.has-project-motion .site-header__toggle,
.project-motion > .site-section {
    background: var(--village-linen);
    border-color: var(--village-rule);
}

html.has-project-motion .site-nav__item.is-active a,
html.has-project-motion .site-nav__item a:hover,
html.has-project-motion .site-header__languages a:hover,
html.has-project-motion .site-header__languages .is-current {
    color: var(--village-wine);
}

.project-motion .site-section.section--alt,
.project-motion .project-detail__sidebar,
.project-motion .spec-grid__item,
.project-motion .tag-list span,
html.has-project-motion .site-footer {
    background: var(--village-limestone);
    color: var(--village-cypress);
}

html.has-project-motion .site-footer h2,
html.has-project-motion .site-footer h3,
html.has-project-motion .site-footer p,
html.has-project-motion .site-footer a {
    color: var(--village-cypress);
}

html.has-project-motion .site-footer__bottom {
    border-color: var(--village-rule);
}

html.has-project-motion .site-footer a:hover,
.project-motion .newsletter-socials__link:hover,
.project-motion .project-card__title-link:hover {
    color: var(--village-wine);
}

.project-motion .eyebrow {
    /* Olive is reserved for the light Linen ground, not Limestone panels. */
    color: var(--village-olive);
}

.project-motion .project-detail__price,
.project-motion .project-card__price,
.project-motion .rich-text a {
    color: var(--village-wine);
}

.project-motion .rich-text a:hover {
    color: var(--village-cypress);
}

.project-motion .button,
.project-motion .newsletter-form__submit,
.project-motion .project-card__badge {
    background: var(--village-cypress);
    border-color: var(--village-cypress);
    color: var(--village-linen);
}

.project-motion .button:hover,
.project-motion .newsletter-form__submit:hover {
    background: var(--village-wine);
    border-color: var(--village-wine);
    color: var(--village-linen);
}

.project-motion .button--secondary {
    background: transparent;
    border-color: var(--village-cypress);
    color: var(--village-cypress);
}

.project-motion .button--secondary:hover {
    background: var(--village-wine);
    border-color: var(--village-wine);
    color: var(--village-linen);
}

.project-motion .project-card__badge--inactive,
.project-motion .project-card__badge--past {
    background: var(--village-linen);
    color: var(--village-cypress);
}

.project-motion .project-card__media {
    background: var(--village-rule);
}

.project-motion .project-card__icon {
    color: var(--village-linen);
}

.project-motion .project-card__title-link {
    color: var(--village-cypress);
    border-color: var(--village-wine);
}

.project-motion .project-card__summary,
.project-motion .project-card__meta {
    color: var(--village-cypress);
}

.project-motion .newsletter-form {
    border-color: var(--village-cypress);
}

.project-motion .newsletter-form__field input {
    background: var(--village-linen);
    color: var(--village-cypress);
}

.project-motion .newsletter-form__field input::placeholder {
    color: var(--village-olive);
    opacity: 1;
}

.project-motion .newsletter-flash {
    background: var(--village-linen);
    color: var(--village-cypress);
}

.project-motion .newsletter-flash--success {
    border-color: var(--village-olive);
}

.project-motion .newsletter-flash--error {
    border-color: var(--village-wine);
    color: var(--village-wine);
}

html.has-project-motion :is(a, button, input):focus-visible {
    outline: 2px solid var(--village-wine);
    outline-offset: 3px;
}

.project-motion .newsletter-form__field input:focus-visible {
    /* The shared input removes its outline; keep this one inside the field. */
    outline-offset: -4px;
}

.project-motion {
    --village-content-gutter: clamp(1rem, 3vw, 3.5rem);
    width: 100%;
    min-width: 0;
}

/* Project film: first element of the page, edge to edge, fixed 16:9 box (Bunny Stream embed). */
.project-video {
    position: relative;
    width: 100%;
    padding-top: 56.25%;
    background: var(--village-cypress);
    overflow: hidden;
}

.project-video iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.project-video__fallback {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    color: var(--village-linen);
}

@media (max-width: 767px) {
    .project-video { padding-top: 177.777778%; }
    .project-video iframe {
        /* Dedicated mobile film fills the portrait player without landscape cropping. */
        inset: 0;
        width: 100%;
        max-width: none;
        height: 100%;
        transform: none;
    }
}

/* Mobile uses the existing media/copy once, in an editorial vertical sequence. */
.project-motion--mobile > .site-section:first-of-type { padding-top: 0; }
.project-motion--mobile .project-detail__gallery { gap: 0; }
.project-motion--mobile .project-detail__gallery > :not(.project-mobile-flow) { display: none; }
.project-mobile-flow { min-width: 0; }
.project-motion--mobile-animated .project-mobile-flow { isolation: isolate; }
.project-motion--mobile-animated .project-mobile-story--first { position: relative; z-index: 0; }
.project-motion--mobile-animated .project-detail__intro { position: relative; }
/* Darkens as the next scene covers it; --motion-cover is driven by the text-cover scene. */
.project-motion--mobile-animated .project-detail__intro::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgb(0 0 0 / .22);
    opacity: var(--motion-cover, 0);
    pointer-events: none;
}
.project-motion--mobile-animated .project-mobile-pair { z-index: 2; }
.project-motion--mobile .project-mobile-flow figure { overflow: hidden; border-radius: 0; }
.project-motion--mobile .project-mobile-flow figure img { border-radius: 0; }
.project-motion--mobile .project-mobile-story > figure {
    aspect-ratio: 4 / 5;
}
.project-motion--mobile .project-mobile-story > figure img {
    width: 100%; height: 100%; object-fit: cover;
}
.project-motion--mobile .project-detail__intro,
.project-motion--mobile .project-detail__content {
    padding: clamp(3rem, 9svh, 5rem) max(1.5rem, 8vw);
    background: var(--village-limestone);
}
.project-motion--mobile .project-detail__intro .eyebrow { color: var(--village-cypress); }
.project-motion--mobile .project-mobile-pair,
.project-motion--mobile .project-mobile-fullscreen {
    position: relative;
    background: var(--village-linen);
}
.project-motion--mobile .project-mobile-pair > figure,
.project-motion--mobile .project-mobile-fullscreen > figure { margin-block: 2rem; }
.project-motion--mobile .project-motion__overlay { padding: 2rem max(1.5rem, 8vw); }
.project-motion--mobile .project-mobile-ending { padding-block: 10svh; }
.project-motion--mobile-animated .project-mobile-pair,
.project-motion--mobile-animated .project-mobile-fullscreen {
    height: calc(100svh - var(--motion-mobile-header, 72px));
    overflow: hidden;
}
.project-motion.project-motion--mobile-animated .project-mobile-pair > figure,
.project-motion.project-motion--mobile-animated .project-mobile-fullscreen > figure {
    position: absolute;
    margin: 0;
    overflow: hidden;
}
.project-motion--mobile-animated .project-mobile-pair > figure img,
.project-motion--mobile-animated .project-mobile-fullscreen > figure img {
    width: 100%; height: 100%; object-fit: cover;
}
.project-motion--mobile-animated .project-mobile-fullscreen .project-motion__overlay {
    position: absolute;
    z-index: 2;
    left: 5%;
    bottom: 4%;
    width: 90%;
    padding: 1.25rem;
    background: var(--village-linen);
}
.project-motion--mobile-animated .project-mobile-fullscreen .project-motion__caption { top: .5rem; bottom: auto; }
.project-motion--mobile-animated .project-mobile-pair .project-motion__caption {
    font-size: .625rem;
    right: .3rem; bottom: .3rem;
    padding: .2rem .3rem;
}
@media (max-width: 767px) and (max-height: 560px) {
    .project-motion--mobile-animated .project-mobile-fullscreen .project-motion__overlay { padding: .75rem; }
    .project-motion--mobile-animated .project-mobile-fullscreen .section-title { font-size: 1.5rem; margin-bottom: .5rem; }
    .project-motion--mobile-animated .project-mobile-fullscreen .eyebrow { margin-bottom: .5rem; }
}

.project-motion > .site-section > .container {
    width: 100%;
    max-width: none;
    margin-inline: 0;
}

.project-motion .project-detail {
    grid-template-columns: minmax(0, 2fr) minmax(0, 0.9fr);
}

.project-motion .project-detail__intro {
    padding-inline: var(--village-content-gutter);
}

.project-motion .project-detail__content {
    min-width: 0;
    max-width: none;
    padding-left: var(--village-content-gutter);
}

.project-motion .project-detail__sidebar {
    min-width: 0;
    margin-right: var(--village-content-gutter);
}

.project-motion [data-motion-rail] > .container > .section-title,
.project-motion [data-motion-rail] > .container > .project-motion__clip,
.project-motion #stay-connected > .container {
    padding-inline: var(--village-content-gutter);
}

.project-motion [data-motion-rail] .card-grid {
    padding-inline: var(--village-content-gutter);
}

@media (max-width: 1024px) {
    .project-motion .project-detail {
        grid-template-columns: minmax(0, 1fr);
    }

    .project-motion .project-detail__content {
        padding-inline: var(--village-content-gutter);
    }

    .project-motion .project-detail__sidebar {
        margin-inline: var(--village-content-gutter);
    }
}

.project-motion .project-detail__gallery img {
    width: 100%;
    height: auto;
    min-height: 0;
}

.project-motion .project-detail__gallery {
    grid-column: 1 / -1;
    grid-template-columns: minmax(0, 1fr);
    min-width: 0;
    width: 100%;
}

.project-motion .project-detail__intro {
    grid-column: 1 / -1;
}

.project-motion .project-detail__gallery figure {
    position: relative;
    margin: 0;
}

.project-motion__caption {
    position: absolute;
    right: 0.75rem;
    bottom: 0.75rem;
    max-width: calc(100% - 1.5rem);
    padding: 0.3rem 0.6rem;
    background: var(--village-linen);
    color: var(--color-text);
    font-size: 0.75rem;
    line-height: 1.4;
    z-index: 1;
}

.project-motion--desktop [data-motion-viewport] .project-motion__caption {
    /* Keep the image credit separate from the lower-left editorial overlay. */
    bottom: 0.75rem;
}

.project-motion__pair,
.project-motion__dual,
.project-motion__fullscreen {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 1rem;
}

.project-motion__clip {
    overflow: clip;
    /* Keep line metrics/margins on the original element, including Georgian glyphs. */
    display: flow-root;
}

.project-motion--active [data-motion-editorial] {
    overflow: hidden;
    border-radius: 14px;
}

.project-motion--desktop .project-detail__gallery {
    grid-column: 1 / -1;
}

.project-motion--desktop .project-detail__gallery ~ .project-detail__content {
    grid-column: 1;
    grid-row: 3;
}

.project-motion--desktop .project-detail__gallery ~ .project-detail__sidebar {
    grid-column: 2;
    grid-row: 3;
}

.project-motion--desktop .project-motion__pair,
.project-motion--desktop .project-motion__fullscreen {
    display: block;
    position: relative;
    width: var(--motion-viewport);
    margin-left: calc((100% - var(--motion-viewport)) / 2);
    height: 100vh;
    height: 100svh;
    overflow: hidden;
}

/* Bring the next scene into the empty lower edge of the finished pair. */
.project-motion--desktop .project-motion__fullscreen {
    margin-top: -18vh;
    margin-top: -18svh;
}

.project-motion--desktop .project-motion__pair > figure,
.project-motion--desktop [data-motion-viewport] {
    position: absolute;
    margin: 0;
    overflow: hidden;
}

.project-motion--desktop .project-motion__pair img,
.project-motion--desktop [data-motion-viewport] img {
    width: 100%;
    height: 100%;
    min-height: 0;
    object-fit: cover;
    border-radius: 0;
}

.project-motion--desktop [data-motion-overlay] {
    position: absolute;
    left: max(6vw, 1.5rem);
    bottom: max(7svh, 1.5rem);
    max-width: min(42rem, 85%);
    z-index: 1;
}

.project-motion__overlay {
    padding: clamp(1.25rem, 2vw, 2rem);
    background: var(--village-linen);
}

.project-motion--desktop .project-motion__overlay {
    /* A local text surface preserves legibility without darkening the photograph. */
    background: var(--village-linen);
    color: var(--color-text);
    max-width: min(36rem, 85%);
}

.project-motion--desktop .project-motion__dual {
    grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
    align-items: center;
    gap: 6%;
    padding-block: 6svh;
}

.project-motion--desktop .project-motion__dual > figure {
    position: relative;
    overflow: hidden;
    margin: 0;
    height: 65svh;
    border-radius: 14px;
}

.project-motion--desktop .project-motion__dual > figure:first-child {
    height: 40svh;
}

.project-motion--desktop .project-motion__dual img {
    position: absolute;
    width: 100%;
    min-height: 0;
    max-width: none;
    object-fit: cover;
    border-radius: 0;
}

.project-motion--desktop [data-motion-rail].project-motion__rail--active {
    overflow: hidden;
}

.project-motion--desktop .project-motion__rail-viewport {
    width: var(--motion-viewport);
    margin-left: calc((100% - var(--motion-viewport)) / 2);
    overflow: hidden;
}

.project-motion--desktop .project-motion__rail--active .card-grid {
    display: flex;
    flex-wrap: nowrap;
    gap: var(--motion-card-gap);
    padding-inline: var(--village-content-gutter);
    width: max-content;
    will-change: transform;
}

.project-motion--desktop .project-motion__rail--active .project-card {
    flex: 0 0 var(--motion-card-width);
    width: var(--motion-card-width);
}

.project-motion__clip:focus-within {
    overflow: visible;
}

/* Three-column mobile mosaic -> dominant centre image -> full viewport. */
.project-mobile-mosaic { position: relative; background: var(--village-linen); }
.project-mobile-mosaic__column,
.project-mobile-mosaic__satellite { display: none; }
.project-motion--mobile-animated .project-mobile-mosaic {
    height: calc(100svh - var(--motion-mobile-header, 72px));
    overflow: hidden;
}
.project-motion--mobile-animated .project-mobile-mosaic__column {
    position: absolute;
    display: grid;
    gap: 8px;
    width: 32%;
    height: 120%;
    top: -10%;
    grid-template-rows: 1fr 1fr;
}
.project-mobile-mosaic__column--left { left: 0; }
.project-mobile-mosaic__column--right { right: 0; }
.project-mobile-mosaic__tile { overflow: hidden; min-height: 0; }
.project-motion--mobile-animated .project-mobile-mosaic__satellite {
    display: block;
    position: absolute;
    left: 34%;
    width: 32%;
    height: 40%;
    overflow: hidden;
}
.project-mobile-mosaic__satellite--top { top: -12%; }
.project-mobile-mosaic__satellite--bottom { top: 72%; }
.project-motion.project-motion--mobile-animated .project-mobile-mosaic__focus {
    position: absolute;
    margin: 0;
    z-index: 1;
    overflow: hidden;
}
.project-motion--mobile-animated .project-mobile-mosaic img {
    width: 100%; height: 100%; object-fit: cover; border-radius: 0;
}
.project-motion--mobile-animated .project-mobile-mosaic [data-motion-overlay] {
    position: absolute;
    z-index: 2;
    left: 5%; bottom: 4%; width: 90%;
    padding: 1.25rem;
    background: var(--village-linen);
}
.project-motion--mobile-animated .project-mobile-mosaic .project-motion__caption {
    top: .5rem; bottom: auto;
    font-size: .625rem;
}

/* Village Iveria typography: local brand fonts; no effect on other pages. */
@font-face { font-family: 'Cormorant Garamond'; src: url('fonts/village-iveria/cormorant-display.woff2') format('woff2'); font-weight: 300 700; font-style: normal; font-display: swap; }
@font-face { font-family: 'Cormorant Garamond'; src: url('fonts/village-iveria/cormorant-display-italic.woff2') format('woff2'); font-weight: 300 700; font-style: italic; font-display: swap; }
@font-face { font-family: 'Alegreya Sans'; src: url('fonts/village-iveria/alegreya-regular.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'Alegreya Sans'; src: url('fonts/village-iveria/alegreya-medium.woff2') format('woff2'); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: 'Alegreya Sans'; src: url('fonts/village-iveria/alegreya-bold.woff2') format('woff2'); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: 'Village Noto Serif Georgian'; src: url('fonts/village-iveria/noto-serif-georgian-medium.woff2') format('woff2'); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: 'Village Noto Serif Georgian'; src: url('fonts/village-iveria/noto-serif-georgian-semibold.woff2') format('woff2'); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: 'Noto Sans Georgian'; src: url('fonts/village-iveria/noto-sans-georgian.woff2') format('woff2'); font-weight: 100 900; font-style: normal; font-display: swap; }
html.has-project-motion {
    --font-sans: 'Alegreya Sans', 'Segoe UI', Helvetica, sans-serif;
    --font-ui: var(--font-sans);
    --font-serif: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
}
html.has-project-motion[lang='ka'] {
    --font-sans: 'Noto Sans Georgian', 'Segoe UI', Helvetica, sans-serif;
    --font-serif: 'Village Noto Serif Georgian', Georgia, 'Times New Roman', serif;
}
html.has-project-motion body { font-size: 17px; line-height: 1.55; }
html.has-project-motion :is(button, input, select, textarea) { font-family: var(--font-sans); }
.project-motion :is(h1, h2, h3, .section-title, .project-card__title-link, .newsletter-block__title) {
    font-family: var(--font-serif);
    font-weight: 500;
    text-transform: none;
    letter-spacing: 0;
}
.project-motion h1.section-title {
    font-size: clamp(48px, 5vw, 64px);
    line-height: 1.05;
    letter-spacing: -.01em;
}
.project-motion :is(h2, .section-title, .newsletter-block__title) { font-size: 40px; line-height: 1.1; }
.project-motion :is(h3, .project-card__title-link) { font-size: 28px; line-height: 1.2; font-weight: 600; }
.project-motion .lead { font-size: 20px; line-height: 1.45; font-weight: 400; }
.project-motion .project-detail__tagline { font-family: var(--font-serif); font-size: 28px; line-height: 1.2; font-weight: 500; }
.project-motion :is(.rich-text, .project-card__summary) { font-size: 17px; line-height: 1.55; }
.project-motion :is(.eyebrow, .project-card__location, .project-card__badge) {
    font-family: var(--font-sans);
    font-size: 12px;
    line-height: 1.3;
    font-weight: 500;
    letter-spacing: .1em;
    text-transform: uppercase;
}
.project-motion .project-motion__caption { font-family: var(--font-sans); font-size: 14px; line-height: 1.45; }
.project-motion .project-mobile-pair .project-motion__caption,
.project-motion .project-mobile-mosaic .project-motion__caption { font-size: 14px; line-height: 1.45; }
.project-motion :is(.project-detail__price, .project-detail__facts, time) { font-variant-numeric: tabular-nums; }
html.has-project-motion[lang='ka'] .project-motion { line-height: 1.65; }
html.has-project-motion[lang='ka'] .project-motion :is(h1, h2, h3, .section-title, .project-card__title-link) { line-height: 1.2; }
html.has-project-motion[lang='ka'] .project-motion :is(.eyebrow, .project-card__location, .project-card__badge) { text-transform: none; letter-spacing: .02em; }
html.has-project-motion[lang='ka'] .project-detail__tagline em { font-style: normal; }
html.has-project-motion[lang='ka'] .project-motion :is(.rich-text, .project-card__summary) { line-height: 1.65; }
