/* PHOTOS: favorite shows grid, tilting photos, favorite characters.
   Tilt behavior (JS) lives in effects.js; this file is the look. */

/* ===== PHOTO FRAME (shared by shows and characters) ===== */
.photo {
    position: relative;
    width: 100%;
    aspect-ratio: 3 / 4;
}

/* ===== SHOWS (big poster + hoverable title list; stacks on mobile, see responsive.css) ===== */
.shows {
    --show-shift: 12px; /* how far the selected row slides right */
    --num-fg: #fff; /* number tag text colour */
    --show-rows: 6; /* titles visible before the list scrolls */
    --show-row-h: clamp(64px, 8vw, 88px); /* height of one title row */
    display: grid;
    grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
    align-items: center;
    gap: clamp(20px, 3.4vw, 44px);
    padding: var(--inset);
    border-radius: var(--r-lg);
    background: var(--card);
}
/* posters are stacked on top of each other; the active one fades in */
.show-img {
    position: absolute;
    inset: 0;
    opacity: 0;
    transform: scale(1.08);
    transition:
        opacity var(--t-slow) var(--ease),
        transform var(--t-slow) var(--ease);
}
.show-img.is-active {
    opacity: 1;
    transform: none;
}
.shows-list {
    --blob-room: 12px; /* room for the jelly highlight to overshoot */
    position: relative;
    margin-right: calc(var(--blob-room) * -1);
    padding-right: var(--blob-room);
    max-height: calc((var(--show-row-h) + 1px) * var(--show-rows));
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: none; /* still scrolls, scroll bar hidden */
}
.shows-list::-webkit-scrollbar {
    display: none;
}
.shows-view {
    cursor: pointer;
}
.shows-list li + li {
    border-top: 1px solid var(--rule);
}
.show-row {
    display: flex;
    align-items: center;
    gap: 16px;
    height: var(--show-row-h);
    color: inherit;
    text-decoration: none;
    opacity: 0.4;
    transition:
        opacity var(--t-base) var(--ease),
        padding-left var(--t-base) var(--ease);
    -webkit-touch-callout: none;
}
.shows-list li.is-active .show-row {
    opacity: 1;
    padding-left: var(--show-shift);
}
.show-num {
    flex: none;
    padding: 4px 10px;
    border-radius: var(--pill);
    background: var(--hl);
    color: var(--ink);
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    font-variant-numeric: tabular-nums;
    transition: opacity var(--t-short) var(--ease);
}
.shows-list:not(.has-blob) li.is-active .show-num {
    background: var(--accent);
    color: var(--num-fg);
}
.shows-list.has-blob li.is-active .show-num {
    opacity: 0;
}
.show-blob {
    position: absolute;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--pill);
    background: var(--accent);
    color: var(--num-fg);
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    font-variant-numeric: tabular-nums;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
}
@media (prefers-color-scheme: dark) {
    .shows {
        --num-fg: #1e1519; /* number tag text in dark mode */
    }
}
.show-go {
    letter-spacing: 0.04em;
    white-space: nowrap;
}
.show-name {
    flex: 1;
    min-width: 0;
    font-size: clamp(1.4rem, 3vw, 2.4rem);
    font-weight: 300;
    letter-spacing: -0.04em;
    line-height: 1.1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.show-row .link-cta {
    flex: none;
}
/* "Download" / "Learn more" label */
.link-cta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.95rem;
    font-weight: 700;
    transition: transform var(--t-quick) var(--ease);
}
.char:hover .link-cta {
    transform: translateY(var(--hover-lift));
}

/* ===== TILT PHOTOS ===== */
[data-tilt] {
    perspective: 700px;
    touch-action: pan-y; /* a finger on the image still scrolls the page (effects.js holds it still only while tilting) */
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}
/* profile picture: a finger always tilts it, never scrolls */
[data-tilt-instant] {
    touch-action: none;
}
/* --rx/--ry = tilt angle, --gx/--gy = glare position, set by effects.js */
.tilt-card {
    --rx: 0deg;
    --ry: 0deg;
    --gx: 50%;
    --gy: 50%;
    --lift: 1;
    position: relative;
    isolation: isolate;
    width: 100%;
    height: 100%;
    border-radius: var(--r-img);
    clip-path: inset(0 round var(--r-img));
    overflow: hidden;
    background: var(--hl);
    transform: rotateX(var(--rx)) rotateY(var(--ry)) scale(var(--lift));
    transition: transform var(--t-slow) var(--ease);
    will-change: transform;
}
.tilt-card.active {
    --lift: 1.03; /* how much a photo grows while tilting */
    transition: transform 0.25s var(--ease);
}
.tilt-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
}
/* parallax image: slightly taller than its frame, moved by --py (header.js) */
img[data-parallax] {
    position: absolute;
    left: 0;
    top: calc(var(--pa, 0px) * -1);
    width: 100%;
    height: calc(100% + var(--pa, 0px) * 2);
    object-fit: cover;
    translate: 0 var(--py, 0px);
    will-change: translate;
}
/* shiny highlight that follows the pointer */
.glare {
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    opacity: 0;
    background: radial-gradient(
        circle at var(--gx) var(--gy),
        rgba(255, 255, 255, 0.55),
        transparent 55%
    );
    mix-blend-mode: soft-light;
    transition: opacity 600ms var(--ease);
}
.tilt-card.active .glare {
    opacity: 1;
}

/* ===== FAVORITE CHARACTERS (two equal panels, identical cards) ===== */
.chars {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--gap);
    align-items: stretch;
}
.char-panel {
    display: flex;
    flex-direction: column;
    gap: clamp(14px, 2vw, 20px);
    padding: var(--card-pad);
    border-radius: var(--r-lg);
    background: var(--card);
}
.char-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.char-head h3 {
    font-size: clamp(1.25rem, 1.8vw, 1.5rem);
    font-weight: 600;
}
/* "02" counter badge */
.char-count {
    padding: 4px 10px;
    border-radius: var(--pill);
    background: var(--hl);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    font-variant-numeric: tabular-nums;
}
.char-grid {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-rows: 1fr; /* every card the same height */
    gap: var(--gap);
}
.char-grid > li {
    display: flex;
    min-width: 0;
}
.char {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 0;
    color: inherit;
    text-align: center;
    text-decoration: none;
    -webkit-touch-callout: none;
    -webkit-user-drag: none;
}
.char-cap {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}
.char-name {
    margin: 0;
    font-family: var(--font-display);
    font-size: clamp(1.05rem, 1.5vw, 1.3rem);
    font-weight: 500;
    letter-spacing: -0.02em;
    line-height: 1.2;
    text-wrap: balance;
    overflow-wrap: anywhere;
}
.char-cap .link-cta {
    margin-top: auto; /* "Learn more" always on the same line */
}
