/* ==========================
   SUPER DOOBIE FRAMEWORK
   Comic Page / Printed Sheet
========================== */

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
}

body {
    margin: 0;
    min-height: 100%;

    background:
        radial-gradient(circle, rgba(246, 209, 61, .12) 2px, transparent 2.6px),
        radial-gradient(circle, rgba(255, 255, 255, .07) 1.5px, transparent 2.2px),
        linear-gradient(115deg, rgba(4, 27, 46, .38), transparent 30%, transparent 70%, rgba(4, 27, 46, .48)),
        #236493;

    background-size:
        19px 19px,
        29px 29px,
        100% 100%,
        100% 100%;

    background-position:
        0 0,
        9px 12px,
        center,
        center;

    background-attachment: fixed;

    font-family: Arial, Helvetica, sans-serif;
    color: #111;
}

/* ==========================
   COMIC PAGE SHELL
========================== */

.site-shell {
    position: relative;

    width: min(94vw, 1200px);

    margin: 10px auto 24px;

    background:
        radial-gradient(circle, rgba(0,0,0,.06) 1px, transparent 1px),
        radial-gradient(circle, rgba(255,255,255,.18) 1px, transparent 1px),
        linear-gradient(rgba(255,255,255,.18), rgba(0,0,0,.04)),
        #f4e3a8;

    background-size:
        7px 7px,
        13px 13px,
        100% 100%,
        100% 100%;

    border: 5px solid #111;

    box-shadow:
        12px 14px 0 rgba(4, 31, 52, .72),
        0 25px 48px rgba(0, 0, 0, .38);

    overflow: hidden;
} 

/* subtle spine / seam */
.site-shell::before {
    content: "";
    position: absolute;
    top: 0;
    left: -10px;

    width: 10px;
    height: 100%;

    background:
        linear-gradient(90deg, rgba(0,0,0,.25), rgba(255,255,255,.12), rgba(0,0,0,.12)),
        #d8c58c;

    border-left: 2px solid #111;
    border-right: 2px solid rgba(0,0,0,.35);

    z-index: -1;
}

/* staple marks */
.site-shell::after {
    content: "";
    position: absolute;
    left: -7px;
    top: 115px;

    width: 5px;
    height: 26px;

    background: rgba(20,20,20,.55);
    border-radius: 8px;

    box-shadow:
        0 520px 0 rgba(20,20,20,.48);

    z-index: 2;
}

/* ==========================
   PAGE LAYOUT
========================== */

.site-layout {
    display: grid;
    grid-template-columns: 170px minmax(0, 1fr) 170px;
    gap: 0;

    align-items: start;

    padding: 0 0 18px;
}

/* ==========================
   MAIN CONTENT
========================== */

.site-main {
    padding: 0;
}

.comic-page {
    min-height: 260px;

    margin: 0;
    padding: 24px;

    background:
        radial-gradient(circle, rgba(0,0,0,.04) 1px, transparent 1px),
        linear-gradient(rgba(255,255,255,.18), rgba(0,0,0,.03)),
        #fff0b8;

    background-size:
        7px 7px,
        100% 100%,
        100% 100%;

    border-left: 4px solid #111;
    border-right: 4px solid #111;
    border-bottom: 4px solid #111;

    box-shadow: none;
}

.comic-page p {
    margin: 0;
}

/* ==========================
   MOBILE
========================== */

@media (max-width: 760px) {

    body {
        background: #333;
    }

    .site-shell {
        width: 100%;
        margin: 0;
        border: 4px solid #111;
        box-shadow: none;
    }

    .site-layout {
        display: flex;
        flex-direction: column;
        padding-bottom: 0;
    }

    .site-main {
        order: 1;
        width: 100%;
    }

    .site-sidebar-left {
        order: 2;
        width: 100%;
    }

    .site-sidebar-right {
        order: 3;
        width: 100%;
    }

    .comic-page {
        min-height: auto;
        padding: 16px 12px;
        border-left: 0;
        border-right: 0;
        border-bottom: 4px solid #111;
    }
}

/* ==========================
   SHARED COMIC TITLE BANNER
========================== */

.site-main .comic-section-banner {
    position: relative;
    overflow: hidden;
    margin: 0 0 18px;
    padding: 13px 18px 16px;
    background:
        radial-gradient(circle, rgba(255, 255, 255, 0.22) 2px, transparent 2.3px),
        linear-gradient(135deg, #246fa7, #398fc7);
    background-size: 13px 13px, 100% 100%;
    border: 5px solid #111;
    text-align: center;
}

.site-main .comic-section-banner::before,
.site-main .comic-section-banner::after {
    content: "";
    position: absolute;
    z-index: 0;
    width: 72px;
    height: 72px;
    background: #d92d1f;
    border: 4px solid #111;
    transform: rotate(45deg);
}

.site-main .comic-section-banner::before {
    top: -48px;
    left: -39px;
}

.site-main .comic-section-banner::after {
    right: -39px;
    bottom: -48px;
}

.site-main .comic-section-banner h1 {
    position: relative;
    z-index: 1;
    margin: 0;
    color: #f6d13d;
    font-family: Impact, "Arial Black", Arial, sans-serif;
    font-size: clamp(2.8rem, 7vw, 5.2rem);
    font-style: italic;
    font-weight: 900;
    line-height: 0.9;
    letter-spacing: 0.025em;
    text-transform: uppercase;
    -webkit-text-stroke: 2px #111;
    text-shadow: 5px 5px 0 #111;
    transform: rotate(-0.5deg);
}

.site-main .comic-section-banner p {
    position: relative;
    z-index: 1;
    display: inline-block;
    margin: 11px 0 0;
    padding: 6px 15px;
    background: #fff0b8;
    border: 3px solid #111;
    color: #111;
    font-family: "Arial Black", Arial, sans-serif;
    font-size: clamp(0.78rem, 1.8vw, 1rem);
    font-style: italic;
    font-weight: 900;
    line-height: 1.05;
    text-transform: uppercase;
}

@media (max-width: 760px) {
    .site-main .comic-section-banner {
        margin-bottom: 12px;
        padding: 11px 8px 13px;
        border-width: 4px;
    }

    .site-main .comic-section-banner h1 {
        max-width: 100%;
        font-size: clamp(1.85rem, 9.5vw, 2.75rem);
        line-height: 0.96;
        letter-spacing: 0.015em;
        white-space: nowrap;
        -webkit-text-stroke-width: 1.5px;
        text-shadow: 3px 3px 0 #111;
    }

    .site-main .comic-section-banner p {
        max-width: 94%;
        margin-top: 9px;
        padding: 5px 9px;
        border-width: 2px;
        font-size: clamp(0.6rem, 2.7vw, 0.7rem);
        line-height: 1.15;
        text-wrap: balance;
        white-space: normal;
    }
}

/* ==========================
   COMPONENT LOAD STABILITY
========================== */

#header-placeholder:empty {
    min-height: clamp(285px, 30vw, 360px);
    background:
        linear-gradient(
            to bottom,
            #2f6fa3 0 12%,
            #111 12% 13%,
            #fff0b8 13% 81%,
            #111 81% 83%,
            #b92e1b 83% 100%
        );
}

@media (max-width: 760px) {
    #header-placeholder:empty {
        min-height: 210px;
    }
}

/* Crossfade complete page snapshots without resizing individual components. */
@view-transition {
    navigation: auto;
}

::view-transition-old(root) {
    animation: page-fade-out 110ms ease-out both;
}

::view-transition-new(root) {
    animation: page-fade-in 150ms ease-in both;
}

@keyframes page-fade-out {
    from { opacity: 1; }
    to { opacity: 0.78; }
}

@keyframes page-fade-in {
    from { opacity: 0.78; }
    to { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
    ::view-transition-old(root),
    ::view-transition-new(root) {
        animation-duration: 0.01ms;
    }
}
