/*
 * PC Ekspert theme — base stylesheet.
 * theme.json provides light-mode color tokens; this file overrides them
 * to the dark palette when the user's OS reports prefers-color-scheme: dark.
 */

@media (prefers-color-scheme: dark) {
  :root {
    --wp--preset--color--background: #0E1419;
    --wp--preset--color--surface: #1A222B;
    --wp--preset--color--foreground: #E8ECEF;
    --wp--preset--color--foreground-muted: #8B95A1;
    --wp--preset--color--border: #2A323B;
    --wp--preset--color--primary: #2E7BC7;
  }
}

/* ---- Site header ---------------------------------------------------- */
.site-header {
    /* Diagonal gradient: primary → slightly deeper variant.
     * Hard #-hex stops because the dark-mode CSS-variable swap doesn't
     * cleanly express both ends of a gradient yet; the dark-mode rule
     * below restates the whole thing. */
    background: linear-gradient(135deg, #185FA5 0%, #0E4378 100%);
    color: #fff;
    padding-block: 0;
    padding-inline: clamp(1rem, 4vw, 2rem);
    /* Hairline highlight at top + soft shadow below = depth without weight */
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.08),
        0 8px 24px -8px rgba(0, 0, 0, 0.25);
    position: relative;
    z-index: 2;
}
@media (prefers-color-scheme: dark) {
    .site-header {
        background: linear-gradient(135deg, #1A4E85 0%, #0A3460 100%);
        box-shadow:
            inset 0 1px 0 rgba(255, 255, 255, 0.06),
            0 8px 24px -8px rgba(0, 0, 0, 0.5);
    }
}
.site-header a { color: inherit; text-decoration: none; }
.site-header__inner {
    align-items: center;
    gap: 1.5rem;
    padding-block: 0.3rem;
}
.site-header__logo {
    margin: 0;
    display: flex;
    align-items: center;
}
.site-header__logo a {
    display: block;
    height: 100%;
}
.site-header__logo img {
    height: 100%;
    max-height: 130px;
    width: auto;
    display: block;
}
@media (max-width: 600px) {
    .site-header__logo img { max-height: 64px; }
}

/* Navigation pills */
.site-header__nav { flex-wrap: nowrap; }
.site-header__nav .wp-block-navigation__container { flex-wrap: nowrap; gap: 0.15rem; }
.site-header__nav .wp-block-navigation-item__content {
    padding: 0.5rem 1rem;
    border-radius: 999px;
    transition: background-color 0.15s ease;
    color: #fff;
    white-space: nowrap;
    font-size: 1.05rem;
}
.site-header__nav .wp-block-navigation-item__content:hover,
.site-header__nav .current-menu-item > .wp-block-navigation-item__content {
    background: rgba(0,0,0,0.25);
}

/* ---- Site footer ---------------------------------------------------- */
.site-footer {
    /* Same gradient + shadow treatment as the header for visual balance. */
    background: linear-gradient(135deg, #185FA5 0%, #0E4378 100%);
    color: #fff;
    padding-block: 1.75rem;
    margin-block-start: 3rem;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.08),
        0 -8px 24px -8px rgba(0, 0, 0, 0.25);
}
@media (prefers-color-scheme: dark) {
    .site-footer {
        background: linear-gradient(135deg, #1A4E85 0%, #0A3460 100%);
        box-shadow:
            inset 0 1px 0 rgba(255, 255, 255, 0.06),
            0 -8px 24px -8px rgba(0, 0, 0, 0.5);
    }
}
.site-footer__inner {
    text-align: center;
}
.site-footer__copy {
    font-size: 0.9375rem;
    margin: 0 0 0.4rem;
}
.site-footer__links {
    font-size: 0.875rem;
    margin: 0;
    opacity: 0.9;
}
.site-footer__links a {
    color: #fff;
    text-decoration: none;
}
.site-footer__links a:hover {
    text-decoration: underline;
}

/* ---- Front page grid ------------------------------------------------ */
.site-main { padding-block: 1.5rem; }

.front-grid {
    gap: 1.5rem;
    align-items: flex-start;
}
.front-main    { flex: 1 1 600px; min-width: 0; }
.front-sidebar { flex: 0 1 320px; min-width: 0; }
@media (max-width: 800px) {
    .front-sidebar { flex: 1 1 100%; }
}

/* Card base */
.hero-card, .article-card, .sidebar-card {
    background: var(--wp--preset--color--surface);
    border: 1px solid var(--wp--preset--color--border);
    border-radius: 10px;
    overflow: hidden;
}

/* Hero card */
.hero-card { margin-block-end: 1.5rem; }
.hero-card__link { display: block; color: inherit; text-decoration: none; }
.hero-card__media { position: relative; aspect-ratio: 16 / 9; overflow: hidden; }
.hero-card__image { width: 100%; height: 100%; object-fit: cover; display: block; }
.is-placeholder { background: linear-gradient(135deg, #2a323b, #3a4452); }
.hero-card__badge {
    position: absolute;
    bottom: 0.75rem;
    left: 0.75rem;
    background: var(--wp--preset--color--primary);
    color: #fff;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-size: 0.8125rem;
    font-weight: 500;
}
.hero-card__body { padding: 1rem 1.25rem 1.25rem; }
.hero-card__meta {
    color: var(--wp--preset--color--foreground-muted);
    font-size: 0.875rem;
    margin-block-end: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}
.hero-card__sep { opacity: 0.5; }
.hero-card__tag {
    background: var(--wp--preset--color--primary);
    color: #fff;
    padding: 0.1rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8125rem;
}
.hero-card__title { font-size: 1.5rem; margin: 0 0 0.5rem; line-height: 1.25; }
.hero-card__excerpt {
    color: var(--wp--preset--color--foreground-muted);
    margin: 0;
    line-height: 1.5;
}

/* Grid heading */
.grid-heading {
    font-size: 0.875rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin-block: 1.5rem 1rem;
    color: var(--wp--preset--color--foreground-muted);
}

/* Article cards (2-col) */
.article-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}
@media (max-width: 500px) { .article-grid { grid-template-columns: 1fr; } }

.article-card__link { display: block; color: inherit; text-decoration: none; }
.article-card__media { aspect-ratio: 16 / 9; overflow: hidden; }
.article-card__image { width: 100%; height: 100%; object-fit: cover; display: block; }
.article-card__body { padding: 0.75rem 1rem 1rem; }
.article-card__date {
    display: block;
    color: var(--wp--preset--color--foreground-muted);
    font-size: 0.8125rem;
    margin-block-end: 0.25rem;
}
.article-card__title { font-size: 1rem; margin: 0; line-height: 1.35; }

/* Sidebar cards */
.sidebar-card { padding: 1rem 1.25rem; margin-block-end: 1rem; }
.sidebar-card__heading {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    color: var(--wp--preset--color--foreground-muted);
    margin: 0 0 0.75rem;
    text-transform: uppercase;
}
.sidebar-card__list { list-style: none; padding: 0; margin: 0; }
.sidebar-card__item {
    border-bottom: 1px solid var(--wp--preset--color--border);
    padding-block: 0.6rem;
}
.sidebar-card__item:last-child { border-bottom: none; }
.sidebar-card__link {
    color: inherit;
    text-decoration: none;
    display: block;
}
.sidebar-card__title { display: block; line-height: 1.3; }
.sidebar-card__date {
    display: block;
    font-size: 0.8125rem;
    color: var(--wp--preset--color--foreground-muted);
    margin-top: 0.15rem;
}
.sidebar-card__link:hover .sidebar-card__title { color: var(--wp--preset--color--primary); }

/* Forum list */
.sidebar-card__forum-list { list-style: none; padding: 0; margin: 0; }
.sidebar-card__forum-list li { padding-block: 0.4rem; }
.sidebar-card__forum-list li::before { content: "💬"; margin-right: 0.4rem; opacity: 0.6; }
.sidebar-card__forum-list a { color: inherit; text-decoration: none; }
.sidebar-card__forum-list a:hover { color: var(--wp--preset--color--primary); }

/* Ad placeholder */
.sidebar-card--ad {
    text-align: center;
    min-height: 300px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    border-style: dashed;
}
.sidebar-card__ad-label {
    font-size: 0.75rem;
    color: var(--wp--preset--color--foreground-muted);
    letter-spacing: 0.15em;
    margin: 0 0 1rem;
}

/* ---- Side-rail ads (desktop only) ----------------------------------- */
/*
 * Threshold derivation:
 *   content wideSize (1320) + 2 * rail (240) + 2 * gap (20) = 1840px
 *   below 1840px viewport: rails hide, content centers as normal
 */
.page-rail {
    position: fixed;
    top: 80px;
    width: 240px;
    height: 600px;
    background: var(--wp--preset--color--surface);
    border: 1px dashed var(--wp--preset--color--border);
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    z-index: 1;
}
/* Rails hug content edge with a 20px gap.
 * 680px = half of wideSize (660) + gap (20).
 * The right edge of the left rail sits 680px left of viewport center;
 * with a 240px width, its left edge is 920px left of viewport center,
 * so the rails appear/disappear in lockstep with the content frame. */
.page-rail--left  { right: calc(50% + 680px); }
.page-rail--right { left:  calc(50% + 680px); }

.page-rail__label {
    font-size: 0.75rem;
    letter-spacing: 0.15em;
    color: var(--wp--preset--color--foreground-muted);
    margin: 0 0 0.5rem;
}
.page-rail__slot {
    color: var(--wp--preset--color--foreground-muted);
    font-size: 0.875rem;
}

@media (max-width: 1879px) {
    .page-rail { display: none; }
}

/* ---- Mobile navigation overlay -------------------------------------- */
/* When the hamburger opens the full-screen overlay, override WP defaults:
 *  - background follows our theme (instead of white)
 *  - items stack centered (the desktop "justifyContent:right" leaks in)
 *  - text uses our foreground color
 * Using !important is the pragmatic call — WP applies inline styles that
 * would otherwise win the cascade. */
.wp-block-navigation__responsive-container.is-menu-open {
    /* Light mode default; dark mode override below.
     * Backdrop blur gives a frosted-glass effect over the page beneath. */
    background-color: rgba(250, 251, 252, 0.88) !important;
    color: var(--wp--preset--color--foreground) !important;
    padding: 4rem 1.5rem 2rem;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}
@media (prefers-color-scheme: dark) {
    .wp-block-navigation__responsive-container.is-menu-open {
        background-color: rgba(14, 20, 25, 0.85) !important;
    }
}
.wp-block-navigation__responsive-container.is-menu-open
    .wp-block-navigation__responsive-container-content {
    align-items: center;
    justify-content: flex-start;
}
.wp-block-navigation__responsive-container.is-menu-open
    .wp-block-navigation__container {
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 0.5rem;
}
.wp-block-navigation__responsive-container.is-menu-open
    .wp-block-navigation-item__content {
    color: var(--wp--preset--color--foreground) !important;
    font-size: 1.5rem;
    padding: 0.6rem 1rem;
    border-radius: 6px;
    background: transparent !important;
}
.wp-block-navigation__responsive-container.is-menu-open
    .wp-block-navigation-item__content:hover {
    background: var(--wp--preset--color--surface) !important;
}

/* Hamburger trigger: white on the blue header */
.site-header .wp-block-navigation__responsive-container-open {
    color: #fff;
}
/* Close X inside the overlay: theme foreground */
.wp-block-navigation__responsive-container-close {
    color: var(--wp--preset--color--foreground) !important;
}

/* ---- Score card ----------------------------------------------------- */
.score-card {
    background: var(--wp--preset--color--surface);
    border: 1px solid var(--wp--preset--color--border);
    border-radius: 12px;
    padding: 1.5rem;
    margin-block: 2rem;
}

.score-card__header {
    display: flex;
    gap: 1.5rem;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    margin-block-end: 1.5rem;
    padding-block-end: 1.25rem;
    border-block-end: 1px solid var(--wp--preset--color--border);
}
.score-card__title {
    margin: 0;
    font-size: 1.25rem;
    line-height: 1.3;
    flex: 1 1 auto;
    min-width: 0;
}
.score-card .score-card__title { font-size: 1.25rem; }
.score-card h1.score-card__title { font-size: 1.75rem; }

.score-card__score {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex-shrink: 0;
    padding: 0.5rem 1.25rem;
    border-radius: 10px;
    border: 1px solid var(--wp--preset--color--border);
    min-width: 100px;
}
.score-card__score-number {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1;
}
.score-card__score-max {
    font-size: 0.75rem;
    color: var(--wp--preset--color--foreground-muted);
    margin-block-start: 0.15rem;
}
.score-card__score-tier {
    margin-block-start: 0.4rem;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

/* Tier coloring — applied to the score badge */
.tier-excellent .score-card__score {
    background: rgba(34, 139, 70, 0.12);
    border-color: rgba(34, 139, 70, 0.4);
    color: #2a9d4f;
}
.tier-very-good .score-card__score {
    background: rgba(80, 160, 90, 0.10);
    border-color: rgba(80, 160, 90, 0.35);
    color: #5fa564;
}
.tier-good .score-card__score {
    background: rgba(200, 160, 50, 0.10);
    border-color: rgba(200, 160, 50, 0.35);
    color: #b88a2e;
}
.tier-solid .score-card__score {
    background: rgba(220, 140, 50, 0.10);
    border-color: rgba(220, 140, 50, 0.35);
    color: #c97b2a;
}
.tier-average .score-card__score {
    background: rgba(200, 90, 50, 0.10);
    border-color: rgba(200, 90, 50, 0.35);
    color: #c75c33;
}
.tier-poor .score-card__score {
    background: rgba(180, 50, 50, 0.10);
    border-color: rgba(180, 50, 50, 0.4);
    color: #c44343;
}

.score-card__columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}
@media (max-width: 600px) {
    .score-card__columns { grid-template-columns: 1fr; }
}
.score-card__col-heading {
    font-size: 0.875rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin: 0 0 0.5rem;
    padding-inline-start: 0.6rem;
    border-inline-start: 3px solid var(--wp--preset--color--border);
}
.score-card__col--plus  .score-card__col-heading { border-color: #2a9d4f; color: #2a9d4f; }
.score-card__col--minus .score-card__col-heading { border-color: #c44343; color: #c44343; }
.score-card__col-body {
    line-height: 1.55;
    color: var(--wp--preset--color--foreground);
}

.score-card__footer {
    margin-block-start: 1.25rem;
    padding-block-start: 1rem;
    border-block-start: 1px solid var(--wp--preset--color--border);
    font-size: 0.875rem;
    color: var(--wp--preset--color--foreground-muted);
}
.score-card__ustupio-label { margin-inline-end: 0.4rem; }
.score-card__ustupio-link  { color: var(--wp--preset--color--primary); text-decoration: none; }
.score-card__ustupio-link:hover { text-decoration: underline; }

.score-card__parent-link {
    margin-block-start: 1.25rem;
    font-size: 0.95rem;
}
.score-card__parent-link a { color: var(--wp--preset--color--primary); text-decoration: none; }
.score-card__parent-link a:hover { text-decoration: underline; }

/* Multiple score cards (roundup case): tighter gap */
.clanak-scores .score-card + .score-card { margin-block-start: 1rem; }

/* Single-ocjena layout */
.single-ocjena-wrap { gap: 1.5rem; align-items: flex-start; }
.single-ocjena-main { flex: 1 1 600px; min-width: 0; }

/* ---- Single clanak -------------------------------------------------- */
.single-clanak-wrap { gap: 1.5rem; align-items: flex-start; }
.single-clanak-main { flex: 1 1 600px; min-width: 0; }

.clanak {
    background: var(--wp--preset--color--surface);
    border: 1px solid var(--wp--preset--color--border);
    border-radius: 12px;
    padding: 1.75rem clamp(1rem, 3vw, 2rem);
    margin-block-end: 2rem;
}

.clanak__header { margin-block-end: 1.5rem; }
.clanak__title {
    font-size: clamp(1.5rem, 2.5vw, 2rem);
    line-height: 1.2;
    margin: 0 0 0.75rem;
}
.clanak__meta {
    color: var(--wp--preset--color--foreground-muted);
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}
.clanak__sep { opacity: 0.5; }
.clanak__byline a { color: inherit; text-decoration: none; }
.clanak__byline a:hover { color: var(--wp--preset--color--primary); }

.clanak__featured {
    margin: 0 0 1.5rem;
    border-radius: 10px;
    overflow: hidden;
}
.clanak__featured img {
    width: 100%;
    height: auto;
    display: block;
}

/* Article body typography */
.clanak__content {
    line-height: 1.65;
    font-size: 1.0625rem;
}
.clanak__content > * + * { margin-block-start: 1.1em; }
.clanak__content h2 { font-size: 1.5rem; margin-block-start: 2rem; }
.clanak__content h3 { font-size: 1.25rem; margin-block-start: 1.5rem; }
.clanak__content img { max-width: 100%; height: auto; border-radius: 8px; }
.clanak__content figure { margin: 1.5rem 0; }
.clanak__content figcaption {
    font-size: 0.875rem;
    color: var(--wp--preset--color--foreground-muted);
    margin-block-start: 0.5rem;
    text-align: center;
}
.clanak__content blockquote {
    border-inline-start: 3px solid var(--wp--preset--color--primary);
    padding-inline-start: 1rem;
    margin-inline: 0;
    color: var(--wp--preset--color--foreground-muted);
    font-style: italic;
}
.clanak__content table {
    width: 100%;
    border-collapse: collapse;
    margin-block: 1.5rem;
    font-size: 0.95rem;
}
.clanak__content th, .clanak__content td {
    padding: 0.6rem 0.8rem;
    border: 1px solid var(--wp--preset--color--border);
    text-align: start;
}
.clanak__content th { background: var(--wp--preset--color--background); }
.clanak__content a { color: var(--wp--preset--color--primary); }

/* Between-page ad slot */
.clanak__between-ad {
    margin-block-end: 1.5rem;
    padding: 1.25rem;
    border: 1px dashed var(--wp--preset--color--border);
    border-radius: 10px;
    text-align: center;
    background: var(--wp--preset--color--background);
}
.clanak__between-ad-label {
    font-size: 0.75rem;
    letter-spacing: 0.15em;
    color: var(--wp--preset--color--foreground-muted);
    margin: 0 0 0.25rem;
}
.clanak__between-ad-slot {
    color: var(--wp--preset--color--foreground-muted);
    margin: 0;
}

/* Pagination links (wp_link_pages output) */
.clanak__pagination {
    margin-block-start: 2rem;
    padding-block-start: 1.5rem;
    border-block-start: 1px solid var(--wp--preset--color--border);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}
.clanak__pagination-label {
    font-size: 0.875rem;
    color: var(--wp--preset--color--foreground-muted);
    margin-inline-end: 0.5rem;
}
.clanak__pagination a,
.clanak__pagination .clanak__pagination-num {
    display: inline-block;
    min-width: 2.25rem;
    text-align: center;
    padding: 0.4rem 0.7rem;
    border-radius: 6px;
    border: 1px solid var(--wp--preset--color--border);
    color: var(--wp--preset--color--foreground);
    text-decoration: none;
    font-size: 0.9375rem;
    line-height: 1.2;
}
.clanak__pagination a:hover {
    border-color: var(--wp--preset--color--primary);
    color: var(--wp--preset--color--primary);
}
/* Current page (wp_link_pages renders current as plain span, not <a>) */
.clanak__pagination > .clanak__pagination-num {
    background: var(--wp--preset--color--primary);
    color: #fff;
    border-color: var(--wp--preset--color--primary);
}

/* Related strip */
.clanak-related { margin-block-start: 2rem; }

/* ---- Lightbox cursor hint on clanak images -------------------------- */
.clanak__content .wp-block-image { cursor: zoom-in; }
.clanak__content .wp-block-image img { transition: opacity 0.15s ease; }
.clanak__content .wp-block-image:hover img { opacity: 0.92; }

/* ---- Migrated image-pair layout ------------------------------------- */
/* Legacy editors paired images in <p style="text-align: center;"> with
 * 2-3 <figure>s. Browser parses these as: empty <p></p> followed by sibling
 * <figure>s — flow content can't sit inside <p>. Result: all figures are
 * direct siblings in .clanak__content.
 *
 * Solution: figures default to inline-block 50% width. Adjacent figure
 * pairs share a row. Orphan figures (preceded AND followed by non-figure
 * elements like <p>) get full-width-with-natural-size via the override
 * selector below using :has() relational matching.
 *
 * Tested on Chrome 148+, Firefox 121+, Safari 15.4+. */

.clanak__content > .wp-block-image {
    display: inline-block;
    width: calc(50% - 1rem);
    vertical-align: top;
    margin: 0.5rem 0;
    /* No margin-left on the +sibling: the &nbsp; WP auto-injects between
     * figures already serves as the gap, and adding margin pushes the
     * second figure past the container's right edge causing wrap. */
}
.clanak__content > .wp-block-image img {
    width: 100%;
    height: auto;
}

/* Orphan figures: not followed by another figure AND not preceded by one.
 * These get reset to natural size and centered.
 * The selector reads: a .wp-block-image whose previous element is not a
 * .wp-block-image AND whose next element is not a .wp-block-image. */
.clanak__content > .wp-block-image:not(:has(+ .wp-block-image)):not(.wp-block-image + .wp-block-image *) {
    /* CSS can't express "previous sibling is not X" directly without :has()
     * with sibling selectors. Instead: every figure starts paired (above),
     * and we use the explicit "no adjacent siblings on either side" pattern
     * via a wrapping approach. */
}

/* The reliable form: use sibling combinators to identify orphans.
 * A figure is "orphan" if neither preceded nor followed by another figure.
 * "Followed by figure" = .wp-block-image:has(+ .wp-block-image)
 * "Preceded by figure" = .wp-block-image + .wp-block-image
 * Both negated means: orphan. */
.clanak__content > .wp-block-image:not(:has(+ .wp-block-image)) {
    /* Not followed by a figure. Could still be preceded (right side of pair). */
}
/* If it's not followed AND not preceded, restore natural size */
.clanak__content > p + .wp-block-image:not(:has(+ .wp-block-image)),
.clanak__content > h2 + .wp-block-image:not(:has(+ .wp-block-image)),
.clanak__content > h3 + .wp-block-image:not(:has(+ .wp-block-image)),
.clanak__content > .wp-block-image:first-child:not(:has(+ .wp-block-image)) {
    display: block;
    width: auto;
    max-width: 100%;
    margin: 1rem auto;
    text-align: center;
}
.clanak__content > p + .wp-block-image:not(:has(+ .wp-block-image)) img,
.clanak__content > h2 + .wp-block-image:not(:has(+ .wp-block-image)) img,
.clanak__content > h3 + .wp-block-image:not(:has(+ .wp-block-image)) img,
.clanak__content > .wp-block-image:first-child:not(:has(+ .wp-block-image)) img {
    width: auto;
    max-width: 100%;
    height: auto;
    margin: 0 auto;
}

/* Narrow screens: stack all figures full-width */
@media (max-width: 500px) {
    .clanak__content > .wp-block-image {
        display: block;
        width: 100%;
        margin-left: 0;
    }
    .clanak__content > .wp-block-image + .wp-block-image {
        margin-left: 0;
    }
}

/* ---- Lightbox overlay translucency ---------------------------------- */
/* WP core defaults the lightbox scrim to white@90% (light) or black@solid.
 * Match our theme: translucent + backdrop blur for the frosted-glass look. */
.wp-lightbox-overlay .scrim {
    background-color: rgba(14, 20, 25, 0.78) !important;
    opacity: 1 !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}
@media (prefers-color-scheme: light) {
    .wp-lightbox-overlay .scrim {
        background-color: rgba(250, 251, 252, 0.85) !important;
    }
}

/* ---- Archive listings ---------------------------------------------- */
.archive-wrap { gap: 1.5rem; align-items: flex-start; }
.archive-main { flex: 1 1 600px; min-width: 0; }

.archive-header {
    margin-block-end: 1.5rem;
    padding-block-end: 1rem;
    border-block-end: 1px solid var(--wp--preset--color--border);
}
.archive-heading {
    margin: 0;
    font-size: clamp(1.5rem, 2.5vw, 2rem);
    line-height: 1.2;
}
.archive-meta {
    margin: 0.5rem 0 0;
    color: var(--wp--preset--color--foreground-muted);
    font-size: 0.875rem;
}

.archive-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
}
@media (max-width: 900px) { .archive-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 500px) { .archive-grid { grid-template-columns: 1fr; } }

.archive-card {
    background: var(--wp--preset--color--surface);
    border: 1px solid var(--wp--preset--color--border);
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.15s ease, border-color 0.15s ease;
    position: relative;
}

/* Category link sits absolutely positioned over the card, above the
 * card-wide <a>. Independent click target — clicking the badge goes
 * to the category page, clicking anywhere else goes to the article. */
.archive-card__category-link {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    z-index: 2;
    padding: 0.25rem 0.6rem;
    background: rgba(0, 0, 0, 0.65);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    border-radius: 6px;
    text-decoration: none;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: background-color 0.15s ease;
}
.archive-card__category-link:hover {
    background: var(--wp--preset--color--primary);
    color: #fff;
}
/* Solid badge on text-only cards (no image to overlay). */
.archive-card--no-image .archive-card__category-link {
    background: var(--wp--preset--color--primary);
}
.archive-card--no-image .archive-card__category-link:hover {
    background: var(--wp--preset--color--foreground);
}
.archive-card:hover {
    transform: translateY(-2px);
    border-color: var(--wp--preset--color--primary);
}
.archive-card__link {
    color: inherit;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    height: 100%;
}
.archive-card__media {
    aspect-ratio: 16 / 9;
    overflow: hidden;
}
.archive-card__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.archive-card__body {
    padding: 0.85rem 1rem 1rem;
    flex: 1;
}
.archive-card__date {
    display: block;
    color: var(--wp--preset--color--foreground-muted);
    font-size: 0.8125rem;
    margin-block-end: 0.25rem;
}
.archive-card__title {
    font-size: 1rem;
    margin: 0 0 0.5rem;
    line-height: 1.3;
}
.archive-card__excerpt {
    margin: 0;
    color: var(--wp--preset--color--foreground-muted);
    font-size: 0.875rem;
    line-height: 1.45;
}

/* Pagination */
.archive-pagination {
    margin-block-start: 2rem;
    padding-block-start: 1.5rem;
    border-block-start: 1px solid var(--wp--preset--color--border);
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
    justify-content: center;
}
.archive-pagination .page-numbers,
.archive-pagination .page-numbers.current {
    display: inline-block;
    min-width: 2.25rem;
    text-align: center;
    padding: 0.4rem 0.7rem;
    border-radius: 6px;
    border: 1px solid var(--wp--preset--color--border);
    color: var(--wp--preset--color--foreground);
    text-decoration: none;
    font-size: 0.9375rem;
}
.archive-pagination a.page-numbers:hover {
    border-color: var(--wp--preset--color--primary);
    color: var(--wp--preset--color--primary);
}
.archive-pagination .page-numbers.current {
    background: var(--wp--preset--color--primary);
    color: #fff;
    border-color: var(--wp--preset--color--primary);
}
.archive-pagination .page-numbers.dots { border: none; }

.archive-empty {
    padding: 2rem;
    text-align: center;
    color: var(--wp--preset--color--foreground-muted);
}

/* ---- Archive listings ---------------------------------------------- */
.archive-wrap { gap: 1.5rem; align-items: flex-start; }
.archive-main { flex: 1 1 600px; min-width: 0; }

.archive-header {
    margin-block-end: 1.5rem;
    padding-block-end: 1rem;
    border-block-end: 1px solid var(--wp--preset--color--border);
}
.archive-heading {
    margin: 0;
    font-size: clamp(1.5rem, 2.5vw, 2rem);
    line-height: 1.2;
}
.archive-meta {
    margin: 0.5rem 0 0;
    color: var(--wp--preset--color--foreground-muted);
    font-size: 0.875rem;
}

.archive-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
}
@media (max-width: 900px) { .archive-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 500px) { .archive-grid { grid-template-columns: 1fr; } }

.archive-card--no-image .archive-card__body {
    padding: 1.25rem 1.25rem 1.5rem;
}
.archive-card--no-image .archive-card__title {
    font-size: 1.0625rem;
    margin-block-end: 0.6rem;
}
.archive-card--no-image .archive-card__excerpt {
    font-size: 0.9375rem;
    -webkit-line-clamp: 4;
    line-clamp: 4;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ---- Single novost -------------------------------------------------- */
.single-novost-wrap { gap: 1.5rem; align-items: flex-start; }
.single-novost-main { flex: 1 1 600px; min-width: 0; }

.novost {
    background: var(--wp--preset--color--surface);
    border: 1px solid var(--wp--preset--color--border);
    border-radius: 12px;
    padding: 1.75rem clamp(1rem, 3vw, 2rem);
    margin-block-end: 2rem;
}
.novost__header { margin-block-end: 1.5rem; }
.novost__title { font-size: clamp(1.5rem, 2.5vw, 2rem); line-height: 1.2; margin: 0 0 0.75rem; }
.novost__meta {
    color: var(--wp--preset--color--foreground-muted);
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}
.novost__sep { opacity: 0.5; }
.novost__byline a { color: inherit; text-decoration: none; }
.novost__byline a:hover { color: var(--wp--preset--color--primary); }

.novost__featured { margin: 0 0 1.5rem; border-radius: 10px; overflow: hidden; }
.novost__featured img { width: 100%; height: auto; display: block; }

.novost__content { line-height: 1.65; font-size: 1.0625rem; }
.novost__content > * + * { margin-block-start: 1.1em; }
.novost__content img { max-width: 100%; height: auto; border-radius: 8px; }
.novost__content a { color: var(--wp--preset--color--primary); }

.novost__source {
    margin-block-start: 1.5rem;
    padding-block-start: 1rem;
    border-block-start: 1px solid var(--wp--preset--color--border);
    color: var(--wp--preset--color--foreground-muted);
    font-size: 0.9375rem;
}
.novost__source-label { margin-inline-end: 0.4rem; }
.novost__source a { color: var(--wp--preset--color--primary); text-decoration: none; }
.novost__source a:hover { text-decoration: underline; }

.novost-related { margin-block-start: 2rem; }

/* ---- 404 page ------------------------------------------------------- */
.error-404 {
    text-align: center;
    padding: 3rem 1rem;
    max-width: 600px;
    margin: 0 auto;
}
.error-404__code {
    font-size: clamp(4rem, 12vw, 8rem);
    line-height: 1;
    margin: 0;
    color: var(--wp--preset--color--primary);
    font-weight: 700;
}
.error-404__title {
    font-size: 1.5rem;
    margin: 0.5rem 0 1rem;
}
.error-404__text {
    color: var(--wp--preset--color--foreground-muted);
    margin-block-end: 2rem;
}
.error-404__search { margin-block-end: 2rem; }
.error-404__links {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}
.error-404__links p { margin: 0; }
.error-404__links a {
    color: var(--wp--preset--color--primary);
    text-decoration: none;
}

/* ---- Search form ---------------------------------------------------- */
.search-form {
    margin-block-start: 1rem;
    display: flex;
    gap: 0.5rem;
    max-width: 500px;
}
.search-form input[type="search"] {
    flex: 1;
    padding: 0.6rem 0.85rem;
    border: 1px solid var(--wp--preset--color--border);
    border-radius: 6px;
    background: var(--wp--preset--color--background);
    color: var(--wp--preset--color--foreground);
    font-size: 0.9375rem;
}
.search-form input[type="search"]:focus {
    outline: none;
    border-color: var(--wp--preset--color--primary);
}
.search-form button {
    padding: 0.6rem 1.25rem;
    border: none;
    border-radius: 6px;
    background: var(--wp--preset--color--primary);
    color: #fff;
    cursor: pointer;
    font-size: 0.9375rem;
}
.search-form button:hover { opacity: 0.92; }

.search-type {
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-size: 0.6875rem;
    color: var(--wp--preset--color--primary);
    font-weight: 600;
}

/* ---- Social icons in header ----------------------------------------- */
.site-header__social {
    display: flex;
    list-style: none;
    padding: 0;
    margin: 0 0 0 0.5rem;
    gap: 0.25rem;
}
.site-header__social a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 8px;
    color: #fff;
    transition: background-color 0.15s ease, color 0.15s ease;
}
.site-header__social a:hover {
    background: rgba(0,0,0,0.25);
}
.site-header__social svg { display: block; width: 22px; height: 22px; }

/* Hide social icons when nav is in mobile overlay mode */
@media (max-width: 600px) {
    .site-header__social { display: none; }
}

/* Search form: type-filter dropdown */
.search-form__type {
    padding: 0.6rem 0.85rem;
    border: 1px solid var(--wp--preset--color--border);
    border-radius: 6px;
    background: var(--wp--preset--color--background);
    color: var(--wp--preset--color--foreground);
    font-size: 0.9375rem;
    cursor: pointer;
}
.search-form__type:focus {
    outline: none;
    border-color: var(--wp--preset--color--primary);
}
@media (max-width: 500px) {
    .search-form { flex-wrap: wrap; }
    .search-form input[type="search"] { width: 100%; }
}

/* 404 page: center the search form (flex defaults to left) */
.error-404__search {
    margin-inline: auto;
    margin-block-end: 2rem;
    justify-content: center;
    max-width: 500px;
}

/* ---- Single page (O nama, Kontakt, etc.) --------------------------- */
.single-page-wrap { gap: 1.5rem; align-items: flex-start; }
.single-page-main { flex: 1 1 600px; min-width: 0; }

.page-content {
    background: var(--wp--preset--color--surface);
    border: 1px solid var(--wp--preset--color--border);
    border-radius: 12px;
    padding: 1.75rem clamp(1rem, 3vw, 2rem);
    margin-block-end: 2rem;
}
.page-content__title {
    font-size: clamp(1.5rem, 2.5vw, 2rem);
    line-height: 1.2;
    margin: 0 0 1.5rem;
    padding-block-end: 1rem;
    border-block-end: 1px solid var(--wp--preset--color--border);
}
.page-content .wp-block-post-content {
    line-height: 1.65;
    font-size: 1.0625rem;
}
.page-content .wp-block-post-content > * + * { margin-block-start: 1.1em; }
.page-content .wp-block-post-content h2 { font-size: 1.5rem; margin-block-start: 2rem; }
.page-content .wp-block-post-content h3 { font-size: 1.25rem; margin-block-start: 1.5rem; }
.page-content .wp-block-post-content img { max-width: 100%; height: auto; border-radius: 8px; }
.page-content .wp-block-post-content a { color: var(--wp--preset--color--primary); }

/* ---- Category display ---------------------------------------------- */
.clanak__category,
.archive-card__category {
    color: var(--wp--preset--color--primary);
    text-decoration: none;
    font-weight: 600;
}
.clanak__category:hover,
.archive-card__category:hover {
    text-decoration: underline;
}
.archive-card__category {
    font-weight: 600;
}

.archive-kicker {
    font-size: 0.75rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--wp--preset--color--foreground-muted);
    margin: 0 0 0.25rem;
}

/* ---- Top hardware page --------------------------------------------- */
.top-hardware {
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
}

.top-hardware__year {
    border-block-start: 1px solid var(--wp--preset--color--border);
    padding-block-start: 1.5rem;
}
.top-hardware__year:first-child { border-block-start: none; padding-block-start: 0; }

.top-hardware__year-heading {
    font-size: clamp(1.5rem, 2.5vw, 2rem);
    margin: 0 0 1.25rem;
    color: var(--wp--preset--color--primary);
    letter-spacing: -0.02em;
}

.top-hardware__list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.top-hardware__item {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 1.25rem;
    padding: 0.85rem 1.25rem;
    background: var(--wp--preset--color--surface);
    border: 1px solid var(--wp--preset--color--border);
    border-radius: 10px;
    transition: border-color 0.15s ease, transform 0.15s ease;
}
.top-hardware__item:hover {
    border-color: var(--wp--preset--color--primary);
    transform: translateX(2px);
}

/* Score badge — reuse the tier colors from score-card */
.top-hardware__score {
    display: flex;
    align-items: baseline;
    gap: 0.1rem;
    min-width: 4.5rem;
    padding: 0.5rem 0.85rem;
    border-radius: 8px;
    font-weight: 700;
    font-size: 1.25rem;
    line-height: 1;
    border: 1px solid var(--wp--preset--color--border);
    justify-content: center;
}
.top-hardware__score-pct { font-size: 0.875rem; opacity: 0.7; }

.tier-excellent .top-hardware__score {
    background: rgba(34, 139, 70, 0.12);
    border-color: rgba(34, 139, 70, 0.4);
    color: #2a9d4f;
}
.tier-very-good .top-hardware__score {
    background: rgba(80, 160, 90, 0.10);
    border-color: rgba(80, 160, 90, 0.35);
    color: #5fa564;
}
.tier-good .top-hardware__score {
    background: rgba(200, 160, 50, 0.10);
    border-color: rgba(200, 160, 50, 0.35);
    color: #b88a2e;
}
.tier-solid .top-hardware__score {
    background: rgba(220, 140, 50, 0.10);
    border-color: rgba(220, 140, 50, 0.35);
    color: #c97b2a;
}

.top-hardware__main {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}
.top-hardware__title {
    color: var(--wp--preset--color--foreground);
    text-decoration: none;
    font-weight: 600;
    font-size: 1.0625rem;
    line-height: 1.3;
}
.top-hardware__title:hover { color: var(--wp--preset--color--primary); }
.top-hardware__category {
    color: var(--wp--preset--color--foreground-muted);
    text-decoration: none;
    font-size: 0.8125rem;
}
.top-hardware__category:hover { color: var(--wp--preset--color--primary); }

@media (max-width: 500px) {
    .top-hardware__item {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
    .top-hardware__score {
        align-self: flex-start;
        min-width: 0;
    }
}

/* ---- Submenu styles (Recenzije dropdown) ---------------------------
 * Using gradient match to header for visual continuity, and !important
 * on color/background because WP injects per-block inline styles that
 * otherwise win the cascade. */
.wp-block-navigation__submenu-container {
    background: linear-gradient(135deg, #185FA5 0%, #0E4378 100%) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    border-radius: 8px !important;
    padding: 0.4rem !important;
    min-width: 200px !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35) !important;
}
@media (prefers-color-scheme: dark) {
    .wp-block-navigation__submenu-container {
        background: linear-gradient(135deg, #1A4E85 0%, #0A3460 100%) !important;
    }
}
.wp-block-navigation__submenu-container .wp-block-navigation-item__content {
    color: #fff !important;
    padding: 0.5rem 0.85rem !important;
    border-radius: 6px !important;
    background: transparent !important;
}
.wp-block-navigation__submenu-container .wp-block-navigation-item__content:hover {
    background: rgba(0, 0, 0, 0.25) !important;
}

/* ===== Category overview (/clanci/kategorije/) ===== */
.cat-overview {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-block-start: 2rem;
}
.cat-overview__card {
    background: var(--wp--preset--color--surface);
    border: 1px solid var(--wp--preset--color--border);
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
    position: relative;
}
.cat-overview__card:hover {
    transform: translateY(-2px);
    border-color: var(--wp--preset--color--primary);
    box-shadow: 0 6px 20px rgba(14, 67, 120, 0.10);
}

/* Category badge — overlay pill, top-right, matches archive-card language */
a.cat-overview__cat-link,
a.cat-overview__cat-link:visited,
a.cat-overview__cat-link:hover,
a.cat-overview__cat-link:focus {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    z-index: 2;
    display: inline-flex;
    align-items: baseline;
    gap: 0.45rem;
    padding: 0.4rem 0.85rem;
    background: var(--wp--preset--color--primary);
    color: #ffffff !important;
    text-decoration: none !important;
    border-radius: 999px;
    font-size: 0.82rem;
    line-height: 1.2;
    box-shadow: 0 2px 8px rgba(14, 67, 120, 0.28);
    transition: filter 0.15s ease, transform 0.15s ease;
}
a.cat-overview__cat-link:hover,
a.cat-overview__cat-link:focus {
    filter: brightness(1.12);
    transform: translateY(-1px);
}
.cat-overview__cat-link .cat-overview__cat-name {
    font-weight: 600;
    color: #ffffff !important;
}
.cat-overview__cat-link .cat-overview__cat-count {
    font-weight: 400;
    opacity: 0.92;
    font-size: 0.92em;
    color: #ffffff !important;
}

.cat-overview__clanak-link {
    display: flex;
    flex-direction: column;
    color: inherit;
    text-decoration: none;
    flex: 1;
}
.cat-overview__thumb {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    display: block;
    background: var(--wp--preset--color--border);
}
.cat-overview__thumb--empty {
    background: repeating-linear-gradient(135deg,
        var(--wp--preset--color--border) 0 14px,
        var(--wp--preset--color--background) 14px 28px);
}
.cat-overview__clanak-title {
    padding: 0.95rem 1.1rem 1.1rem;
    font-size: 1.02rem;
    line-height: 1.4;
    font-weight: 500;
    margin: 0;
    color: var(--wp--preset--color--foreground);
}
.cat-overview__clanak-link:hover .cat-overview__clanak-title {
    color: var(--wp--preset--color--primary);
}
@media (max-width: 800px) {
    .cat-overview { grid-template-columns: 1fr; gap: 1rem; }
}
