/*
 * Example Emails page — page-specific styles.
 * Extracted from DesignV2 pages/example-emails.html inline <style>.
 */

.ex-section { padding: 100px 0 80px; }
.ex-stack { display: flex; flex-direction: column; gap: 48px; max-width: 820px; margin: 0 auto; }
.ex-card {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 10;
    border-radius: 18px;
    overflow: hidden;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: flex; align-items: center; justify-content: center;
}
.ex-card::before {
    content: "";
    position: absolute; inset: 0;
    background: rgba(0, 0, 0, 0.25);
    z-index: 1;
}
/* Fixed-height scrollable viewport so a tall email (with real header + footer)
   can be scrolled top-to-bottom while the card/background stays the same size. */
.ex-mail-wrap {
    position: relative; z-index: 2;
    height: 88%;
    width: min(460px, 82%);
    display: flex; align-items: center; justify-content: center;
}
.ex-mail {
    position: relative;
    width: 100%;
    height: 100%;
    border-radius: 6px;
    overflow-y: auto;
    overflow-x: hidden;
    background: #fff;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.35);
    scrollbar-width: thin;
    scrollbar-color: rgba(0,0,0,0.35) transparent;
    scroll-behavior: smooth;
}
.ex-mail::-webkit-scrollbar { width: 8px; }
.ex-mail::-webkit-scrollbar-track { background: transparent; }
.ex-mail::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.25); border-radius: 4px; }
.ex-mail::-webkit-scrollbar-thumb:hover { background: rgba(0,0,0,0.45); }
/* Image renders at natural aspect; width fills the viewport, height follows. */
.ex-mail img { display: block; width: 100%; height: auto; }

/* Subtle "more below" hint fade at the bottom of the viewport. */
.ex-mail-wrap::after {
    content: "";
    position: absolute; left: 0; right: 0; bottom: 0;
    height: 40px;
    background: linear-gradient(to top, rgba(255,255,255,0.8), transparent);
    pointer-events: none;
    border-bottom-left-radius: 6px;
    border-bottom-right-radius: 6px;
}
.ex-caption {
    display: flex; align-items: center; justify-content: space-between; gap: 16px;
    padding: 14px 4px 0;
}
.ex-caption-text h3 {
    font-family: 'Roboto', sans-serif; font-size: 1.05rem; font-weight: 700; color: #111213; margin: 0 0 4px;
}
.ex-caption-text p {
    font-size: 0.85rem; color: #666; margin: 0;
}
.ex-btn {
    background: #8dbb44; color: #fff; border: none; padding: 10px 22px; border-radius: 999px;
    font-weight: 700; font-size: 0.85rem; text-decoration: none; white-space: nowrap;
}
.ex-btn:hover { background: #7da737; color: #fff; }

@media (max-width: 640px) {
    .ex-card { aspect-ratio: auto; min-height: 420px; padding: 30px 16px; }
    .ex-mail { max-width: 85%; }
    .ex-caption { flex-direction: column; align-items: flex-start; gap: 12px; }
}

/* === Magnifier button (overlay on email preview) === */
.ex-expand {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 3;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.15s ease;
    backdrop-filter: blur(2px);
}
.ex-expand:hover,
.ex-expand:focus-visible {
    background: rgba(0, 0, 0, 0.8);
    transform: scale(1.05);
    outline: none;
}
.ex-expand:focus-visible {
    box-shadow: 0 0 0 3px rgba(141, 187, 68, 0.6);
}

/* === Lightbox === */
.ex-lightbox {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    overscroll-behavior: contain;
}
.ex-lightbox[hidden] { display: none; }
.ex-lightbox-stage {
    max-width: min(90vw, 720px);
    max-height: 92vh;
    overflow-y: auto;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
    scrollbar-width: thin;
    scrollbar-color: rgba(0,0,0,0.35) transparent;
}
.ex-lightbox-img {
    display: block;
    width: 100%;
    height: auto;
}
.ex-lightbox-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease;
}
.ex-lightbox-close:hover,
.ex-lightbox-close:focus-visible {
    background: rgba(255, 255, 255, 0.3);
    outline: none;
}
body.ex-lightbox-open { overflow: hidden; }
