/* Komic CSS — adapted for The Oxford Comma by Ernie */
/* Original layout by Stupied: https://stupied.net   */

@import url('https://fonts.googleapis.com/css2?family=Grandstander:ital,wght@0,100..900;1,100..900&display=swap');

:root {
    --color-accent: #7b4f2e;
    --color-accent-light: #c0a882;
    --color-bg: #f5f0e8;
    --color-dark: #2b1d0e;
    --display-font: Grandstander, Georgia, serif;
    --body-font: Georgia, serif;
    --comic-width: 860px;
}

* { box-sizing: border-box; }

body {
    padding: 0;
    margin: 0;
    font-family: var(--body-font);
    background-color: var(--color-bg);
    color: var(--color-dark);
}

h1, h2, h3, h4, h5, h6 {
    margin: 0;
    font-family: var(--display-font);
    color: var(--color-dark);
}

ol, ul { margin-top: 0; }
a { text-decoration: none; color: inherit; }
p { margin-top: 0; }
p > a { text-decoration: underline; }

hr {
    border: none;
    border-top: 1px solid #c0b09a;
    margin: 1.5rem 0;
}

/* ── Header ── */
#mainHeader {
    text-align: center;
    margin: auto;
    padding: 1rem;
    width: 100%;
    background-color: var(--color-dark);
    color: #f5f0e8;
}

/* ── Nav ── */
#mainNav {
    border-top: 2px solid var(--color-dark);
    border-bottom: 2px solid var(--color-dark);
    background-color: #fff;
    margin: auto;
    width: 100%;
    padding: 0.75rem 1rem;
    text-align: center;
}

#mainNav a:hover { color: var(--color-accent); }

#mainNav a:nth-of-type(n+2)::before {
    content: ' | ';
    display: inline-block;
    margin: 0 0.75rem;
    color: #c0b09a;
}

/* ── Main area ── */
main {
    position: relative;
    background-color: var(--color-bg);
    background-image:
        repeating-linear-gradient(45deg, rgba(192,176,154,0.2), rgba(192,176,154,0.2) 20px, transparent 20px, transparent 40px),
        repeating-linear-gradient(-45deg, rgba(192,176,154,0.2), rgba(192,176,154,0.2) 20px, transparent 20px, transparent 40px);
    padding-bottom: 2rem;
}

/* ── Comic header (title of current entry) ── */
#comicHeader {
    padding: 1rem 0;
    text-align: center;
}

@media only screen and (min-width: 600px) {
    #comicHeader { font-size: 1.5rem; }
}

/* ── Navigation buttons ── */
.comic-nav > * {
    display: flex;
    text-align: center;
    justify-content: center;
    padding: 1rem 0;
    gap: 0.5rem;
}

.comic-nav img {
    max-width: 100px;
    width: 100%;
}

/* ── Comic image view ── */
#comicView {
    border: 2px solid var(--color-dark);
    background-color: white;
    margin: auto;
    max-width: var(--comic-width);
    width: 95%;
    box-shadow: 4px 4px 0 rgba(0,0,0,0.15);
}

#comicView img {
    display: block;
    width: 100%;
}

/* ── Info panel ── */
#comicInfo {
    background-color: white;
    border: 2px solid var(--color-dark);
    border-top: none;
    max-width: var(--comic-width);
    width: 95%;
    margin: 0 auto;
    padding: 1.5rem;
    box-shadow: 4px 4px 0 rgba(0,0,0,0.15);
}

#comicInfo h2 {
    font-size: 1.1rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    border-bottom: 1px solid #c0b09a;
    padding-bottom: 6px;
    margin-bottom: 0.75rem;
}

#comicDate {
    display: block;
    font-size: 0.85rem;
    color: var(--color-accent);
    font-style: italic;
    margin-bottom: 0.5rem;
}

#comicDesc {
    font-size: 0.95rem;
    line-height: 1.6;
    color: #444;
}

/* ── Archive list ── */
.comic-list-item {
    display: flex;
    padding: 0.75rem 1rem;
    position: relative;
    border-bottom: 1px solid #e8e0d4;
    transition: background 0.1s ease;
}

.comic-list-item:hover {
    background-color: #f5f0e8;
}

.comic-list-item > * > span {
    position: relative;
    display: block;
    top: 50%;
    left: 0;
    transform: translateY(-50%);
}

.comic-list-item > * > span > span {
    font-family: var(--display-font);
    font-weight: bolder;
    color: var(--color-dark);
}

.comic-list-item img[src="#"] { display: none; }

.comic-list-item img {
    max-width: 3rem;
    aspect-ratio: 1/1;
    margin-right: 1rem;
    object-fit: cover;
    border-radius: 3px;
}

.comic-list-title {
    flex: 1;
    margin-right: 10px;
    font-size: 0.9rem;
    color: #555;
}

.comic-list-index {
    position: relative;
    min-width: 30px;
    font-size: 0.85rem;
    color: var(--color-accent);
}

/* ── Footer ── */
#mainFooter {
    text-align: center;
    margin: auto;
    padding: 1rem;
    background-color: var(--color-dark);
    color: #f5f0e8;
    font-size: 0.8rem;
}

#mainFooter a { text-decoration: underline; }

/* ── Dark mode ── */
@media (prefers-color-scheme: dark) {
    :root {
        --color-bg: #1a1410;
        --color-dark: #e8d8c0;
        --color-accent: #c4a882;
    }
    body { background: #1a1410; }
    #mainNav { background-color: #2a2018; border-color: #4a3828; }
    #comicView { background: #2a2018; border-color: #4a3828; }
    #comicInfo { background: #2a2018; border-color: #4a3828; }
    .comic-list-item:hover { background: #2e241a; }
    .comic-list-item { border-color: #3a2e22; }
    #comicDesc { color: #aaa; }
}
