/** Copyright (C) 2026 Der Akademiker und der Hauptschüler
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program.  If not, see <https://www.gnu.org/licenses/>.
*
* Author: Der Akademiker und der Hauptschüler
*/

/* Blog pages, generated by scripts/build.mjs on top of style.css */

/* The header height varies with the viewport width, so on blog pages it takes
   its own space in the layout instead of overlapping the content. */
.blog-page .header {
    position: sticky;
}

.blog-main {
    padding: 48px 0 80px;
    min-height: 70vh;
}

/* Blog overview */
.blog-index h1,
.post-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1rem;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.blog-list {
    display: grid;
    gap: 1.5rem;
    margin-top: 2.5rem;
}

.blog-card {
    display: block;
    background: var(--dark-gray);
    border: 1px solid var(--medium-gray);
    border-radius: 12px;
    padding: 1.75rem 2rem;
    color: var(--light-gray);
    text-decoration: none;
    transition: all 0.3s ease;
}

.blog-card:hover {
    border-color: var(--primary-red);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.2);
}

.blog-card h2 {
    font-size: 1.35rem;
    font-weight: 600;
    color: var(--white);
    margin: 0.25rem 0 0.5rem;
}

.blog-empty {
    color: var(--light-gray);
    font-style: italic;
}

.post-meta {
    font-size: 0.9rem;
    color: #9E9E9E;
}

.post-meta a {
    color: var(--primary-cyan);
    text-decoration: none;
}

.post-meta a:hover {
    color: var(--accent-teal);
}

.post-summary {
    font-size: 1.15rem;
    color: var(--light-gray);
    max-width: 780px;
}

.draft-banner,
.draft-tag {
    background: var(--primary-red);
    color: var(--white);
    font-weight: 600;
    border-radius: 6px;
}

.draft-banner {
    padding: 0.5rem 1rem;
    margin-bottom: 1.5rem;
    display: inline-block;
}

.draft-tag {
    padding: 0.1rem 0.5rem;
    font-size: 0.8rem;
}

/* Single post */
.post {
    max-width: 860px;
}

.post-header {
    margin-bottom: 2.5rem;
    padding-bottom: 2rem;
    border-bottom: 2px solid var(--primary-red);
}

.post-header .post-meta {
    margin-bottom: 0.75rem;
}

.post-header .btn {
    margin-top: 1.5rem;
}

.post-body {
    font-size: 1.05rem;
    line-height: 1.75;
}

.post-body h2 {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--white);
    margin: 2.75rem 0 1rem;
    padding-left: 0.85rem;
    border-left: 4px solid var(--primary-red);
}

.post-body h3 {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--white);
    margin: 2rem 0 0.75rem;
}

.post-body p,
.post-body ul,
.post-body ol,
.post-body table,
.post-body blockquote,
.post-body figure {
    margin-bottom: 1.25rem;
}

.post-body ul,
.post-body ol {
    padding-left: 1.5rem;
}

.post-body li {
    margin-bottom: 0.4rem;
}

.post-body strong {
    color: var(--white);
}

.post-body a {
    color: var(--primary-cyan);
    text-decoration: none;
    border-bottom: 1px solid rgba(0, 229, 255, 0.35);
    overflow-wrap: anywhere;
}

.post-body a:hover {
    color: var(--accent-teal);
    border-bottom-color: var(--accent-teal);
}

.post-body blockquote {
    background: var(--dark-gray);
    border-left: 4px solid var(--primary-cyan);
    border-radius: 0 8px 8px 0;
    padding: 1rem 1.25rem;
}

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

.post-body code {
    background: var(--medium-gray);
    border-radius: 4px;
    padding: 0.1rem 0.35rem;
    font-size: 0.9em;
}

/* Tables scroll sideways on small screens instead of breaking the layout */
.post-body table {
    display: block;
    overflow-x: auto;
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.post-body th,
.post-body td {
    border: 1px solid var(--medium-gray);
    padding: 0.6rem 0.85rem;
    text-align: left;
    vertical-align: top;
}

.post-body th {
    background: var(--dark-gray);
    color: var(--white);
    font-weight: 600;
}

.post-body img {
    display: block;
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

.post-body img + em,
.post-body p > em:only-child {
    display: block;
    font-size: 0.9rem;
    color: #9E9E9E;
    margin-top: 0.5rem;
}

.post-body hr {
    border: none;
    border-top: 1px solid var(--medium-gray);
    margin: 2.5rem 0;
}

@media (max-width: 768px) {
    .blog-index h1,
    .post-header h1 {
        font-size: 1.9rem;
    }

    .blog-card {
        padding: 1.25rem;
    }
}
