/* ==========================================================================
   BoingBoing.dk
   Main Stylesheet — The only one you need.
   ========================================================================== */

/* ---------- Reset & Base ---------- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --color-primary: #3949ab;
    --color-primary-dark: #1a237e;
    --color-primary-light: #9fa8da;
    --color-accent: #ff6d00;
    --color-accent-hover: #e65100;
    --color-text: #2c2c2c;
    --color-text-light: #616161;
    --color-text-muted: #9e9e9e;
    --color-bg: #ffffff;
    --color-bg-alt: #f4f5f9;
    --color-border: #e0e0e0;
    --color-tab-bg: #1a1f4e;
    --color-tab-active: #ffffff;
    --color-tab-text: #b0b8e8;
    --color-tab-text-active: var(--color-primary-dark);
    --color-tag-bg: #e8eaf6;
    --color-tag-text: #3949ab;
    --font-body: "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-heading: Georgia, "Times New Roman", serif;
    --font-mono: "SF Mono", "Fira Code", "Fira Mono", Menlo, Consolas, monospace;
    --max-width: 1100px;
    --content-width: 760px;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-body);
    color: var(--color-text);
    background-color: var(--color-bg);
    line-height: 1.7;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--color-primary-dark);
    text-decoration: underline;
}

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

ul, ol {
    list-style: none;
}

/* ---------- Typography ---------- */
h1, h2, h3, h4 {
    font-family: var(--font-heading);
    color: var(--color-primary-dark);
    line-height: 1.3;
    margin-bottom: 0.5em;
}

h1 {
    font-size: 2.4rem;
}

h2 {
    font-size: 1.8rem;
}

h3 {
    font-size: 1.3rem;
}

p {
    margin-bottom: 1em;
}

/* ---------- Layout ---------- */
.container {
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 1.5rem;
}

.container--narrow {
    max-width: var(--content-width);
}

main {
    flex: 1;
}

/* ---------- Site Header ---------- */
.site-header {
    background-color: var(--color-primary-dark);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

/* -- Brand bar -- */
.brand-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.9rem 0;
}

.brand-bar .logo a {
    color: #ffffff;
    font-family: var(--font-heading);
    font-size: 1.8rem;
    font-weight: 700;
    text-decoration: none;
    letter-spacing: 0.02em;
}

.brand-bar .logo a span {
    color: var(--color-accent);
    font-weight: 400;
}

/* -- Tab Navigation -- */
.tab-nav {
    background-color: var(--color-tab-bg);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.tab-nav .container {
    position: relative;
}

.tab-list {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
}

.tab-list li {
    flex: 0 0 auto;
}

.tab-list a {
    display: block;
    padding: 0.7rem 1.25rem;
    color: var(--color-tab-text);
    font-size: 0.92rem;
    font-weight: 500;
    text-decoration: none;
    border-radius: 6px 6px 0 0;
    position: relative;
    transition:
        background-color 0.2s ease,
        color 0.2s ease;
    white-space: nowrap;
}

.tab-list a:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    text-decoration: none;
}

.tab-list a.active {
    background-color: var(--color-tab-active);
    color: var(--color-tab-text-active);
    font-weight: 600;
}

/* subtle bottom indicator on active tab */
.tab-list a.active::after {
    content: "";
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 3px;
    background-color: var(--color-accent);
    border-radius: 3px 3px 0 0;
}

/* ---------- Mobile Nav Toggle ---------- */
.nav-toggle {
    display: none;
    background: none;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-radius: 5px;
    cursor: pointer;
    padding: 0.35rem 0.55rem;
    transition: border-color 0.2s ease;
}

.nav-toggle:hover {
    border-color: #ffffff;
}

.nav-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background-color: #ffffff;
    margin: 4px 0;
    border-radius: 2px;
    transition:
        transform 0.3s ease,
        opacity 0.3s ease;
}

/* Hamburger animation when open */
.nav-toggle.open span:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
}

.nav-toggle.open span:nth-child(2) {
    opacity: 0;
}

.nav-toggle.open span:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
}

/* ---------- Hero Section ---------- */
.hero {
    background: linear-gradient(135deg, var(--color-bg-alt) 0%, #e8eaf6 100%);
    padding: 4rem 0;
    text-align: center;
    border-bottom: 3px solid var(--color-primary-light);
}

.hero h1 {
    font-size: 2.8rem;
    margin-bottom: 0.3em;
}

.hero p {
    font-size: 1.15rem;
    color: var(--color-text-light);
    max-width: 650px;
    margin: 0 auto 1.5em;
}

.btn {
    display: inline-block;
    background-color: var(--color-accent);
    color: #ffffff;
    padding: 0.75rem 2rem;
    border-radius: 5px;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    transition:
        background-color 0.2s ease,
        transform 0.1s ease;
}

.btn:hover {
    background-color: var(--color-accent-hover);
    color: #ffffff;
    text-decoration: none;
    transform: translateY(-1px);
}

.btn:active {
    transform: translateY(0);
}

.btn--outline {
    background-color: transparent;
    color: var(--color-primary);
    border: 2px solid var(--color-primary);
}

.btn--outline:hover {
    background-color: var(--color-primary);
    color: #ffffff;
}

/* ---------- Content Sections ---------- */
.section {
    padding: 3rem 0;
}

.section--alt {
    background-color: var(--color-bg-alt);
}

.section__title {
    text-align: center;
    margin-bottom: 2rem;
}

/* ---------- Blog Post List (homepage / archive) ---------- */
.post-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.post-list li {
    margin-bottom: 2rem;
}

.post-card {
    background-color: #ffffff;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 2rem;
    display: block;
    text-decoration: none;
    color: inherit;
    transition:
        box-shadow 0.2s ease,
        transform 0.2s ease,
        border-color 0.2s ease;
}

.post-card:hover {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
    border-color: var(--color-primary-light);
    text-decoration: none;
    color: inherit;
}

.post-card__meta {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    margin-bottom: 0.5rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
}

.post-card__title {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    color: var(--color-primary-dark);
    margin-bottom: 0.4em;
    line-height: 1.3;
}

.post-card:hover .post-card__title {
    color: var(--color-primary);
}

.post-card__excerpt {
    color: var(--color-text-light);
    font-size: 0.98rem;
    line-height: 1.6;
    margin-bottom: 0.75rem;
}

.post-card__read-more {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--color-accent);
}

.post-card:hover .post-card__read-more {
    text-decoration: underline;
}

/* ---------- Tags ---------- */
.tag {
    display: inline-block;
    background-color: var(--color-tag-bg);
    color: var(--color-tag-text);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.2em 0.65em;
    border-radius: 3px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.tag--tech {
    background-color: #e3f2fd;
    color: #1565c0;
}

.tag--kultur {
    background-color: #fce4ec;
    color: #c62828;
}

.tag--web {
    background-color: #e8f5e9;
    color: #2e7d32;
}

.tag--mening {
    background-color: #fff3e0;
    color: #e65100;
}

/* ---------- Single Blog Post (article page) ---------- */
.post-header {
    padding: 3rem 0 1.5rem;
    border-bottom: 2px solid var(--color-primary-light);
    margin-bottom: 2rem;
}

.post-header h1 {
    font-size: 2.4rem;
    margin-bottom: 0.4em;
    max-width: var(--content-width);
}

.post-header .post-meta {
    font-size: 0.9rem;
    color: var(--color-text-muted);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
}

.post-content {
    padding: 0 0 3rem;
    max-width: var(--content-width);
}

.post-content h2 {
    margin-top: 2.5em;
    margin-bottom: 0.6em;
    padding-bottom: 0.25em;
    border-bottom: 1px solid var(--color-border);
}

.post-content h3 {
    margin-top: 1.8em;
    margin-bottom: 0.4em;
}

.post-content p {
    font-size: 1.05rem;
    line-height: 1.8;
}

.post-content ul,
.post-content ol {
    margin: 0 0 1.5em 1.5em;
}

.post-content ul {
    list-style: disc;
}

.post-content ol {
    list-style: decimal;
}

.post-content li {
    margin-bottom: 0.4em;
    font-size: 1.05rem;
    line-height: 1.7;
}

.post-content blockquote {
    border-left: 4px solid var(--color-primary-light);
    margin: 1.5em 0;
    padding: 1em 1.5em;
    background-color: var(--color-bg-alt);
    color: var(--color-text-light);
    font-style: italic;
    border-radius: 0 6px 6px 0;
}

.post-content blockquote p:last-child {
    margin-bottom: 0;
}

.post-content pre {
    background-color: #1e1e2e;
    color: #cdd6f4;
    padding: 1.25rem 1.5rem;
    border-radius: 6px;
    overflow-x: auto;
    margin: 1.5em 0;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    line-height: 1.5;
}

.post-content code {
    font-family: var(--font-mono);
    font-size: 0.88em;
    background-color: var(--color-bg-alt);
    padding: 0.15em 0.4em;
    border-radius: 3px;
    color: var(--color-primary-dark);
}

.post-content pre code {
    background: none;
    padding: 0;
    border-radius: 0;
    color: inherit;
    font-size: 1em;
}

.post-content img {
    border-radius: 6px;
    margin: 1.5em 0;
}

.post-content a {
    text-decoration: underline;
    text-decoration-color: var(--color-primary-light);
    text-underline-offset: 2px;
}

.post-content a:hover {
    text-decoration-color: var(--color-primary);
}

.post-content .info-box {
    background-color: #e8eaf6;
    border: 1px solid var(--color-primary-light);
    border-radius: 8px;
    padding: 1.25rem 1.5rem;
    margin: 1.5em 0;
}

.post-content .info-box h3 {
    margin-top: 0;
    color: var(--color-primary);
}

/* ---------- Post Navigation (prev / next) ---------- */
.post-nav {
    display: flex;
    justify-content: space-between;
    gap: 1.5rem;
    padding: 2rem 0;
    border-top: 1px solid var(--color-border);
    margin-top: 1rem;
}

.post-nav a {
    display: block;
    padding: 1rem 1.25rem;
    background-color: var(--color-bg-alt);
    border-radius: 6px;
    flex: 1;
    transition: background-color 0.2s ease;
    text-decoration: none;
}

.post-nav a:hover {
    background-color: #e8eaf6;
    text-decoration: none;
}

.post-nav__label {
    display: block;
    font-size: 0.8rem;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
}

.post-nav__title {
    font-family: var(--font-heading);
    color: var(--color-primary-dark);
    font-size: 1rem;
    font-weight: 600;
}

.post-nav a:last-child {
    text-align: right;
}

/* ---------- Page Content (static pages) ---------- */
.page-content {
    padding: 3rem 0 4rem;
}

.page-content h1 {
    margin-bottom: 0.75em;
    border-bottom: 2px solid var(--color-primary-light);
    padding-bottom: 0.3em;
}

.page-content h2 {
    margin-top: 2em;
    margin-bottom: 0.5em;
}

.page-content h3 {
    margin-top: 1.5em;
    margin-bottom: 0.4em;
}

.page-content p + ul,
.page-content p + ol {
    margin-top: -0.5em;
}

.page-content ul,
.page-content ol {
    margin: 0 0 1em 1.5em;
}

.page-content ul {
    list-style: disc;
}

.page-content ol {
    list-style: decimal;
}

.page-content li {
    margin-bottom: 0.4em;
}

.page-content blockquote {
    border-left: 4px solid var(--color-primary-light);
    margin: 1.5em 0;
    padding: 1em 1.5em;
    background-color: var(--color-bg-alt);
    color: var(--color-text-light);
    font-style: italic;
    border-radius: 0 6px 6px 0;
}

/* ---------- Developer Page ---------- */
.dev-ascii {
    background-color: #1e1e2e;
    color: var(--color-primary-light);
    padding: 1.5rem;
    border-radius: 6px;
    overflow-x: auto;
    font-family: var(--font-mono);
    font-size: 0.55rem;
    line-height: 1.2;
    margin: 2rem 0;
    text-align: center;
}

.dev-tree {
    background-color: #1e1e2e;
    color: #cdd6f4;
    padding: 1.25rem 1.5rem;
    border-radius: 6px;
    overflow-x: auto;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    line-height: 1.6;
    margin: 1.5rem 0;
}

.dev-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    font-size: 0.95rem;
}

.dev-table th,
.dev-table td {
    padding: 0.6rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--color-border);
}

.dev-table th {
    background-color: var(--color-bg-alt);
    font-weight: 600;
    color: var(--color-primary-dark);
}

.dev-table tr:hover td {
    background-color: var(--color-bg-alt);
}

.dev-who {
    background-color: var(--color-bg-alt);
    border-radius: 8px;
    padding: 2rem;
    margin: 2rem 0;
}

.dev-comment {
    background-color: #1e1e2e;
    color: #6c7086;
    padding: 1.25rem 1.5rem;
    border-radius: 6px;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    line-height: 1.6;
    margin: 1.5rem 0;
}

/* ---------- Archive Page ---------- */
.archive-year {
    margin-bottom: 2.5rem;
}

.archive-year h2 {
    font-size: 1.6rem;
    margin-bottom: 1rem;
    padding-bottom: 0.3em;
    border-bottom: 2px solid var(--color-primary-light);
}

.archive-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.archive-list li {
    display: flex;
    align-items: baseline;
    gap: 1rem;
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--color-border);
}

.archive-list li:last-child {
    border-bottom: none;
}

.archive-date {
    flex-shrink: 0;
    font-size: 0.85rem;
    color: var(--color-text-muted);
    font-family: var(--font-mono);
    min-width: 5.5rem;
}

.archive-list a {
    font-weight: 500;
}

/* ---------- Card Grid (reusable) ---------- */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.card {
    background-color: #ffffff;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 1.5rem;
    transition:
        box-shadow 0.2s ease,
        transform 0.2s ease;
}

.card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.card h3 {
    margin-bottom: 0.5em;
}

.card p {
    color: var(--color-text-light);
    font-size: 0.95rem;
    margin-bottom: 0;
}

/* ---------- Footer ---------- */
.site-footer {
    background-color: var(--color-primary-dark);
    color: #cccccc;
    text-align: center;
    padding: 1.5rem 0;
    font-size: 0.85rem;
    margin-top: auto;
}

.site-footer p {
    margin-bottom: 0;
}

.site-footer a {
    color: var(--color-primary-light);
}

.footer-nav {
    list-style: none;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 1rem;
}

/* ---------- Pagination ---------- */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    padding: 2rem 0;
}

.pagination a,
.pagination span {
    display: inline-block;
    padding: 0.5rem 0.9rem;
    border-radius: 4px;
    font-size: 0.9rem;
    font-weight: 500;
}

.pagination a {
    background-color: var(--color-bg-alt);
    color: var(--color-primary);
    text-decoration: none;
    transition: background-color 0.2s ease;
}

.pagination a:hover {
    background-color: #e8eaf6;
    text-decoration: none;
}

.pagination .current {
    background-color: var(--color-primary);
    color: #ffffff;
}

/* ---------- Responsive: Tablet ---------- */
@media (max-width: 900px) {
    .tab-list a {
        padding: 0.6rem 0.9rem;
        font-size: 0.85rem;
    }

    .post-card {
        padding: 1.5rem;
    }
}

/* ---------- Responsive: Mobile ---------- */
@media (max-width: 768px) {
    h1 {
        font-size: 1.8rem;
    }

    h2 {
        font-size: 1.4rem;
    }

    .hero {
        padding: 2.5rem 0;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .hero p {
        font-size: 1rem;
    }

    /* Show mobile toggle */
    .nav-toggle {
        display: block;
    }

    /* Hide tab bar by default on mobile */
    .tab-nav {
        display: none;
    }

    .tab-nav.open {
        display: block;
    }

    .tab-list {
        flex-direction: column;
        padding: 0.5rem 0;
    }

    .tab-list li {
        border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    }

    .tab-list li:last-child {
        border-bottom: none;
    }

    .tab-list a {
        border-radius: 0;
        padding: 0.8rem 1.5rem;
        font-size: 0.95rem;
    }

    .tab-list a.active {
        background-color: rgba(255, 255, 255, 0.15);
        color: #ffffff;
    }

    .tab-list a.active::after {
        display: none;
    }

    .section {
        padding: 2rem 0;
    }

    /* Blog post */
    .post-header h1 {
        font-size: 1.8rem;
    }

    .post-content p {
        font-size: 1rem;
    }

    .post-nav {
        flex-direction: column;
    }

    .post-nav a:last-child {
        text-align: left;
    }

    /* Post cards */
    .post-card__title {
        font-size: 1.25rem;
    }

    .post-card__meta {
        gap: 0.5rem;
    }

    /* Archive */
    .archive-list li {
        flex-direction: column;
        gap: 0.2rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 1rem;
    }

    .brand-bar .logo a {
        font-size: 1.4rem;
    }

    .hero h1 {
        font-size: 1.6rem;
    }

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

    .btn {
        padding: 0.65rem 1.5rem;
        font-size: 0.9rem;
    }

    .post-card {
        padding: 1.25rem;
    }

    .dev-ascii {
        font-size: 0.38rem;
    }
}
