/* ==========================
   COMIC STRIP PAGE
========================== */

.comic-strip-page {
    padding: 24px;
    text-align: center;
}

/* ==========================
   PAGE TITLE
========================== */

.page-title-panel {
    margin-bottom: 18px;
}

.page-title-panel h1 {
    margin: 0;

    font-size: clamp(2rem, 4vw, 3.4rem);

    font-weight: 900;

    text-transform: uppercase;

    letter-spacing: .03em;
}

.page-title-panel p {
    margin: 8px 0 0;

    font-size: 1rem;

    font-weight: 900;

    text-transform: uppercase;
}

/* ==========================
   STRIP VIEWER
========================== */

.strip-image {
    display: block;
    width: 100%;
    height: auto;

    border: 4px solid #111;
    background: #fff;
}
.visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* ==========================
   CLICKABLE COMIC
========================== */

.strip-viewer {
    width: 100%;
    max-width: none;
    margin: 0 auto;
}

.strip-click-zone {
    position: relative;
    display: block;
    width: 94%;
    max-width: 980px;
    margin: 0 auto 20px;
    cursor: pointer;
}

.strip-image {
    display: block;
    width: 100%;
    height: auto;
    margin: 0 auto;
    border: 4px solid #111;
    background: #fff;
}


/* ==========================
   BUTTONS
========================== */

.strip-controls {

    display: flex;

    justify-content: center;

    gap: 12px;

    flex-wrap: wrap;
}

.strip-controls button {

    background: #f6d13d;

    color: #111;

    border: 4px solid #111;

    padding: 10px 18px;

    font-size: .95rem;

    font-weight: 900;

    text-transform: uppercase;

    cursor: pointer;

    transition:
        background .15s,
        color .15s,
        transform .12s;
}

.strip-controls button:hover {

    background: #d92d1f;

    color: #fff;

    transform: translateY(-2px);
}

.strip-controls button:disabled {

    opacity: .35;

    cursor: not-allowed;

    transform: none;
}

/* ==========================
   COMIC ENGAGEMENT
========================== */

.comic-engagement {
    position: absolute;
    left: 10px;
    right: 10px;
    bottom: 10px;
    z-index: 20;

    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;

    padding: 10px;

    background: rgba(0, 0, 0, .72);

    opacity: 0;
    pointer-events: none;
    transform: translateY(12px);
    transition: opacity .22s ease, transform .22s ease;
}

.strip-click-zone:hover .comic-engagement,
.strip-click-zone:focus-within .comic-engagement {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.comic-action-button {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    min-height: 32px;
    padding: 6px 9px;
    background: #f6d13d;
    color: #111;
    border: 3px solid #111;
    box-shadow: 2px 2px 0 #111;
    font: inherit;
    font-size: .62rem;
    font-weight: 900;
    text-decoration: none;
    text-transform: uppercase;
    cursor: pointer;
    transition: color .16s ease, background-color .16s ease, transform .16s ease, box-shadow .16s ease;
}

.comic-action-button:hover {
    background: #d92d1f;
    color: #fff;
    transform: translate(-1px, -1px);
    box-shadow: 4px 4px 0 #111;
}

.comic-action-button:focus-visible,
.comic-share-menu button:focus-visible,
.comic-share-menu a:focus-visible {
    outline: 4px solid #d92d1f;
    outline-offset: 3px;
}

.comic-love-button.is-loved {
    background: #d92d1f;
    color: #fff;
}

.comic-action-count {
    display: inline-grid;
    min-width: 1.5em;
    min-height: 1.5em;
    margin-left: 2px;
    padding: 1px 4px;
    place-items: center;
    background: #111;
    color: #fff;
    border-radius: 999px;
    font-size: .58rem;
    line-height: 1;
}

.comic-flurry-heart {
    --flurry-x: 0px;
    --flurry-y: -70px;
    --flurry-delay: 0ms;
    --flurry-rotate: 0deg;
    --flurry-size: 1rem;
    position: absolute;
    left: 50%;
    top: 50%;
    z-index: 30;
    color: #e21d2e;
    font-size: var(--flurry-size);
    text-shadow: 1px 1px 0 #fff;
    pointer-events: none;
    opacity: 0;
    animation: comic-love-flurry 1.45s ease-out var(--flurry-delay) forwards;
}

@keyframes comic-love-flurry {
    0% {
        opacity: 0;
        transform: translate(-50%, -20%) scale(.35) rotate(0deg);
    }
    18% {
        opacity: 1;
        transform: translate(-50%, -25%) scale(1) rotate(0deg);
    }
    72% {
        opacity: .9;
    }
    100% {
        opacity: 0;
        transform: translate(calc(-50% + var(--flurry-x)), calc(-20% + var(--flurry-y))) scale(.82) rotate(var(--flurry-rotate));
    }
}

.comic-share-menu {
    position: absolute;
    left: 50%;
    bottom: 56px;
    z-index: 40;
    width: min(92%, 420px);
    padding: 12px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    background: #111;
    border: 4px solid #111;
    box-shadow: 7px 7px 0 rgba(0, 0, 0, .35);
    opacity: 0;
    transform: translate(-50%, 12px) scale(.96);
}

.comic-share-menu[hidden] {
    display: none;
}

.comic-share-menu.is-open {
    animation: comic-share-menu-pop .2s ease-out forwards;
}

.comic-share-menu button,
.comic-share-menu a {
    padding: 9px 8px;
    background: #f6d13d;
    color: #111;
    border: 2px solid #fff;
    font: inherit;
    font-size: .78rem;
    font-weight: 900;
    text-align: center;
    text-decoration: none;
    text-transform: uppercase;
    cursor: pointer;
}

.comic-share-menu button:hover,
.comic-share-menu a:hover {
    background: #d92d1f;
    color: #fff;
}

@keyframes comic-share-menu-pop {
    to {
        opacity: 1;
        transform: translate(-50%, 0) scale(1);
    }
}

.strip-click-zone.shared-strip-highlight {
    animation: shared-strip-highlight 3.2s ease-out;
}

@keyframes shared-strip-highlight {
    0%, 28% {
        filter: drop-shadow(0 0 12px rgba(217, 45, 31, .85));
        transform: rotate(-.25deg) scale(1.01);
    }
    100% {
        filter: none;
        transform: none;
    }
}

/* ==========================
   MOBILE
========================== */

@media (max-width:760px) {

    .welcome-banner {
        display: none;
    }

    .comic-strip-page {
        padding: 18px 10px;
    }

    .page-title-panel {
        margin-bottom: 14px;
    }

    .strip-viewer h2 {
        font-size: 1.25rem;
    }

    .strip-click-zone {
        width: 100%;
        margin-bottom: 12px;
    }

    .strip-image {
        width: 100%;
        max-width: 100%;
    }

    /* Hide floating arrows on mobile */
    .strip-click-hint {
        display: none;
    }

    /* Mobile controls become simple arrow buttons */
    .strip-controls {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
        margin-top: 8px;
    }

    #random-strip {
        display: none;
    }

    #previous-strip,
    #next-strip {
        width: 100%;
        padding: 10px;
        font-size: 0;
    }

    #previous-strip::before {
        content: "◀";
        font-size: 1.4rem;
    }

    #next-strip::before {
        content: "▶";
        font-size: 1.4rem;
    }

    #previous-strip {
        order: 1;
    }

    #next-strip {
        order: 2;
    }

    .comic-engagement {
        position: relative;
        left: auto;
        right: auto;
        bottom: auto;

        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 7px;

        margin-top: 9px;
        padding: 0;

        background: transparent;

        opacity: 1;
        pointer-events: auto;
        transform: none;
        transition: none;
    }

    .comic-action-button {
        width: 100%;
        min-width: 0;
        padding: 5px 4px;
        font-size: .58rem;
    }

    .comic-share-menu {
        bottom: 60px;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}   

.welcome-banner {
    margin: 10px auto 10px;
    text-align: center;
}

.welcome-banner-image {
    display: block;
    width: 75%;
    max-width: 800px;
    height: auto;
    margin: 0 auto;

    border: 4px solid #111;
    box-shadow: 0 8px 20px rgba(0,0,0,.25);
}

@media (prefers-reduced-motion: reduce) {
    .comic-flurry-heart {
        display: none;
    }

    .comic-share-menu.is-open,
    .strip-click-zone.shared-strip-highlight {
        animation: none;
    }

    .comic-action-button {
        transition: none;
    }
}

@media (hover: none), (pointer: coarse) {
    .comic-engagement {
        position: relative;
        left: auto;
        right: auto;
        bottom: auto;

        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 7px;

        margin-top: 9px;
        padding: 0;

        background: transparent;

        opacity: 1;
        pointer-events: auto;
        transform: none;
        transition: none;
    }
}
