/* RESET */


* {
    margin: 0;
}

*,
*::before,
*::after {
    transition: background-color 0.3s ease, color 0.3s ease,
        border-color 0.3s ease, box-shadow 0.3s ease;
}


/* BASE */


body {
    display: grid;
    grid-template-columns: 4% 92% 4%;
    grid-template-rows: auto auto 1fr auto;
    min-height: 100vh;
    background-color: #eeece7;
    color: #25221d;
    font-family: Georgia, 'Times New Roman', Times, serif;
}

a {
    color: inherit;
    text-decoration: none;
}

a:not([class]) {
    color: #2e82a3;
}

a:not([class]):hover,
a:not([class]):active {
    color: #389ec7;
    text-decoration: underline;
}

main {
    grid-column: 2 / 3;
    margin: 2rem 0;
}

div.side-panel {
    background: none;
}

article p {
    padding-bottom: 1.5em;
    text-align: justify;
    font-size: 1.2em;
    line-height: 1.5;
}


/* SELECTION */


.light-icon::selection,
.dark-icon::selection,
header .header-title ::selection,
.hero-slide img::selection,
.card-image::selection {
    background-color: transparent;
    color: inherit;
}


/* HERO CAROUSEL */


#hero {
    --slide-w: 100%;
    --slide-h: 100%;
    --gap: 1.5rem;
    --top-margin: 1.5rem;
    --gutter: calc((100% - var(--slide-w)) / 2);
    --arrow-w: 3rem;

    position: relative;
    grid-column: 1 / 4;
    width: 100%;
    height: 25vh;
    overflow: hidden;
    box-sizing: border-box;
    border-radius: 0;
    background: linear-gradient(to bottom, #dcd8cd, transparent);
}

#hero-track {
    display: flex;
    gap: var(--gap);
    height: 100%;
    transform: translateX(calc(var(--gutter) - var(--i, 1) * (var(--slide-w) + var(--gap))));
    transition: transform 0.6s ease;
}

.hero-slide {
    display: flex;
    flex: 0 0 var(--slide-w);
    align-items: center;
    justify-content: center;
    align-self: center;
    position: relative;
    min-width: 0;
    height: 100%;
    overflow: hidden;
    background-size: cover;
    background-position: center;
    text-decoration: none;
    transition: height 0.6s ease;
}

.hero-slide:not(.active) {
    height: var(--slide-h);
    cursor: pointer;
    filter: drop-shadow(0 3px 6px rgba(37, 34, 29, 0.5));
}

.hero-slide> :not(img) {
    transition: opacity 0.4s ease;
}

.hero-slide:not(.active)> :not(img) {
    opacity: 0;
}

#hero.jumping,
#hero.jumping * {
    transition: none;
}

.hero-slide img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
}

.hero-slide::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1;
}


/* HERO SLIDE TEXT */


.slide-text {
    display: flex;
    flex-direction: column;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75em;
    position: relative;
    margin: 0 2.5em;
    color: #eeece7;
    text-align: center;
    z-index: 1;
}

.slide-title {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    overflow: hidden;
    color: inherit;
    text-shadow: #25221d 0 0 8px;
    font-size: clamp(1rem, 6cqw, 2.5rem);
    font-weight: 600;
}

.slide-subtext {
    text-transform: uppercase;
    font-size: 0.6rem;
    font-weight: 400;
    letter-spacing: 0.2em;
    opacity: 0.6;
}

.slide-subtext.badge {
    position: absolute;
    top: -2rem;
    padding: 0.5em 1.5em;
    font-weight: 600;
    white-space: nowrap;
    opacity: 0.85;
}

.slide-subtext:not(.badge) {
    text-shadow: #25221d 0 0 2px, #25221d 0 0 8px;
}

.slide-details {
    display: none;
    overflow: hidden;
    color: #eeece7;
    font-size: clamp(0.9rem, 2.5cqw, 1.2rem);
    line-height: 1.5;
    opacity: 0.85;
    z-index: 1;
}

.slide-welcome {
    margin: 0.9em 0;
    text-transform: uppercase;
    font-size: clamp(1rem, 3cqw, 2rem);
    font-weight: 400;
    letter-spacing: 0.2em;
    opacity: 0.6;
}


/* HERO SLIDE TEXT POSITION */


/* 2 details, left visible */
.slide-details:where(:has(+ .slide-details)) {
    display: block;
    margin: 0 2.5em;
}

/* 2 details, right visible */
/* .slide-details:where(.slide-details + .slide-details) {
    display: block;
    margin: 0 2.5em;
} */

.hero-slide:has(.slide-details + .slide-details) {
    grid-template-columns: 1fr 1fr;
}

.hero-slide:has(.slide-details + .slide-details) .slide-details {
    grid-area: auto;
    margin: 0 20%;
}

/* 1 details, centered */
.hero-slide:not(:has(.slide-text)) {
    grid-template-columns: 1fr;
}

.hero-slide:not(:has(.slide-text))::before {
    background: rgba(0, 0, 0, 0.6);
}

.hero-slide:not(:has(.slide-text)) .slide-details {
    display: block;
    grid-area: 1 / 1 / 2 / 2;
    max-width: 25em;
    margin: 0 auto 2rem;
    padding: 0 3.1em;
    text-align: center;
    font-size: clamp(1rem, 3cqw, 1.6rem);
}


/* HERO ARROWS */


.hero-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: 0;
    bottom: 0;
    width: var(--arrow-w);
    height: var(--slide-h);
    margin-block: auto;
    padding: 0;
    border: none;
    background-color: rgba(37, 34, 29, 0.5);
    color: #eeece7;
    font-size: clamp(3.5rem, 12cqw, 5rem);
    cursor: pointer;
    z-index: 2;
}

.hero-arrow.left {
    left: max(0px, calc(var(--gutter) - var(--arrow-w) - var(--gap)));
}

.hero-arrow.right {
    right: max(0px, calc(var(--gutter) - var(--arrow-w) - var(--gap)));
}

.hero-arrow.left::before {
    content: "‹";
}

.hero-arrow.right::before {
    content: "›";
}

.hero-arrow:hover,
.hero-arrow:active,
#hero:has(.hero-slide:hover ~ .active) .hero-arrow.left,
#hero:has(.active ~ .hero-slide:hover) .hero-arrow.right {
    filter: contrast(130%);
}


/* HERO DOTS */


#hero-dot-container {
    display: flex;
    gap: 0.66em;
    position: absolute;
    bottom: 0.6rem;
    left: 50%;
    transform: translateX(-50%);
}

.hero-dot {
    flex-shrink: 0;
    width: 12px;
    height: 12px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.33);
    cursor: pointer;
}

.hero-dot.active {
    background: rgba(255, 255, 255, 0.66);
    transform: scale(1.25);
}

.hero-dot:hover,
.hero-dot:active {
    background: rgba(255, 255, 255, 0.66);
}


/* SECTION TITLE */


.section-title {
    margin: 1.5rem 0;
    text-align: center;
    text-decoration: none;
    text-transform: uppercase;
    font-size: 1.5rem;
    font-weight: 400;
    letter-spacing: 0.2em;
}

h1.section-title {
    text-decoration: underline;
}

.section-subtitle {
    text-align: center;
    font-style: italic;
}


/* CARDS */


.card-container {
    display: flex;
    flex-flow: column wrap;
    justify-content: space-evenly;
    gap: 1.5rem;
    text-decoration: none;
}

.card-wrap {
    display: block;
    position: relative;
    width: 100%;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card-wrap:hover {
    transform: translateY(-2px) scale(1.01);
}

.card {
    display: flex;
    flex-direction: row;
    position: relative;
    height: 144px;
    overflow: hidden;
    border-top: solid #f6f5f2 2px;
    border-right: solid #f6f5f2 2px;
    border-bottom: solid #f6f5f2 2px;
    border-left: solid #f6f5f2 1px;
    border-radius: 3px;
    background-color: #f6f5f2;
    box-shadow:
        0 2px 4px rgba(37, 34, 29, 0.3),
        0 1px 2px rgba(37, 34, 29, 0.2);
    color: #25221d;
    transition: box-shadow 0.2s ease;
    z-index: 2;
}

.card-wrap:hover .card {
    box-shadow:
        0 12px 24px rgba(37, 34, 29, 0.2),
        0 6px 12px rgba(37, 34, 29, 0.15),
        0 2px 4px rgba(37, 34, 29, 0.1);
}

.card-image {
    flex-shrink: 0;
    width: 96px;
    object-fit: cover;
    border-radius: 2px 0 0 2px;
    clip-path: polygon(0 0, 100% 0, 85% 100%, 0 100%);
    transform: translateX(1px);
}

.card-text {
    display: flex;
    flex: 1;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    overflow: hidden;
}

.card-title {
    padding: 0.25em 0.5em;
    background-color: #24657f;
    clip-path: polygon(calc(100% - 99%) 0, 100% 0, 100% 100%, 0 100%);
    color: #f5e17a;
    text-align: center;
    font-size: 1em;
}

.card-details {
    display: flex;
    flex: 1;
    align-items: center;
    padding: 0 1em;
    text-align: left;
}

.card-details p {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 6;
    line-clamp: 6;
    overflow: hidden;
    text-align: left;
    text-overflow: ellipsis;
}


/* RIBBON BADGES */


.ribbon-body {
    display: flex;
    align-items: center;
    position: absolute;
    top: 12px;
    left: -8px;
    height: 20px;
    padding: 0 1.2em;
    border-radius: 1px 1px 1px 0;
    box-shadow: 2px 2px 4px rgba(37, 34, 29, 0.4);
    font-size: 0.5rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    white-space: nowrap;
    z-index: 3;
}

.ribbon-fold {
    position: absolute;
    top: 28px;
    left: -8px;
    width: 10px;
    height: 10px;
    box-shadow: 1px 2px 3px rgba(37, 34, 29, 0.3);
    clip-path: polygon(0 0, 100% 0, 100% 100%, 0 50%);
    z-index: 1;
}

.new,
.new+.ribbon-fold {
    background-color: #c7a838;
    color: #25221d;
}

.soon,
.soon+.ribbon-fold {
    background-color: #b54a5e;
    color: #eeece7;
}

.updated,
.updated+.ribbon-fold {
    background-color: #4485a3;
    color: #eeece7;
}

.new::before {
    content: "NEW";
}

.soon::before {
    content: "COMING SOON";
}

.updated::before {
    content: "UPDATED";
}


/* BACK TO TOP BUTTON */


#back-to-top {
    visibility: hidden;
    display: grid;
    place-items: center;
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    width: 2rem;
    height: 2rem;
    padding: 0;
    border: none;
    border-radius: 3px;
    background-color: #24657f;
    box-shadow:
        0 2px 4px rgba(37, 34, 29, 0.3),
        0 1px 2px rgba(37, 34, 29, 0.2);
    color: #f5e17a;
    cursor: pointer;
    opacity: 0;
    transform: translateY(1rem);
    transition: opacity 0.3s ease, transform 0.3s ease,
        visibility 0.3s ease, background-color 0.3s ease, box-shadow 0.3s ease;
    z-index: 5;
}

#back-to-top::before {
    content: '';
    width: 0.6rem;
    height: 0.6rem;
    border-top: 0.15rem solid currentColor;
    border-left: 0.15rem solid currentColor;
    transform: translateY(0.2rem) rotate(45deg);
}

#back-to-top.visible {
    visibility: visible;
    opacity: 1;
    transform: translateY(0);
}

#back-to-top:hover,
#back-to-top:active {
    box-shadow:
        0 12px 24px rgba(37, 34, 29, 0.2),
        0 6px 12px rgba(37, 34, 29, 0.15),
        0 2px 4px rgba(37, 34, 29, 0.1);
    transform: translateY(-1px) scale(1.05);
}


/* DISABLED */


main .disabled {
    pointer-events: none;
    cursor: default;
}

main .disabled img,
.dark body main .disabled img {
    filter: grayscale(100%);
}

main .disabled .card-text {
    opacity: 0.5;
}


/* DARK MODE */


html.dark {
    color-scheme: dark;
}

.dark body {
    background-color: #181613;
    color: rgba(238, 236, 231, 0.85);
}

.dark body #hero {
    background: linear-gradient(to bottom, #0f0e0b, transparent);
}

.dark body .hero-slide:not(.active) {
    filter: drop-shadow(0 3px 3px rgba(0, 0, 0, 0.25));
}

.dark body .card {
    border: solid #1d1b17 2px;
    background-color: #1d1b17;
    box-shadow:
        0 2px 4px 2px rgba(0, 0, 0, 0.3),
        0 2px 2px rgba(0, 0, 0, 0.2);
    color: rgba(238, 236, 231, 0.85);
    transition: box-shadow 0.2s ease;
}

.dark body .card-wrap:hover .card {
    box-shadow:
        0 12px 24px 2px rgba(0, 0, 0, 0.2),
        0 6px 12px 2px rgba(0, 0, 0, 0.15),
        0 2px 4px 2px rgba(0, 0, 0, 0.1);
}

.dark body .card-image {
    width: 95px;
    filter: brightness(85%);
    transform: translateX(0.5px);
}

.dark body .card-title {
    background-color: #1a495b;
    color: #f0d060;
}

.dark body .ribbon-body,
.dark body .ribbon-fold {
    filter: brightness(85%);
}

.dark body #back-to-top {
    background-color: #1a495b;
    box-shadow:
        0 2px 4px 2px rgba(0, 0, 0, 0.3),
        0 2px 2px rgba(0, 0, 0, 0.2);
}

.dark body #back-to-top:hover {
    box-shadow:
        0 12px 24px 2px rgba(0, 0, 0, 0.2),
        0 6px 12px 2px rgba(0, 0, 0, 0.15),
        0 2px 4px 2px rgba(0, 0, 0, 0.1);
    transition: box-shadow 0.2s ease;
}

.card * {
    transition: none;
}


/* REDUCED MOTION */


@media (prefers-reduced-motion: reduce) {
    * {
        transition-duration: 0s !important;
        animation: none;
        animation-play-state: paused;
    }
}


/* SHARED TABLET, MOBILE LANDSCAPE, & DESKTOP */


@media screen and (orientation: portrait) and (min-width: 60vmax),
screen and (orientation: landscape) and (max-width: 80rem),
screen and (orientation: landscape) and (min-width: 80rem) {
    #hero::after {
        --fade: calc(var(--gutter) / 2);

        content: '';
        position: absolute;
        inset: 0;
        height: var(--slide-h);
        margin-block: auto;
        background: linear-gradient(to right,
                rgba(0, 0, 0, 0.5) 0,
                transparent var(--fade),
                transparent calc(100% - var(--fade)),
                rgba(0, 0, 0, 0.5) 100%);

        pointer-events: none;
        z-index: 2;
    }

    .hero-slide {
        display: grid;
        grid-template-columns: 3fr 2fr;
        grid-template-rows: 1fr;
        grid-column-gap: 0px;
        grid-row-gap: 0px;
    }

    .hero-slide::before {
        background: linear-gradient(to right,
                rgba(0, 0, 0, 0.4),
                rgba(0, 0, 0, 0.8) 66%);
    }

    .slide-text {
        display: flex;
        flex-direction: column;
        flex-wrap: wrap;
        align-items: center;
        gap: 1.25em;
        position: relative;
        grid-area: 1 / 1 / 2 / 2;
        margin: 0 5em;
        color: #eeece7;
        text-align: center;
        z-index: 1;
    }

    .slide-subtext {
        font-size: 0.9rem;
    }

    .slide-subtext.badge {
        top: -3rem;
    }

    .slide-details {
        display: grid;
        grid-area: 1 / 2 / 2 / 3;
        overflow: hidden;
        margin-right: 25%;
        color: #eeece7;
        line-height: 1.5;
        opacity: 0.85;
        z-index: 1;
    }

    .hero-arrow {
        --arrow-w: 4rem;
    }

    #hero-dot-container {
        bottom: 1rem;
    }

    .section-title,
    .section-subtitle {
        text-align: left;
    }

    .card-container {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }
}


/* TABLET */


@media screen and (orientation: portrait) and (min-width: 60vmax) {
    body {
        grid-template-columns: 2% 96% 2%;
    }

    #hero {
        --slide-w: 75%;
        --slide-h: 85%;

        height: 33vh;
    }

    .slide-title {
        -webkit-line-clamp: 4;
        line-clamp: 4;
    }

    .card {
        height: 160px;
    }

    .card-details p {
        -webkit-line-clamp: 7;
        line-clamp: 7;
    }

    .ribbon-body {
        top: 14px;
        height: 23px;
        padding: 0 1.2em;
        font-size: 0.6rem;
    }

    .ribbon-fold {
        top: 33px;
        height: 11px;
    }
}


/* MOBILE LANDSCAPE */


@media screen and (orientation: landscape) and (max-width: 80rem) {
    body {
        grid-template-columns: 2% 96% 2%;
    }

    #hero {
        --slide-w: 75%;
        --slide-h: 85%;

        height: 75vh;
    }
}


/* DESKTOP */


@media screen and (orientation: landscape) and (min-width: 80rem) {
    body {
        grid-template-columns: 17% 66% 17%;
    }

    main {
        margin: 2rem 0.2rem;
    }

    #hero {
        --slide-w: 66%;
        --slide-h: 85%;

        height: 50vh;
    }

    .slide-details {
        margin-right: 33%;
    }

    .card {
        height: 160px;
    }

    .card-container {
        gap: 2rem;
    }

    .card-image {
        width: 144px;
        clip-path: polygon(0 0, 100% 0, 85% 100%, 0 100%);
    }

    .card-details p {
        -webkit-line-clamp: 6;
        line-clamp: 6;
    }

    .ribbon-body {
        top: 12px;
        height: 23px;
        padding: 0 0.9em;
        font-size: 0.75rem;
    }

    .ribbon-fold {
        top: 30px;
        height: 11px;
    }

    #back-to-top {
        right: 1rem;
        bottom: 1rem;
        width: 2.5rem;
        height: 2.5rem;
    }

    #back-to-top::before {
        content: '';
        width: 0.7rem;
        height: 0.7rem;
        border-top: 0.2rem solid currentColor;
        border-left: 0.2rem solid currentColor;
        transform: translateY(0.3rem) rotate(45deg);
    }

    .dark body .card-image {
        width: 143px;
    }
}