/* Stylesheet for OldBlogs static archive on www.petrsnajdr.cz */

:root {
    --bg-dark: #060a11;
    --bg-dark-elevated: #0d1522;
    --bg-canvas: #f6f8fb;
    --bg-card: #ffffff;
    --text-primary: #0f172a;
    --text-secondary: #334155;
    --text-muted: #64748b;
    --border-subtle: #e2e8f0;
    --border-strong: #cbd5e1;
    --gold: #c69a45;
    --gold-light: #e5c17b;
    --gold-soft: rgba(198, 154, 69, 0.13);
    --gold-border: rgba(198, 154, 69, 0.35);
    --shadow-card: 0 4px 18px rgba(15, 23, 42, 0.05);
    --shadow-card-hover: 0 12px 28px rgba(15, 23, 42, 0.09);
    --radius-lg: 14px;
    --radius-md: 10px;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    min-height: 100%;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-canvas);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    line-height: 1.65;
}

body {
    display: flex;
    flex-direction: column;
}

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

a {
    color: #1e40af;
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
}

a:hover {
    color: #926d27;
}

.container {
    width: 100%;
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Header */
.site-header {
    background: linear-gradient(135deg, var(--bg-dark) 0%, var(--bg-dark-elevated) 100%);
    color: #ffffff;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding: 18px 0;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: #ffffff;
}

.brand:hover {
    color: #ffffff;
}

.brand-mark {
    width: 10px;
    height: 10px;
    border-radius: 2px;
    background: var(--gold);
    box-shadow: 0 0 14px rgba(198, 154, 69, 0.55);
    flex-shrink: 0;
}

.brand-text {
    font-size: 0.95rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-weight: 400;
    color: #cbd5e1;
}

.brand-text strong {
    font-weight: 800;
    color: #ffffff;
}

.header-nav {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.header-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 13px;
    border-radius: 8px;
    font-size: 0.84rem;
    font-weight: 500;
    color: #cbd5e1;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.11);
    text-decoration: none;
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.header-link:hover {
    background: rgba(198, 154, 69, 0.16);
    border-color: var(--gold-border);
    color: #ffffff;
}

.header-link--accent {
    background: var(--gold-soft);
    border-color: var(--gold-border);
    color: var(--gold-light);
}

/* Hero Banner on Index */
.archive-hero {
    background: linear-gradient(180deg, var(--bg-dark-elevated) 0%, #111c2d 100%);
    color: #ffffff;
    padding: 44px 0 48px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.hero-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--gold);
    background: var(--gold-soft);
    border: 1px solid var(--gold-border);
    padding: 5px 12px;
    border-radius: 999px;
    margin-bottom: 16px;
}

.archive-hero h1 {
    margin: 0 0 12px;
    font-size: clamp(1.75rem, 3vw, 2.5rem);
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.archive-hero-lead {
    margin: 0;
    max-width: 740px;
    color: #cbd5e1;
    font-size: 1.02rem;
    line-height: 1.6;
}

.hero-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 26px;
}

.stat-pill {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.11);
    border-radius: var(--radius-md);
    padding: 10px 16px;
    min-width: 145px;
}

.stat-value {
    display: block;
    font-size: 1.25rem;
    font-weight: 700;
    color: #ffffff;
    line-height: 1.25;
}

.stat-label {
    display: block;
    font-size: 0.78rem;
    color: #94a3b8;
    margin-top: 2px;
}

/* Main Content */
.main-content {
    flex: 1 0 auto;
    padding: 36px 0 64px;
}

/* Controls on Archive Index */
.controls-bar {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 18px 20px;
    margin-bottom: 28px;
    box-shadow: var(--shadow-card);
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.controls-top {
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
}

.search-wrap {
    position: relative;
    flex: 1 1 280px;
}

.search-input {
    width: 100%;
    padding: 10px 14px;
    border-radius: 8px;
    border: 1px solid var(--border-strong);
    font-family: inherit;
    font-size: 0.94rem;
    color: var(--text-primary);
    background: #ffffff;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.search-input:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 3px var(--gold-soft);
}

.sort-select {
    padding: 10px 14px;
    border-radius: 8px;
    border: 1px solid var(--border-strong);
    font-family: inherit;
    font-size: 0.9rem;
    color: var(--text-primary);
    background: #ffffff;
    cursor: pointer;
}

.results-meta {
    font-size: 0.85rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.filter-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.filter-btn {
    border: 1px solid var(--border-subtle);
    background: #f8fafc;
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 0.84rem;
    font-weight: 500;
    padding: 6px 13px;
    border-radius: 999px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.filter-btn:hover {
    border-color: var(--gold-border);
    background: #ffffff;
    color: var(--text-primary);
}

.filter-btn.is-active {
    background: var(--bg-dark);
    color: #ffffff;
    border-color: var(--bg-dark);
}

.active-subcat-bar {
    display: none;
    align-items: center;
    gap: 10px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    padding-top: 4px;
}

.active-subcat-bar.is-visible {
    display: flex;
}

.reset-filter-link {
    background: none;
    border: none;
    padding: 0;
    color: #926d27;
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: underline;
}

/* Articles Grid */
.articles-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 22px;
}

@media (max-width: 980px) {
    .articles-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .articles-grid {
        grid-template-columns: 1fr;
    }
}

.article-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-card);
    display: flex;
    flex-direction: column;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.article-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-card-hover);
    border-color: var(--border-strong);
}

.article-card.is-hidden {
    display: none;
}

.card-thumb {
    display: block;
    aspect-ratio: 16 / 10;
    background: #e2e8f0;
    overflow: hidden;
}

.card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.card-body {
    padding: 18px 20px 20px;
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
}

.card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px;
}

.card-tag {
    font-size: 0.74rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #926d27;
    background: var(--gold-soft);
    padding: 3px 8px;
    border-radius: 5px;
    text-decoration: none;
}

.card-title {
    margin: 0 0 8px;
    font-size: 1.08rem;
    font-weight: 700;
    line-height: 1.35;
}

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

.card-title a:hover {
    color: #926d27;
}

.card-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.card-excerpt {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.55;
    margin: 0 0 16px;
    flex: 1 1 auto;
}

.card-read-link {
    font-size: 0.88rem;
    font-weight: 600;
    color: #1e40af;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.card-read-link:hover {
    color: #926d27;
}

.empty-state {
    display: none;
    background: var(--bg-card);
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius-lg);
    padding: 40px 24px;
    text-align: center;
    color: var(--text-secondary);
}

.empty-state.is-visible {
    display: block;
}

/* Single Article Page */
.article-shell {
    max-width: 840px;
    margin: 0 auto;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    padding: 34px 40px 42px;
}

@media (max-width: 700px) {
    .article-shell {
        padding: 24px 20px 32px;
    }
}

.breadcrumbs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    font-size: 0.84rem;
    color: var(--text-muted);
    margin-bottom: 18px;
}

.breadcrumbs a {
    color: var(--text-secondary);
    text-decoration: none;
}

.breadcrumbs a:hover {
    color: #926d27;
    text-decoration: underline;
}

.article-header {
    border-bottom: 1px solid var(--border-subtle);
    padding-bottom: 20px;
    margin-bottom: 26px;
}

.article-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.article-title {
    margin: 0 0 12px;
    font-size: clamp(1.6rem, 3vw, 2.25rem);
    font-weight: 800;
    line-height: 1.24;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

.article-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 14px;
    font-size: 0.86rem;
    color: var(--text-muted);
}

.article-hero-media {
    margin: 0 0 28px;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: #f1f5f9;
}

.article-hero-media img {
    display: block;
    width: 100%;
    max-height: 520px;
    object-fit: cover;
}

.article-hero-media figcaption {
    font-size: 0.82rem;
    color: var(--text-muted);
    padding: 8px 12px;
    background: #f8fafc;
    border-top: 1px solid var(--border-subtle);
}

/* Article Typography & Blocks */
.article-body {
    font-size: 1.03rem;
    line-height: 1.72;
    color: #1e293b;
}

.article-body > *:first-child {
    margin-top: 0;
}

.article-body h2,
.article-body h3,
.article-body h4 {
    color: var(--text-primary);
    line-height: 1.3;
    margin-top: 1.8em;
    margin-bottom: 0.65em;
    font-weight: 700;
}

.article-body h2 {
    font-size: 1.48rem;
}

.article-body h3 {
    font-size: 1.22rem;
}

.article-body p {
    margin: 0 0 1.15em;
}

.article-body ul,
.article-body ol {
    margin: 0 0 1.2em;
    padding-left: 1.4em;
}

.article-body li {
    margin-bottom: 0.45em;
}

.article-body blockquote {
    margin: 1.5em 0;
    padding: 14px 20px;
    border-left: 3px solid var(--gold);
    background: #f8fafc;
    color: var(--text-secondary);
    font-style: italic;
    border-radius: 0 8px 8px 0;
}

.article-body blockquote cite {
    display: block;
    margin-top: 8px;
    font-style: normal;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
}

.article-body figure {
    margin: 1.6em 0;
    width: 100% !important;
    max-width: 100%;
}

.article-body figure.alignleft,
.article-body figure.alignright,
.article-body figure.aligncenter,
.article-body img.alignleft,
.article-body img.alignright,
.article-body img.aligncenter {
    float: none;
    margin-left: 0;
    margin-right: 0;
}

.article-body figure:not(.wp-block-gallery) img,
.article-body > p img,
.article-body > img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    display: block;
}

.article-body > p img {
    margin: 1em 0;
}

.article-body figcaption {
    margin-top: 8px;
    font-size: 0.84rem;
    color: var(--text-muted);
    text-align: left;
}

.article-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.4em 0;
    font-size: 0.94rem;
    display: block;
    overflow-x: auto;
}

.article-body th,
.article-body td {
    border: 1px solid var(--border-subtle);
    padding: 10px 12px;
    text-align: left;
    vertical-align: top;
}

.article-body th {
    background: #f8fafc;
    font-weight: 600;
}

.article-body iframe {
    width: 100%;
    max-width: 100%;
    aspect-ratio: 16 / 9;
    height: auto;
    border-radius: 8px;
    display: block;
}

/* Galleries */
.wp-block-gallery,
.oldblogs-gallery {
    margin: 1.6em 0;
    width: 100%;
}

.wp-block-gallery .blocks-gallery-grid,
.oldblogs-gallery-grid {
    display: grid;
    width: 100%;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.wp-block-gallery.columns-2 .blocks-gallery-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (max-width: 640px) {
    .wp-block-gallery .blocks-gallery-grid,
    .oldblogs-gallery-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.wp-block-gallery .blocks-gallery-item,
.oldblogs-gallery-item {
    margin: 0;
}

.wp-block-gallery .blocks-gallery-item figure,
.oldblogs-gallery-item figure {
    margin: 0;
    height: 100%;
}

.wp-block-gallery img,
.oldblogs-gallery img {
    width: 100%;
    height: 190px;
    object-fit: cover;
    border-radius: 8px;
    display: block;
    cursor: zoom-in;
    transition: transform 0.18s ease, opacity 0.18s ease;
}

.wp-block-gallery img:hover,
.oldblogs-gallery img:hover {
    transform: scale(1.015);
    opacity: 0.95;
}

.article-body img.lightboxable {
    cursor: zoom-in;
}

/* Page CTA cleanup link */
.oldblogs-inline-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    padding: 10px 18px;
    border-radius: 8px;
    background: var(--bg-dark);
    color: #ffffff;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.92rem;
}

.oldblogs-inline-btn:hover {
    background: #1e293b;
    color: var(--gold-light);
}

/* Prev / Next Navigation */
.article-nav {
    margin-top: 38px;
    padding-top: 22px;
    border-top: 1px solid var(--border-subtle);
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

@media (max-width: 640px) {
    .article-nav {
        grid-template-columns: 1fr;
    }
}

.article-nav-card {
    display: block;
    padding: 14px 16px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
    background: #f8fafc;
    text-decoration: none;
    transition: border-color 0.2s, background-color 0.2s;
}

.article-nav-card:hover {
    border-color: var(--gold-border);
    background: #ffffff;
}

.article-nav-label {
    display: block;
    font-size: 0.76rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.article-nav-title {
    display: block;
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.35;
}

.article-nav-card--next {
    text-align: right;
}

.article-back-row {
    margin-top: 22px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 0.88rem;
}

.archive-note {
    margin-top: 24px;
    padding: 14px 16px;
    background: #f8fafc;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Advanced Fullscreen & Zoom Image Viewer (Lightbox) */
.oldblogs-lightbox {
    position: fixed;
    inset: 0;
    background: rgba(6, 10, 17, 0.96);
    z-index: 9999;
    display: none;
    flex-direction: column;
    color: #f8fafc;
}

.oldblogs-lightbox.is-open {
    display: flex;
}

.oldblogs-lb-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 18px;
    background: rgba(13, 21, 34, 0.92);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 3;
    flex-shrink: 0;
}

.oldblogs-lb-counter {
    font-size: 0.88rem;
    font-weight: 600;
    color: #cbd5e1;
    min-width: 70px;
}

.oldblogs-lb-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.oldblogs-lb-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ffffff;
    font-family: inherit;
    font-size: 0.86rem;
    font-weight: 600;
    height: 36px;
    padding: 0 12px;
    border-radius: 8px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.oldblogs-lb-btn:hover {
    background: var(--gold);
    border-color: var(--gold);
    color: #060a11;
}

.oldblogs-lb-zoom-label {
    font-size: 0.82rem;
    color: #cbd5e1;
    min-width: 48px;
    text-align: center;
}

.oldblogs-lb-stage {
    position: relative;
    flex: 1 1 auto;
    width: 100%;
    height: 100%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 64px;
    touch-action: none;
}

.oldblogs-lightbox-img {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    user-select: none;
    -webkit-user-drag: none;
    transform-origin: center center;
    transition: transform 0.12s ease-out;
    cursor: zoom-in;
}

.oldblogs-lightbox-img.is-zoomed {
    cursor: grab;
}

.oldblogs-lightbox-img.is-dragging {
    cursor: grabbing;
    transition: none;
}

.oldblogs-lb-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 46px;
    height: 64px;
    border-radius: 10px;
    background: rgba(13, 21, 34, 0.72);
    border: 1px solid rgba(255, 255, 255, 0.22);
    color: #ffffff;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.oldblogs-lb-nav:hover {
    background: var(--gold);
    border-color: var(--gold);
    color: #060a11;
}

.oldblogs-lb-nav--prev {
    left: 12px;
}

.oldblogs-lb-nav--next {
    right: 12px;
}

.oldblogs-lb-nav[hidden] {
    display: none;
}

.oldblogs-lb-caption {
    padding: 8px 18px 12px;
    text-align: center;
    font-size: 0.88rem;
    color: #cbd5e1;
    background: rgba(13, 21, 34, 0.92);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    flex-shrink: 0;
}

.oldblogs-lb-caption:empty {
    display: none;
}

@media (max-width: 640px) {
    .oldblogs-lb-stage {
        padding: 8px 12px;
    }

    .oldblogs-lb-nav {
        width: 38px;
        height: 48px;
        font-size: 1.25rem;
    }
}

/* Footer */
.site-footer {
    background: var(--bg-dark);
    color: #94a3b8;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding: 24px 0;
    font-size: 0.85rem;
}

.footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 14px;
}

.footer-links {
    display: flex;
    gap: 18px;
    flex-wrap: wrap;
}

.footer-links a {
    color: #cbd5e1;
    text-decoration: none;
}

.footer-links a:hover {
    color: var(--gold-light);
}
