/* ============================================================
   Screenshot Modal Component
   Usage:
   1. Include this CSS file on any page
   2. Add the JS snippet at the bottom of the page (or include screenshot-modal.js)
   3. Use this markup for clickable thumbnails:

   <div class="screenshot-thumb" data-full="screenshots/tariff-lookup-full.png" data-caption="Tariff Lookup showing savings opportunities and rate trajectory">
       <img src="screenshots/tariff-lookup-thumb.png" alt="Tariff Lookup screenshot">
       <span class="screenshot-thumb-label">Click to enlarge</span>
   </div>

   The modal is auto-created by the JS. Image sizes to fit viewport.
   ============================================================ */

/* ---- Thumbnail ---- */
.screenshot-thumb {
    display: inline-block;
    position: relative;
    cursor: pointer;
    border-radius: var(--card-radius, 8px);
    overflow: hidden;
    border: 1px solid var(--color-border, #e2e8f0);
    transition: box-shadow 0.2s, transform 0.15s;
    max-width: 100%;
}
.screenshot-thumb:hover {
    box-shadow: 0 4px 20px rgba(0,0,0,0.12);
    transform: translateY(-2px);
}
.screenshot-thumb img {
    display: block;
    width: 100%;
    height: auto;
}
.screenshot-thumb-label {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 0.4rem 0.75rem;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #fff;
    background: rgba(15, 31, 61, 0.75);
    text-align: center;
    pointer-events: none;
    transition: opacity 0.15s;
}
.screenshot-thumb:hover .screenshot-thumb-label {
    opacity: 0;
}

/* ---- Modal overlay ---- */
.screenshot-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(15, 31, 61, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s, visibility 0.25s;
    cursor: pointer;
}
.screenshot-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* ---- Modal content (sizes to image) ---- */
.screenshot-modal-content {
    position: relative;
    max-width: 90vw;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    cursor: default;
    animation: screenshotModalIn 0.2s ease-out;
}
@keyframes screenshotModalIn {
    from { transform: scale(0.95); opacity: 0; }
    to   { transform: scale(1); opacity: 1; }
}

.screenshot-modal-content img {
    display: block;
    max-width: 90vw;
    max-height: calc(85vh - 3rem);
    width: auto;
    height: auto;
    border-radius: var(--card-radius, 8px) var(--card-radius, 8px) 0 0;
    object-fit: contain;
    background: #fff;
}

/* ---- Caption bar ---- */
.screenshot-modal-caption {
    padding: 0.65rem 1rem;
    font-size: 0.85rem;
    color: #e2e8f0;
    background: rgba(15, 31, 61, 0.95);
    border-radius: 0 0 var(--card-radius, 8px) var(--card-radius, 8px);
    line-height: 1.5;
    text-align: center;
}

/* ---- Close button ---- */
.screenshot-modal-close {
    position: absolute;
    top: -0.75rem;
    right: -0.75rem;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    color: var(--color-primary-900, #0F1F3D);
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    transition: transform 0.15s;
    z-index: 1;
}
.screenshot-modal-close:hover {
    transform: scale(1.1);
}

/* ---- Responsive ---- */
@media (max-width: 640px) {
    .screenshot-modal-overlay { padding: 1rem; }
    .screenshot-modal-content img {
        max-width: 95vw;
        max-height: calc(90vh - 3rem);
    }
    .screenshot-modal-close {
        top: -0.5rem;
        right: -0.5rem;
        width: 1.75rem;
        height: 1.75rem;
    }
}
