/* Styles for assets/js/ux.js: figure viewer and CV request dialog. */

/* ---------- Enlargeable figures ---------- */
.project-page img[data-lightbox] { cursor: zoom-in; transition: filter .2s ease; }
.project-page img[data-lightbox]:hover { filter: brightness(.97); }
.project-page img[data-lightbox]:focus-visible { outline: 2px solid var(--accent-color); outline-offset: 4px; border-radius: 6px; }
.project-page :is(.figure-plate, .walkthrough-panel) { position: relative; }
.project-page .figure-plate:has(img[data-lightbox])::after {
    content: ""; position: absolute; right: 10px; bottom: 10px; width: 30px; height: 30px; border-radius: 50%;
    background: rgb(11 16 24 / .7) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='M15 3h6v6M9 21H3v-6M21 3l-7 7M3 21l7-7'/%3E%3C/svg%3E") center / 15px no-repeat;
    opacity: 0; transform: scale(.9); transition: opacity .2s ease, transform .2s ease; pointer-events: none;
}
.project-page .figure-plate:has(img[data-lightbox]):hover::after,
.project-page .figure-plate:has(img[data-lightbox]:focus-visible)::after { opacity: 1; transform: none; }
@media (hover: none) { .project-page .figure-plate:has(img[data-lightbox])::after { opacity: .85; transform: none; } }

/* ---------- Figure viewer dialog ---------- */
html.lightbox-open { overflow: hidden; }
.lightbox {
    width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; margin: 0; padding: 0; border: 0;
    display: none; flex-direction: column; background: rgb(8 11 17 / .985); color: #f2f5fa;
}
.lightbox[open] { display: flex; }
.lightbox::backdrop { background: rgb(8 11 17 / .6); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.lightbox-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: max(12px, env(safe-area-inset-top)) 16px 8px; }
.lightbox-count { color: #b8c2d3; font: 500 12px/1.4 'JetBrains Mono', monospace; letter-spacing: .06em; }
.lightbox-tools { display: flex; gap: 6px; margin-left: auto; }
.lightbox-btn {
    display: inline-grid; place-items: center; width: 44px; height: 44px; border: 1px solid #ffffff24; border-radius: 50%;
    background: #ffffff10; color: #f2f5fa; cursor: pointer; transition: background .2s ease;
}
.lightbox-btn:hover { background: #ffffff24; }
.lightbox-btn:focus-visible { outline: 2px solid #8fb4ff; outline-offset: 2px; }
.lightbox-btn[aria-pressed="true"] { background: #f2f5fa; color: #0b1018; }
.lightbox-btn[hidden] { display: none; }
.lightbox-stage { flex: 1; min-height: 0; display: grid; place-items: center; overflow: auto; padding: 8px 16px; overscroll-behavior: contain; }
.lightbox-img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 6px; background: #fff; cursor: zoom-in; }
.lightbox.is-zoomed .lightbox-stage { place-items: start; }
.lightbox.is-zoomed .lightbox-img { max-width: none; max-height: none; cursor: zoom-out; }
.lightbox-caption {
    max-width: 880px; margin: 0 auto; padding: 10px 20px max(18px, env(safe-area-inset-bottom));
    color: #c9d2df; font-size: 14.5px; line-height: 1.55; text-align: center;
}
@media (max-width: 600px) {
    .lightbox-bar { padding-inline: 10px; }
    .lightbox-tools { gap: 4px; }
    .lightbox-caption { font-size: 13.5px; max-height: 28dvh; overflow-y: auto; text-align: left; }
}

/* ---------- CV request dialog ---------- */
.cv-dialog {
    position: fixed; inset: 0; margin: auto; height: fit-content;
    width: min(480px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); padding: 0; border: 1px solid var(--border-color);
    border-radius: 22px; background: var(--card-bg, var(--bg-primary)); color: var(--text-primary);
    box-shadow: 0 30px 80px -30px rgb(0 0 0 / .45); overflow: auto;
}
.cv-dialog::backdrop { background: rgb(8 11 17 / .5); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.cv-form, .cv-done { position: relative; display: grid; gap: 14px; padding: 30px 28px 26px; }
.cv-form[hidden], .cv-done[hidden] { display: none; }
.cv-close {
    position: absolute; top: 14px; right: 14px; display: grid; place-items: center; width: 40px; height: 40px;
    border: 0; border-radius: 50%; background: var(--bg-secondary); color: var(--text-secondary); cursor: pointer;
}
.cv-close:hover { color: var(--text-primary); }
.cv-kicker { margin: 0; color: var(--accent-color); font: 500 11px/1.4 'JetBrains Mono', monospace; letter-spacing: .12em; text-transform: uppercase; }
.cv-dialog h2 { margin: -6px 0 0; font-family: 'Sora', sans-serif; font-size: 26px; font-weight: 700; letter-spacing: -.03em; }
.cv-intro, .cv-done p { margin: -4px 0 4px; color: var(--text-secondary); font-size: 15px; line-height: 1.6; }
.cv-field { display: grid; gap: 6px; }
.cv-field label { color: var(--text-primary); font-size: 13.5px; font-weight: 600; }
.cv-field label span { margin-left: 4px; color: var(--text-tertiary); font-weight: 400; }
.cv-field input, .cv-field textarea {
    width: 100%; min-height: 44px; padding: 10px 14px; border: 1px solid var(--border-color); border-radius: 12px;
    background: var(--bg-primary, transparent); color: var(--text-primary); font: inherit; font-size: 15px;
}
.cv-field textarea { resize: vertical; }
.cv-field :is(input, textarea):focus-visible { outline: 2px solid var(--accent-color); outline-offset: 1px; border-color: transparent; }
.cv-error { margin: 0; padding: 10px 12px; border-radius: 10px; background: color-mix(in srgb, #d93636 12%, transparent); color: var(--text-primary); font-size: 14px; }
.cv-error a, .cv-alt a { color: var(--accent-color); }
.cv-submit { width: 100%; justify-content: center; margin-top: 4px; }
.cv-submit:disabled { opacity: .7; cursor: progress; }
.cv-alt { margin: 0; color: var(--text-tertiary); font-size: 13.5px; text-align: center; }
.cv-done { justify-items: center; padding-block: 40px 32px; text-align: center; }
.cv-done-icon { display: grid; place-items: center; width: 60px; height: 60px; border-radius: 50%; background: color-mix(in srgb, var(--accent-color) 14%, transparent); color: var(--accent-color); }
.cv-done-icon svg { width: 30px; height: 30px; }
.cv-done h2:focus { outline: none; }

@media (prefers-reduced-motion: reduce) {
    .project-page img[data-lightbox], .project-page .figure-plate::after, .lightbox-btn { transition: none; }
}
