:root {
    --lffb-primary: #4f46e5;
    --lffb-accent: #7c3aed;
    --lffb-accent-hover: #6d28d9;
    --lffb-bg: #0f0b1e;
    --lffb-text: #1a1a1a;
    --lffb-heading: #111;
    --lffb-muted: #666;
    --lffb-tag-cat-bg: #ede9fe;
    --lffb-tag-cat-color: #6d28d9;
    --lffb-tag-kw-bg: #dbeafe;
    --lffb-tag-kw-color: #1e40af;
}

/* ============================================================
   Base
   ============================================================ */

body {
    background-color: var(--lffb-bg);
    color: #e8e8e8;
    font-family: Inter, system-ui, -apple-system, sans-serif;
    font-size: 1rem;
    line-height: 1.7;
}

main.container-xl {
    background-color: #fff;
    border-radius: 0 0 10px 10px;
    color: var(--lffb-text);
    overflow-wrap: break-word;
    word-break: break-word;
}

/* ============================================================
   Typography
   ============================================================ */

h1,
h2,
h3,
h4,
h5,
h6 {
    margin-bottom: 0.75rem;
    font-family: 'Grenze', Georgia, serif;
    font-weight: 600;
    line-height: 1.35;
}

h1 { font-size: 2.8rem; }
h2 { font-size: 2.2rem; }
h3 { font-size: 1.9rem; }
h4 { font-size: 1.6rem; }
h5 { font-size: 1.3rem; }
h6 { font-size: 1.1rem; }

p {
    margin-bottom: 1rem;
}

/* ============================================================
   Links
   ============================================================ */

a {
    color: var(--lffb-accent);
}

a:hover {
    color: var(--lffb-accent-hover);
}

.text-accent {
    color: var(--lffb-accent) !important;
}

/* ============================================================
   Cards
   ============================================================ */

.card {
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 10px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
}

.card-body {
    color: var(--lffb-text);
    opacity: 1;
}

.card-body h1,
.card-body h2,
.card-body h3,
.card-body h4,
.card-body h5,
.card-body h6 {
    color: var(--lffb-heading);
}

.card-body p,
.card-body li {
    color: #222;
}

.card-body .frame p,
.card-body .frame li {
    font-size: 0.9375rem;
}

.card-body a {
    color: var(--lffb-accent);
}

.card-body a:hover {
    color: var(--lffb-accent-hover);
}

/* ============================================================
   Sidebar
   ============================================================ */

.sidebar-content,
.sidebar-content p,
.sidebar-content li {
    color: var(--lffb-text);
}

.sidebar-content a {
    color: var(--lffb-accent);
    text-decoration: none;
}

.sidebar-content a:hover {
    color: var(--lffb-accent-hover);
    text-decoration: underline;
}

.sidebar-content h1,
.sidebar-content h2,
.sidebar-content h3,
.sidebar-content h4 {
    margin-bottom: 0.5rem;
    color: var(--lffb-heading);
    font-size: 1.3rem;
    font-weight: 500;
}

.sidebar-content .badge {
    padding: 0.25em 0.5em;
    border-radius: 4px;
    font-size: 0.7em;
}

.sidebar-content .d-flex.flex-wrap {
    gap: 0.3rem !important;
}

.sidebar-content .frame + .frame {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e5e7eb;
}

/* ============================================================
   Badges
   ============================================================ */

.badge {
    padding: 0.35em 0.65em;
    border-radius: 6px;
    font-size: 0.75em;
    letter-spacing: 0.02em;
}

/* ============================================================
   Header banner
   ============================================================ */

.header-banner {
    position: relative;
    width: 100%;
    height: 350px;
    overflow: hidden;
}

.header-banner__image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.header-banner::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(15, 11, 30, 0.6) 0%, transparent 50%);
    pointer-events: none;
    z-index: 1;
}

.header-logo {
    position: absolute;
    top: 50%;
    left: 25%;
    transform: translateY(-50%);
    display: block;
    line-height: 0;
    transition: transform 0.2s ease;
    z-index: 2;
}

.header-logo:hover {
    transform: translateY(-50%) scale(1.05);
}

.header-logo__img {
    width: 250px;
    height: auto;
    border-radius: 50%;
    box-shadow:
        0 0 0 3px rgba(124, 58, 237, 0.5),
        0 8px 40px rgba(124, 58, 237, 0.4);
}

/* ============================================================
   Navbar
   ============================================================ */

.navbar {
    border-top: 3px solid var(--lffb-accent);
    border-bottom: 1px solid #222;
}

.navbar-logo {
    width: auto;
    height: 36px;
}

.navbar-dark .nav-link {
    font-weight: 500;
    color: rgba(255, 255, 255, 0.85) !important;
}

.navbar-dark .nav-link:hover {
    color: #fff !important;
}

/* ============================================================
   News search form
   ============================================================ */

.lffb-search-form-wrap {
    background-color: #f8f8f8;
    border: 1px solid #e8e8e8;
    border-radius: 6px;
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
}

.lffb-search-form-wrap .form-label {
    font-size: 0.78rem;
    color: var(--lffb-muted);
    margin-bottom: 0.25rem;
}

/* ============================================================
   News list
   ============================================================ */

.news-list-view .list-group {
    gap: 0.75rem;
}

.news-list-view .list-group-item {
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    overflow: hidden;
    min-height: 200px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.news-list-view .news-list-item {
    min-height: 100%;
    width: 100%;
}

.news-list-view .list-group-item:hover {
    border-color: #d1d5db;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

/* --- Flush image panel -------------------------------------- */

.news-list-image {
    display: flex;
    width: 190px;
    flex-shrink: 0;
    align-self: stretch;
}

.news-list-image a {
    flex: 1 1 auto;
}

.news-list-image__img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
}

.news-list-image-placeholder {
    width: 190px;
    flex-shrink: 0;
}

.news-list-content {
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
}

/* On mobile: stack image above content */
@media (max-width: 767.98px) {
    .news-list-view .list-group-item {
        min-height: 0;
        height: auto;
    }

    .news-list-view .news-list-item {
        min-height: 0;
        height: auto;
    }

    .news-list-item {
        flex-direction: column;
    }

    .news-list-image {
        width: 100%;
        height: 200px;
    }

    .news-list-image-placeholder {
        display: none;
    }

    .news-list-content {
        justify-content: flex-start;
    }
}

.news-list .card-title a {
    color: var(--lffb-accent);
    text-decoration: none;
}

.news-list .card-title a:hover {
    color: var(--lffb-accent-hover);
}

/* --- Headings ------------------------------------------------ */

.news-list-view h3.news-list-heading {
    font-size: 1.45rem;
    margin-bottom: 0.3rem;
    line-height: 1.35;
    overflow-wrap: break-word;
}

.news-list-view h3.news-list-heading a {
    color: var(--lffb-heading);
    text-decoration: none;
}

.news-list-view h3.news-list-heading a:hover {
    color: var(--lffb-accent);
}

/* --- Metadata row -------------------------------------------- */

.news-item-meta {
    font-size: 0.875rem;
    color: var(--lffb-muted);
    line-height: 1.6;
}

/* --- Category / tag pills ------------------------------------ */

.lffb-tag {
    display: inline-block;
    padding: 0.1em 0.45em;
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--lffb-tag-cat-color);
    background-color: var(--lffb-tag-cat-bg);
    border-radius: 4px;
    white-space: nowrap;
    vertical-align: baseline;
}

.news-item-tags .lffb-tag {
    color: var(--lffb-tag-kw-color);
    background-color: var(--lffb-tag-kw-bg);
}

/* --- Teaser text --------------------------------------------- */

.news-list-teaser {
    font-size: 1rem;
    line-height: 1.6;
    color: var(--lffb-muted);
    margin-bottom: 0.75rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-list-teaser p {
    margin-bottom: 0.2rem;
}

/* --- Read more button ---------------------------------------- */

.btn-read-more {
    background-color: var(--lffb-accent);
    border-color: var(--lffb-accent);
    color: #fff;
    font-size: 0.8rem;
    font-weight: 500;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
}

.btn-read-more:hover,
.btn-read-more:focus {
    background-color: var(--lffb-accent-hover);
    border-color: var(--lffb-accent-hover);
    color: #fff;
}

/* --- Category filter pills ----------------------------------- */

.lffb-cat-btn {
    font-size: 0.78rem;
    padding: 0.25rem 0.75rem;
    background-color: var(--lffb-tag-kw-bg);
    border: 1px solid rgba(30, 64, 175, 0.12);
    color: var(--lffb-tag-kw-color) !important;
    border-radius: 20px;
    white-space: nowrap;
    text-decoration: none !important;
    display: inline-block;
    line-height: 1.4;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.lffb-cat-btn:hover,
.lffb-cat-btn:focus {
    background-color: #bfdbfe;
    border-color: rgba(30, 64, 175, 0.25);
    color: var(--lffb-tag-kw-color) !important;
}

.lffb-cat-btn--active {
    background-color: var(--lffb-accent);
    border-color: var(--lffb-accent);
    color: #fff !important;
}

.lffb-cat-btn--active:hover,
.lffb-cat-btn--active:focus {
    background-color: var(--lffb-accent-hover);
    border-color: var(--lffb-accent-hover);
    color: #fff !important;
}

/* Kategorijas block: violet to match category pills in news items */
.frame-type-news_categorylist .lffb-cat-btn {
    background-color: var(--lffb-tag-cat-bg);
    border-color: rgba(109, 40, 217, 0.12);
    color: var(--lffb-tag-cat-color) !important;
}

.frame-type-news_categorylist .lffb-cat-btn:hover,
.frame-type-news_categorylist .lffb-cat-btn:focus {
    background-color: #ddd6fe;
    border-color: rgba(109, 40, 217, 0.25);
    color: var(--lffb-tag-cat-color) !important;
}

.lffb-cat-btn--remove {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
    border-left: 1px solid rgba(255, 255, 255, 0.3);
}

.lffb-tag-cloud {
    line-height: 2;
}

.lffb-tag-count {
    font-size: 0.68rem;
    opacity: 0.75;
}

/* --- Pagination ---------------------------------------------- */

.f3-widget-paginator.pagination {
    gap: 0.35rem;
    margin-top: 0.75rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
    justify-content: center;
}

.f3-widget-paginator.pagination .page-link {
    padding: 0.4rem 0.8rem;
    font-size: 0.9rem;
    line-height: 1.4;
    color: var(--lffb-text);
    background-color: #fff;
    border-color: #e5e7eb;
    border-radius: 6px;
}

.f3-widget-paginator.pagination .page-item.active .page-link {
    background-color: var(--lffb-accent);
    border-color: var(--lffb-accent);
    color: #fff;
}

.f3-widget-paginator.pagination .page-item:not(.active) .page-link:hover {
    background-color: #f3f4f6;
    border-color: #d1d5db;
    color: var(--lffb-accent);
}

/* ============================================================
   News detail
   ============================================================ */

.news-single,
.news-single p,
.news-single li,
.news-single div,
.news-single span {
    color: var(--lffb-text);
    opacity: 1;
}

.news-single h1,
.news-single h2,
.news-single h3,
.news-single h4,
.news-single h5,
.news-single h6 {
    color: var(--lffb-heading);
    overflow-wrap: break-word;
    word-break: break-word;
}

.news-single a {
    color: var(--lffb-accent);
}

.news-single a:hover {
    color: var(--lffb-accent-hover);
}

.news-single .text-muted,
.news-single .caption.text-muted,
.news-single .small.text-muted {
    color: var(--lffb-muted) !important;
    opacity: 1 !important;
}

.news-single .lead {
    font-size: 1.05rem;
    font-weight: 400;
    font-style: italic;
    color: var(--lffb-muted);
}

.news-single .caption {
    margin-top: 0.5rem;
    line-height: 1.4;
}

/* ============================================================
   Featured image + side gallery
   ============================================================ */

.news-single .thumbnail {
    display: block;
    margin-bottom: 1rem;
}

.news-single .thumbnail a,
.news-side-gallery a {
    display: block;
    overflow: hidden;
}

.news-single .thumbnail a {
    border-radius: 8px;
}

.news-side-gallery a {
    border-radius: 6px;
}

.news-single .thumbnail img,
.thumbnail--featured img {
    display: block;
    width: 100%;
    height: auto;
    opacity: 1;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.news-single .thumbnail a:hover img {
    opacity: 0.92;
    transform: scale(1.02);
}

.news-side-gallery {
    margin-top: 0.5rem;
}

.side-gallery-thumb {
    display: block;
    width: 100%;
    height: 82px;
    object-fit: cover;
    opacity: 1;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.news-side-gallery a:hover .side-gallery-thumb {
    opacity: 0.92;
    transform: scale(1.02);
}

/* ============================================================
   Footer
   ============================================================ */

footer.container-xl {
    color: #aaa;
}

footer.container-xl a,
footer.container-xl .text-muted {
    color: #aaa !important;
}

/* ============================================================
   Breadcrumb
   ============================================================ */

.lffb-breadcrumb {
    padding-top: 0.25rem;
    padding-bottom: 0.25rem;
    margin-bottom: 0.75rem;
    border-bottom: 1px solid #e0e0e0;
}

.lffb-breadcrumb .breadcrumb {
    font-size: 0.78rem;
}

.lffb-breadcrumb .breadcrumb-item + .breadcrumb-item::before {
    content: ">";
    color: #adb5bd;
}

.lffb-breadcrumb .breadcrumb-item a {
    color: var(--lffb-accent);
    text-decoration: none;
}

.lffb-breadcrumb .breadcrumb-item a:hover {
    color: var(--lffb-accent-hover);
    text-decoration: underline;
}

.lffb-breadcrumb .breadcrumb-item.active {
    color: var(--lffb-heading);
    font-weight: 500;
}

/* ============================================================
   Legacy fallback
   ============================================================ */

.gallery-thumb {
    display: block;
    width: 100%;
    height: 180px;
    object-fit: cover;
    cursor: pointer;
    opacity: 1;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.gallery-thumb:hover {
    opacity: 0.92;
    transform: scale(1.02);
}

/* ============================================================
   Tablet  (768px – 991px): shift logo toward center
   ============================================================ */

@media (min-width: 768px) and (max-width: 991.98px) {
    .header-logo {
        left: 35%;
    }
}

/* ============================================================
   Mobile usability  (≤ 767px)
   Desktop styles above are intentionally left unchanged.
   ============================================================ */

@media (max-width: 767.98px) {

    /* --- Header banner + logo --------------------------------
       Reduce banner height and logo size on mobile; center the
       logo horizontally so it doesn't hug the left edge.
    --------------------------------------------------------- */
    .header-banner {
        height: 220px;
    }

    .header-logo {
        left: 50%;
        transform: translate(-50%, -50%);
    }

    .header-logo:hover {
        transform: translate(-50%, -50%) scale(1.05);
    }

    .header-logo__img {
        width: 170px;
    }



    /* --- Navbar: logo and hamburger -------------------------
       Logo is unreadably small at 36px on a real phone.
       Toggler default padding gives a tap target that is too
       small for reliable finger use.
    --------------------------------------------------------- */
    .navbar-logo {
        height: 48px;
    }

    .navbar-toggler {
        padding: 0.5rem 0.8rem;
    }

    .navbar-toggler-icon {
        width: 1.6em;
        height: 1.6em;
    }

    /* Collapsed nav links need enough vertical padding to be
       comfortably tappable row-by-row. */
    .navbar-nav .nav-link {
        padding-top: 0.65rem;
        padding-bottom: 0.65rem;
        font-size: 1rem;
    }

    /* --- News list: headings --------------------------------
       1.05rem renders around 17px on desktop where spacing
       context helps. On a small phone it reads as too tight.
    --------------------------------------------------------- */
    .news-list-view h3.news-list-heading {
        font-size: 1.25rem;
    }

    /* --- News list: metadata row ---------------------------
       0.78rem is too small for comfortable reading on mobile.
    --------------------------------------------------------- */
    .news-item-meta {
        font-size: 0.9375rem;
        line-height: 1.8;
    }

    /* --- News list: inline tags (Rubrika, Kategorija) ------
       0.7rem renders as ≈11px — unreadably small.
    --------------------------------------------------------- */
    .lffb-tag {
        font-size: 0.78rem;
        padding: 0.15em 0.5em;
    }

    /* --- News list: teaser text ----------------------------
       0.875rem is passable but too small when combined with
       dense line-height on a narrow screen.
    --------------------------------------------------------- */
    .news-list-teaser {
        font-size: 0.9375rem;
        margin-top: 0.4rem;
    }

    /* --- News list: read more button -----------------------
       Increase touch area without changing desktop button size.
    --------------------------------------------------------- */
    .btn-read-more {
        font-size: 0.875rem;
        padding: 0.4rem 1rem;
        margin-top: 0.25rem;
    }

    /* --- Category / tag filter buttons (Rubrikas / Kategorijas)
       0.78rem font and 0.2rem padding give tap targets well
       below the recommended 44px minimum touch area.
    --------------------------------------------------------- */
    .lffb-cat-btn {
        font-size: 0.875rem;
        padding: 0.4rem 0.9rem;
    }

    /* --- Pagination ----------------------------------------
       0.82rem text and 0.25rem padding make page numbers tiny
       and difficult to tap accurately on a phone.
    --------------------------------------------------------- */
    .f3-widget-paginator.pagination {
        gap: 0.35rem;
    }

    .f3-widget-paginator.pagination .page-link {
        font-size: 0.95rem;
        padding: 0.45rem 0.85rem;
    }

}

/* =============================================================
   Navigation dropdowns
   ============================================================= */

/* Show dropdown on hover for wider screens */
@media (min-width: 992px) {
    .navbar-nav .nav-item.dropdown:hover > .dropdown-menu {
        display: block;
        margin-top: 0;
    }
}

/* Align dropdown items with the navbar dark theme */
.dropdown-menu-dark .dropdown-item.active,
.dropdown-menu-dark .dropdown-item:active {
    background-color: var(--bs-primary, #c8a84b);
}
