.photo { margin: 0 0 1rem; container-type: inline-size; }
.page-type-darkroom-photo .ccm-block-top-navigation-bar + .container { padding-top: clamp(5.75rem, 9vw, 7.25rem); }
.photo__media { display: block; }
.photo__link { display: block; }
.photo__img { display: block; width: 100%; height: auto; }
.photo__media--lightbox { position: relative; cursor: zoom-in; }
.photo__media--lightbox .photo__img { cursor: zoom-in; }

.photo__lightbox-trigger {
    position: absolute;
    right: 1rem;
    bottom: 1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 0.85rem;
    border: 1px solid rgba(255, 255, 255, 0.5);
    background: rgba(17, 24, 20, 0.58);
    color: #f7f2e7;
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    backdrop-filter: blur(12px);
    opacity: 0;
    transform: translateY(0.35rem);
    transition: opacity 180ms ease, transform 180ms ease, background-color 180ms ease;
}

.photo__media--lightbox:hover .photo__lightbox-trigger,
.photo__media--lightbox:focus-within .photo__lightbox-trigger {
    opacity: 1;
    transform: translateY(0);
}

.photo__lightbox-trigger:hover,
.photo__lightbox-trigger:focus-visible {
    background: rgba(17, 24, 20, 0.78);
}

.photo__ratio { position: relative; width: 100%; overflow: hidden; }
.photo__ratio .photo__img { width: 100%; height: 100%; object-fit: cover; }
.photo__ratio--16x9 { aspect-ratio: 16 / 9; }
.photo__ratio--4x3 { aspect-ratio: 4 / 3; }
.photo__ratio--1x1 { aspect-ratio: 1 / 1; }

.photo__caption { margin-top: 0.75rem; min-width: 0; }
.photo__text {
    margin-bottom: 0.5rem;
    line-height: 1.5;
    min-width: 0;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.photo__meta {
    font-size: 0.94rem;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 0.5rem;
    padding: 0.75rem;
    background: rgba(0, 0, 0, 0.02);
    min-width: 0;
}

.photo__meta-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.16rem;
    padding: 0.25rem 0;
    min-width: 0;
}

.photo__meta-label {
    min-width: 0;
    font-weight: 600;
    opacity: 0.8;
    font-size: 0.78rem;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.photo__meta-value {
    font-size: 0.93rem;
    line-height: 1.48;
    min-width: 0;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.photo__meta--compact .photo__meta-row {
    display: grid;
    margin-right: 0;
}

.photo__meta--compact .photo__meta-label {
    min-width: 0;
    margin-right: 0;
}

@container (max-width: 1024px) {
    .photo__meta {
        padding: 0.66rem 0.7rem;
    }

    .photo__meta-label {
        font-size: 0.75rem;
    }

    .photo__meta-value {
        font-size: 0.9rem;
    }
}

@container (max-width: 640px) {
    .photo__caption {
        margin-top: 0.62rem;
    }

    .photo__meta {
        padding: 0.58rem 0.62rem;
    }

    .photo__meta-row {
        gap: 0.14rem;
        padding: 0.22rem 0;
    }

    .photo__meta-label {
        font-size: 0.72rem;
    }

    .photo__meta-value {
        font-size: 0.87rem;
        line-height: 1.42;
    }
}

/* EXIF rows: icons only, grouped as camera/lens/exposure */
.photo__meta-value--exif-stack {
    display: grid;
    gap: 0.16rem;
}

.photo__meta-value--exif-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.28rem 0.65rem;
}

.photo__exif-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.22rem;
    white-space: normal;
    min-width: 0;
}

/* Title/Description emphasis without labels */
.photo__meta-row--title-only,
.photo__meta-row--description-only {
    padding: 0;
}

.photo__meta-title {
    margin: 0;
    font-size: 1.12rem;
    line-height: 1.22;
    font-weight: 700;
    color: #1f2933;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.photo__meta-description {
    margin: 0;
    font-size: 0.93rem;
    line-height: 1.48;
    color: #2b3a47;
    font-style: italic;
    overflow-wrap: anywhere;
    word-break: break-word;
}

@container (max-width: 1024px) {
    .photo__meta-title {
        font-size: 1.02rem;
    }

    .photo__meta-description {
        font-size: 0.9rem;
    }
}

@container (max-width: 640px) {
    .photo__meta-title {
        font-size: 0.94rem;
    }

    .photo__meta-description {
        font-size: 0.86rem;
        line-height: 1.42;
    }
}

/* Keep download controls compact and right-aligned */
.photo__download {
    display: flex;
    justify-content: flex-end;
}

.photo__download .input-group {
    display: inline-flex;
    width: auto;
    max-width: 100%;
}

.photo__download .input-group .form-select,
.photo__download .input-group select.form-control {
    flex: 0 0 auto;
    width: auto;
    min-width: 0;
}

.photo__lightbox[hidden] {
    display: none !important;
}

.photo__lightbox {
    position: fixed;
    inset: 0;
    z-index: 2100;
}

.photo__lightbox-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(8, 12, 10, 0.82);
    backdrop-filter: blur(14px);
    opacity: 0;
    transition: opacity 220ms ease;
}

.photo__lightbox-dialog {
    position: relative;
    display: grid;
    place-items: center;
    width: min(92vw, 1280px);
    max-height: calc(100vh - 3rem);
    margin: 1.5rem auto;
    padding: 3.75rem 1rem 1rem;
    opacity: 0;
    transform: translateY(1.2rem) scale(0.965);
    transition: opacity 220ms ease, transform 260ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.photo__lightbox.is-open .photo__lightbox-backdrop {
    opacity: 1;
}

.photo__lightbox.is-open .photo__lightbox-dialog {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.photo__lightbox-close {
    position: absolute;
    top: 0.65rem;
    right: 0.65rem;
    z-index: 1;
    width: 2.75rem;
    height: 2.75rem;
    border: 1px solid rgba(255, 255, 255, 0.28);
    background: rgba(10, 14, 12, 0.52);
    color: #f7f2e7;
    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
    backdrop-filter: blur(10px);
}

.photo__lightbox-figure {
    display: grid;
    gap: 0.85rem;
    margin: 0;
}

.photo__lightbox-image {
    display: block;
    width: auto;
    max-width: 100%;
    max-height: calc(100vh - 9rem);
    margin: 0 auto;
    box-shadow: 0 28px 60px rgba(0, 0, 0, 0.36);
}

.photo__lightbox-caption {
    max-width: min(72ch, 100%);
    margin: 0 auto;
    padding: 0.95rem 1rem 1.05rem;
    background: rgba(17, 24, 20, 0.5);
    color: rgba(247, 242, 231, 0.94);
    border: 1px solid rgba(255, 255, 255, 0.14);
    backdrop-filter: blur(10px);
}

.photo__lightbox-title {
    font-family: var(--nfe-display, serif);
    font-size: 1.35rem;
    line-height: 1.1;
    color: #fff;
}

.photo__lightbox-text {
    margin-top: 0.45rem;
    font-size: 0.95rem;
    line-height: 1.55;
}

body.photo-lightbox-open {
    overflow: hidden;
}

@media (max-width: 767.98px) {
    .photo__lightbox-trigger {
        opacity: 1;
        transform: none;
        right: 0.7rem;
        bottom: 0.7rem;
        padding: 0.45rem 0.7rem;
        font-size: 0.72rem;
    }

    .photo__lightbox-dialog {
        width: calc(100vw - 1rem);
        max-height: calc(100vh - 1rem);
        margin: 0.5rem auto;
        padding: 3.5rem 0.35rem 0.35rem;
    }

    .photo__lightbox-image {
        max-height: calc(100vh - 8rem);
    }

    .photo__lightbox-caption {
        padding: 0.8rem;
    }

    .photo__lightbox-title {
        font-size: 1.12rem;
    }
}
