/* ==========================================================================
   Full-screen cover landing page (cover.hbs)

   Self-contained, build-free stylesheet loaded directly via {{asset}} from
   cover.hbs. It does NOT go through the gulp/screen.css pipeline, so no
   official theme file is modified — this keeps the cover fully compatible
   with upstream Edge updates.

   Scoped with body:has(.cover-root) so it only affects the cover template.
   ========================================================================== */

/* Break out of the default content container and hide chrome we don't want */
body:has(.cover-root) {
    overflow: hidden;
    background: #000;
}

body:has(.cover-root) .site-content {
    padding: 0;
}

body:has(.cover-root) .gh-foot {
    display: none;
}

/* Reuse the inherited Edge header markup, just turn it into a transparent,
   white overlay that floats on top of the full-screen imagery. */
body:has(.cover-root) #gh-head {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: transparent;
    color: #fff;
}

body:has(.cover-root) #gh-head a,
body:has(.cover-root) #gh-head .gh-head-logo {
    color: #fff;
}

body:has(.cover-root) #gh-head .gh-icon-btn svg {
    color: #fff;
}

body:has(.cover-root) #gh-head .gh-burger::before,
body:has(.cover-root) #gh-head .gh-burger::after {
    background: #fff;
}

/* When the mobile menu opens, Edge's shared CSS forces the panel to a white
   background. Combined with our white text that makes the menu look blank.
   These rules (with !important to beat the high-specificity shared selector)
   turn the open panel solid dark so the white links are visible. */
body:has(.cover-root).is-head-open {
    overflow: hidden;
}

body:has(.cover-root).is-head-open #gh-head {
    background: rgba(0, 0, 0, 0.96) !important;
}

body:has(.cover-root).is-head-open #gh-head .gh-head-actions {
    background: transparent !important;
}

body:has(.cover-root).is-head-open #gh-head .nav a,
body:has(.cover-root).is-head-open #gh-head .gh-head-link {
    color: #fff;
}

/* Gradient scrims keep the header and titles legible on any image */
.cover-scrim-top {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 180px;
    z-index: 50;
    background: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0.5) 0%,
        rgba(0, 0, 0, 0.25) 50%,
        rgba(0, 0, 0, 0) 100%
    );
    pointer-events: none;
}

/* Bottom darkening lives INSIDE each slide (between the image and the title),
   so it darkens the photo for legibility but never overlays the title text.
   .cover-slides creates its own stacking context, so a standalone sibling
   scrim would always paint on top of the title — this pseudo-element avoids
   that trap. */
.cover-slide::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 220px;
    z-index: 5;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.55), rgba(0, 0, 0, 0));
    pointer-events: none;
}

/* Slides */
.cover-slides {
    position: fixed;
    inset: 0;
    z-index: 1;
    display: flex;
    height: 100vh;
    height: 100dvh;
    width: 100vw;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    /* No CSS scroll-behavior: smooth here. Slide transitions are animated in
       cover.js via requestAnimationFrame + easeInOutCubic; a CSS smooth scroll
       would fight that custom animation and cause stutter. Snap stays on for
       native touch swiping and is toggled off by the JS only while it animates. */
    scrollbar-width: none;
    background: #000;
}

.cover-slides::-webkit-scrollbar {
    display: none;
}

.cover-slide {
    position: relative;
    flex: 0 0 100vw;
    height: 100vh;
    height: 100dvh;
    scroll-snap-align: start;
}

.cover-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Empty-state slide (no featured post yet): centered caption on the black bg
   instead of a blank screen. */
.cover-empty {
    display: flex;
    align-items: center;
    justify-content: center;
}

.cover-empty-title {
    position: static;
    max-width: none;
    color: #fff;
    opacity: 0.6;
}

/* Only the title is interactive — clicking it enters the post.
   z-index must sit ABOVE the in-slide bottom scrim (.cover-slide::after, z 5),
   otherwise the dark scrim overlays the white text and dims it to grey. The
   scrim still darkens the image behind the title for legibility. */
.cover-title {
    position: absolute;
    left: 40px;
    bottom: 40px;
    z-index: 60;
    margin: 0;
    font-size: 30px;
    font-weight: 600;
    max-width: 60%;
}

.cover-title-link {
    display: inline-block;
    color: #fff;
    text-decoration: none;
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.cover-title-link:hover {
    color: #fff;
    opacity: 0.72;
    transform: translateX(6px);
}

/* Dot navigation */
.cover-dots {
    position: fixed;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 60;
    display: flex;
    gap: 8px;
}

.cover-dots button {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.45);
    cursor: pointer;
    padding: 0;
}

.cover-dots button.active {
    background: #fff;
}

/* ---- Mobile tweaks ---- */
@media (max-width: 767px) {
    .cover-title {
        left: 20px;
        right: 20px;
        bottom: 56px;
        max-width: none;
        font-size: 22px;
    }

    .cover-dots {
        bottom: 24px;
    }
}
