/* 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-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;
}

.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;
}
