/* ==========================================================================
   Archive Udalosti — Design System v1.0
   Namespace: .zsmh-archive-page
   CSS custom properties from css/fonts.css
   ========================================================================== */


/* --- DIVI OVERRIDES ---
   Divi sets padding, sidebar, content-area styles that conflict.
   These overrides match specificity of Divi's selectors. */

body:not(.et-tb) .zsmh-archive-page#main-content .container,
body:not(.et-tb-has-header) .zsmh-archive-page#main-content .container {
    padding-top: 0;
    width: 100%;
    max-width: 100%;
}

.zsmh-archive-page #left-area {
    width: 100% !important;
    padding: 0 !important;
    float: none !important;
}

.zsmh-archive-page #sidebar {
    display: none !important;
}

.zsmh-archive-page #content-area::before {
    display: none !important;
    background: none !important;
}


/* --- LAYOUT CONTAINERS --- */

.zsmh-archive-header-wrap,
.zsmh-archive-infobar-inner,
.zsmh-archive-content-wrap {
    width: 80%;
    max-width: 1080px;
    margin: 0 auto;
}

.zsmh-archive-header-wrap {
    padding-top: 40px;
    padding-bottom: 16px;
}


/* --- HEADER --- */

.zsmh-archive-title {
    font-family: var(--font-heading);
    font-size: 2.1rem;
    font-weight: 700;
    color: #222;
    line-height: 1.25;
    margin: 0;
}


/* --- INFO BAR --- */

.zsmh-archive-infobar {
    background-color: #fdf2e1;
    padding: 10px 0;
    margin-bottom: 20px;
    border-top: 3px solid #f19e00;
}

.zsmh-archive-infobar-inner {
    font-family: var(--font-body);
    font-size: 0.92rem;
    color: #555;
    line-height: 1.5;
}


/* --- GRID CONTAINER --- */

.zsmh-archive-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    padding: 20px 0;
    margin: 0 auto;
    width: 80%;
    max-width: 1080px;
    margin-bottom: 48px;
    box-sizing: border-box;
}


/* --- CARD --- */

.zsmh-card {
    background: #fff;
    border-radius: 10px;
    border: 1px solid #eee;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
}

.zsmh-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
    border-color: #f19e00;
}

/* Highlight Important Posts */
.zsmh-card.highlight {
    border: 2px solid #f19e00;
    background: #fffbf5;
}

.zsmh-card.highlight .zsmh-date-badge i {
    color: #fff;
}


/* --- CARD IMAGE --- */

.zsmh-card-image {
    aspect-ratio: 16/10;
    overflow: hidden;
    position: relative;
    background-color: #f5f5f5;
}

.zsmh-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.zsmh-card:hover .zsmh-card-image img {
    transform: scale(1.05);
}

.zsmh-card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    transition: background 0.2s;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.15) 0%, transparent 40%);
    pointer-events: none;
}


/* --- DATE BADGE (Overlay) --- */

.zsmh-date-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    padding: 5px 10px;
    border-radius: 6px;
    font-family: var(--font-heading);
    font-size: 0.7rem;
    font-weight: 700;
    color: #333;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 5px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    pointer-events: none;
}

.zsmh-date-badge i {
    color: #f19e00;
    font-size: 0.75rem;
}

/* Highlight/Important cards — use orange badge */
.zsmh-card.highlight .zsmh-date-badge {
    background: rgba(241, 158, 0, 0.92);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: #fff;
}

/* --- MEDIA BADGES (bottom-right on card image) --- */
.zsmh-media-badges {
    position: absolute;
    bottom: 10px;
    right: 10px;
    display: flex;
    gap: 5px;
    z-index: 10;
    pointer-events: none;
}

.zsmh-media-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 4px;
    font-family: var(--font-heading);
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.3px;
    white-space: nowrap;
    line-height: 1;
}

.zsmh-media-badge svg {
    flex-shrink: 0;
}

.zsmh-media-video {
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    color: #fff;
}

.zsmh-media-gallery {
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    color: #555;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
}

.zsmh-media-attach {
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    color: #555;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
}


/* --- CARD CONTENT --- */

.zsmh-card-content {
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}


/* --- CARD TITLE --- */

.zsmh-card-title {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 10px;
    line-height: 1.35;
    color: #222;
}

.zsmh-card-title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s;
}

.zsmh-card-title a:hover {
    color: #f19e00;
}


/* --- CARD EXCERPT --- */

.zsmh-card-excerpt {
    font-family: var(--font-body);
    font-size: 0.9rem;
    color: #777;
    line-height: 1.6;
    margin-bottom: 16px;
    flex-grow: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}


/* --- CARD TAGS --- */

.zsmh-card-tags {
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid #eee;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}


/* --- TAG PILL --- */

.zsmh-tag {
    font-family: var(--font-heading);
    font-size: 0.72rem;
    padding: 4px 12px;
    background: #f5f5f5;
    color: #555;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 700;
    transition: all 0.2s;
    border: 1px solid #e8e8e8;
}

.zsmh-tag:hover {
    background: #fff;
    color: #f19e00;
    border-color: #f19e00;
}

.zsmh-tag i {
    margin-right: 4px;
    font-size: 0.65rem;
    opacity: 0.7;
}


/* =========================================================================
   HERO + FILTER SECTION — unified warm background
   ========================================================================= */

.zsmh-archive-hero {
    background: linear-gradient(160deg, #fefcf8 0%, #fef9ef 40%, #fdf4e2 100%);
    padding: 28px 0 16px;
    border-bottom: 3px solid #f19e00;
}

.zsmh-archive-hero-inner {
    width: 80%;
    max-width: 1080px;
    margin: 0 auto;
}

.zsmh-archive-hero .zsmh-archive-title {
    margin: 0 0 4px;
}

.zsmh-archive-hero-sub {
    font-family: var(--font-body);
    font-size: 0.88rem;
    color: #999;
    line-height: 1.5;
    margin: 0 0 16px;
}

.zsmh-archive-hero-sub strong {
    color: #f19e00;
    font-weight: 700;
}

/* --- Kategória pills (inline row) --- */
.zsmh-ql-row {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.zsmh-ql-pill {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 4px 12px;
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid rgba(190, 145, 50, 0.28);
    border-radius: 50px;
    font-family: var(--font-heading);
    font-size: 0.76rem;
    font-weight: 700;
    color: #777;
    box-shadow: 0 1px 3px rgba(180, 140, 50, 0.07);
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    white-space: nowrap;
}

.zsmh-ql-pill:hover {
    background: #fff;
    color: #f19e00;
    border-color: #f19e00;
}

.zsmh-ql-pill.active {
    background: #f19e00;
    border-color: #f19e00;
    color: #fff;
}

/* --- Filter row (zaradenie + rok) --- */
.zsmh-filter-row {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.zsmh-filter-label {
    font-family: var(--font-heading);
    font-size: 0.65rem;
    font-weight: 700;
    color: #c5a060;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-right: 2px;
}

.zsmh-zaradenie-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 12px;
    background: rgba(255, 255, 255, 0.75);
    border: 1px solid rgba(190, 145, 50, 0.22);
    border-radius: 50px;
    font-family: var(--font-heading);
    font-size: 0.76rem;
    font-weight: 700;
    color: #999;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    box-shadow: 0 1px 2px rgba(180, 140, 50, 0.05);
}

.zsmh-zaradenie-pill:hover {
    background: #fff;
    color: #f19e00;
    border-color: #f19e00;
}

.zsmh-zaradenie-pill.active {
    background: #f19e00;
    border-color: #f19e00;
    color: #fff;
}

.zsmh-zaradenie-pill.active .zsmh-pill-dot {
    background: #fff !important;
}

.zsmh-pill-dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* --- Rok selector --- */
.zsmh-rok-form {
    display: inline-flex;
    margin-left: auto;
}

.zsmh-rok-select {
    padding: 4px 10px;
    background: rgba(255, 255, 255, 0.75);
    border: 1px solid rgba(190, 145, 50, 0.22);
    border-radius: 50px;
    font-family: var(--font-heading);
    font-size: 0.76rem;
    font-weight: 700;
    color: #999;
    cursor: pointer;
    transition: all 0.2s ease;
    outline: none;
    box-shadow: 0 1px 2px rgba(180, 140, 50, 0.05);
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    padding-right: 22px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23c5a060' d='M3 5l3 3 3-3'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 7px center;
}

.zsmh-rok-select:hover,
.zsmh-rok-select:focus {
    border-color: #f19e00;
    color: #f19e00;
}


/* =========================================================================
   PAGINATION (numbered)
   ========================================================================= */

.zsmh-pagination {
    width: 80%;
    max-width: 1080px;
    margin: 0 auto;
    padding: 32px 0 48px;
}

.zsmh-pagination .page-numbers {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    list-style: none !important;
    padding: 0 !important;
    margin: 0;
}

.zsmh-pagination .page-numbers li {
    list-style: none !important;
    margin: 0;
    padding: 0;
}

.zsmh-pagination .page-numbers a,
.zsmh-pagination .page-numbers .current {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    background: #fff;
    color: #333;
    border: 1px solid #e8e8e8;
    border-radius: 50px;
    font-family: var(--font-heading);
    font-weight: 700;
    text-decoration: none;
    transition: all 0.2s;
    font-size: 0.85rem;
}

.zsmh-pagination .page-numbers a:hover {
    background: #f19e00;
    color: #fff;
    border-color: #f19e00;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(241, 158, 0, 0.15);
}

/* Active page */
.zsmh-pagination .page-numbers .current {
    background: #f19e00;
    color: #fff;
    border-color: #f19e00;
    box-shadow: 0 2px 8px rgba(241, 158, 0, 0.2);
}

/* Prev/Next arrows */
.zsmh-pagination .page-numbers .prev,
.zsmh-pagination .page-numbers .next {
    font-size: 1.1rem;
    min-width: 40px;
    padding: 0;
}

/* Dots */
.zsmh-pagination .page-numbers .dots {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    color: #999;
    font-weight: 700;
    border: none;
    background: none;
}


/* =========================================================================
   RESPONSIVE
   ========================================================================= */

/* Tablet */
@media (max-width: 1024px) {
    .zsmh-archive-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }

    .zsmh-archive-title {
        font-size: 1.6rem;
    }
}

/* Small tablet */
@media (max-width: 768px) {
    .zsmh-archive-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
        padding-left: 16px;
        padding-right: 16px;
    }

    .zsmh-archive-header-wrap,
    .zsmh-archive-infobar-inner,
    .zsmh-archive-hero-inner {
        padding-left: 16px;
        padding-right: 16px;
    }

    /* Pill rows: horizontal scroll */
    .zsmh-ql-row,
    .zsmh-filter-row {
        flex-wrap: nowrap;
        overflow-x: auto;
        -ms-overflow-style: none;
        scrollbar-width: none;
    }
    .zsmh-ql-row::-webkit-scrollbar,
    .zsmh-filter-row::-webkit-scrollbar {
        display: none;
    }
    .zsmh-ql-pill {
        flex-shrink: 0;
    }
    .zsmh-zaradenie-pill {
        flex-shrink: 0;
    }
    .zsmh-filter-label {
        flex-shrink: 0;
    }
    .zsmh-rok-form {
        flex-shrink: 0;
    }

    .zsmh-card-title {
        font-size: 1.05rem;
    }

    .zsmh-card-content {
        padding: 16px;
    }
}

/* Phone */
@media (max-width: 480px) {
    .zsmh-archive-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .zsmh-archive-title {
        font-size: 1.2rem;
    }

    .zsmh-archive-hero {
        padding: 16px 0 10px;
    }

    .zsmh-archive-hero-sub {
        font-size: 0.78rem;
    }

    .zsmh-ql-row {
        gap: 5px;
    }

    .zsmh-ql-pill {
        font-size: 0.68rem;
        padding: 3px 8px;
    }

    .zsmh-filter-row {
        gap: 5px;
    }

    .zsmh-zaradenie-pill {
        font-size: 0.68rem;
        padding: 3px 8px;
    }

    .zsmh-card-excerpt {
        -webkit-line-clamp: 2;
        line-clamp: 2;
    }

    .zsmh-pagination .page-numbers {
        gap: 4px;
    }

    .zsmh-pagination .page-numbers a,
    .zsmh-pagination .page-numbers > .current {
        min-width: 36px;
        height: 36px;
        font-size: 0.8rem;
        padding: 0 8px;
    }
}


/* =========================================================================
   BACK TO TOP BUTTON
   ========================================================================= */

.zsmh-back-to-top {
    position: fixed;
    bottom: 28px;
    right: 28px;
    width: 44px;
    height: 44px;
    background: #f19e00;
    color: #fff;
    border: none;
    border-radius: 50%;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(241, 158, 0, 0.3);
    transition: all 0.3s ease;
    opacity: 0;
    visibility: hidden;
    transform: translateY(12px);
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.zsmh-back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.zsmh-back-to-top:hover {
    background: #d88a00;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(241, 158, 0, 0.4);
}


/* =========================================================================
   CARD FADE-IN ANIMATION
   ========================================================================= */

@keyframes zsmhFadeInUp {
    from {
        opacity: 0;
        transform: translateY(18px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.zsmh-card {
    animation: zsmhFadeInUp 0.4s ease both;
}

.zsmh-archive-grid .zsmh-card:nth-child(1) { animation-delay: 0s; }
.zsmh-archive-grid .zsmh-card:nth-child(2) { animation-delay: 0.06s; }
.zsmh-archive-grid .zsmh-card:nth-child(3) { animation-delay: 0.12s; }
.zsmh-archive-grid .zsmh-card:nth-child(4) { animation-delay: 0.15s; }
.zsmh-archive-grid .zsmh-card:nth-child(5) { animation-delay: 0.18s; }
.zsmh-archive-grid .zsmh-card:nth-child(6) { animation-delay: 0.21s; }
.zsmh-archive-grid .zsmh-card:nth-child(n+7) { animation-delay: 0.24s; }


/* =========================================================================
   PRINT
   ========================================================================= */

@media print {
    .zsmh-archive-infobar,
    .zsmh-ql-row,
    .zsmh-filter-row,
    .zsmh-pagination,
    .zsmh-back-to-top {
        display: none !important;
    }

    .zsmh-archive-hero {
        background: #fff !important;
        border-bottom: 1px solid #ddd !important;
    }

    .zsmh-archive-page {
        background: #fff !important;
    }

    .zsmh-archive-grid {
        display: block !important;
    }

    .zsmh-card {
        break-inside: avoid;
        box-shadow: none !important;
        border: 1px solid #ddd !important;
        border-radius: 0 !important;
        margin-bottom: 12px;
    }

    .zsmh-card:hover {
        transform: none !important;
    }

    .zsmh-card-image {
        max-height: 150px;
    }
}
