/* ==========================================================================
   frobieter theme — dark design with per-category accent colors
   Frontend = orange, Drupal = blue, Miscellaneous = yellow
   ========================================================================== */

:root {
    --bg: #0d0f14;
    --bg-header: rgba(13, 15, 20, 0.86);
    --bg-card: #151a24;
    --bg-card-hover: #1a2130;
    --bg-code: #0a0c11;
    --border: #262d3c;
    --text: #e8eaf1;
    --text-muted: #a6adbf;
    --link: #9ecbff;

    /* Category accent colors (overridable via theme blueprint colors) */
    --accent-frontend: #ff7a1a;
    --accent-drupal: #2f9be8;
    --accent-miscellaneous: #f5c518;

    /* Neutral default accent; category-* classes override it per context */
    --accent: var(--link);

    --radius: 12px;
    --wrap: 46rem;
    --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-mono: ui-monospace, "SF Mono", "Cascadia Code", Menlo, Consolas, monospace;
}

.category-frontend      { --accent: var(--accent-frontend); }
.category-drupal        { --accent: var(--accent-drupal); }
.category-miscellaneous { --accent: var(--accent-miscellaneous); }

/* ---------- Reset / base ---------- */

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

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-sans);
    font-size: 1.0625rem;
    line-height: 1.65;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.wrap {
    width: 100%;
    max-width: var(--wrap);
    margin-inline: auto;
    padding-inline: 1.25rem;
}

main.wrap { flex: 1 0 auto; padding-block: 2.5rem 3rem; }

h1, h2, h3, h4 {
    line-height: 1.25;
    font-weight: 700;
    letter-spacing: -0.01em;
}

h1 { font-size: clamp(1.7rem, 4.5vw, 2.3rem); margin: 0 0 1rem; }
h2 { font-size: clamp(1.25rem, 3vw, 1.5rem); margin: 0 0 .75rem; }
h3 { font-size: 1.15rem; margin: 1.75rem 0 .5rem; }

a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
    border-radius: 4px;
}

img, svg, video { max-width: 100%; height: auto; }

code, pre, kbd, samp { font-family: var(--font-mono); font-size: .92em; }
code { background: var(--bg-code); border: 1px solid var(--border); border-radius: 6px; padding: .1em .35em; }
pre {
    background: var(--bg-code);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    overflow-x: auto;
}
pre code { background: none; border: 0; padding: 0; }

blockquote {
    margin: 1.5rem 0;
    padding: .25rem 0 .25rem 1.25rem;
    border-left: 3px solid var(--accent);
    color: var(--text-muted);
}

hr { border: 0; border-top: 1px solid var(--border); margin: 2rem 0; }

/* ---------- Skip link (a11y) ---------- */

.skip-link {
    position: absolute;
    left: 1rem;
    top: -4rem;
    z-index: 100;
    background: var(--text);
    color: var(--bg);
    padding: .5rem 1rem;
    border-radius: 8px;
    font-weight: 600;
    transition: top .15s ease;
}
.skip-link:focus { top: 1rem; color: var(--bg); }

/* ---------- Header ---------- */

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: var(--bg-header);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
}

.header-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: .75rem 1.5rem;
    padding-block: .9rem;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: .7rem;
    text-decoration: none;
    color: var(--text);
}

/* Logo (project root logo.svg, served as /logo.svg); dots are the fallback while/if it is missing */
.brand-logo { display: none; height: 2rem; width: auto; }
.brand-logo.is-loaded { display: block; }
.brand-logo.is-loaded ~ .brand-dots { display: none; }

.brand-dots { display: inline-flex; gap: 3px; }
.brand-dots i { width: 10px; height: 10px; border-radius: 50%; display: block; }
.brand-dots .d1 { background: var(--accent-frontend); }
.brand-dots .d2 { background: var(--accent-drupal); }
.brand-dots .d3 { background: var(--accent-miscellaneous); }

.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-name { font-family: var(--font-mono); font-weight: 700; font-size: 1.02rem; color: var(--text); }
.brand-tagline { font-size: .78rem; color: var(--text-muted); }

/* ---------- Category navigation ---------- */

.cat-nav ul {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem .25rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.cat-link {
    display: inline-flex;
    align-items: center;
    padding: .3rem .7rem;
    border-radius: 999px;
    border: 1px solid var(--border);
    color: var(--text-muted);
    text-decoration: none;
    font-size: .85rem;
    font-weight: 600;
    transition: color .15s ease, border-color .15s ease, background .15s ease;
}
.cat-link:hover { color: var(--text); border-color: var(--text-muted); }
.cat-link.active { color: var(--bg); background: var(--text); border-color: var(--text); }

.cat-link .dot {
    width: .55rem;
    height: .55rem;
    border-radius: 50%;
    margin-right: .45rem;
    background: var(--text-muted);
}
.cat-link.cat-frontend .dot      { background: var(--accent-frontend); }
.cat-link.cat-drupal .dot        { background: var(--accent-drupal); }
.cat-link.cat-miscellaneous .dot { background: var(--accent-miscellaneous); }
.cat-link.cat-frontend:hover, .cat-link.cat-frontend.active      { border-color: var(--accent-frontend); }
.cat-link.cat-drupal:hover, .cat-link.cat-drupal.active            { border-color: var(--accent-drupal); }
.cat-link.cat-miscellaneous:hover, .cat-link.cat-miscellaneous.active { border-color: var(--accent-miscellaneous); }
.cat-link.cat-frontend.active      { background: var(--accent-frontend); border-color: var(--accent-frontend); color: #140b02; }
.cat-link.cat-drupal.active        { background: var(--accent-drupal); border-color: var(--accent-drupal); color: #04121f; }
.cat-link.cat-miscellaneous.active { background: var(--accent-miscellaneous); border-color: var(--accent-miscellaneous); color: #1c1502; }

/* ---------- Blog overview ---------- */

.blog-header { margin-bottom: 2rem; }
.blog-intro { color: var(--text-muted); max-width: 40rem; }

.post-list {
    display: grid;
    gap: 1.25rem;
}

.post-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.4rem 1.5rem 1.2rem;
    transition: border-color .15s ease, background .15s ease, transform .15s ease;
}
.post-card:hover {
    background: var(--bg-card-hover);
    border-color: var(--accent);
    transform: translateY(-2px);
}

.post-card-header {
    display: flex;
    align-items: center;
    gap: .8rem;
    margin-bottom: .6rem;
}

.post-date { color: var(--text-muted); font-size: .82rem; }

.post-title { margin: 0 0 .5rem; }
.post-title a { color: var(--text); text-decoration: none; }
.post-title a:hover { color: var(--accent); }

.post-summary { color: var(--text-muted); margin: 0 0 1rem; }

.post-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.read-more { font-weight: 600; color: var(--accent); text-decoration: none; }
.read-more:hover { text-decoration: underline; }

.reading-time { color: var(--text-muted); font-size: .8rem; }

.no-posts { color: var(--text-muted); }

/* ---------- Badge (category label) ---------- */

.badge {
    display: inline-block;
    padding: .18rem .65rem;
    border-radius: 999px;
    background: var(--accent);
    color: #10131a;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    text-decoration: none;
}
a.badge:hover { filter: brightness(1.1); color: #10131a; }

/* ---------- Single post ---------- */

.post-header { margin-bottom: 1.75rem; }
.post-header .badge { margin-bottom: .9rem; }
.post-meta { color: var(--text-muted); font-size: .88rem; margin: 0; }

.post-content { max-width: 42rem; }
.post-content > :first-child { margin-top: 0; }
.post-content a { color: var(--accent); }
.post-content h2, .post-content h3 { color: var(--text); }
.post-content table { border-collapse: collapse; width: 100%; margin: 1.25rem 0; font-size: .95rem; }
.post-content th, .post-content td { border: 1px solid var(--border); padding: .5rem .75rem; text-align: left; }
.post-content th { background: var(--bg-card); }

.post-footer { margin-top: 2.5rem; }
.post-tags { display: flex; flex-wrap: wrap; gap: .5rem; margin: 0; }
.tag {
    font-family: var(--font-mono);
    font-size: .8rem;
    color: var(--text-muted);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: .2rem .7rem;
    text-decoration: none;
}
.tag:hover { color: var(--accent); border-color: var(--accent); }

.post-nav { margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid var(--border); }
.back-link { font-weight: 600; }

/* ---------- Pagination ---------- */

.pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 2.25rem;
}
.page-link {
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: .45rem 1rem;
    text-decoration: none;
    font-weight: 600;
    font-size: .9rem;
}
.page-link:hover { border-color: var(--accent); color: var(--accent); }
.page-status { color: var(--text-muted); font-size: .85rem; }

/* ---------- Footer ---------- */

.site-footer {
    border-top: 1px solid var(--border);
    padding-block: 2rem;
    margin-top: auto;
}
.footer-inner { display: grid; gap: 2rem; }

/* 3-spaltiges Widget-Raster wie auf der alten Seite */
.footer-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}
.footer-title {
    margin: 0 0 .9rem;
    font-size: .95rem;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--text);
}
.footer-widget p { margin: 0 0 .7rem; font-size: .9rem; color: var(--text-muted); }
.footer-widget a { color: var(--text); }
.footer-widget a:hover { color: var(--accent, var(--accent-frontend)); }

.footer-post { margin-bottom: .7rem; font-size: .9rem; }
.footer-post a { display: block; line-height: 1.35; }
.footer-post-date { font-size: .78rem; color: var(--text-muted); }

.footer-social { list-style: none; display: flex; flex-wrap: wrap; gap: .9rem; margin: .2rem 0 0; padding: 0; font-size: .85rem; }

.footer-banners { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; }
.footer-banner img { height: 2.4rem; width: auto; display: block; }
.footer-banner { display: inline-block; padding: .4rem .6rem; border: 1px solid var(--border); border-radius: 6px; background: #fff; }
.footer-banner:hover { border-color: var(--accent, var(--accent-frontend)); }

.footer-bottom {
    border-top: 1px solid var(--border);
    padding-top: 1.2rem;
    display: grid;
    gap: .5rem;
}
.footer-brand { margin: 0; font-weight: 600; }
.footer-links { list-style: none; display: flex; flex-wrap: wrap; gap: 1.25rem; margin: 0; padding: 0; font-size: .9rem; }
.footer-note { margin: 0; color: var(--text-muted); font-size: .82rem; }

/* ---------- Responsive ---------- */

@media (max-width: 40rem) {
    .header-inner { flex-direction: column; align-items: flex-start; gap: .6rem; }
    .post-card { padding: 1.15rem 1.2rem 1rem; }
    .pagination { flex-direction: column; }
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    .post-card:hover { transform: none; }
}
