/*
 * InkArtists tattoo viewer: one piece of work pinned up in the shop.
 * Served as-is (no build step); every rule is scoped under .pvw (and the
 * pop-up's .pvw-overlay). The tattoo and flash pages show it as the page
 * (.pvw--inline); the tattoo search and the artist pages open it over
 * everything (.pvw--modal). The photo hangs as a pinned print on the ink
 * stage, as on the lists' front windows; the words sit on the shop's paper
 * card; the request button follows.
 * Brand: ink #1C1712, paper #F7F3EC, ember #D65A31.
 * Headlines: Fraunces (soft, normal width, -0.01em); the rest Satoshi.
 */

.pvw {
    --ink: #1C1712;
    --paper: #F7F3EC;
    --paper-2: #EFE6D8;
    --card: #FFFDF8;
    --line: #E6DFD3;
    --soft: #6B5F53;
    --ember: #D65A31;
    --ember-ui: #C24E26;
    --ember-deep: #A83E1E;
    --ember-tint: #FFE4D9;
    --ember-glow: #FF9B72;
    --flash: #F2E9DA;
    --display: "Fraunces", Georgia, "Times New Roman", serif;
    --sans: Satoshi, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    background: var(--paper);
    color: var(--ink);
    font-family: var(--sans);
}

/* Resets in a cascade layer, so they rank below the Tailwind utilities the
   menu and the bookmark button still carry. */
@layer pvw-reset {
    :where(.pvw) *, :where(.pvw) *::before, :where(.pvw) *::after { box-sizing: border-box; }
    :where(.pvw) :where(h1, h2, p) { margin: 0; }
    :where(.pvw) :where(a) { color: inherit; text-decoration: none; }
    :where(.pvw) :where(button) { font: inherit; color: inherit; }
}
.pvw :focus-visible { outline: 3px solid var(--ember-glow); outline-offset: 3px; }

/* The pop-up: the whole screen in ink, scrolled on its own. */
.pvw-overlay { position: fixed; inset: 0; z-index: 120; overflow-y: auto; overscroll-behavior: contain; background: #1C1712; }
.pvw--modal { min-height: 100%; }

/* ═══════════════════════════ THE STAGE ═══════════════════════════ */
.pvw-stage {
    position: relative; display: grid; justify-items: center; align-content: center; gap: 18px; min-width: 0;
    padding: 34px 16px 28px;
    background: radial-gradient(900px 520px at 85% 0%, rgba(214, 90, 49, .16), transparent 62%), var(--ink);
}
.pvw--modal .pvw-stage { padding-top: 74px; }
.pvw-frame { position: relative; display: grid; justify-items: center; width: 100%; min-width: 0; }

/* The photo, pinned up as a print. */
.pvw-print {
    position: relative; max-width: 100%; padding: 10px; border-radius: 4px; background: var(--flash);
    box-shadow: 0 2px 0 rgba(0, 0, 0, .25), 0 34px 50px -24px rgba(0, 0, 0, .9);
}
.pvw-print::before {
    /* the pin */
    content: ""; position: absolute; top: -9px; left: 50%; z-index: 2; width: 20px; height: 20px; translate: -50% 0; border-radius: 50%;
    background: radial-gradient(circle at 35% 32%, #FFB08F, var(--ember) 46%, var(--ember-deep)); box-shadow: 0 4px 6px rgba(0, 0, 0, .5);
}
.pvw-print__media {
    display: block; width: auto; height: auto; max-width: 100%; max-height: min(66vh, 760px); min-width: 120px; min-height: 120px;
    object-fit: contain; border-radius: 2px; background: var(--paper-2);
}

/* Round paper buttons on the print: the menu (top) and the like (bottom). */
.pvw-print__menu { position: absolute; top: 20px; right: 20px; z-index: 3; }
.pvw-print__like { position: absolute; right: 20px; bottom: 20px; z-index: 3; }
.pvw-round, .pvw .pvw-print__menu > button {
    display: grid; place-items: center; width: 42px; height: 42px; padding: 0; border-radius: 50%; cursor: pointer;
    background: rgba(247, 243, 236, .94); color: var(--ink); border: 1px solid rgba(28, 23, 18, .12);
    box-shadow: 0 10px 22px -10px rgba(0, 0, 0, .65); transition: transform .2s, color .2s, background-color .2s;
}
.pvw-round:hover, .pvw .pvw-print__menu > button:hover { transform: scale(1.06); background: #fff; color: var(--ember-deep); }
.pvw-print__like .fa-heart { font-size: 18px; }
.pvw-print__like .fa-solid.fa-heart { color: var(--ember-ui); }

/* Previous and next, at the stage's edges. */
.pvw-nav {
    position: absolute; top: 50%; z-index: 4; display: grid; place-items: center; width: 42px; height: 42px; margin-top: -21px; padding: 0;
    border-radius: 50%; cursor: pointer; color: var(--paper); background: rgba(28, 23, 18, .6); border: 1.5px solid rgba(247, 243, 236, .35);
    transition: background-color .2s, color .2s, border-color .2s;
}
.pvw-nav:hover { background: var(--paper); color: var(--ink); border-color: var(--paper); }
.pvw-nav--prev { left: 2px; }
.pvw-nav--next { right: 2px; }

.pvw-close {
    position: fixed; top: 14px; left: 14px; z-index: 6; display: grid; place-items: center; width: 44px; height: 44px; padding: 0;
    border: 0; border-radius: 50%; cursor: pointer; background: rgba(247, 243, 236, .94); color: var(--ink); font-size: 18px;
    box-shadow: 0 10px 24px -10px rgba(0, 0, 0, .7); transition: transform .2s;
}
.pvw-close:hover { transform: scale(1.06); }

/* More photos of the same piece. */
.pvw-thumbs { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; max-width: 100%; }
.pvw-thumb {
    width: 54px; height: 54px; padding: 0; overflow: hidden; border-radius: 10px; cursor: pointer; opacity: .7;
    background: rgba(247, 243, 236, .08); border: 2px solid rgba(247, 243, 236, .2); transition: opacity .2s, border-color .2s;
}
.pvw-thumb:hover { opacity: 1; }
.pvw-thumb.is-current { opacity: 1; border-color: var(--ember-glow); }
.pvw-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }

/* ═══════════════════════════ THE CARD ═══════════════════════════ */
/* The shared paper card of the artist and studio lists. */
.pvw-sheet { min-width: 0; padding: 22px 16px 26px; }
.pvw-card {
    display: grid; gap: 14px; width: min(560px, 100%); margin-inline: auto; padding: clamp(20px, 3vw, 28px);
    border-radius: 18px; background: var(--card); border: 1px solid var(--line);
    box-shadow: 0 2px 0 rgba(28, 23, 18, .04), 0 26px 40px -30px rgba(28, 23, 18, .45);
}
.pvw-kicker { font: 800 12px/1.2 var(--sans); letter-spacing: .2em; text-transform: uppercase; color: var(--ember-deep); }
.pvw-title {
    font-family: var(--display); font-weight: 640; font-size: clamp(1.55rem, 1.2rem + 1.4vw, 2.3rem); line-height: 1.1;
    letter-spacing: -0.01em; text-wrap: balance; overflow-wrap: anywhere;
}
.pvw-title a { transition: color .2s; }
.pvw-title a:hover { color: var(--ember-deep); }
.pvw-title i { margin-left: .4em; font-size: .4em; vertical-align: .35em; color: var(--soft); transition: color .2s; }
.pvw-title a:hover i { color: var(--ember-deep); }
.pvw-story { font-size: 15.5px; line-height: 1.65; color: #43392F; white-space: pre-line; overflow-wrap: anywhere; }
.pvw-story:empty { display: none; }

/* Who made it. */
.pvw-artist { display: flex; align-items: center; gap: 12px; min-width: 0; margin-top: 4px; padding-top: 16px; border-top: 1px dashed #D9CEBD; }
.pvw-artist__avatar {
    flex: none; display: grid; place-items: center; width: 52px; height: 52px; overflow: hidden; border-radius: 50%;
    background: var(--paper-2); box-shadow: 0 0 0 1px var(--line); font: 650 1.25rem/1 var(--display); color: var(--ink);
}
.pvw-artist__avatar img { display: block; width: 100%; height: 100%; object-fit: cover; }
.pvw-artist__who { flex: 1; min-width: 0; display: grid; gap: 3px; }
.pvw-artist__name {
    font: 650 1.15rem/1.2 var(--display); letter-spacing: -0.005em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    transition: color .2s;
}
.pvw-artist__name:hover { color: var(--ember-deep); }
.pvw-artist__meta { font-size: 13px; line-height: 1.35; color: var(--soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pvw-artist__meta:empty { display: none; }
.pvw-artist__score { flex: none; display: inline-flex; align-items: baseline; gap: 4px; font-size: 13px; color: var(--soft); }
.pvw-artist__score i { color: var(--ember-ui); font-size: 12px; }
.pvw-artist__score b { color: var(--ink); font-size: 15px; }

/* ═══════════════════════════ THE REQUEST BAR ═══════════════════════════ */
/* On phones it stays at the bottom of the screen; beside the stage it sits under the card. */
.pvw-cta {
    position: sticky; bottom: 0; z-index: 30; display: flex; justify-content: center;
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
    background: rgba(247, 243, 236, .97); border-top: 1px solid var(--line); box-shadow: 0 -18px 30px -24px rgba(28, 23, 18, .45);
}
.pvw-cta__row { display: flex; align-items: center; gap: 10px; width: min(560px, 100%); }
.pvw-btn {
    flex: 1; min-width: 0; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 50px; padding: 12px 20px;
    border: 0; border-radius: 999px; background: var(--ember-ui); color: #fff; font: 800 15px/1.2 var(--sans); text-align: center; cursor: pointer;
    box-shadow: 0 14px 30px -14px rgba(214, 90, 49, .9); transition: background-color .2s, transform .2s;
}
.pvw-btn:hover { background: var(--ember-deep); transform: translateY(-2px); }
.pvw-btn > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Booking by calendar only: the button explains instead (x-artist.cta-actions adds bg-gray-900). */
.pvw .pvw-btn.bg-gray-900 { background: var(--ink); color: var(--paper); box-shadow: none; }
.pvw .pvw-btn.bg-gray-900:hover { background: #000; transform: none; }
.pvw-btn--off { background: var(--paper-2); color: var(--soft); box-shadow: none; cursor: default; }
.pvw-btn--off:hover { background: var(--paper-2); transform: none; }
.pvw-keep {
    flex: none; display: grid; place-items: center; width: 50px; height: 50px; padding: 0; border-radius: 50%; cursor: pointer;
    background: var(--card); color: var(--ink); border: 1.5px solid var(--line); font-size: 19px; transition: border-color .2s, color .2s, background-color .2s;
}
.pvw-keep:hover { border-color: var(--ink); }
.pvw-keep[aria-pressed="true"] { color: var(--ember-deep); background: var(--ember-tint); border-color: rgba(194, 78, 38, .35); }
.pvw-keep[disabled] { opacity: .45; cursor: not-allowed; }
.pvw-keep[disabled]:hover { border-color: var(--line); }

/* ═══════════════════════════ BESIDE THE STAGE ═══════════════════════════ */
@media (min-width: 1024px) {
    .pvw {
        grid-template-columns: minmax(0, 1fr) clamp(380px, 33vw, 480px);
        grid-template-rows: minmax(0, 1fr) auto auto minmax(0, 1fr);
    }
    .pvw--inline { min-height: calc(100vh - 76px); }
    .pvw-stage { grid-column: 1; grid-row: 1 / -1; padding: 52px 86px 44px; }
    .pvw--modal .pvw-stage { padding-top: 52px; }
    .pvw-sheet { grid-column: 2; grid-row: 2; padding: 40px 32px 0; }
    .pvw-cta {
        grid-column: 2; grid-row: 3; position: static; padding: 16px 32px 40px;
        background: none; border: 0; box-shadow: none;
    }
    /* Room under the print for the other photos' thumbnails. */
    .pvw-print__media { max-height: max(360px, min(calc(100vh - 250px), 880px)); }
    .pvw-nav { width: 50px; height: 50px; margin-top: -25px; background: rgba(247, 243, 236, .06); }
    .pvw-nav--prev { left: -68px; }
    .pvw-nav--next { right: -68px; }
}

.pvw:lang(ja) .pvw-title, .pvw:lang(ja) .pvw-artist__name {
    font-family: "Fraunces", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic", Meiryo, sans-serif;
    font-weight: 700; letter-spacing: 0;
}
.pvw:lang(ko) .pvw-title, .pvw:lang(ko) .pvw-artist__name {
    font-family: "Fraunces", "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", sans-serif; font-weight: 700; letter-spacing: 0;
}

@media (prefers-reduced-motion: reduce) {
    .pvw-round, .pvw-btn, .pvw-nav, .pvw-close, .pvw-thumb, .pvw .pvw-print__menu > button { transition: none; }
}
