:root {
    --bg-top: #7ecfe1;
    --bg-bottom: #ffcfc7;
    --shell-border: #2f6b3b;
    --window-bg: linear-gradient(180deg, #f2e7e2, #ddc9c1);
    --window-title-start: #5ea26c;
    --window-title-end: #2f6b3b;
    --window-title-text: #fffdf8;
    --paper: #f3f2ed;
    --panel-soft: linear-gradient(180deg, #f4ebe7, #e4d2cb);
    --panel-alt: linear-gradient(180deg, #efe2dc, #dcc5bd);
    --muted: #6c5a42;
    --text: #24345f;
    --shadow: rgba(34, 84, 45, 0.2);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: "Trebuchet MS", "Verdana", sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(255, 255, 255, 0.55), transparent 20%),
        linear-gradient(180deg, var(--bg-top), var(--bg-bottom));
    background-attachment: fixed;
}

img {
    display: block;
    max-width: 100%;
}

a {
    color: inherit;
}

code {
    font-family: "Courier New", monospace;
    font-size: 0.92em;
}

.page-shell {
    width: min(1120px, calc(100vw - 32px));
    margin: 24px auto 40px;
}

.post-hero {
    position: relative;
    overflow: hidden;
    margin-bottom: 18px;
    padding: 28px 30px;
    border: 4px solid var(--shell-border);
    border-radius: 28px 28px 14px 14px;
    background:
        linear-gradient(rgba(243, 242, 237, 0.94), rgba(232, 213, 203, 0.9)),
        url("../graphics/rippedpaper.png");
    background-size: auto, 280px;
    background-repeat: no-repeat, repeat;
    background-position: center, center;
    box-shadow: 0 20px 40px var(--shadow);
}

.post-hero__stickers {
    position: absolute;
    top: 14px;
    right: 18px;
    display: flex;
    gap: 10px;
}

.post-hero__stickers img {
    width: 34px;
    height: 34px;
}

.post-hero__eyebrow {
    margin: 0 0 10px;
    font-size: 0.85rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: #d04d62;
}

.post-hero__title {
    margin: 0;
    font-size: clamp(2.1rem, 3.5vw, 3.8rem);
    line-height: 0.95;
    color: #f04f72;
    text-shadow: 2px 2px 0 #fff7ef, 4px 4px 0 #ffb8c5;
}

.post-hero__meta {
    margin: 12px 0 0;
    font-size: 0.98rem;
    color: var(--muted);
}

.post-layout {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    gap: 18px;
}

.post-sidebar,
.post-content {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.window {
    overflow: hidden;
    border: 4px solid var(--shell-border);
    background: var(--window-bg);
    box-shadow: 0 12px 24px var(--shadow);
}

.window__title {
    position: relative;
    padding: 8px 12px;
    padding-right: 38px;
    font-size: 0.88rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    color: var(--window-title-text);
    background: linear-gradient(90deg, var(--window-title-start), var(--window-title-end));
    border-bottom: 3px solid var(--shell-border);
}

.window__title::after {
    content: "";
    position: absolute;
    top: 50%;
    right: 10px;
    width: 18px;
    height: 18px;
    background: url("../graphics/s4league_icon.png") center/contain no-repeat;
    transform: translateY(-50%);
}

.sidebar-card {
    background: var(--panel-alt);
}

.sidebar-card__content,
.sidebar-card__art {
    padding: 16px;
}

.sidebar-card__content p {
    margin: 0 0 12px;
    line-height: 1.45;
}

.sidebar-card__content p:last-child {
    margin-bottom: 0;
}

.sidebar-card__art {
    display: grid;
    place-items: center;
    min-height: 180px;
}

.sidebar-card__art img {
    width: min(100%, 90px);
    filter: drop-shadow(0 10px 18px rgba(1, 49, 31, 0.2));
}

.nav-box {
    background: var(--panel-soft);
}

.nav-box__link {
    display: block;
    padding: 12px 14px;
    border-bottom: 2px solid rgba(1, 49, 31, 0.2);
    text-decoration: none;
    font-weight: 700;
    background: rgba(243, 242, 237, 0.52);
}

.nav-box__link:hover,
.nav-box__link:focus-visible {
    background: rgba(243, 242, 237, 0.82);
    outline: none;
}

.article-window {
    background: linear-gradient(180deg, #f4ebe7, #e4d2cb);
}

.article-window__paper {
    margin: 18px;
    padding: 26px 26px 30px;
    background:
        url("../graphics/rippedpaper.png") center/cover no-repeat,
        var(--paper);
    line-height: 1.7;
}

.article-window__paper p {
    margin: 0 0 18px;
}

.article-window__paper h2 {
    margin: 28px 0 12px;
    font-size: 1.25rem;
    color: #123928;
}

.article-window__figure {
    margin: 24px 0;
    padding: 12px;
    border: 3px solid rgba(1, 49, 31, 0.16);
    background: rgba(243, 242, 237, 0.64);
}

.article-window__figure img {
    width: 100%;
    max-width: 520px;
    margin: 0 auto 10px;
}

.article-window__figure figcaption {
    text-align: center;
    color: var(--muted);
    font-size: 0.92rem;
}

.article-window__gallery {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin: 24px 0;
}

.gallery-card {
    overflow: hidden;
    aspect-ratio: 1 / 1;
    padding: 8px;
    border: 3px solid rgba(1, 49, 31, 0.18);
    border-radius: 18px;
    background: rgba(243, 242, 237, 0.82);
    box-shadow: inset 0 0 0 1px rgba(47, 107, 59, 0.08);
}

.gallery-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 12px;
}

.article-window__note {
    margin: 22px 0;
    padding: 16px 18px;
    border-left: 5px solid #5ea26c;
    background: rgba(243, 242, 237, 0.74);
    color: var(--muted);
}

.article-window__back-link {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 30px;
}

.article-window__back-link a {
    display: inline-block;
    min-width: 190px;
    padding: 10px 18px;
    border: 3px solid var(--shell-border);
    text-decoration: none;
    font-weight: 700;
    text-align: center;
    color: #fffdf8;
    background: linear-gradient(90deg, var(--window-title-start), var(--window-title-end));
    box-shadow: 0 8px 18px rgba(34, 84, 45, 0.16);
}

.article-window__back-link a:hover,
.article-window__back-link a:focus-visible {
    transform: translateY(-2px);
    outline: none;
}

.tips-window {
    background: linear-gradient(180deg, #efe2dc, #dec9c2);
}

.tips-window__grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    padding: 18px;
}

.tip-card {
    min-height: 170px;
    padding: 18px;
    border: 3px solid rgba(1, 49, 31, 0.18);
    background: rgba(243, 242, 237, 0.72);
}

.tip-card h2 {
    margin: 0 0 10px;
    font-size: 1.08rem;
    color: #123928;
}

.tip-card p {
    margin: 0;
    line-height: 1.52;
}

@media (max-width: 980px) {
    .post-layout,
    .tips-window__grid {
        grid-template-columns: 1fr;
    }

    .article-window__gallery {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .post-hero__stickers {
        position: static;
        justify-content: flex-end;
        margin-bottom: 8px;
    }
}

@media (max-width: 640px) {
    .page-shell {
        width: min(100vw - 16px, 100%);
        margin: 8px auto 24px;
    }

    .post-hero,
    .window__title,
    .article-window__paper,
    .tips-window__grid {
        padding-left: 12px;
        padding-right: 12px;
    }

    .post-hero__title {
        font-size: 2rem;
    }

    .post-hero__stickers img {
        width: 30px;
        height: 30px;
    }

    .article-window__gallery {
        grid-template-columns: 1fr;
    }
}
