/*
Theme Name: Qero Blog
Theme URI: https://qero.cc
Author: Qero.cc
Author URI: https://qero.cc
Description: Official blog theme for Qero.cc — QR-first URL shortener. Dark, futuristic, cyan & mint accents.
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: qero-blog
Tags: dark, minimal, blog, technology
*/

/* ── Design Tokens ──────────────────────────────────────────── */
:root {
    --bg0:        #080e19;
    --bg1:        #0b1220;
    --bg2:        #0f1929;
    --surface:    rgba(255,255,255,.045);
    --surface2:   rgba(255,255,255,.07);
    --border:     rgba(255,255,255,.09);
    --border2:    rgba(255,255,255,.13);
    --text:       #e7eef8;
    --muted:      #7a8fa8;
    --accent:     #69e7ff;   /* cyan */
    --accent2:    #9bffb1;   /* mint */
    --accent3:    #b596fa;   /* violet */
    --danger:     #ff4d6d;
    --sans:       'Syne', 'Space Grotesk', system-ui, sans-serif;
    --mono:       'Space Mono', 'JetBrains Mono', monospace;
    --radius:     16px;
    --radius-sm:  10px;
    --shadow:     0 8px 40px rgba(0,0,0,.45);
    --sidebar-w:  260px;
}

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

html { scroll-behavior: smooth; }

body {
    background:
        radial-gradient(1200px 700px at 15% -8%,  rgba(105,231,255,.14), transparent 58%),
        radial-gradient(800px 600px  at 95% 5%,   rgba(181,150,255,.11), transparent 55%),
        radial-gradient(900px 800px  at 50% 110%, rgba(155,255,177,.07), transparent 55%),
        linear-gradient(180deg, var(--bg0) 0%, var(--bg1) 100%);
    background-attachment: fixed;
    color: var(--text);
    font-family: var(--sans);
    font-size: 16px;
    line-height: 1.7;
    min-height: 100vh;
}

/* Dot-grain texture */
body::before {
    content: '';
    pointer-events: none;
    position: fixed;
    inset: 0;
    z-index: 0;
    opacity: .055;
    background-image: radial-gradient(rgba(255,255,255,.7) .55px, transparent .55px);
    background-size: 10px 10px;
    mask-image: linear-gradient(180deg, rgba(0,0,0,.8), rgba(0,0,0,.2));
}

a { color: var(--accent); text-decoration: none; transition: color .18s; }
a:hover { color: var(--accent2); }

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

h1, h2, h3, h4, h5, h6 {
    font-family: var(--sans);
    font-weight: 900;
    letter-spacing: -.03em;
    line-height: 1.15;
    color: var(--text);
}

/* ── Utility ────────────────────────────────────────────────── */
.container {
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 24px;
    position: relative;
    z-index: 1;
}

.visually-hidden {
    position: absolute;
    width: 1px; height: 1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
}

/* ── Header / Navbar ────────────────────────────────────────── */
#masthead {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(8,14,25,.82);
    backdrop-filter: blur(18px) saturate(140%);
    border-bottom: 1px solid var(--border);
}

.site-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
    gap: 24px;
}

/* Logo */
.site-branding { display: flex; align-items: center; gap: 12px; text-decoration: none; }

.logo-mark {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: radial-gradient(circle at 30% 30%, rgba(155,255,177,.9), rgba(105,231,255,.55) 60%, rgba(105,231,255,.08) 100%);
    box-shadow: 0 8px 24px rgba(105,231,255,.22);
    flex-shrink: 0;
}

.site-title-text {
    font-size: 20px;
    font-weight: 900;
    letter-spacing: -.04em;
    color: var(--text);
    line-height: 1;
}

.site-tagline {
    font-size: 11px;
    color: var(--muted);
    font-family: var(--mono);
    letter-spacing: .04em;
    margin-top: 2px;
}

/* Nav */
#site-navigation { display: flex; align-items: center; }

.nav-menu {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 6px;
}

.nav-menu a {
    display: block;
    padding: 7px 14px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--muted);
    border-radius: 8px;
    transition: color .18s, background .18s;
}

.nav-menu a:hover,
.nav-menu .current-menu-item a {
    color: var(--accent);
    background: rgba(105,231,255,.08);
}

.nav-cta {
    margin-left: 10px;
    padding: 8px 18px !important;
    background: var(--accent) !important;
    color: #07100c !important;
    border-radius: 10px !important;
    font-weight: 900 !important;
}

.nav-cta:hover {
    background: var(--accent2) !important;
    color: #07100c !important;
}

/* Mobile hamburger */
.menu-toggle {
    display: none;
    background: none;
    border: 1px solid var(--border2);
    border-radius: 8px;
    padding: 8px 10px;
    cursor: pointer;
    color: var(--text);
    font-size: 20px;
    line-height: 1;
}

/* ── Main Layout ─────────────────────────────────────────────── */
#primary {
    max-width: 1180px;
    margin: 0 auto;
    padding: 48px 24px 80px;
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 1fr var(--sidebar-w);
    gap: 40px;
    align-items: start;
}

/* Full-width page override */
.no-sidebar #primary {
    grid-template-columns: 1fr;
    max-width: 860px;
}

/* ── Posts Loop ─────────────────────────────────────────────── */
.posts-grid {
    display: grid;
    gap: 28px;
}

/* Post card */
article.post-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: border-color .22s, transform .22s, box-shadow .22s;
    box-shadow: var(--shadow);
}

article.post-card:hover {
    border-color: rgba(105,231,255,.28);
    transform: translateY(-2px);
    box-shadow: 0 16px 56px rgba(0,0,0,.55), 0 0 0 1px rgba(105,231,255,.12);
}

.post-thumbnail {
    aspect-ratio: 16/7;
    overflow: hidden;
    background: var(--bg2);
}

.post-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .4s ease;
}

article.post-card:hover .post-thumbnail img {
    transform: scale(1.04);
}

/* Placeholder thumbnail */
.post-thumbnail-placeholder {
    aspect-ratio: 16/7;
    background: linear-gradient(135deg, rgba(105,231,255,.08) 0%, rgba(181,150,255,.08) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.post-thumbnail-placeholder::after {
    content: '⬡';
    font-size: 48px;
    opacity: .15;
}

.post-body {
    padding: 28px 30px 30px;
}

.post-meta {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

.post-category {
    font-family: var(--mono);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--accent);
    background: rgba(105,231,255,.1);
    padding: 3px 10px;
    border-radius: 20px;
    border: 1px solid rgba(105,231,255,.2);
    text-decoration: none;
}

.post-category:hover { background: rgba(105,231,255,.18); color: var(--accent); }

.post-date {
    font-family: var(--mono);
    font-size: 11px;
    color: var(--muted);
    letter-spacing: .06em;
}

.post-read-time {
    font-family: var(--mono);
    font-size: 11px;
    color: var(--muted);
    margin-left: auto;
}

.post-card .entry-title {
    font-size: 22px;
    margin-bottom: 12px;
    line-height: 1.25;
}

.post-card .entry-title a {
    color: var(--text);
    text-decoration: none;
}

.post-card .entry-title a:hover { color: var(--accent); }

.entry-excerpt {
    color: var(--muted);
    font-size: 14px;
    line-height: 1.65;
    margin-bottom: 22px;
}

.read-more {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 700;
    font-family: var(--mono);
    letter-spacing: .05em;
    color: var(--accent);
    border-bottom: 1px solid rgba(105,231,255,.3);
    padding-bottom: 1px;
    text-decoration: none;
    transition: gap .18s, border-color .18s;
}

.read-more:hover { gap: 10px; border-color: var(--accent); color: var(--accent); }
.read-more::after { content: '→'; }

/* Featured post (first post, larger) */
article.post-card.is-featured .entry-title { font-size: 30px; }

/* ── Single Post ────────────────────────────────────────────── */
.single #primary {
    grid-template-columns: 1fr var(--sidebar-w);
}

.entry-header { margin-bottom: 36px; }

.entry-header .post-meta { margin-bottom: 18px; }

.entry-header .entry-title {
    font-size: clamp(28px, 4vw, 46px);
    margin-bottom: 20px;
    line-height: 1.12;
}

.entry-header .post-author-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.author-avatar {
    width: 40px; height: 40px;
    border-radius: 50%;
    border: 2px solid var(--border2);
    overflow: hidden;
    background: var(--bg2);
}

.author-name { font-weight: 700; font-size: 14px; }
.author-role { font-size: 12px; color: var(--muted); font-family: var(--mono); }

/* Featured image */
.post-featured-image {
    margin-bottom: 40px;
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
}

.post-featured-image img {
    width: 100%;
    max-height: 480px;
    object-fit: cover;
}

/* Entry content */
.entry-content {
    font-size: 16px;
    line-height: 1.8;
    color: #ccd8e8;
}

.entry-content h2 {
    font-size: 26px;
    margin: 2.4em 0 .8em;
    color: var(--text);
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
}

.entry-content h3 {
    font-size: 20px;
    margin: 2em 0 .7em;
    color: var(--text);
}

.entry-content h4 { font-size: 17px; margin: 1.8em 0 .6em; }

.entry-content p { margin-bottom: 1.4em; }

.entry-content a { color: var(--accent); border-bottom: 1px solid rgba(105,231,255,.3); }
.entry-content a:hover { color: var(--accent2); border-color: var(--accent2); }

.entry-content ul, .entry-content ol {
    margin: 0 0 1.4em 1.6em;
    color: #b8c8da;
}

.entry-content li { margin-bottom: .5em; }

.entry-content blockquote {
    margin: 2em 0;
    padding: 20px 24px;
    border-left: 3px solid var(--accent);
    background: rgba(105,231,255,.05);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    color: var(--text);
    font-size: 17px;
    font-style: italic;
}

.entry-content code {
    font-family: var(--mono);
    font-size: 13px;
    background: rgba(255,255,255,.08);
    padding: 2px 7px;
    border-radius: 5px;
    color: var(--accent2);
}

.entry-content pre {
    background: rgba(0,0,0,.4);
    border: 1px solid var(--border2);
    border-radius: var(--radius-sm);
    padding: 20px 22px;
    overflow-x: auto;
    margin: 1.6em 0;
}

.entry-content pre code {
    background: none;
    padding: 0;
    font-size: 13px;
    line-height: 1.7;
}

.entry-content img {
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    margin: 1.4em 0;
}

.entry-content hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 2.4em 0;
}

.entry-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.6em 0;
    font-size: 14px;
}

.entry-content th {
    background: var(--surface2);
    padding: 10px 14px;
    text-align: left;
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--muted);
    border-bottom: 1px solid var(--border2);
}

.entry-content td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
}

/* Post tags */
.entry-footer { margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--border); }

.post-tags { display: flex; flex-wrap: wrap; gap: 8px; }

.post-tags a {
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: .08em;
    color: var(--muted);
    background: var(--surface2);
    border: 1px solid var(--border);
    padding: 4px 12px;
    border-radius: 20px;
    text-decoration: none;
    transition: color .18s, border-color .18s;
}

.post-tags a:hover { color: var(--accent2); border-color: var(--accent2); }

/* ── Sidebar ────────────────────────────────────────────────── */
#secondary {
    position: sticky;
    top: 80px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.widget {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px;
    box-shadow: var(--shadow);
}

.widget-title {
    font-family: var(--mono);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .18em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

/* Qero CTA widget */
.qero-cta-widget {
    background: linear-gradient(135deg, rgba(105,231,255,.08) 0%, rgba(155,255,177,.06) 100%);
    border-color: rgba(105,231,255,.2);
    text-align: center;
}

.qero-cta-widget .logo-mark { margin: 0 auto 14px; }

.qero-cta-widget h3 {
    font-size: 18px;
    margin-bottom: 8px;
}

.qero-cta-widget p {
    font-size: 13px;
    color: var(--muted);
    margin-bottom: 16px;
    line-height: 1.55;
}

.btn-cta {
    display: block;
    background: var(--accent);
    color: #07100c;
    font-weight: 900;
    font-size: 14px;
    letter-spacing: .03em;
    padding: 11px 20px;
    border-radius: var(--radius-sm);
    text-align: center;
    text-decoration: none;
    transition: background .18s, transform .18s;
}

.btn-cta:hover {
    background: var(--accent2);
    color: #07100c;
    transform: translateY(-1px);
}

/* Widget lists */
.widget ul { list-style: none; }
.widget ul li {
    border-bottom: 1px solid var(--border);
    padding: 8px 0;
    font-size: 13px;
}
.widget ul li:last-child { border-bottom: none; padding-bottom: 0; }
.widget ul li a { color: var(--muted); text-decoration: none; transition: color .15s; }
.widget ul li a:hover { color: var(--accent); }

/* Search widget */
.search-form { display: flex; gap: 8px; }

.search-field {
    flex: 1;
    background: var(--bg2);
    border: 1px solid var(--border2);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-family: var(--mono);
    font-size: 13px;
    padding: 10px 14px;
    outline: none;
    transition: border-color .2s;
}

.search-field:focus { border-color: var(--accent); }
.search-field::placeholder { color: var(--muted); }

.search-submit {
    background: var(--accent);
    color: #07100c;
    border: none;
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    cursor: pointer;
    font-weight: 900;
    font-size: 14px;
    transition: background .18s;
}

.search-submit:hover { background: var(--accent2); }

/* ── Pagination ─────────────────────────────────────────────── */
.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 40px;
    flex-wrap: wrap;
}

.page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border2);
    color: var(--muted);
    font-family: var(--mono);
    font-size: 13px;
    text-decoration: none;
    transition: all .18s;
}

.page-numbers:hover,
.page-numbers.current {
    background: var(--accent);
    color: #07100c;
    border-color: var(--accent);
}

.page-numbers.dots {
    border: none;
    background: none;
    color: var(--muted);
    width: auto;
    padding: 0 4px;
}

/* ── Comments ───────────────────────────────────────────────── */
.comments-area {
    margin-top: 56px;
    padding-top: 36px;
    border-top: 1px solid var(--border);
}

.comments-title {
    font-size: 22px;
    margin-bottom: 28px;
}

.comment-list { list-style: none; }

.comment-body {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 20px 22px;
    margin-bottom: 16px;
}

.comment-author { font-weight: 700; font-size: 14px; margin-bottom: 4px; }
.comment-metadata { font-size: 11px; color: var(--muted); font-family: var(--mono); margin-bottom: 12px; }
.comment-content { font-size: 14px; color: var(--muted); line-height: 1.65; }

.comment-form input,
.comment-form textarea {
    width: 100%;
    background: var(--bg2);
    border: 1px solid var(--border2);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-family: var(--sans);
    font-size: 14px;
    padding: 12px 14px;
    outline: none;
    transition: border-color .2s;
    margin-bottom: 12px;
}

.comment-form input:focus,
.comment-form textarea:focus { border-color: var(--accent); }

.comment-form textarea { min-height: 120px; resize: vertical; }

.comment-form-submit input[type="submit"] {
    background: var(--accent);
    color: #07100c;
    font-weight: 900;
    border: none;
    border-radius: var(--radius-sm);
    padding: 12px 24px;
    cursor: pointer;
    font-size: 14px;
    transition: background .18s;
    width: auto;
    margin: 0;
}

.comment-form-submit input[type="submit"]:hover { background: var(--accent2); }

/* ── Footer ─────────────────────────────────────────────────── */
#colophon {
    position: relative;
    z-index: 1;
    border-top: 1px solid var(--border);
    background: rgba(8,14,25,.6);
    padding: 56px 0 32px;
    margin-top: 40px;
}

.footer-inner {
    display: grid;
    grid-template-columns: 1.8fr 1fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 48px;
}

.footer-brand .logo-mark { margin-bottom: 14px; }
.footer-brand p { font-size: 13px; color: var(--muted); line-height: 1.65; max-width: 240px; }

.footer-col-title {
    font-family: var(--mono);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .18em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 14px;
}

.footer-links { list-style: none; }
.footer-links li { margin-bottom: 8px; }
.footer-links a { font-size: 13px; color: var(--muted); text-decoration: none; transition: color .15s; }
.footer-links a:hover { color: var(--accent); }

.footer-bottom {
    padding-top: 24px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.footer-copy { font-size: 12px; color: var(--muted); font-family: var(--mono); }
.footer-copy a { color: var(--muted); text-decoration: none; border-bottom: 1px dashed rgba(255,255,255,.2); }
.footer-copy a:hover { color: var(--accent); border-color: var(--accent); }

.footer-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: var(--mono);
    font-size: 11px;
    color: var(--muted);
}

.footer-badge::before {
    content: '';
    display: inline-block;
    width: 7px; height: 7px;
    border-radius: 50%;
    background: var(--accent2);
    box-shadow: 0 0 8px var(--accent2);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%       { opacity: .6; transform: scale(0.85); }
}

/* ── Category / Archive Header ──────────────────────────────── */
.archive-header {
    margin-bottom: 36px;
    padding: 36px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.archive-label {
    font-family: var(--mono);
    font-size: 10px;
    letter-spacing: .18em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 8px;
}

.archive-title { font-size: 32px; margin-bottom: 8px; }
.archive-description { font-size: 14px; color: var(--muted); }

/* ── Page (static) ──────────────────────────────────────────── */
.page .entry-title { font-size: 38px; margin-bottom: 32px; }

/* ── 404 ────────────────────────────────────────────────────── */
.error-404 { text-align: center; padding: 80px 0; }
.error-404 .page-title { font-size: 80px; color: var(--accent); opacity: .4; line-height: 1; margin-bottom: 0; }
.error-404 h2 { font-size: 28px; margin-bottom: 12px; }
.error-404 p { color: var(--muted); font-size: 15px; }

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 960px) {
    #primary {
        grid-template-columns: 1fr;
    }

    #secondary {
        position: static;
    }

    .footer-inner {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 640px) {
    .container { padding: 0 16px; }

    .site-header-inner { height: 56px; }

    .nav-menu {
        display: none;
        position: absolute;
        top: 57px;
        left: 0; right: 0;
        background: rgba(8,14,25,.97);
        border-bottom: 1px solid var(--border);
        flex-direction: column;
        padding: 12px 0;
        gap: 2px;
    }

    .nav-menu.is-open { display: flex; }
    .nav-menu a { padding: 11px 20px; border-radius: 0; }

    .menu-toggle { display: block; }

    #primary { padding: 28px 16px 60px; }

    .footer-inner { grid-template-columns: 1fr; }
    .footer-bottom { flex-direction: column; text-align: center; }

    article.post-card.is-featured .entry-title { font-size: 22px; }
    .entry-content h2 { font-size: 22px; }
}
