/**
 * Photo styles — see inc/photo-styles.php
 *
 * Applied via `is-style-{slug}` on an Image block <figure> or on .portfolio-hero.
 * Self-contained: this file also loads inside the block editor, where the theme's
 * :root variables in style.css are not available.
 *
 * Mat anatomy (outside → in): border = mat board, padding = bevel core, then photo.
 * Bottom is weighted slightly heavier, as with a hand-cut gallery mat.
 */

/**********[ #MATTED ]**********/

.is-style-matted-white,
.is-style-matted-black {
    --mat-width: clamp(14px, 4vw, 48px);
    --mat-bevel: 3px;
}

.is-style-matted-white {
    --mat-board: #f2efe8;  /* warm museum white */
    --mat-core:  #d6d1c5;  /* bevel reads as a shadowed cut edge */
}

.is-style-matted-black {
    --mat-board: #0b0b0b;
    --mat-core:  #f2efe8;  /* white-core black mat — bright bevel line */
}

.is-style-matted-white img,
.is-style-matted-black img {
    box-sizing: border-box;
    border-style: solid;
    border-color: var(--mat-board);
    border-width: var(--mat-width) var(--mat-width) calc(var(--mat-width) * 1.15);
    padding: var(--mat-bevel);
    background: var(--mat-core);
    border-radius: 0;
    /* hairline edge separates a black mat from the dark page; shadow lifts it off the wall */
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.08),
        0 12px 32px rgba(0, 0, 0, 0.55);
}

/* Captions sit below the mat, not tight against the photo */
.is-style-matted-white figcaption,
.is-style-matted-black figcaption {
    margin-top: 1em;
}

/**********[ #PORTFOLIO HERO — MATTED ]**********/

/* Default hero is full-bleed object-fit: cover. Matted shows the whole photo, uncropped. */
.portfolio-hero.is-style-matted-white,
.portfolio-hero.is-style-matted-black {
    display: flex;
    justify-content: center;
    align-items: center;
    max-height: none;
    overflow: visible;
    background: none;
    padding: calc(80px + 2rem) 1rem 3rem; /* clears the fixed header */
}

.portfolio-hero.is-style-matted-white img,
.portfolio-hero.is-style-matted-black img {
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 85vh;
    object-fit: contain;
}
