/* Work collection layout. Card content determines row height, while shared
   identity and action areas keep every project and the invitation aligned. */
body.work-index-page .work-index-hero .page-container {
    display: grid;
    min-width: 0;
    align-items: center;
    grid-template-columns: minmax(0, 1fr) minmax(0, .86fr);
    grid-template-rows: repeat(5, auto);
    column-gap: clamp(26px, 4vw, 72px);
}
body.work-index-page .work-index-hero .page-container:has(> .work-hero-preview[hidden]) {
    display: block;
}
body.work-index-page .work-index-hero .page-container > :is(.breadcrumbs, .eyebrow, h1, .hero-description, .inner-hero-actions) {
    grid-column: 1;
}
body.work-index-page .work-hero-preview {
    min-width: 0;
    margin: 0;
    grid-column: 2;
    grid-row: 1 / span 5;
    align-self: center;
}
body.work-index-page .work-hero-preview[hidden] {
    display: none;
}
body.work-index-page .work-hero-screen {
    position: relative;
    min-height: clamp(320px, 38vw, 520px);
    overflow: hidden;
    background: radial-gradient(circle at 72% 22%, rgba(232, 177, 63, .24), transparent 38%), rgba(255, 255, 255, .07);
    border: 1px solid rgba(255, 255, 255, .17);
    border-radius: 22px;
    box-shadow: 0 22px 42px rgba(1, 12, 32, .24);
}
body.work-index-page .work-hero-scroll {
    position: absolute;
    top: 4%;
    left: 3%;
    display: block;
    width: 94%;
    height: 92%;
    overflow-x: hidden;
    overflow-y: auto;
    background: #fff;
    border: 4px solid #12263f;
    border-radius: 12px;
    box-shadow: 0 15px 28px rgba(1, 10, 27, .32);
    scrollbar-color: var(--gold-500) #dce5ef;
    scrollbar-width: thin;
}
body.work-index-page .work-hero-scroll img {
    display: block;
    width: 100%;
    height: auto;
}
body.work-index-page .work-hero-screen[data-preview-mode="brand"] {
    background: radial-gradient(circle at 50% 50%, rgba(245, 181, 192, .16), transparent 65%), #fefff9;
}
body.work-index-page .work-hero-screen[data-preview-mode="brand"] .work-hero-scroll,
body.work-index-page .work-hero-screen[data-preview-mode="site"] .work-hero-brand {
    display: none;
}
body.work-index-page .work-hero-brand {
    position: absolute;
    inset: 0;
    display: grid;
    padding: 24px;
    grid-template-rows: auto minmax(0, 1fr);
    place-items: center;
    color: #754e60;
}
body.work-index-page .work-hero-brand span {
    font-size: .7rem;
    font-weight: 850;
    letter-spacing: .13em;
    text-align: center;
    text-transform: uppercase;
}
body.work-index-page .work-hero-brand img {
    display: block;
    width: min(75%, 290px);
    max-height: 100%;
    object-fit: contain;
}
@media (prefers-reduced-motion: no-preference) {
    body.work-index-page .work-hero-screen {
        animation: work-hero-arrive 650ms cubic-bezier(.2, .7, .2, 1) both;
    }
}
@keyframes work-hero-arrive {
    from { opacity: .82; transform: translateY(12px) scale(.985); }
    to { opacity: 1; transform: none; }
}
body.work-index-page .work-hero-preview figcaption {
    display: flex;
    align-items: baseline;
    justify-content: center;
    flex-wrap: wrap;
    gap: 4px 12px;
    padding: 12px 4px 0;
    color: #fff;
    font-size: .76rem;
    text-align: center;
}
body.work-index-page .work-hero-preview figcaption span {
    color: var(--gold-300);
    font-weight: 850;
    letter-spacing: .08em;
    text-transform: uppercase;
}
body.work-index-page .work-hero-preview figcaption strong {
    font-size: .9rem;
}
@media (max-width: 760px) {
    body.work-index-page .work-index-hero .page-container {
        display: block;
    }
    body.work-index-page .work-hero-preview {
        margin-top: 28px;
    }
    body.work-index-page .work-hero-screen {
        min-height: clamp(215px, 60vw, 350px);
    }
}
body.work-index-page .work-carousel-frame {
    display: contents;
}
body.work-index-page .work-carousel-toolbar,
body.work-index-page .work-page-swipe,
body.work-index-page .public-scroll-indicator {
    display: none !important;
}
body.work-index-page .portfolio-grid {
    display: grid;
    width: 100%;
    margin: 0;
    padding: 0 0 22px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-auto-flow: row;
    grid-auto-columns: auto;
    grid-auto-rows: 1fr;
    gap: 24px;
    overflow: visible;
    scroll-snap-type: none;
}
body.work-index-page .portfolio-grid > .portfolio-card {
    position: relative;
    display: flex;
    width: auto;
    height: auto;
    min-width: 0;
    min-height: 0;
    grid-column: auto;
    flex-direction: column;
    overflow: clip;
}
body.work-index-page .portfolio-card .portfolio-visual {
    --work-visual-height: 230px;
    --work-visual-padding: 26px;
    --work-visual-bottom: var(--work-visual-padding);
    position: relative;
    isolation: isolate;
    display: grid;
    width: 100%;
    height: var(--work-visual-height);
    min-height: var(--work-visual-height);
    padding: var(--work-visual-padding) var(--work-visual-padding) var(--work-visual-bottom);
    flex: 0 0 auto;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr);
    place-items: center;
    overflow: hidden;
}
body.work-index-page .portfolio-card .portfolio-visual:has(.portfolio-status-badge) {
    --work-visual-bottom: 50px;
}
body.work-index-page .portfolio-card .portfolio-visual-wings-of-grace-ballet-studio {
    --work-visual-padding: 14px;
    --work-visual-bottom: 34px;
}
body.work-index-page .portfolio-card .portfolio-logo {
    position: static;
    display: block;
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
    max-width: 300px;
    max-height: calc(var(--work-visual-height) - var(--work-visual-padding) - var(--work-visual-bottom));
    margin: auto;
    object-fit: contain;
    object-position: center;
    filter: none;
    transform: none;
}
body.work-index-page .portfolio-visual-lambert {
    background: #fff;
}
body.work-index-page .portfolio-card .portfolio-visual > .portfolio-offer-badge {
    position: absolute;
    z-index: 4;
    top: 14px;
    right: 14px;
}
body.work-index-page .portfolio-card .portfolio-card-content {
    position: relative;
    display: flex;
    min-height: 0;
    padding: 24px;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 16px;
}
body.work-index-page .portfolio-card-content::before {
    display: block;
    width: 86%;
    height: 5px;
    margin: 0 auto;
    flex: 0 0 5px;
    background: var(--gold-500);
    border-radius: 999px;
    box-shadow: 0 4px 12px rgba(229, 163, 35, .16);
    content: "";
    transition: width 220ms ease, box-shadow 220ms ease;
}
body.work-index-page .portfolio-card:hover .portfolio-card-content::before,
body.work-index-page .portfolio-card:focus-within .portfolio-card-content::before {
    width: 100%;
    box-shadow: 0 6px 16px rgba(229, 163, 35, .28);
}
body.work-index-page .portfolio-card .portfolio-card-header {
    display: grid;
    width: 100%;
    min-height: 104px;
    margin: 0;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(62px, auto) minmax(32px, auto);
    align-content: start;
    gap: 10px;
}
body.work-index-page .portfolio-card .portfolio-card-header h2,
body.work-index-page .portfolio-card .portfolio-card-header h3 {
    display: flex;
    min-width: 0;
    min-height: 62px;
    margin: 0;
    padding: 10px 14px;
    align-items: center;
    justify-content: center;
    color: #fff;
    background: linear-gradient(135deg, #102a56 0%, #244a82 100%);
    border: 1px solid #294f86;
    border-top: 3px solid var(--gold-500);
    border-radius: 12px;
    box-shadow: 0 8px 18px rgba(8, 31, 67, .14);
    font-size: clamp(1.1rem, 1.4vw, 1.3rem);
    line-height: 1.15;
    text-align: center;
    text-shadow: 0 1px 1px rgba(0, 0, 0, .18);
    overflow-wrap: anywhere;
}
body.work-index-page .portfolio-card .portfolio-meta {
    display: flex;
    width: 100%;
    min-height: 32px;
    margin: 0;
    align-items: center;
    justify-content: center;
    gap: 5px;
}
body.work-index-page .portfolio-card .portfolio-meta > span {
    max-width: 100%;
    padding: 6px 10px;
    font-size: .64rem;
    line-height: 1.3;
    text-align: center;
    white-space: normal;
    overflow-wrap: anywhere;
}
body.work-index-page .portfolio-card .portfolio-card-summary {
    min-height: 4.2em;
    margin: 0;
    font-size: .94rem;
    line-height: 1.4;
    overflow-wrap: anywhere;
}
body.work-index-page .portfolio-card .portfolio-card-content > p {
    margin: 0;
}
body.work-index-page .portfolio-card .portfolio-card-links {
    display: grid;
    min-height: 100px;
    margin-top: auto;
    padding: 0;
    grid-template-columns: minmax(0, 1fr);
    align-content: start;
    gap: 8px;
}
body.work-index-page .portfolio-card .portfolio-card-links .text-link {
    box-sizing: border-box;
    display: inline-flex;
    width: 100%;
    min-height: 46px;
    margin: 0;
    padding: 10px 12px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: #fff;
    background: #173f78;
    border: 1px solid #173f78;
    border-radius: 11px;
    font-size: .82rem;
    line-height: 1.2;
    text-align: center;
    text-decoration: none;
    transform: none;
    transition: box-shadow 180ms ease;
}
body.work-index-page .portfolio-card .portfolio-card-links .text-link + .text-link {
    color: #102651;
    background: #fff9e9;
    border-color: #e4bf62;
}
body.work-index-page .portfolio-card .portfolio-card-links .text-link:hover,
body.work-index-page .portfolio-card .portfolio-card-links .text-link:focus-visible {
    box-shadow: 0 7px 16px rgba(8, 37, 76, .12);
}

/* Hover and keyboard emphasis covers the entire card without resizing it. */
body.work-index-page .portfolio-card::after {
    position: absolute;
    z-index: 5;
    inset: 0;
    border: 2px solid var(--gold-500);
    border-radius: inherit;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .48);
    content: "";
    opacity: 0;
    pointer-events: none;
    transition: opacity 220ms ease, box-shadow 220ms ease;
}
body.work-index-page .portfolio-card:hover::after,
body.work-index-page .portfolio-card:focus-within::after {
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .48), 0 12px 28px rgba(229, 163, 35, .2);
    opacity: 1;
}
@media (min-width: 561px) and (max-width: 1100px) {
    body.work-index-page .portfolio-grid {
        width: min(calc(100% - 44px), 920px);
        margin-inline: auto;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 20px;
    }
    body.work-index-page .portfolio-card .portfolio-visual {
        --work-visual-height: 210px;
        --work-visual-padding: 24px;
    }
    body.work-index-page .portfolio-card .portfolio-card-content {
        padding: 22px;
    }
    body.work-index-page .portfolio-card .portfolio-card-header {
        min-height: 94px;
        grid-template-rows: minmax(52px, auto) minmax(32px, auto);
    }
    body.work-index-page .portfolio-card .portfolio-card-header h2,
    body.work-index-page .portfolio-card .portfolio-card-header h3 {
        min-height: 52px;
        font-size: 1.12rem;
    }
    body.work-index-page .portfolio-card .portfolio-card-summary {
        font-size: .86rem;
    }
}
@media (prefers-reduced-motion: reduce) {
    body.work-index-page .portfolio-card,
    body.work-index-page .portfolio-card::after,
    body.work-index-page .portfolio-card-content::before,
    body.work-index-page .portfolio-card .portfolio-card-links .text-link {
        transition: none;
    }
}
/* Keep the tablet project dialog content-sized and centered. Only genuinely
   tall case studies should scroll; short ones must not stretch to the full
   viewport and strand their actions beneath a field of empty space. */
@media (min-width: 701px) and (max-width: 1100px) {
    .work-project-dialog {
        inset: 0 !important;
        width: min(calc(100% - 28px), 940px) !important;
        height: fit-content !important;
        block-size: fit-content !important;
        max-width: 940px !important;
        max-height: calc(100dvh - 28px) !important;
        margin: auto !important;
        overflow: hidden !important;
    }
    .work-project-dialog-card {
        box-sizing: border-box !important;
        height: auto !important;
        max-height: calc(100dvh - 28px) !important;
        padding: 18px !important;
        grid-template-columns: 218px minmax(0, 1fr) !important;
        gap: 14px 20px !important;
        overflow-y: auto !important;
        overscroll-behavior: contain !important;
    }
    .work-project-dialog-brand {
        top: 0 !important;
        align-self: start !important;
    }
    .work-project-dialog-copy {
        min-width: 0 !important;
        padding-right: 46px !important;
    }
    .work-project-dialog-actions {
        position: static !important;
        margin: 0 !important;
        padding: 10px 0 0 !important;
        grid-column: 1 / -1 !important;
        background: transparent !important;
    }
}
