/* Projects portfolio: match the shared navy, gray and pale-blue design. */
.portfolio {
    --portfolio-navy: #1c2752;
    --portfolio-text: #566779;
    --portfolio-border: #dce4ee;
    overflow-wrap: anywhere;
}

.portfolio [hidden],
.portfolio-photo-modal [hidden] {
    display: none !important;
}

.portfolio > .section {
    padding: 0;
}

.portfolio .container {
    max-width: 1320px;
}

.projects-page #navmenu > ul > li > a[aria-current="page"] > span {
    text-decoration: underline;
    text-decoration-color: #5675c9;
    text-underline-offset: 10px;
    text-decoration-thickness: 2px;
}

.portfolio .portfolio-hero {
    padding-block: 34px;
    background: #f2f4f8 linear-gradient(135deg, transparent 65%, rgba(255, 255, 255, .55) 65%, rgba(255, 255, 255, .55) 80%, transparent 80%);
}

.portfolio-hero-layout {
    display: grid;
    grid-template-columns: minmax(0, .815fr) minmax(0, 1.185fr);
    align-items: center;
    gap: 48px;
}

.portfolio-eyebrow {
    display: block;
    margin: 0 0 22px;
    color: var(--portfolio-navy);
    font-family: var(--nav-font);
    font-size: .75rem;
    font-weight: 700;
    letter-spacing: .1em;
    line-height: 1.5;
    text-transform: uppercase;
}

.portfolio-hero h1 {
    max-width: 13ch;
    margin: 0 0 16px;
    color: #304768;
    font-size: clamp(2.25rem, 3.8vw, 3.5rem);
    font-weight: 700;
    letter-spacing: -.035em;
    line-height: 1.08;
}

.portfolio-hero p {
    max-width: 46ch;
    margin: 0 0 30px;
    color: #435c79;
    font-size: 1.1875rem;
    line-height: 1.6;
}

.portfolio-hero-image {
    width: 100%;
    height: 350px;
    border-radius: 20px;
    object-fit: cover;
}

.portfolio-button {
    display: inline-flex;
    min-height: 50px;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 12px 28px;
    border: 1px solid transparent;
    border-radius: 999px;
    font-size: .875rem;
    font-weight: 600;
    line-height: 1.5;
    text-align: center;
    text-decoration: none;
    transition: background-color .2s ease, border-color .2s ease, transform .2s ease;
}

.portfolio-button--primary {
    background: var(--portfolio-navy);
    color: #fff;
}

.portfolio-button--primary:hover {
    background: #2d3e70;
    color: #fff;
    transform: translateY(-2px);
}

.portfolio-button--outline {
    border-color: #aab7cd;
    background: #fff;
    color: var(--portfolio-navy);
}

.portfolio-button--outline:hover {
    border-color: var(--portfolio-navy);
    background: #f2f6fc;
    color: var(--portfolio-navy);
}

.portfolio a:focus-visible,
.portfolio button:focus-visible {
    outline: 3px solid #5675c9;
    outline-offset: 4px;
}

.portfolio .portfolio-featured-section {
    padding-block: 38px 48px;
}

.portfolio-featured-section .portfolio-eyebrow {
    margin-bottom: 14px;
}

.portfolio-featured {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr);
    overflow: hidden;
    border: 1px solid var(--portfolio-border);
    border-radius: 12px;
}

.portfolio-featured-photo {
    position: relative;
    display: block;
    min-height: 320px;
    background: #edf2f7;
}

.portfolio-featured-photo img {
    position: absolute;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.portfolio-featured-copy {
    align-self: center;
    padding: 36px 44px;
}

.portfolio-category {
    display: block;
    color: #52657f;
    font-size: .75rem;
    font-weight: 400;
    line-height: 1.5;
}

.portfolio-featured-copy h3 {
    margin: 16px 0;
    color: var(--portfolio-navy);
    font-size: clamp(1.75rem, 2.8vw, 2.5rem);
    font-weight: 700;
    letter-spacing: -.025em;
}

.portfolio-featured-copy p {
    margin-bottom: 36px;
    color: var(--portfolio-text);
    font-size: 1.0625rem;
    line-height: 1.7;
}

.portfolio-featured .portfolio-button {
    min-height: 48px;
    padding-inline: 24px;
    border-color: var(--portfolio-border);
    border-radius: 12px;
}

.portfolio .portfolio-selection {
    padding-bottom: 40px;
}

.portfolio-selection h2,
.portfolio-contact h2 {
    margin: 0 0 8px;
    color: #2d5069;
    font-size: clamp(1.75rem, 2.8vw, 2.375rem);
    font-weight: 700;
    letter-spacing: -.03em;
    line-height: 1.2;
}

.portfolio-selection-description {
    margin-bottom: 20px;
    color: #64748b;
    line-height: 1.6;
}

.portfolio-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 30px;
}

.portfolio-filter {
    min-height: 44px;
    padding: 10px 24px;
    border: 1px solid var(--portfolio-border);
    border-radius: 999px;
    background: #fff;
    color: #304b69;
    font-size: .8125rem;
    line-height: 1.5;
    transition: background-color .2s ease, border-color .2s ease;
}

.portfolio-filter:hover {
    border-color: #8595b1;
    background: #f2f6fc;
}

.portfolio-filter.is-active {
    border-color: var(--portfolio-navy);
    background: var(--portfolio-navy);
    color: #fff;
    box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .08);
}

.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 26px;
}

.portfolio-card {
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--portfolio-border);
    border-radius: 12px;
    background: #fff;
    transition: transform .25s ease, box-shadow .25s ease;
}

.portfolio-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 28px rgba(28, 39, 82, .08);
}

.portfolio-card-link {
    display: block;
    height: 100%;
    color: var(--portfolio-navy);
}

.portfolio .portfolio-card-link:focus-visible {
    outline-offset: -4px;
}

.portfolio-card-photo {
    position: relative;
    aspect-ratio: 1.95;
    overflow: hidden;
    background: #edf2f7;
}

.portfolio-card-photo img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .35s ease;
}

.portfolio-card-link:hover img {
    transform: scale(1.025);
}

.portfolio-card-copy {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 18px 16px;
}

.portfolio-card h3 {
    margin: 3px 0 0;
    color: var(--portfolio-navy);
    font-size: 1.0625rem;
    font-weight: 700;
    line-height: 1.35;
}

.portfolio-card .portfolio-category {
    font-size: .6875rem;
}

.portfolio-expand {
    display: inline-flex;
    width: 38px;
    height: 38px;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--portfolio-border);
    border-radius: 10px;
    color: #23456b;
    font-size: .875rem;
}

.portfolio-more {
    margin-top: 26px;
    text-align: center;
}

.portfolio-more .portfolio-button {
    min-width: 260px;
    border-radius: 16px;
}

.portfolio-empty {
    padding: 32px;
    border: 1px solid var(--portfolio-border);
    border-radius: 12px;
    text-align: center;
}

.portfolio .portfolio-contact {
    padding-block: 46px;
    background: #f1f7fd linear-gradient(135deg, transparent 59%, rgba(255, 255, 255, .55) 59%, rgba(255, 255, 255, .55) 73%, transparent 73%);
}

.portfolio-contact-layout {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 32px;
}

.portfolio-contact p {
    margin: 0;
    color: #526981;
    font-size: 1.0625rem;
}

.portfolio-contact .portfolio-button {
    flex-shrink: 0;
}

.portfolio-image-fallback {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 24px;
    color: #52657f;
    font-size: .875rem;
    text-align: center;
}

.portfolio-image-fallback > i {
    font-size: 2rem;
}

.portfolio-photo-modal .modal-content {
    overflow: hidden;
    border: 0;
    border-radius: 18px;
}

.portfolio-photo-modal .modal-dialog {
    max-width: min(1600px, calc(100% - 32px));
    margin-inline: auto;
}

.portfolio-gallery-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 16px;
}

.portfolio-gallery-toolbar > a {
    color: var(--accent-color);
    font-size: .875rem;
    text-decoration: underline;
    text-underline-offset: 4px;
}

.portfolio-gallery-navigation {
    display: flex;
    align-items: center;
    gap: 16px;
}

.portfolio-gallery-navigation button {
    width: 44px;
    height: 44px;
    border: 1px solid #dce4ee;
    border-radius: 12px;
    background: #fff;
    color: var(--accent-color);
}

.portfolio-gallery-navigation span {
    color: #52657f;
    font-size: .875rem;
}

.portfolio-gallery-thumbnails {
    position: relative;
    display: flex;
    gap: 12px;
    overflow-x: auto;
    margin-top: 16px;
    padding: 4px;
}

.portfolio-gallery-thumbnails button {
    position: relative;
    width: 96px;
    height: 68px;
    flex-shrink: 0;
    overflow: hidden;
    padding: 0;
    border: 2px solid transparent;
    border-radius: 10px;
    background: #e8eef5;
}

.portfolio-gallery-thumbnails button[aria-current] {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 2px #fff, 0 0 0 3px var(--accent-color);
}

.portfolio-gallery-thumbnails img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.portfolio-gallery-thumbnails span {
    position: absolute;
    right: 3px;
    bottom: 3px;
    padding: 0 5px;
    border-radius: 4px;
    background: #1c2752;
    color: #fff;
    font-size: .75rem;
}

.portfolio-photo-modal button:focus-visible,
.portfolio-photo-modal a:focus-visible {
    outline: 3px solid #5675c9;
    outline-offset: 2px;
}

.portfolio-gallery-caption {
    margin: 16px 0 0;
    color: #52657f;
    line-height: 1.6;
}

.portfolio-photo-modal .modal-header,
.portfolio-photo-modal .modal-body {
    padding: 24px;
}

.portfolio-photo-modal .modal-header {
    align-items: flex-start;
    border-bottom-color: #e5ebf3;
}

.portfolio-photo-modal .modal-title {
    margin-top: 6px;
    font-size: 1.5rem;
    font-weight: 700;
}

.portfolio-photo-frame {
    display: grid;
    min-height: 180px;
    place-items: center;
    padding: 12px;
    border-radius: 12px;
    background: #f2f4f8;
    touch-action: pan-y pinch-zoom;
}

.portfolio-photo-frame img {
    display: block;
    max-width: 100%;
    max-height: 68vh;
    object-fit: contain;
}

.portfolio-photo-loading {
    margin: 0;
    color: #52657f;
}

.portfolio-photo-error {
    padding: 24px;
    text-align: center;
}

.portfolio-photo-error > i {
    font-size: 2rem;
    color: #52657f;
}

.portfolio-photo-error p {
    margin-top: 16px;
}

.portfolio-photo-error a {
    text-decoration: underline;
}

.portfolio-photo-caption p {
    margin: 20px 0 0;
    color: #52657f;
    line-height: 1.7;
}

.portfolio-photo-caption .portfolio-photo-location {
    margin-top: 8px;
    font-size: .875rem;
}

@media (max-width: 991.98px) {
    .portfolio-hero-layout {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        gap: 24px;
    }

    .portfolio-hero-image {
        height: 320px;
    }

    .portfolio-hero p {
        font-size: 1rem;
    }

    .portfolio-featured-copy {
        padding: 28px;
    }

    .portfolio-featured-photo {
        min-height: 300px;
    }

    .portfolio-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 20px;
    }

    .portfolio-contact-layout {
        align-items: flex-start;
        flex-direction: column;
        gap: 24px;
    }
}

@media (max-width: 575.98px) {
    .portfolio .portfolio-hero {
        padding-block: 40px;
    }

    .portfolio-hero-layout,
    .portfolio-featured,
    .portfolio-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .portfolio-hero-layout {
        gap: 32px;
    }

    .portfolio-hero h1 {
        max-width: 14ch;
    }

    .portfolio-hero-image {
        height: 230px;
        border-radius: 16px;
    }

    .portfolio-featured-photo {
        min-height: 0;
        aspect-ratio: 1.6;
    }

    .portfolio-featured-copy {
        padding: 24px;
    }

    .portfolio-featured-copy p {
        margin-bottom: 24px;
    }

    .portfolio-filters {
        gap: 8px;
    }

    .portfolio-filter {
        padding-inline: 16px;
    }

    .portfolio .portfolio-featured-section {
        padding-block: 32px;
    }

    .portfolio-card-photo {
        aspect-ratio: 1.75;
    }

    .portfolio-card h3 {
        font-size: 1.125rem;
    }

    .portfolio .portfolio-contact {
        padding-block: 36px;
    }

    .portfolio-photo-modal .modal-header,
    .portfolio-photo-modal .modal-body {
        padding: 18px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .portfolio *,
    .portfolio *::before,
    .portfolio *::after {
        transition: none !important;
        scroll-behavior: auto !important;
    }
}
