/* ======================================================
   BLOG CUSTOM STYLES — search, layout, mobile, lightbox
   ====================================================== */

/* --- Search form: aligned height --- */
.blog-search-form {
    display: flex;
    align-items: center;
    gap: 4px;
}

.blog-search-form label {
    margin: 0;
    display: flex;
    align-items: center;
}

.blog-search-field {
    border: 1px solid grey !important;
    border-radius: 4px 0 0 4px !important;
    height: 34px !important;
    line-height: 34px;
    padding: 0 8px;
    margin: 0 !important;
    box-sizing: border-box;
    width: 250px;
    font-size: 14px;
}

.blog-search-btn {
    height: 34px !important;
    line-height: 1 !important;
    padding: 0 14px !important;
    border-radius: 0 4px 4px 0 !important;
    margin: 0 !important;
    font-size: 14px;
    white-space: nowrap;
    display: flex;
    align-items: center;
}

/* --- Blog section wrapper --- */
.blogPreview .container {
    padding-top: 0;
    padding-bottom: 0;
    position: relative;
    z-index: 1;
    background: #fff;
}

/* --- 2-column article rows: spacing between rows --- */
.blog-articles-row {
    margin-bottom: 24px;
}

/* On pages 2+ there is no bigArticle — padding (not margin) avoids collapsing through the container */
.blogPreview .container > .blog-articles-row:first-child {
    padding-top: 32px;
}

.blog-articles-row .col-md-6 {
    margin-bottom: 0;
}

/* Vertical divider between the two columns on desktop */
@media (min-width: 768px) {
    .blog-articles-row .col-md-6:first-child {
        border-right: 1px solid #f0f0f0;
    }
}

/* --- Big (featured) article listing: title 2pt smaller, beige meta, smaller description --- */
.blogPreview .bigArticle .contentArticle .title {
    font-size: 30px !important;
}

.bigArticle .meta {
    color: #c09f69 !important;
}

.blogPreview .bigArticle .contentText p {
    font-size: 0.9rem !important;
    line-height: 1.65 !important;
}

/* --- Single article: body text matches meta size (16px), including lists --- */
.blogDetail .bigArticle .contentText p,
.blogDetail .bigArticle .contentText li,
.blogDetail .bigArticle .contentText ul,
.blogDetail .bigArticle .contentText ol {
    font-size: 16px !important;
    line-height: 1.75 !important;
}

/* --- Small articles: slightly smaller description text --- */
.smallArticle .contentText p {
    font-size: 0.82rem !important;
    line-height: 1.5 !important;
}

/* --- Remove gray gradient at top of blog section --- */
section.contentWrapper.bgstyle.blogPreview::before,
.contentWrapper.blogPreview::before {
    content: none !important;
    display: none !important;
    height: 0 !important;
    background: none !important;
}

/* --- Single article: remove horizontal line below button and widen text --- */

/* The line comes from .bigArticle { border-bottom: 1px solid #d7d7da } in main.css */
.blogDetail .bigArticle {
    border-bottom: none !important;
    margin-bottom: 0 !important;
}

.blogDetail .bigArticle .contentArticle {
    border-bottom: none !important;
    margin-bottom: 0 !important;
}

/* Widen the text area — main.css limits it to max-width: 70% */
.blogDetail .contentText,
.blogDetail .bigArticle .contentText {
    max-width: 100% !important;
    border-bottom: none !important;
}

.blogDetail .contentText hr,
.blogDetail .contentText .wp-block-separator {
    display: none !important;
}

.blog-back-btn {
    margin-top: 24px;
    margin-bottom: 100px;
    display: inline-block;
}

/* --- Single article: right sidebar --- */
.blog-sidebar {
    padding: 24px 20px 24px 24px;
    background: #f9f9f9;
    border-left: 2px solid #c09f69;
    margin-top: 40px;
}

/* Search inside sidebar: full-width input */
.blog-sidebar-search {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 8px !important;
    margin-bottom: 24px;
}

.blog-sidebar-search-field {
    width: 100% !important;
    border-radius: 4px !important;
}

.blog-sidebar-search .blog-search-btn {
    border-radius: 4px !important;
    width: 100%;
    justify-content: center;
}

.blog-sidebar-title {
    font-size: 13px !important;
    font-weight: 700 !important;
    color: #383747 !important;
    margin-top: 100px !important;
    margin-bottom: 12px !important;
    padding-bottom: 10px !important;
    border-bottom: 1px solid #e8e8e8 !important;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.sidebar-article-item {
    display: flex;
    flex-direction: column;
    padding: 10px 0;
    border-bottom: 1px solid #ececec;
}

.sidebar-article-item:last-child {
    border-bottom: none;
}

.sidebar-article-title {
    font-size: 14px;
    font-weight: 600;
    color: #383747;
    text-decoration: none;
    line-height: 1.4;
    margin-bottom: 3px;
    transition: color 0.15s;
}

.sidebar-article-title:hover {
    color: #c09f69;
    text-decoration: none;
}

.sidebar-article-date {
    font-size: 12px;
    color: #999;
}

@media (max-width: 991px) {
    .blog-sidebar {
        margin-top: 32px;
        border-left: none !important;
        padding-left: 0;
    }

    /* search form — horizontal, same as article listing header */
    .blog-sidebar-search {
        flex-direction: row !important;
        align-items: center !important;
        gap: 4px !important;
        margin-bottom: 0 !important;
    }
    .blog-sidebar-search-field {
        width: auto !important;
        flex: 1 1 auto !important;
        border-radius: 4px 0 0 4px !important;
    }
    .blog-sidebar-search .blog-search-btn {
        width: auto !important;
        border-radius: 0 4px 4px 0 !important;
    }

    /* articles list — no huge top gap on mobile */
    .blog-sidebar-title {
        margin-top: 32px !important;
    }
}

/* --- Small article: thumbnail aligned with title --- */
.smallArticle .row {
    align-items: flex-start !important;
}

.smallArticle .col-3,
.smallArticle .col {
    padding-top: 0 !important;
}

.smallArticle .imageArticle {
    overflow: hidden;
    display: flex;
    align-items: flex-start;
    margin-top: 0 !important;
    padding-top: 0 !important;
}

.smallArticle .contentArticle,
.smallArticle .contentArticle .title,
.smallArticle .contentArticle h3 {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

.smallArticle .imageArticle img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
}

/* --- Responsive: images never overflow + aspect ratio --- */
.bigArticle .imageArticle img,
.smallArticle .imageArticle img,
.entry-content img,
.single-article img {
    max-width: 100% !important;
    height: auto !important;
}

/* --- Lightbox: clickable images in article content --- */
a.blog-lightbox {
    display: inline-block;
    cursor: zoom-in;
}

a.blog-lightbox img {
    max-width: 100%;
    height: auto;
    display: block;
    transition: opacity 0.2s ease;
}

a.blog-lightbox:hover img {
    opacity: 0.85;
}

/* --- Lightbox overlay --- */
.blog-lb-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.88);
    z-index: 99999;
    justify-content: center;
    align-items: center;
    cursor: zoom-out;
}

.blog-lb-overlay.active {
    display: flex;
}

.blog-lb-overlay img {
    max-width: 92vw;
    max-height: 90vh;
    object-fit: contain;
    box-shadow: 0 4px 32px rgba(0,0,0,0.7);
    border-radius: 2px;
    cursor: default;
}

.blog-lb-close {
    position: fixed;
    top: 18px;
    right: 24px;
    color: #fff;
    font-size: 36px;
    font-weight: 300;
    line-height: 1;
    cursor: pointer;
    z-index: 100000;
    background: none;
    border: none;
    padding: 0;
    opacity: 0.8;
}

.blog-lb-close:hover {
    opacity: 1;
}

/* --- Pagination --- */
.navigation.pagination {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    margin: 48px 0 44px !important;
    border-top: none !important;
    min-height: auto !important;
    position: static !important;
    font-family: Montserrat, "Helvetica Neue", sans-serif !important;
    width: 100% !important;
}

.navigation.pagination h2,
.navigation.pagination .screen-reader-text {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
}

.navigation.pagination::before,
.navigation.pagination::after {
    display: none !important;
    content: none !important;
}

.navigation.pagination .nav-links {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 6px !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
}

.navigation.pagination .nav-links::before,
.navigation.pagination .nav-links::after {
    display: none !important;
    content: none !important;
}

/* All page numbers — base reset */
.navigation.pagination .page-numbers {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-width: 36px !important;
    height: 36px !important;
    padding: 0 10px !important;
    background: transparent !important;
    color: #555 !important;
    font-size: 13px !important;
    font-weight: 400 !important;
    font-family: Montserrat, "Helvetica Neue", sans-serif !important;
    text-decoration: none !important;
    border: none !important;
    border-bottom: 2px solid transparent !important;
    border-radius: 0 !important;
    position: static !important;
    top: auto !important;
    right: auto !important;
    width: auto !important;
    overflow: visible !important;
    transition: color 0.15s, border-color 0.15s !important;
    box-shadow: none !important;
    letter-spacing: normal !important;
    text-transform: none !important;
}

.navigation.pagination .page-numbers:hover {
    background: transparent !important;
    color: #222326 !important;
    border-bottom-color: #222326 !important;
    box-shadow: none !important;
}

/* Active / current page */
.navigation.pagination .page-numbers.current {
    color: #222326 !important;
    font-weight: 700 !important;
    border-bottom: 2px solid #222326 !important;
    background: transparent !important;
    cursor: default !important;
}

/* Ellipsis dots */
.navigation.pagination .page-numbers.dots {
    color: #aaa !important;
    border-bottom: none !important;
    pointer-events: none !important;
    min-width: 20px !important;
    padding: 0 4px !important;
}

/* Prev / Next buttons — site beige/gold color */
.navigation.pagination .page-numbers.prev,
.navigation.pagination .page-numbers.next {
    background-color: #c09f69 !important;
    color: #fff !important;
    border: none !important;
    border-bottom: 3px solid rgba(0,0,0,0.2) !important;
    height: 38px !important;
    padding: 0 22px !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.06em !important;
    border-radius: 0 !important;
    transition: background 0.2s, border-color 0.2s !important;
    text-decoration: none !important;
}

.navigation.pagination .page-numbers.prev:hover,
.navigation.pagination .page-numbers.next:hover {
    background-color: #a8864e !important;
    border-bottom-color: rgba(0,0,0,0.2) !important;
    color: #fff !important;
    box-shadow: none !important;
}

.navigation.pagination .page-numbers.prev::before,
.navigation.pagination .page-numbers.prev::after,
.navigation.pagination .page-numbers.next::before,
.navigation.pagination .page-numbers.next::after {
    display: none !important;
    content: none !important;
}

/* ---- Search button: magnifying glass icon on mobile (listing + search page only) ---- */
@media (max-width: 767px) {
    .accountNav .blog-search-btn {
        font-size: 0 !important;
        padding: 0 10px !important;
        min-width: 38px !important;
        justify-content: center !important;
    }
    .accountNav .blog-search-btn::after {
        content: "\1F50D";
        font-size: 15px;
        display: inline-block;
        line-height: 1;
    }

    /* Field: narrow enough to show only "Hledat" from the placeholder "Hledat v článcích" */
    .accountNav .blog-search-field {
        width: 72px !important;
        flex: 0 0 72px !important;
        font-size: 13px !important;
        padding: 0 6px !important;
    }
}

/* ---- Tablet (768px–991px): 2 columns, no thumbnails ---- */
@media (min-width: 768px) and (max-width: 991px) {
    .smallArticle .col-3 {
        display: none !important;
    }
    .smallArticle .col {
        flex: 0 0 100% !important;
        max-width: 100% !important;
    }
}

/* ---- Mobile fixes (max 767px): 1 column, no thumbnails ---- */
@media (max-width: 767px) {

    /* 1 column: each article takes full width */
    .blog-articles-row .col-md-6 {
        flex: 0 0 100% !important;
        max-width: 100% !important;
        margin-bottom: 20px;
    }

    /* Remove extra row gap — spacing is now per-article (margin-bottom above) */
    .blog-articles-row {
        margin-bottom: 0 !important;
    }

    /* Remove vertical divider between columns */
    .blog-articles-row .col-md-6:first-child {
        border-right: none !important;
    }

    /* Hide thumbnails */
    .smallArticle .col-3 {
        display: none !important;
    }
    .smallArticle .col {
        flex: 0 0 100% !important;
        max-width: 100% !important;
        padding-top: 0 !important;
    }

    .smallArticle .contentArticle {
        padding-top: 0 !important;
        margin-top: 0 !important;
    }

    .smallArticle .contentArticle .title,
    .smallArticle .contentArticle h3 {
        margin-top: 0 !important;
        padding-top: 0 !important;
    }

    /* Large images in article content: constrained width */
    .entry-content img,
    .single-article img,
    .bigArticle img,
    .smallArticle img {
        max-width: 100% !important;
        width: 100% !important;
        height: auto !important;
    }

    /* Search form on small screens — field takes remaining space (overridden for accountNav above) */
    .blog-search-field {
        width: auto !important;
        flex: 1 1 auto !important;
        min-width: 0 !important;
        font-size: 13px !important;
    }

    /* accountNav on mobile: title and search on same line */
    .accountNav {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        justify-content: space-between !important;
        flex-wrap: nowrap !important;
    }

    .accountNav > div[style*="float:left"],
    .accountNav > div[style*="float: left"] {
        float: none !important;
        flex: 1 1 auto !important;
    }

    .accountNav > div[style*="float:right"],
    .accountNav > div[style*="float: right"] {
        float: none !important;
        flex: 0 0 auto !important;
        padding-top: 0 !important;
        padding-right: 0 !important;
    }

    /* Hide the clearfix div */
    .accountNav > div[style*="clear"] {
        display: none !important;
    }

}

/* bigArticle: remove white space around image when columns stack (below lg = 992px) */
@media (max-width: 991px) {
    .bigArticle .imageArticle {
        margin-bottom: 0 !important;
        padding-bottom: 0 !important;
    }

    .bigArticle .col-lg-6:first-child {
        padding-bottom: 0 !important;
        margin-bottom: 0 !important;
    }

    .bigArticle .imageArticle img {
        display: block !important;
        width: 100% !important;
        margin-bottom: 0 !important;
    }
}
