/* Item detail page: remote-PC / classified-folder terminal interface. Reuses .lab-shell chrome from home-lab.css. */

.item-lab-body {
    overflow-x: hidden;
    background: #060a10;
}

/* Item page has no JS-driven fallback: the shell must always be visible. */
.item-lab-body .lab-shell {
    position: static;
    inset: auto;
    display: flex !important;
    min-height: calc(100vh - clamp(16px, 3.2vh, 40px));
    margin: clamp(8px, 1.6vh, 20px) clamp(8px, 1.4vw, 26px);
}

/* Desktop: the terminal window keeps a constant size; content scrolls inside it instead. */
@media (min-width: 861px) {
    .item-lab-body .lab-shell {
        height: calc(100vh - clamp(16px, 3.2vh, 40px));
        min-height: 0;
    }
}

/* Decorated green "hacker" scrollbar for internally-scrolling zones. */
.item-zone-brief-scroll,
.item-lab-side {
    scrollbar-width: thin;
    scrollbar-color: rgba(69, 244, 189, 0.85) rgba(6, 18, 21, 0.7);
}

.item-zone-brief-scroll::-webkit-scrollbar,
.item-lab-side::-webkit-scrollbar {
    width: 10px;
}

.item-zone-brief-scroll::-webkit-scrollbar-track,
.item-lab-side::-webkit-scrollbar-track {
    background:
        repeating-linear-gradient(180deg, rgba(69, 244, 189, 0.08) 0 2px, transparent 2px 4px),
        rgba(6, 18, 21, 0.7);
    border-left: 1px solid rgba(69, 244, 189, 0.18);
}

.item-zone-brief-scroll::-webkit-scrollbar-thumb,
.item-lab-side::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, rgba(120, 255, 235, 0.95), rgba(69, 244, 189, 0.55));
    border-radius: 5px;
    border: 1px solid rgba(4, 10, 13, 0.85);
    box-shadow: 0 0 8px rgba(69, 244, 189, 0.55);
}

.item-zone-brief-scroll::-webkit-scrollbar-thumb:hover,
.item-lab-side::-webkit-scrollbar-thumb:hover {
    background: rgba(120, 255, 235, 1);
}

.item-lab-body .lab-titlebar-state {
    color: rgba(255, 106, 77, 0.9);
}

.item-lab-body .lab-titlebar-state::before {
    content: "\1F512";
    margin-right: 0.4rem;
    animation: none;
}

/* Faint scanning sweep across the whole viewport for the "remote PC" feel. */
.lab-scan-overlay {
    position: fixed;
    inset: 0;
    z-index: 40;
    pointer-events: none;
    background: linear-gradient(180deg, transparent 0%, rgba(120, 255, 235, 0.025) 50%, transparent 100%);
    background-size: 100% 220px;
    animation: item-lab-scan 7s linear infinite;
    mix-blend-mode: screen;
}

@keyframes item-lab-scan {
    0% { background-position: 0 -220px; }
    100% { background-position: 0 100vh; }
}

.item-lab-grid {
    flex: 1;
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr) auto;
    grid-template-areas:
        "brief side"
        "nav   side";
    gap: 0;
    background: rgba(4, 10, 13, 0.86);
    overflow: hidden;
}

.item-zone-brief {
    grid-area: brief;
}

.item-lab-side {
    grid-area: side;
    display: flex;
    flex-direction: column;
    background: rgba(4, 10, 13, 0.86);
    border-left: 1px solid rgba(120, 255, 235, 0.14);
    min-height: 0;
    overflow-y: auto;
}

.item-lab-grid > .item-lab-navpair {
    grid-area: nav;
}

.item-lab-side > .item-zone + .item-zone {
    border-top: 1px solid rgba(120, 255, 235, 0.14);
}

.item-lab-side > .item-zone:last-child {
    flex: 1;
}

@media (max-width: 860px) {
    .item-lab-grid {
        grid-template-columns: 1fr;
        grid-template-rows: none;
        grid-template-areas: none;
        overflow: visible;
    }

    /* Mobile: no grid areas, so the nav simply follows document order (brief, side, nav) to the true bottom. */
    .item-zone-brief,
    .item-lab-side,
    .item-lab-grid > .item-lab-navpair {
        grid-area: auto;
    }

    .item-lab-side {
        border-left: 0;
        border-top: 1px solid rgba(120, 255, 235, 0.14);
        overflow-y: visible;
    }
}

.item-zone {
    background: rgba(4, 10, 13, 0.86);
    padding: 1rem 1.2rem 1.4rem;
    color: var(--text, #d8faf0);
}

.item-zone-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
    margin: -1rem -1.2rem 1rem;
    padding: 0.4rem 1.2rem;
    border-bottom: 1px dashed rgba(120, 255, 235, 0.3);
    background: rgba(6, 18, 21, 0.75);
    font-family: var(--mono);
    font-size: 0.62rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.item-zone-tag {
    color: rgba(120, 255, 235, 0.85);
}

.item-zone-tag::before {
    content: "\1F4C1 ";
}

.item-zone-access {
    color: rgba(75, 214, 138, 0.9);
}

.item-zone-access::before {
    content: "\25cf ";
    animation: item-lab-blink 1.6s steps(2, end) infinite;
}

@keyframes item-lab-blink {
    50% { opacity: 0.25; }
}

.item-zone-brief {
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

.item-zone-brief-scroll {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
}

@media (max-width: 860px) {
    .item-zone-brief {
        overflow: visible;
    }

    .item-zone-brief-scroll {
        overflow-y: visible;
    }
}

/* Briefing / description zone */
.item-zone-brief .eyebrow {
    font-family: var(--mono);
    font-size: 0.7rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(120, 255, 235, 0.75);
    margin: 0 0 0.4rem;
}

.item-zone-brief h1 {
    margin: 0 0 0.6rem;
    font-size: clamp(1.4rem, 2.4vw, 2rem);
    line-height: 1.2;
}

.item-zone-brief .item-lede {
    font-family: var(--mono);
    font-size: 0.78rem;
    color: rgba(120, 255, 235, 0.7);
    margin: 0 0 1rem;
}

.item-zone-brief h2 {
    font-size: 1rem;
    letter-spacing: 0.04em;
    color: rgba(120, 255, 235, 0.85);
    margin: 0 0 0.8rem;
}

.item-zone-brief .item-body-html {
    color: var(--muted, #8bb4a4);
    line-height: 1.65;
}

.item-zone-brief .item-body-html img,
.item-zone-brief .item-iframe-block iframe,
.item-zone-brief .item-body-html video,
.item-zone-brief .item-body-html embed {
    max-width: 100%;
    border-radius: 6px;
}

.item-zone-brief .item-iframe-html {
    margin: 0.8rem 0 1rem;
}

/* Embeds (YouTube, Vimeo...) get a comfortable, centered 16:9 frame. */
.item-zone-brief .item-iframe-block {
    max-width: 720px;
    margin: 0 auto 0.8rem;
}

.item-zone-brief .item-iframe-block iframe {
    display: block;
    width: 100% !important;
    height: auto !important;
    aspect-ratio: 16 / 9;
    border: 1px solid rgba(120, 255, 235, 0.25);
    border-radius: 8px;
}

/* Share buttons under the byline */
.item-lab-share {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0 0 1.1rem;
}

.item-lab-share-label {
    font-family: var(--mono);
    font-size: 0.62rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(120, 255, 235, 0.55);
    margin-right: 0.2rem;
}

.item-lab-share-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(120, 255, 235, 0.16);
    color: rgba(120, 255, 235, 0.95);
    text-decoration: none;
    transition: transform 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.item-lab-share-btn svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

.item-lab-share-btn:hover,
.item-lab-share-btn:focus-visible {
    transform: translateY(-2px);
}

.item-lab-share-btn--x:hover { background: #000; color: #fff; }
.item-lab-share-btn--linkedin:hover { background: #0a66c2; color: #fff; }
.item-lab-share-btn--facebook:hover { background: #1877f2; color: #fff; }
.item-lab-share-btn--whatsapp:hover { background: #25d366; color: #04100f; }
.item-lab-share-btn--email:hover { background: rgba(255, 106, 77, 0.9); color: #04100f; }

/* Source/target link button: stays the site's red pill, just resized to sit in the share row. */
.item-lab-share-source {
    margin-left: auto;
    margin-right: 0.4rem;
    padding: 0.45rem 0.9rem;
    font-size: 0.7rem;
}

.item-lab-navpair {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-shrink: 0;
    padding: 0.8rem 1.2rem;
    background: rgba(4, 10, 13, 0.86);
    border-top: 1px dashed rgba(120, 255, 235, 0.25);
    font-family: var(--mono);
    font-size: 0.72rem;
}

.item-lab-navpair a {
    color: rgba(120, 255, 235, 0.9);
    text-decoration: none;
    padding: 0.35rem 0.7rem;
    border: 1px solid rgba(120, 255, 235, 0.35);
    border-radius: 4px;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.item-lab-navpair a:hover {
    background: rgba(120, 255, 235, 0.16);
}

/* Right-hand link (the "Precedent" button) simply sits on the right, no red highlight. */
.item-lab-navpair-next {
    margin-left: auto;
}

/* Intercepted address / geolocation zone */
.item-zone-address .item-address-text {
    font-family: var(--mono);
    font-size: 0.85rem;
    color: rgba(255, 106, 77, 0.9);
    margin: 0 0 0.7rem;
    position: relative;
    padding-left: 1.2rem;
}

.item-zone-address .item-address-text::before {
    content: "\1F4CD";
    position: absolute;
    left: 0;
}

.item-zone-address .item-address-map {
    position: relative;
    border: 1px solid rgba(120, 255, 235, 0.25);
    border-radius: 8px;
    overflow: hidden;
    filter: grayscale(0.4) contrast(1.05) brightness(0.85) hue-rotate(-6deg);
}

.item-zone-address .item-address-map::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: repeating-linear-gradient(
        180deg,
        rgba(69, 244, 189, 0.05) 0,
        rgba(69, 244, 189, 0.05) 1px,
        transparent 2px,
        transparent 4px
    );
}

.item-zone-address .item-address-map iframe {
    width: 100%;
    min-height: 260px;
    border: 0;
    display: block;
}

/* Finder / classified file browser zone */
.item-zone-finder .item-finder-path {
    display: block;
    margin-bottom: 0.9rem;
    font-family: var(--mono);
    font-size: 0.68rem;
    letter-spacing: 0.04em;
    color: rgba(120, 255, 235, 0.55);
    overflow-wrap: anywhere;
}

.item-finder-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
    gap: 0.7rem;
}

/* A lone file gets a bigger, more visible preview instead of a small tile. */
.item-finder-grid--single {
    grid-template-columns: minmax(200px, 320px);
    justify-content: center;
}

.item-finder-grid--single .item-finder-thumb {
    aspect-ratio: 4 / 3;
}

.item-finder-grid--single .item-finder-name {
    font-size: 0.68rem;
}

.item-finder-file {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    padding: 0.5rem 0.35rem 0.4rem;
    border: 1px solid transparent;
    border-radius: 6px;
    text-decoration: none;
    color: rgba(120, 255, 235, 0.85);
    text-align: center;
    transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}

.item-finder-file:hover,
.item-finder-file:focus-visible {
    border-color: rgba(120, 255, 235, 0.5);
    background: rgba(120, 255, 235, 0.08);
    transform: translateY(-2px);
}

.item-finder-thumb {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid rgba(120, 255, 235, 0.25);
    background: #04100f;
}

.item-finder-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    filter: saturate(0.85) contrast(1.05);
}

.item-finder-thumb::after {
    content: "\1F512";
    position: absolute;
    right: 3px;
    bottom: 3px;
    font-size: 0.6rem;
    opacity: 0.75;
}

.item-finder-name {
    font-family: var(--mono);
    font-size: 0.6rem;
    letter-spacing: 0.02em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.item-lab-fallback {
    display: none;
}
