.portfolio-section .blog-card {
    height: auto;
    min-width: 0;
}
.portfolio-section .blog-image-link {
    height: auto;
    aspect-ratio: 7 / 4;
    flex-shrink: 0;
}
.portfolio-section .blog-card-title,
.portfolio-detail .article-typography-content {
    overflow-wrap: anywhere;
}
.portfolio-link {
    display: inline-block;
    margin-top: auto;
    color: #397cb1;
    font-weight: 600;
}
.portfolio-link:hover {
    text-decoration: underline;
}
.portfolio-detail .portfolio-detail-image {
    display: block;
    width: auto;
    max-width: 100%;
    height: auto;
    max-height: 720px;
    object-fit: contain;
    margin: 0 auto 30px;
}
.portfolio-empty {
    color: #4a5568;
    text-align: center;
    padding: 40px 0;
}

.portfolio-gallery { margin-bottom: 32px; }
.portfolio-gallery-photo { display: block; cursor: zoom-in; }
.portfolio-gallery-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.portfolio-detail .portfolio-gallery-grid figure { margin: 0; min-width: 0; }
.portfolio-detail .portfolio-gallery-grid img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; margin: 0; border-radius: 12px; }
.portfolio-gallery-grid figcaption { padding-top: 8px; color: #536777; font-size: 14px; line-height: 1.5; }
.portfolio-lightbox { width: min(1200px, calc(100% - 32px)); max-width: none; height: calc(100dvh - 32px); max-height: none; margin: auto; padding: 16px; box-sizing: border-box; border: 0; border-radius: 16px; background: #17212d; color: #fff; }
.portfolio-lightbox[open] { display: flex; flex-direction: column; }
.portfolio-lightbox::backdrop { background: #101923e8; }
.portfolio-lightbox-bar { display: flex; justify-content: space-between; align-items: center; flex-shrink: 0; }
.portfolio-lightbox button { flex-shrink: 0; width: 44px; height: 44px; background: #ffffff18; color: #fff; border: 0; border-radius: 50%; font-size: 30px; cursor: pointer; }
.portfolio-lightbox button:focus-visible { outline: 2px solid #89caff; outline-offset: 2px; }
.portfolio-lightbox-stage { display: flex; gap: 12px; align-items: center; justify-content: center; flex: 1; min-height: 0; margin: 16px 0; }
.portfolio-lightbox-stage img { display: block; flex: 1; min-width: 0; width: 0; height: 100%; object-fit: contain; }
.portfolio-photo-caption { margin: 0; text-align: center; line-height: 1.5; max-height: 15vh; overflow-y: auto; overflow-wrap: anywhere; flex-shrink: 0; }
html.portfolio-gallery-open { overflow: hidden; }
@media (max-width: 600px) {
    .portfolio-gallery-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
    .portfolio-lightbox { width: 100%; height: 100dvh; border-radius: 0; padding: max(12px, env(safe-area-inset-top)) 12px max(12px, env(safe-area-inset-bottom)); }
    .portfolio-lightbox-stage { gap: 4px; }
    .portfolio-lightbox-stage button { width: 34px; height: 40px; }
}
.selected-portfolio-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 30px; }
.selected-portfolio-heading h2 { margin: 0; font-size: clamp(26px, 4vw, 36px); }
.selected-portfolio-heading .portfolio-link { margin: 0; flex-shrink: 0; }
@media (max-width: 480px) { .selected-portfolio-heading { align-items: flex-start; flex-direction: column; gap: 12px; } }
