/*
 * ArhivaVijesti — stilovi modula
 * Izgled kartica usklađen s mod_tz_vijesti.
 * Copyright (C) 2026 DROMEDAR.
 */

.arhiva-vijesti {
    --av-accent: #c41e3a;
    --av-accent-dark: #a8182f;
    --av-text: #1a1a1a;
    --av-muted: #666;
    --av-line: #e3e8ee;
    color: var(--av-text);
}

.arhiva-vijesti * {
    box-sizing: border-box;
}

/* ---- Filtar po godini ---- */
.av-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0 0 24px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--av-line);
}

.av-year {
    display: inline-block;
    padding: 5px 11px;
    border: 1px solid var(--av-line);
    border-radius: 999px;
    background: #fff;
    color: var(--av-text);
    font-size: .82rem;
    font-weight: 600;
    line-height: 1.35;
    text-decoration: none;
    transition: background .15s ease, border-color .15s ease, color .15s ease;
}

.av-year:hover,
.av-year:focus-visible {
    border-color: var(--av-accent);
    color: var(--av-accent);
}

.av-year.active {
    background: var(--av-accent);
    border-color: var(--av-accent);
    color: #fff;
    cursor: default;
}

/* ---- Mreža kartica ---- */
.av-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
}

.av-item {
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, .08);
    overflow: hidden;
    transition: transform .3s ease, box-shadow .3s ease;
}

.av-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, .12);
}

/* sličica */
.av-thumb {
    position: relative;
    display: block;
    height: 220px;
    overflow: hidden;
    background: #f0f0f0;
}

.av-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .4s ease;
}

.av-item:hover .av-thumb img {
    transform: scale(1.05);
}

.av-thumb--empty {
    background: linear-gradient(135deg, #e9eef3, #d5dee6);
}

/* datumska značka */
.av-badge {
    position: absolute;
    bottom: 15px;
    left: 15px;
    min-width: 50px;
    padding: 8px 12px;
    border-radius: 8px;
    background: var(--av-accent);
    color: #fff;
    text-align: center;
}

.av-badge-day {
    display: block;
    font-size: 24px;
    font-weight: 700;
    line-height: 1;
}

.av-badge-month {
    display: block;
    margin-top: 2px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .5px;
}

/* značka izdvojeno */
.av-featured {
    position: absolute;
    top: 15px;
    right: 15px;
    padding: 6px 12px;
    border-radius: 20px;
    background: var(--av-accent);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
}

/* tijelo kartice */
.av-body {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    padding: 20px;
}

.av-title {
    margin: 0 0 12px;
    font-size: 17px;
    font-weight: 600;
    line-height: 1.4;
    min-height: 48px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.av-title a {
    color: inherit;
    text-decoration: none;
    transition: color .3s ease;
}

.av-title a:hover {
    color: var(--av-accent);
}

.av-intro {
    margin: 0 0 12px;
    color: var(--av-muted);
    font-size: 14px;
    line-height: 1.55;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.av-more {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: auto;
    padding-top: 4px;
    font-size: 13px;
    font-weight: 600;
    color: var(--av-accent);
    text-decoration: none;
    transition: gap .3s ease, color .3s ease;
}

.av-more:hover {
    gap: 10px;
    color: var(--av-accent-dark);
}

.av-more svg {
    width: 14px;
    height: 14px;
}

.av-empty {
    margin: 0;
    padding: 36px 16px;
    text-align: center;
    color: var(--av-muted);
    font-style: italic;
}

/* ---- Postupno otkrivanje (scroll) ---- */
.av-item.av-hide {
    display: none;
}

.av-sentinel {
    display: flex;
    justify-content: center;
    padding: 24px 0 8px;
}

.av-sentinel[hidden] {
    display: none;
}

.av-spinner {
    width: 26px;
    height: 26px;
    border: 3px solid var(--av-line);
    border-top-color: var(--av-accent);
    border-radius: 50%;
    animation: av-spin .7s linear infinite;
}

@keyframes av-spin {
    to {
        transform: rotate(360deg);
    }
}

@media (prefers-reduced-motion: reduce) {
    .av-spinner {
        animation-duration: 2s;
    }
}

/* ---- Responzivno ---- */
@media (max-width: 360px) {
    .av-list {
        grid-template-columns: 1fr;
    }
}
