/* Speed2 Theme - Main Stylesheet - Optimized for Performance */

/* ============================================
   1. RESET & BASE STYLES
============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-family, 'Poppins'), 'speed2-fallback', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: #1A1A1A;
    background: #FFFFFF;
    overflow-x: hidden;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: #1B4B5A;
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--color-primary, #E4002B);
}

/* ============================================
   2. TYPOGRAPHY
============================================ */
h1, h2, h3, h4, h5, h6 {
    margin-bottom: 1rem;
    line-height: 1.2;
    color: #1A1A1A;
}

h1 { font-size: var(--h1-font-size, 2.5em); font-weight: var(--h1-font-weight, 700); color: var(--h1-color, #1A1A1A); }
h2 { font-size: var(--h2-font-size, 2em); font-weight: var(--h2-font-weight, 700); color: var(--h2-color, #1A1A1A); }
h3 { font-size: var(--h3-font-size, 1.75em); font-weight: var(--h3-font-weight, 600); color: var(--h3-color, #1A1A1A); }
h4 { font-size: var(--h4-font-size, 1.5em); font-weight: var(--h4-font-weight, 600); color: var(--h4-color, #1A1A1A); }
h5 { font-size: var(--h5-font-size, 1.25em); font-weight: var(--h5-font-weight, 500); color: var(--h5-color, #1A1A1A); }
h6 { font-size: 1em; font-weight: 500; }

/* Heading underline decoration */
.entry-content h1,
.entry-content h2,
.entry-content h3,
.page-content h1,
.page-content h2,
.page-content h3,
.section h1,
.section h2,
.section h3,
article h1,
article h2,
article h3 {
    display: block;
    padding-bottom: 12px;
    position: relative;
}

.entry-content h1::after,
.entry-content h2::after,
.entry-content h3::after,
.page-content h1::after,
.page-content h2::after,
.page-content h3::after,
.section h1::after,
.section h2::after,
.section h3::after,
article h1::after,
article h2::after,
article h3::after {
    content: '';
    display: block;
    position: absolute;
    bottom: 0;
    left: 0;
    width: 55px;
    height: 3px;
    background-color: var(--footer-bg, #1A1A1A);
    border-radius: 2px;
}

/* Exclude headings in navigation, hero, footer, accordion headers */
.site-nav h1::after, .site-nav h2::after, .site-nav h3::after,
.hero-content h1::after, .hero-content h2::after, .hero-content h3::after,
.site-footer h1::after, .site-footer h2::after, .site-footer h3::after,
.footer-column h1::after, .footer-column h2::after, .footer-column h3::after,
.footer-widget h1::after, .footer-widget h2::after, .footer-widget h3::after,
.accordion-header::after,
.widget h1::after, .widget h2::after, .widget h3::after,
.vw-widget h1::after, .vw-widget h2::after, .vw-widget h3::after {
    display: none;
}

/* eVisaWidget: naglowki bez paddingu i podkreslenia motywu */
.vw-widget h1, .vw-widget h2, .vw-widget h3 {
    padding-bottom: 0;
    position: static;
}

p {
    margin-bottom: 1rem;
    font-size: 16px;
}

strong {
    font-weight: 600;
}

/* ============================================
   3. LAYOUT & GRID SYSTEM
============================================ */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.container-fluid {
    width: 100%;
    padding: 0 20px;
}

.row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -15px;
}

.col-1, .col-2, .col-3, .col-4 {
    padding: 0 15px;
    margin-bottom: 30px;
}

.col-1 { flex: 0 0 100%; max-width: 100%; }
.col-2 { flex: 0 0 50%; max-width: 50%; }
.col-3 { flex: 0 0 33.333333%; max-width: 33.333333%; }
.col-4 { flex: 0 0 25%; max-width: 25%; }

/* ============================================
   4. HEADER & TOP BAR - Stałe wysokości dla CLS
============================================ */
.top-bar {
    background: var(--topbar-bg, #FFFFFF);
    padding: 0;
    border-bottom: 1px solid #F5F5F5;
    min-height: var(--topbar-height, 90px);
    display: flex;
    align-items: center;
}

.top-bar-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    width: 100%;
}

.logo-container {
    flex: 0 0 auto;
}

.logo-container a {
    display: block;
}

.logo {
    max-width: 350px;
    height: auto;
    max-height: 120px;
}

.contact-info {
    display: flex;
    gap: 20px;
    align-items: center;
    flex-wrap: wrap;
}
#contactemail {
  font-size: 16px;
	font-weight:500;
}
#contactemail a {
  font-size: 16px;
	font-weight:500;
}


.contact-info a {
    color: var(--topbar-text-color, #1A1A1A);
    font-size: var(--topbar-font-size, 14px);
    font-weight: 500;
}

.contact-info a:hover {
    color: var(--color-primary, #E4002B);
}

/* ============================================
   5. NAVIGATION - Stała wysokość
============================================ */
.main-nav {
    background: var(--nav-bg, #E4002B);
    min-height: var(--nav-height, 50px);
    position: relative;
    z-index: 1000;
}

.nav-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: var(--nav-height, 50px);
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: #FFFFFF;
    font-size: 24px;
    cursor: pointer;
    padding: 10px;
}

.main-menu {
    list-style: none;
    display: flex;
    margin: 0;
    padding: 0;
    align-items: center;
}

.main-menu > li {
    position: relative;
}

.main-menu > li > a {
    display: flex;
    align-items: center;
    padding: 0 18px;
    color: var(--nav-text-color, #FFFFFF);
    font-weight: 500;
    font-size: var(--nav-font-size, 15px);
    transition: background 0.3s ease;
    height: var(--nav-height, 50px);
}

.main-menu > li > a:hover,
.main-menu > li.active > a {
    background: rgba(0, 0, 0, 0.2);
    color: var(--nav-text-color, #FFFFFF);
}

/* Submenu */
.submenu {
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--submenu-bg, #FFFFFF);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    min-width: 250px;
    list-style: none;
    padding: 10px 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1001;
}

.main-menu > li:hover > .submenu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.submenu li a {
    display: block;
    padding: 10px 20px;
    color: var(--submenu-link-color, #1A1A1A);
    font-size: 14px;
    transition: background 0.3s ease, color 0.3s ease;
}

.submenu li a:hover {
    background: #F5F5F5;
    color: var(--color-primary, #E4002B);
}

/* ============================================
   6. HERO SECTION - Stałe wymiary
============================================ */
.hero {
    width: 100%;
    position: relative;
    overflow: hidden;
    background: #1A1A1A;
    height: var(--hero-height, 400px);
    min-height: var(--hero-height, 400px);
}

.hero-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    position: absolute;
    top: 0;
    left: 0;
    aspect-ratio: 16 / 9;
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 1200px;
    margin: 0 auto;
    padding: 80px 20px;
    color: #FFFFFF;
    text-align: center;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.hero-content h1 {
    color: #FFFFFF;
    font-size: 3rem;
    margin-bottom: 1.5rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.hero-content p {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.5);
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.5));
    z-index: 1;
}

/* ============================================
   7. SECTIONS
============================================ */
.section {
    padding: 60px 0;
    min-height: 200px;
}

.section-title {
    text-align: center;
    margin-bottom: 3rem;
}

.section.bg-light { background: #F5F5F5; }
.section.bg-white { background: #FFFFFF; }
.section.bg-dark {
    background: #1A1A1A;
    color: #FFFFFF;
}

.section.bg-dark h1, .section.bg-dark h2, .section.bg-dark h3,
.section.bg-dark h4, .section.bg-dark h5, .section.bg-dark h6 {
    color: #FFFFFF;
}

/* ============================================
   8. CARDS & COMPONENTS
============================================ */
.card {
    background: #FFFFFF;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
    will-change: transform;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.card-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    aspect-ratio: 16 / 9;
}

.card-header {
    background: #F5F5F5;
    padding: 15px 20px;
    font-weight: 600;
    font-size: var(--card-header-font-size, 1.25em);
    color: #1A1A1A;
}

.card-body {
    padding: 20px;
    flex: 1;
}

.card-footer {
    padding: 15px 20px;
    background: #F5F5F5;
    border-top: 1px solid #E0E0E0;
}

/* ============================================
   9. TILES
============================================ */
.tiles {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
}

.tile {
    background: #FFFFFF;
    padding: 30px;
    border-radius: 8px;
    border: 2px solid #F5F5F5;
    transition: all 0.3s ease;
    text-align: center;
    min-height: 200px;
}

.tile:hover {
    border-color: var(--color-primary, #E4002B);
    box-shadow: 0 4px 12px rgba(228, 0, 43, 0.2);
}

.tile-icon {
    font-size: 3rem;
    color: var(--color-primary, #E4002B);
    margin-bottom: 1rem;
}

.tile h3 {
    color: #1A1A1A;
    margin-bottom: 1rem;
}

/* ============================================
   10. BUTTONS
============================================ */
.btn {
    display: inline-block;
    padding: 12px 30px;
    font-size: 16px;
    font-weight: 500;
    text-align: center;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    font-family: var(--font-family, 'Poppins'), sans-serif;
    line-height: 1.5;
    will-change: transform;
}

.btn-primary {
    background: var(--button-bg, #E4002B);
    color: var(--button-text-color, #FFFFFF);
}

.btn-primary:hover {
    background: var(--button-bg-hover, #B30022);
    color: var(--button-text-color, #FFFFFF);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(228, 0, 43, 0.3);
}

.btn-secondary {
    background: #1A1A1A;
    color: #FFFFFF;
}

.btn-secondary:hover {
    background: #333333;
    color: #FFFFFF;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.btn-lg {
    padding: 16px 40px;
    font-size: 18px;
}

.btn-sm {
    padding: 8px 20px;
    font-size: 14px;
}

/* ============================================
   11. FOOTER - Stała struktura
============================================ */
.footer {
    background: var(--footer-bg, #1A1A1A);
    color: var(--footer-text-color, #FFFFFF);
    padding: 50px 0 20px;
    margin-top: 0;
    min-height: 300px;
}

.footer a {
    color: var(--footer-link-color, #FFFFFF) !important;
}

.footer a:hover {
    color: var(--color-primary, #E4002B) !important;
}

.footer-columns {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

.footer-column h3 {
    color: var(--footer-text-color, #FFFFFF);
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
    font-weight: 600;
}

.footer-menu {
    list-style: none;
    padding: 0;
}

.footer-menu li {
    margin-bottom: 10px;
}

.footer-menu a,
.footer-menu li a {
    color: var(--footer-link-color, #FFFFFF) !important;
    font-size: 14px;
    transition: color 0.3s ease;
}

.footer-menu a:hover,
.footer-menu li a:hover {
    color: var(--color-primary, #E4002B) !important;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 20px;
    text-align: center;
    font-size: 14px;
}

/* ============================================
   12. WORDPRESS SPECIFIC
============================================ */
.wp-block-image img {
    height: auto;
}

.alignleft {
    float: left;
    margin-right: 1.5rem;
    margin-bottom: 1rem;
}

.alignright {
    float: right;
    margin-left: 1.5rem;
    margin-bottom: 1rem;
}

.aligncenter {
    display: block;
    margin-left: auto;
    margin-right: auto;
}

/* WordPress post/page content */
.entry-content {
    margin-bottom: 2rem;
    margin-left: 10px;
    margin-right: 10px;
}

.entry-meta {
    font-size: 0.875rem;
    color: #666;
    margin-bottom: 1rem;
}

.post-thumbnail {
    margin-bottom: 2rem;
}

/* ============================================
   13. UTILITY CLASSES
============================================ */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }
.mb-5 { margin-bottom: 3rem; }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mt-5 { margin-top: 3rem; }

/* ============================================
   14. RESPONSIVE DESIGN
============================================ */
@media (max-width: 992px) {
    .hero-content h1 { font-size: 2.25rem; }
    .col-2, .col-3, .col-4 {
        flex: 0 0 50%;
        max-width: 50%;
    }
}

@media (max-width: 768px) {
    h1 { font-size: 2rem; }
    h2 { font-size: 1.75rem; }
    h3 { font-size: 1.5rem; }
    
    .hero {
        min-height: var(--hero-height, 400px);
        height: auto;
    }
    
    .hero-content {
        padding: 40px 20px;
    }
    
    .hero-content h1 {
        font-size: 1.75rem;
    }
    
    .hero-content p {
        font-size: 1rem;
    }
    
    .menu-toggle {
        display: block;
    }
    
    .main-menu {
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: var(--nav-bg, #E4002B);
        flex-direction: column;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.5s ease-in-out;
    }
    
    .main-menu.active {
        max-height: 2000px;
    }
    
    .main-menu > li {
        width: 100%;
    }
    
    .col-2, .col-3, .col-4 {
        flex: 0 0 100%;
        max-width: 100%;
    }
    
    .top-bar-content {
        flex-direction: column;
        gap: 15px;
    }
}

/* ============================================
   15. PERFORMANCE OPTIMIZATIONS
============================================ */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Print styles */
@media print {
    .main-nav, .footer, .btn {
        display: none;
    }
}


/* ============================================
   SIDEBAR & WIDGETS
============================================ */
.widget {
    background: #FFFFFF;
    padding: 20px;
    margin-bottom: 30px;
    border-radius: 8px;
    border: 1px solid #E0E0E0;
}

.widget-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--color-primary, #E4002B);
    color: #1A1A1A;
}

.widget ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.widget ul li {
    padding: 8px 0;
    border-bottom: 1px solid #F5F5F5;
}

.widget ul li:last-child {
    border-bottom: none;
}

.widget ul li a {
    color: #1A1A1A;
    transition: color 0.3s ease;
}

.widget ul li a:hover {
    color: var(--color-primary, #E4002B);
}

.header-widget {
    display: inline-block;
    margin-right: 15px;
}

.footer-widget h3 {
    color: var(--footer-text-color, #FFFFFF);
}

.footer-widget ul {
    list-style: none;
    padding: 0;
}

.footer-widget ul li {
    margin-bottom: 10px;
}

.footer-widget a {
    color: var(--footer-link-color, #FFFFFF);
}

.footer-widget a:hover {
    color: var(--color-primary, #E4002B);
}

@media (max-width: 768px) {
    .col-main, .col-sidebar {
        flex: 0 0 100% !important;
        max-width: 100% !important;
        padding-right: 0 !important;
        padding-left: 0 !important;
        order: 0 !important;
    }
    
    /* Author Bio - Mobile Layout */
    .author-bio {
        flex-direction: column !important;
        align-items: center !important;
        text-align: center;
        padding: 1.5rem !important;
        gap: 1rem !important;
    }
    
    .author-avatar {
        flex: none !important;
        margin-bottom: 0.5rem;
    }
    
    .author-avatar img {
        width: 100px !important;
        height: 100px !important;
    }
    
    .author-info {
        flex: none !important;
    }
    
    .author-info h3 {
        font-size: 1.25rem !important;
    }
    
    .author-social {
        justify-content: center !important;
    }
}


/* ============================================
   CONTENT LISTS - OL & UL
============================================ */
.entry-content ul,
.entry-content ol {
    margin-bottom: 1.5rem;
    padding-left: 2rem;
}

.entry-content ul li,
.entry-content ol li {
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

.entry-content ul {
    list-style-type: disc;
}

.entry-content ol {
    list-style-type: decimal;
}

.entry-content ul ul,
.entry-content ol ul {
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
}

.entry-content ul ol,
.entry-content ol ol {
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
}

/* Auto 2-column lists for 10+ items (CSS :has()) */
.entry-content ul:has(> li:nth-child(11)),
.entry-content ol:has(> li:nth-child(11)) {
    columns: 2;
    column-gap: 2.5rem;
}

.entry-content ul:has(> li:nth-child(11)) > li,
.entry-content ol:has(> li:nth-child(11)) > li {
    break-inside: avoid;
}

@media (max-width: 768px) {
    .entry-content ul:has(> li:nth-child(11)),
    .entry-content ol:has(> li:nth-child(11)) {
        columns: 1;
    }
}


/* ============================================
   BREADCRUMBS
============================================ */
.breadcrumbs {
    background: #F5F5F5;
    padding: 12px 0;
    font-size: 14px;
    border-bottom: 1px solid #E0E0E0;
}

.breadcrumbs-list {
    list-style: none;
    display: flex;
    /* Single line on every viewport: breadcrumb bar keeps a constant height,
       so a font swap can never re-wrap it and shift the hero below (CLS) */
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    gap: 8px;
    align-items: center;
    margin: 0;
    padding: 0;
}

.breadcrumbs-list::-webkit-scrollbar {
    display: none;
}

.breadcrumbs-list li {
    white-space: nowrap;
}

.breadcrumbs-list li {
    display: flex;
    align-items: center;
}

.breadcrumbs-list li:not(:last-child)::after {
    content: var(--breadcrumb-separator, '›');
    margin-left: 8px;
    color: #666;
}

.breadcrumbs-list a {
    color: #1B4B5A;
    transition: color 0.3s ease;
}

.breadcrumbs-list a:hover {
    color: var(--color-primary, #E4002B);
}

.breadcrumbs-list .current {
    color: #666;
}

.breadcrumbs-list .current span {
    color: #666;
}


/* ============================================
   SUBMENU / DROPDOWN FIX
============================================ */
.main-menu .sub-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--submenu-bg, #FFFFFF);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    min-width: 250px;
    list-style: none;
    padding: 10px 0;
    margin: 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1001;
}

.main-menu li:hover > .sub-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.main-menu .sub-menu li {
    width: 100%;
}

.main-menu .sub-menu li a {
    display: block;
    padding: 10px 20px;
    color: var(--submenu-link-color, #1A1A1A);
    font-size: 14px;
    transition: background 0.3s ease, color 0.3s ease;
}

.main-menu .sub-menu li a:hover {
    background: #F5F5F5;
    color: var(--color-primary, #E4002B);
}

@media (max-width: 768px) {
    .main-menu .sub-menu {
        position: static;
        box-shadow: none;
        background: rgba(0, 0, 0, 0.2);
        opacity: 1;
        visibility: visible;
        transform: none;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.4s ease-in-out;
    }
    
    .main-menu li.active > .sub-menu {
        max-height: 1000px;
    }
    
    .main-menu .sub-menu li a {
        color: #FFFFFF;
        padding: 12px 20px 12px 35px;
    }
    
    .main-menu .sub-menu li a:hover {
        background: rgba(0, 0, 0, 0.3);
        color: #FFFFFF;
    }
}


/* ============================================
   AUTHOR BIO
============================================ */
.author-bio {
    background: var(--footer-bg, #1A1A1A) !important;
    color: var(--footer-text-color, #FFFFFF);
    padding: 28px;
    border-radius: 14px;
    box-shadow: 0 8px 24px rgba(9, 38, 58, 0.12);
}

.author-bio p {
    color: var(--footer-text-color, #FFFFFF) !important;
    opacity: 0.92;
}

.author-bio h3 {
    color: var(--footer-text-color, #FFFFFF) !important;
    margin-top: 0;
}

.author-bio h3 a {
    color: inherit;
}

.author-bio .avatar,
.author-bio .avatar-circle {
    border-radius: 50% !important;
    width: 120px !important;
    height: 120px !important;
    display: block !important;
}

.author-social a {
    color: rgba(255, 255, 255, 0.8);
    transition: color 0.3s ease;
}

.author-social a:hover {
    color: #FFFFFF;
}


/* ============================================
   TABLES
============================================ */
.entry-content table,
table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 2rem;
    background: #FFFFFF;
    border: 2px solid #E0E0E0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.entry-content table thead,
table thead {
    background: var(--nav-bg, #E4002B);
    color: var(--nav-text-color, #FFFFFF);
}

.entry-content table th,
table th {
    padding: 16px 20px;
    text-align: left;
    font-weight: 700;
    font-size: 1.05em;
    letter-spacing: 0.02em;
    border-bottom: 3px solid rgba(0,0,0,0.15);
}

/* First row styling - thead rows, or first row in tables without <thead> */
.entry-content table thead tr,
table thead tr,
.entry-content table:not(:has(thead)) > tbody > tr:first-child,
table:not(:has(thead)) > tbody > tr:first-child {
    background: var(--nav-bg, #E4002B) !important;
    color: var(--nav-text-color, #FFFFFF) !important;
}

.entry-content table thead td,
table thead td,
.entry-content table thead th,
table thead th,
.entry-content table:not(:has(thead)) > tbody > tr:first-child td,
table:not(:has(thead)) > tbody > tr:first-child td,
.entry-content table:not(:has(thead)) > tbody > tr:first-child th,
table:not(:has(thead)) > tbody > tr:first-child th {
    color: var(--nav-text-color, #FFFFFF);
    font-weight: 700;
    font-size: 1.05em;
    letter-spacing: 0.02em;
    border-bottom: 3px solid rgba(0,0,0,0.15);
}

.entry-content table td,
table td {
    padding: 14px 20px;
    border-bottom: 1px solid #EBEBEB;
    color: #1A1A1A;
    line-height: 1.5;
}

.entry-content table tbody tr:nth-child(even),
table tbody tr:nth-child(even) {
    background: #F8F9FA;
}

.entry-content table tbody tr:hover,
table tbody tr:hover {
    background: #EEF2F7;
    transition: background 0.2s ease;
}

.entry-content table.table-striped tbody tr:nth-child(odd),
table.table-striped tbody tr:nth-child(odd) {
    background: #FAFAFA;
}

.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Mark / Highlight */
mark,
.entry-content mark {
    background: var(--nav-bg, #E4002B);
    color: var(--nav-text-color, #FFFFFF);
    padding: 2px 6px;
    border-radius: 3px;
    font-weight: 600;
}

/* ============================================
   BLOCKQUOTE
============================================ */
.entry-content blockquote,
blockquote {
    margin: 2rem 0;
    padding: 1.5rem 2rem 1.5rem 2rem;
    background: linear-gradient(135deg, #F8F9FA 0%, #EEF2F7 100%);
    border-left: 5px solid var(--nav-bg, #E4002B);
    border-radius: 0 8px 8px 0;
    font-size: 1.1em;
    font-style: italic;
    line-height: 1.7;
    color: #333;
    position: relative;
}

.entry-content blockquote::before,
blockquote::before {
    content: '\201C';
    font-size: 4em;
    color: var(--nav-bg, #E4002B);
    opacity: 0.2;
    position: absolute;
    top: -10px;
    left: 10px;
    font-family: Georgia, serif;
    line-height: 1;
}

.entry-content blockquote p:last-child,
blockquote p:last-child {
    margin-bottom: 0;
}

.entry-content blockquote cite,
blockquote cite {
    display: block;
    margin-top: 1rem;
    font-size: 0.85em;
    font-style: normal;
    font-weight: 600;
    color: #666;
}

.entry-content blockquote cite::before,
blockquote cite::before {
    content: '— ';
}

/* ============================================
   CODE & PRE
============================================ */
.entry-content code,
code {
    background: #F1F3F5;
    color: #E4002B;
    padding: 2px 8px;
    border-radius: 4px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.9em;
    border: 1px solid #E0E0E0;
}

.entry-content pre,
pre {
    background: #1E1E2E;
    color: #CDD6F4;
    padding: 1.5rem;
    border-radius: 8px;
    overflow-x: auto;
    margin-bottom: 2rem;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.9em;
    line-height: 1.6;
    border: 1px solid #313244;
}

.entry-content pre code,
pre code {
    background: transparent;
    color: inherit;
    padding: 0;
    border: none;
    font-size: inherit;
}

/* ============================================
   HORIZONTAL RULE
============================================ */
.entry-content hr,
hr {
    border: none;
    height: 3px;
    background: var(--nav-bg, #E4002B);
    margin: 3rem 0;
    border-radius: 3px;
}

/* ============================================
   LEAD PARAGRAPH (.lead)
============================================ */
.entry-content .lead,
.lead {
    font-size: 1.25em;
    font-weight: 400;
    line-height: 1.7;
    color: #444;
    margin-bottom: 2rem;
}

/* ============================================
   DROP CAP (opt-in via .dropcap class only)
============================================ */
.entry-content .dropcap::first-letter {
    font-size: 3.5em;
    font-weight: 700;
    float: left;
    line-height: 0.8;
    margin: 0.05em 0.12em 0 0;
    color: var(--nav-bg, #E4002B);
}

/* ============================================
   CALLOUT / INFO BOXES
============================================ */
.callout,
.info-box,
.entry-content .callout,
.entry-content .info-box {
    padding: 1.25rem 1.5rem;
    margin: 2rem 0;
    border-radius: 8px;
    border-left: 5px solid;
    line-height: 1.6;
}

.callout-info, .info-box-info {
    background: #EBF5FB;
    border-color: #2196F3;
    color: #1565C0;
}

.callout-success, .info-box-success {
    background: #E8F5E9;
    border-color: #4CAF50;
    color: #2E7D32;
}

.callout-warning, .info-box-warning {
    background: #FFF8E1;
    border-color: #FF9800;
    color: #E65100;
}

.callout-danger, .info-box-danger {
    background: #FFEBEE;
    border-color: #F44336;
    color: #C62828;
}

.callout p:last-child,
.info-box p:last-child {
    margin-bottom: 0;
}

/* ============================================
   FIGCAPTION
============================================ */
.entry-content figure {
    margin: 2rem 0;
}

.entry-content figcaption,
figcaption {
    font-size: 0.875em;
    color: #777;
    text-align: center;
    font-style: italic;
    margin-top: 0.75rem;
    padding-top: 0.5rem;
    border-top: 1px solid #EBEBEB;
}

/* ============================================
   KBD (Keyboard Shortcuts)
============================================ */
.entry-content kbd,
kbd {
    background: #F8F9FA;
    border: 1px solid #CCC;
    border-bottom: 3px solid #BBB;
    border-radius: 4px;
    padding: 2px 8px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.85em;
    color: #333;
    box-shadow: 0 1px 0 rgba(0,0,0,0.1);
}

/* ============================================
   DEFINITION LIST (dl/dt/dd)
============================================ */
.entry-content dl,
dl {
    margin-bottom: 2rem;
}

.entry-content dt,
dt {
    font-weight: 700;
    color: var(--nav-bg, #E4002B);
    margin-bottom: 0.25rem;
    font-size: 1.05em;
}

.entry-content dd,
dd {
    margin-left: 1.5rem;
    margin-bottom: 1rem;
    padding-left: 1rem;
    border-left: 3px solid #EBEBEB;
    color: #555;
    line-height: 1.6;
}

/* ============================================
   ABBR (Abbreviations)
============================================ */
.entry-content abbr[title],
abbr[title] {
    text-decoration: underline dotted var(--nav-bg, #E4002B);
    cursor: help;
    text-underline-offset: 3px;
}

/* ============================================
   SUP & SUB (Superscript / Subscript)
============================================ */
.entry-content sup,
.entry-content sub {
    font-size: 0.75em;
    line-height: 0;
    position: relative;
    vertical-align: baseline;
}

.entry-content sup {
    top: -0.5em;
}

.entry-content sub {
    bottom: -0.25em;
}


/* ============================================
   ACCORDION / FAQ
============================================ */
.accordion {
    margin-bottom: 2rem;
}

.accordion-item {
    background: #FFFFFF;
    border: 1px solid #E0E0E0;
    margin-bottom: 10px;
    border-radius: 6px;
    overflow: hidden;
}

.accordion-button {
    width: 100%;
    background: #F5F5F5;
    color: #1A1A1A;
    padding: 18px 20px;
    border: none;
    text-align: left;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.3s ease;
    font-family: inherit;
}

.accordion-button:hover {
    background: #E8E8E8;
}

.accordion-button::after {
    content: '+';
    font-size: 1.5rem;
    font-weight: 400;
    transition: transform 0.3s ease;
    flex-shrink: 0;
}

.accordion-button.active::after {
    content: '−';
}

.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    background: #FFFFFF;
}

.accordion-content.active {
    max-height: 2000px;
}

.accordion-content-inner {
    padding: 20px;
    color: #1A1A1A;
}

.accordion-content-inner p:last-child {
    margin-bottom: 0;
}


/* FIX: Accordion visibility */
.accordion-content {
    display: none !important;
    max-height: none !important;
}

.accordion-content.active {
    display: block !important;
}


/* ============================================
   PAGINATION
============================================ */
.pagination {
    margin-top: 3rem;
    text-align: center;
}

.pagination .page-numbers {
    display: inline-flex;
    list-style: none;
    padding: 0;
    margin: 0;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
}

.pagination .page-numbers li {
    margin: 0;
}

.pagination .page-numbers a,
.pagination .page-numbers span {
    display: inline-block;
    padding: 10px 16px;
    background: #FFFFFF;
    border: 2px solid #E0E0E0;
    border-radius: 6px;
    color: #1A1A1A;
    font-weight: 500;
    font-size: 15px;
    transition: all 0.3s ease;
    text-decoration: none;
    min-width: 44px;
    text-align: center;
}

.pagination .page-numbers a:hover {
    background: var(--button-bg, #E4002B);
    border-color: var(--button-bg, #E4002B);
    color: #FFFFFF;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(228, 0, 43, 0.3);
}

.pagination .page-numbers .current {
    background: var(--button-bg, #E4002B);
    border-color: var(--button-bg, #E4002B);
    color: #FFFFFF;
    font-weight: 600;
}

.pagination .page-numbers .dots {
    background: transparent;
    border-color: transparent;
    cursor: default;
}

.pagination .page-numbers .dots:hover {
    background: transparent;
    border-color: transparent;
    transform: none;
    box-shadow: none;
}

.pagination .page-numbers .prev,
.pagination .page-numbers .next {
    font-weight: 600;
}

/* Mobile Pagination */
@media (max-width: 768px) {
    .pagination .page-numbers {
        gap: 6px;
    }
    
    .pagination .page-numbers a,
    .pagination .page-numbers span {
        padding: 8px 12px;
        font-size: 14px;
        min-width: 38px;
    }
}

/* ============================================
   FAQ ACCORDION STYLES (Schema.org compatible)
============================================ */
.faq-accordion {
    margin: 2rem 0;
}

.faq-accordion [itemtype="https://schema.org/Question"] {
    margin-bottom: 1rem;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    transition: box-shadow 0.3s ease;
}

.faq-accordion [itemtype="https://schema.org/Question"]:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.faq-accordion [itemprop="name"] {
    margin: 0;
    padding: 1.25rem 3rem 1.25rem 1.5rem;
    font-size: 1.1em;
    font-weight: 600;
    color: #1A1A1A;
    cursor: pointer;
    user-select: none;
    position: relative;
    background: #f8f9fa;
    transition: background-color 0.3s ease;
}

.faq-accordion [itemprop="name"]:hover {
    background: #e9ecef;
}

.faq-accordion [itemprop="name"]::after {
    content: '+';
    position: absolute;
    right: 1.5rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.5em;
    font-weight: 400;
    color: var(--color-primary, #E4002B);
    transition: transform 0.3s ease;
}

.faq-accordion [itemtype="https://schema.org/Question"].active [itemprop="name"]::after {
    content: '−';
    transform: translateY(-50%) rotate(180deg);
}

.faq-accordion [itemtype="https://schema.org/Question"].active [itemprop="name"] {
    background: #fff;
    border-bottom: 1px solid #e0e0e0;
}

.faq-accordion [itemprop="acceptedAnswer"] {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease, padding 0.4s ease;
    background: #fff;
}

.faq-accordion [itemtype="https://schema.org/Question"].active [itemprop="acceptedAnswer"] {
    max-height: 1000px;
    padding: 1.5rem;
}

.faq-accordion [itemprop="acceptedAnswer"] [itemprop="text"] {
    margin: 0;
    line-height: 1.7;
    color: #333;
}

.faq-accordion [itemprop="acceptedAnswer"] [itemprop="text"] p:last-child {
    margin-bottom: 0;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .faq-accordion [itemprop="name"] {
        padding: 1rem 2.5rem 1rem 1rem;
        font-size: 1em;
    }
    
    .faq-accordion [itemprop="name"]::after {
        right: 1rem;
        font-size: 1.3em;
    }
    
    .faq-accordion [itemtype="https://schema.org/Question"].active [itemprop="acceptedAnswer"] {
        padding: 1rem;
    }
}

/* ============================================
   DETAILS/SUMMARY ACCORDION STYLES
============================================ */
.entry-content details {
    margin-bottom: 1rem;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    transition: box-shadow 0.3s ease;
}

.entry-content details:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.entry-content details:last-of-type {
    margin-bottom: 0;
}

.entry-content details summary {
    margin: 0;
    padding: 1.2rem 3rem 1.2rem 1.5rem;
    font-size: 1.1rem;
    font-weight: 600;
    color: #1A1A1A;
    cursor: pointer;
    background: #f8f9fa;
    border: none;
    position: relative;
    list-style: none;
    transition: background 0.3s ease;
    line-height: 1.4;
}

.entry-content details summary::-webkit-details-marker {
    display: none;
}

.entry-content details summary::marker {
    display: none;
    content: '';
}

.entry-content details summary:hover {
    background: #e9ecef;
}

.entry-content details summary::after {
    content: '+';
    position: absolute;
    right: 1.5rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.5rem;
    font-weight: 300;
    color: var(--color-primary, #E4002B);
    transition: transform 0.3s ease;
    line-height: 1;
}

.entry-content details[open] summary {
    background: #fff;
    border-bottom: 1px solid #e0e0e0;
}

.entry-content details[open] summary::after {
    content: '−';
}

.entry-content details > *:not(summary) {
    padding: 0 1.5rem;
}

.entry-content details > p,
.entry-content details > div {
    padding: 1.5rem;
    margin: 0;
    line-height: 1.7;
    color: #333;
}

.entry-content details > p:last-child {
    padding-bottom: 1.5rem;
}

.entry-content details a {
    color: var(--color-primary, #E4002B);
    text-decoration: underline;
}

.entry-content details a:hover {
    text-decoration: none;
}

@media (max-width: 768px) {
    .entry-content details summary {
        padding: 1rem 2.5rem 1rem 1rem;
        font-size: 1rem;
    }

    .entry-content details summary::after {
        right: 1rem;
    }

    .entry-content details > p,
    .entry-content details > div {
        padding: 1rem;
    }
}

/* ============================================
   RANDOM POST WIDGET STYLES
============================================ */
.widget_random_post .random-post-widget {
    margin-bottom: 20px;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.widget_random_post .random-post-widget:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
    transform: translateY(-2px);
}

.widget_random_post .random-post-thumbnail {
    position: relative;
    overflow: hidden;
    background: #f5f5f5;
}

.widget_random_post .random-post-thumbnail img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.4s ease;
}

.widget_random_post .random-post-thumbnail:hover img {
    transform: scale(1.05);
}

.widget_random_post .random-post-content {
    padding: 1.25rem;
}

.widget_random_post .random-post-title {
    margin: 0 0 0.75rem 0;
    font-size: 1.15em;
    font-weight: 600;
    line-height: 1.4;
}

.widget_random_post .random-post-title a {
    color: #1A1A1A;
    text-decoration: none;
    transition: color 0.3s ease;
}

.widget_random_post .random-post-title a:hover {
    color: var(--color-primary, #E4002B);
}

.widget_random_post .random-post-date {
    margin-bottom: 0.75rem;
    font-size: 0.875em;
    color: #666;
}

.widget_random_post .random-post-date time {
    display: inline-block;
}

.widget_random_post .random-post-excerpt {
    margin-bottom: 1rem;
    font-size: 0.9375em;
    line-height: 1.6;
    color: #555;
}

.widget_random_post .random-post-link {
    margin-top: 1rem;
}

.widget_random_post .random-post-link .read-more-btn {
    display: inline-block;
    padding: 0.5rem 1.25rem;
    background: var(--button-bg, #E4002B);
    color: var(--button-text-color, #FFFFFF);
    font-size: 0.9em;
    font-weight: 500;
    border-radius: 4px;
    text-decoration: none;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.widget_random_post .random-post-link .read-more-btn:hover {
    background: var(--button-bg-hover, #B30022);
    transform: translateX(3px);
}

.widget_random_post .widget-title {
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--color-primary, #E4002B);
    font-size: 1.25em;
    font-weight: 600;
    color: #1A1A1A;
}

@media (max-width: 768px) {
    .widget_random_post .random-post-content {
        padding: 1rem;
    }
    .widget_random_post .random-post-title {
        font-size: 1.1em;
    }
    .widget_random_post .random-post-link .read-more-btn {
        padding: 0.45rem 1rem;
        font-size: 0.875em;
    }
}

.footer-widget.widget_random_post .random-post-widget {
    background: rgba(255,255,255,0.05);
    box-shadow: none;
}

.footer-widget.widget_random_post .random-post-widget:hover {
    background: rgba(255,255,255,0.08);
    transform: none;
    box-shadow: none;
}

.footer-widget.widget_random_post .random-post-title a {
    color: var(--footer-link-color, #FFFFFF);
}

.footer-widget.widget_random_post .random-post-title a:hover {
    color: #FFF;
    opacity: 0.8;
}

.footer-widget.widget_random_post .random-post-date,
.footer-widget.widget_random_post .random-post-excerpt {
    color: rgba(255,255,255,0.8);
}

.footer-widget.widget_random_post .widget-title {
    color: var(--footer-text-color, #FFFFFF);
    border-bottom-color: rgba(255,255,255,0.3);
}

/* ============================================
   16. UX & READABILITY ENHANCEMENTS
============================================ */

/* --- Accessibility: selection, focus, skip link --- */
::selection {
    background: var(--color-primary, #E4002B);
    color: #FFFFFF;
}

a:focus-visible,
button:focus-visible,
.btn:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
summary:focus-visible {
    outline: 3px solid var(--color-primary, #E4002B);
    outline-offset: 2px;
    border-radius: 2px;
}

.main-nav a:focus-visible,
.footer a:focus-visible {
    outline-color: #FFFFFF;
}

.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    z-index: 100000;
    padding: 12px 24px;
    background: var(--color-primary, #E4002B);
    color: #FFFFFF;
    font-weight: 600;
    border-radius: 0 0 6px 0;
}

.skip-link:focus {
    left: 0;
    color: #FFFFFF;
}

/* --- Content typography: comfortable reading --- */
.entry-content {
    font-size: 1.125rem;
    line-height: 1.8;
    color: #2B2B2B;
    font-kerning: normal;
}

.entry-content p,
.entry-content ul,
.entry-content ol,
.entry-content blockquote,
.entry-content dl {
    max-width: 72ch;
}

.entry-content p {
    margin-bottom: 1.4rem;
    text-wrap: pretty;
}

/* Vertical rhythm: breathing room before headings */
.entry-content h2 {
    margin-top: 2.75rem;
}

.entry-content h3 {
    margin-top: 2rem;
}

.entry-content h4,
.entry-content h5 {
    margin-top: 1.5rem;
}

.entry-content h1,
.entry-content h2,
.entry-content h3 {
    text-wrap: balance;
}

/* Anchor targets (TOC links) don't hide under viewport top */
.entry-content h1[id],
.entry-content h2[id],
.entry-content h3[id],
.entry-content h4[id],
.entry-content h5[id],
.entry-content h6[id],
:target {
    scroll-margin-top: 90px;
}

/* Links inside content: visible and comfortable to hit */
.entry-content a:not(.btn):not(.read-more-btn) {
    color: var(--color-primary, #E4002B);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
    text-decoration-color: rgba(228, 0, 43, 0.35);
    transition: text-decoration-color 0.2s ease, color 0.2s ease;
}

.entry-content a:not(.btn):not(.read-more-btn):hover {
    text-decoration-color: currentColor;
}

/* Content images: soft corners */
.entry-content img {
    border-radius: 10px;
}

.entry-content .wp-block-image img,
.entry-content figure img {
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

/* --- Entry meta as chips (single post) --- */
.entry-meta-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.meta-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: #F5F6F8;
    border: 1px solid #E8EAED;
    border-radius: 999px;
    font-size: 0.8125rem;
    font-weight: 500;
    color: #444;
    line-height: 1.4;
}

.meta-chip svg {
    flex-shrink: 0;
    width: 14px;
    height: 14px;
    color: var(--color-primary, #E4002B);
}

.meta-chip a {
    color: #444;
}

.meta-chip a:hover {
    color: var(--color-primary, #E4002B);
}

/* --- Prev / Next post navigation as cards --- */
.post-nav-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.post-nav-link {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 20px 24px;
    background: #FFFFFF;
    border: 2px solid #EEEEEE;
    border-radius: 10px;
    transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
}

.post-nav-link:hover {
    border-color: var(--color-primary, #E4002B);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
    transform: translateY(-3px);
}

.post-nav-next {
    text-align: right;
    align-items: flex-end;
}

.post-nav-label {
    font-size: 0.8125rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #888;
}

.post-nav-link:hover .post-nav-label {
    color: var(--color-primary, #E4002B);
}

.post-nav-title {
    font-size: 1.05rem;
    font-weight: 600;
    line-height: 1.4;
    color: #1A1A1A;
}

@media (max-width: 768px) {
    .post-nav-grid {
        grid-template-columns: 1fr;
    }

    .post-nav-next {
        text-align: left;
        align-items: flex-start;
    }
}

/* --- Card polish: readable titles, image zoom, tidy excerpts --- */
.card-header h2,
.card-header h3 {
    font-size: 1.05em;
    font-weight: 700;
    margin-bottom: 0;
    padding-bottom: 0;
    line-height: 1.35;
}

.card-header h2::after,
.card-header h3::after {
    display: none;
}

.card-header a {
    color: #1A1A1A;
}

.card-header a:hover {
    color: var(--color-primary, #E4002B);
}

.card > a {
    overflow: hidden;
    display: block;
}

.card-image {
    transition: transform 0.4s ease;
}

.card:hover .card-image {
    transform: scale(1.04);
}

.card .entry-meta {
    font-size: 0.8125rem;
    margin-bottom: 0.75rem;
}

.card .entry-excerpt {
    color: #555;
    font-size: 0.9375em;
    line-height: 1.6;
}

.card .entry-excerpt p {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 0;
}

/* --- Hero polish --- */
.hero::before {
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.35) 0%, rgba(0, 0, 0, 0.25) 45%, rgba(0, 0, 0, 0.55) 100%);
}

.hero-content h1 {
    text-wrap: balance;
    letter-spacing: -0.01em;
}

.hero-content p {
    max-width: 60ch;
}

/* --- Tables scroll horizontally on small screens --- */
@media (max-width: 768px) {
    .entry-content table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

/* --- Reading progress bar (single posts) --- */
.reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: transparent;
    z-index: 99999;
    pointer-events: none;
}

.reading-progress-bar {
    height: 100%;
    width: 0;
    background: var(--color-primary, #E4002B);
    transition: width 0.1s linear;
}

/* --- Back to top button --- */
.back-to-top {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 46px;
    height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--button-bg, #E4002B);
    color: var(--button-text-color, #FFFFFF);
    border: none;
    border-radius: 50%;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s ease, background 0.3s ease;
    z-index: 9999;
}

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

.back-to-top:hover {
    background: var(--button-bg-hover, #B30022);
}

@media (max-width: 768px) {
    .back-to-top {
        bottom: 16px;
        right: 16px;
        width: 42px;
        height: 42px;
    }
}

/* ============================================
   17. READABILITY & CLARITY POLISH
============================================ */

/* Crisper text rendering everywhere */
body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* Clean alignment: content starts flush with headings */
.entry-content {
    margin-left: 0;
    margin-right: 0;
    overflow-wrap: break-word;
}

/* Lead paragraph: bigger intro invites into the article */
.entry-content > p:first-of-type {
    font-size: 1.15em;
    line-height: 1.7;
    color: #3A3A3A;
    margin-bottom: 1.75rem;
}

/* Bold fragments stand out more against body text */
.entry-content strong {
    color: #111111;
}

/* Multi-line headings read easier with a bit more leading */
.entry-content h2,
.entry-content h3 {
    line-height: 1.3;
}

/* Heading accent bar in the brand color (was footer color) */
.entry-content h1::after,
.entry-content h2::after,
.entry-content h3::after,
.page-content h1::after,
.page-content h2::after,
.page-content h3::after,
article h1::after,
article h2::after,
article h3::after {
    width: 60px;
    background-color: var(--color-primary, #E4002B);
}

/* HR: subtle section divider instead of a loud full-width bar */
.entry-content hr {
    width: 80px;
    height: 3px;
    margin: 2.75rem 0;
    background: var(--color-primary, #E4002B);
}

/* Slightly softer look for very long tables */
.entry-content table td {
    font-size: 0.9375em;
}

/* Mobile: tighter sections, hyphenate long Polish words, tidy breadcrumbs */
@media (max-width: 768px) {
    .section {
        padding: 40px 0;
    }

    .entry-content {
        font-size: 1.0625rem;
        line-height: 1.75;
    }

    .entry-content p {
        hyphens: auto;
    }

    .entry-content > p:first-of-type {
        font-size: 1.1em;
    }

    .breadcrumbs-list {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .breadcrumbs-list::-webkit-scrollbar {
        display: none;
    }

    .breadcrumbs-list li {
        white-space: nowrap;
    }
}

/* ============================================
   18. LISTS & TABLES READABILITY
============================================ */

/* --- Bullet lists: brand-colored dot markers --- */
.entry-content ul {
    list-style: none;
    padding-left: 0.5rem;
}

.entry-content ul > li {
    position: relative;
    padding-left: 1.6rem;
}

.entry-content ul > li::before {
    content: '';
    position: absolute;
    left: 2px;
    top: 0.68em;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--color-primary, #E4002B);
}

/* Nested bullets: hollow dot for visual hierarchy */
.entry-content ul ul > li::before {
    width: 7px;
    height: 7px;
    background: transparent;
    border: 2px solid var(--color-primary, #E4002B);
    top: 0.6em;
}

/* --- Numbered lists: circular number badges --- */
.entry-content ol {
    list-style: none;
    counter-reset: speed2-ol;
    padding-left: 0.5rem;
}

.entry-content ol > li {
    position: relative;
    padding-left: 2.4rem;
    counter-increment: speed2-ol;
}

.entry-content ol > li::before {
    content: counter(speed2-ol);
    position: absolute;
    left: 0;
    top: 0.22em;
    width: 1.5em;
    height: 1.5em;
    line-height: 1.5em;
    text-align: center;
    background: var(--color-primary, #E4002B);
    color: #FFFFFF;
    border-radius: 50%;
    font-size: 0.75em;
    font-weight: 700;
}

/* Lists with a custom start number fall back to browser numbering
   (CSS counters cannot read the start attribute) */
.entry-content ol[start] {
    list-style: decimal;
    padding-left: 2rem;
}

.entry-content ol[start] > li {
    padding-left: 0.25rem;
}

.entry-content ol[start] > li::before {
    content: none;
}

/* A touch more air between list items */
.entry-content ul li,
.entry-content ol li {
    margin-bottom: 0.7rem;
}

.entry-content ul li:last-child,
.entry-content ol li:last-child {
    margin-bottom: 0;
}

/* --- Tables: easier scanning --- */
.entry-content table td {
    vertical-align: top;
}

/* Subtle column separators help track values across rows */
.entry-content table td + td,
.entry-content table tbody th + td {
    border-left: 1px solid #EFEFEF;
}

.entry-content table thead th + th,
.entry-content table thead td + td,
.entry-content table:not(:has(thead)) > tbody > tr:first-child td + td,
.entry-content table:not(:has(thead)) > tbody > tr:first-child th + th {
    border-left: 1px solid rgba(255, 255, 255, 0.2);
}

/* First column = row label: emphasized for comparison tables
   (skips the header-styled first row of tables without <thead>) */
.entry-content table:has(thead) tbody td:first-child,
.entry-content table:has(thead) tbody th:first-child,
.entry-content table:not(:has(thead)) tbody tr:not(:first-child) td:first-child,
.entry-content table:not(:has(thead)) tbody tr:not(:first-child) th:first-child {
    font-weight: 600;
    color: #111111;
}

/* Table caption styled as a small title */
.entry-content table caption {
    caption-side: top;
    text-align: left;
    font-weight: 600;
    font-size: 0.9375em;
    color: #333333;
    padding-bottom: 8px;
}

/* Mobile: cells keep a sensible width, table scrolls sideways */
@media (max-width: 768px) {
    .entry-content table th,
    .entry-content table td {
        min-width: 120px;
        padding: 12px 14px;
    }
}

/* ============================================
   19. NAVIGATION & FOOTER POLISH
============================================ */

/* --- Main menu: animated underline indicator --- */
.main-menu > li > a {
    position: relative;
}

.main-menu > li > a::after {
    content: '';
    position: absolute;
    left: 18px;
    right: 18px;
    bottom: 6px;
    height: 2px;
    background: currentColor;
    transform: scaleX(0);
    transform-origin: left center;
    transition: transform 0.25s ease;
}

.main-menu > li > a:hover::after,
.main-menu > li.current-menu-item > a::after,
.main-menu > li.current-menu-ancestor > a::after,
.main-menu > li.current_page_item > a::after {
    transform: scaleX(1);
}

/* Softer hover overlay (was a heavy 0.2 black) */
.main-menu > li > a:hover,
.main-menu > li.active > a {
    background: rgba(0, 0, 0, 0.12);
}

/* Chevron marks items that open a submenu */
.main-menu > li.menu-item-has-children > a,
.main-menu > li.page_item_has_children > a {
    padding-right: 36px;
}

.main-menu > li.menu-item-has-children > a::before,
.main-menu > li.page_item_has_children > a::before {
    content: '';
    position: absolute;
    right: 17px;
    top: 50%;
    width: 7px;
    height: 7px;
    margin-top: -6px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
    opacity: 0.75;
    transition: transform 0.25s ease, margin-top 0.25s ease;
}

.main-menu > li.menu-item-has-children:hover > a::before,
.main-menu > li.page_item_has_children:hover > a::before {
    transform: rotate(225deg);
    margin-top: -2px;
}

/* Dropdown: rounded, accent-topped, softer shadow */
.main-menu .sub-menu,
.submenu {
    border-radius: 0 0 10px 10px;
    border-top: 3px solid var(--color-primary, #E4002B);
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.16);
    padding: 8px 0;
}

.main-menu .sub-menu li a,
.submenu li a {
    padding: 11px 20px;
    transition: background 0.2s ease, color 0.2s ease, padding-left 0.2s ease;
}

.main-menu .sub-menu li a:hover,
.submenu li a:hover {
    padding-left: 26px;
}

/* Sticky nav (class added in header.php when enabled in Customizer) */
.main-nav.nav-sticky {
    position: sticky;
    top: 0;
}

body.admin-bar .main-nav.nav-sticky {
    top: 32px;
}

@media (max-width: 782px) {
    body.admin-bar .main-nav.nav-sticky {
        top: 46px;
    }
}

/* Shadow appears once the sticky nav detaches from the top */
.main-nav.is-stuck {
    box-shadow: 0 2px 14px rgba(0, 0, 0, 0.22);
}

/* --- Mobile menu: clear separation, tap-friendly rows --- */
@media (max-width: 768px) {
    .main-menu > li > a {
        height: auto;
        padding: 14px 20px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    }

    .main-menu > li:last-child > a {
        border-bottom: none;
    }

    .main-menu > li > a::after {
        display: none;
    }

    .main-menu > li.menu-item-has-children > a::before,
    .main-menu > li.page_item_has_children > a::before {
        right: 22px;
    }

    .main-menu > li.menu-item-has-children.active > a::before,
    .main-menu > li.page_item_has_children.active > a::before {
        transform: rotate(225deg);
        margin-top: -2px;
    }

    .main-menu .sub-menu {
        border-top: none;
        border-radius: 0;
        box-shadow: none;
        padding: 0;
    }

    .menu-toggle {
        padding: 12px 16px;
    }
}

/* --- Footer: brand accent line + clearer hierarchy --- */
.footer {
    border-top: 4px solid var(--color-primary, #E4002B);
    padding: 60px 0 24px;
}

.footer-columns {
    gap: 40px;
}

.footer-column h3,
.footer-widget .widget-title {
    position: relative;
    font-size: 1.05rem;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    padding-bottom: 12px;
    margin-bottom: 1.25rem;
    border-bottom: none;
}

.footer-column h3::after,
.footer-widget .widget-title::after {
    content: '';
    display: block;
    position: absolute;
    left: 0;
    bottom: 0;
    width: 36px;
    height: 3px;
    background: var(--color-primary, #E4002B);
    border-radius: 2px;
}

/* Footer links: quieter at rest, slide on hover */
.footer-menu li a,
.footer-widget ul li a {
    display: inline-block;
    opacity: 0.85;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.footer-menu li a:hover,
.footer-widget ul li a:hover {
    opacity: 1;
    transform: translateX(4px);
}

.footer-menu li a::before,
.footer-widget ul li a::before {
    content: '› ';
    opacity: 0.6;
}

.footer-bottom {
    padding-top: 24px;
    font-size: 13px;
    opacity: 0.75;
}

@media (max-width: 768px) {
    .footer {
        padding: 40px 0 20px;
    }

    .footer-columns {
        gap: 28px;
    }
}

/* ============================================
   20. READING NAVIGATION (TOC, anchors, focus column)
============================================ */

/* Single posts without a sidebar: centered reading column instead of
   text hugging the left edge of a full-width container */
.single .col-main.no-sidebar {
    max-width: 860px !important;
    margin-left: auto;
    margin-right: auto;
}

/* Sidebar TOC: highlight the section currently being read */
.speed2-toc-list a.toc-active {
    color: var(--color-primary, #E4002B) !important;
    font-weight: 600 !important;
}

/* Heading anchor links: visible on hover */
.heading-anchor {
    margin-left: 10px;
    font-weight: 400;
    text-decoration: none !important;
    color: var(--color-primary, #E4002B) !important;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.entry-content h2:hover .heading-anchor,
.entry-content h3:hover .heading-anchor,
.heading-anchor:focus-visible {
    opacity: 0.55;
}

.heading-anchor:hover {
    opacity: 1 !important;
}


/* ============================================
   21. FORMS, WIDGET CONSISTENCY & CTA
============================================ */

/* --- Form controls: styled instead of raw browser defaults --- */
input[type="text"],
input[type="email"],
input[type="url"],
input[type="tel"],
input[type="number"],
input[type="search"],
input[type="password"],
textarea,
select {
    padding: 10px 14px;
    border: 2px solid #E0E0E0;
    border-radius: 6px;
    font-family: inherit;
    font-size: 16px;
    color: #1A1A1A;
    background: #FFFFFF;
    transition: border-color 0.2s ease;
    max-width: 100%;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="url"]:focus,
input[type="tel"]:focus,
input[type="number"]:focus,
input[type="search"]:focus,
input[type="password"]:focus,
textarea:focus,
select:focus {
    border-color: var(--color-primary, #E4002B);
    outline: none;
}

input[type="submit"],
button[type="submit"] {
    padding: 10px 22px;
    border: none;
    border-radius: 6px;
    background: var(--button-bg, #E4002B);
    color: var(--button-text-color, #FFFFFF);
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
}

input[type="submit"]:hover,
button[type="submit"]:hover {
    background: var(--button-bg-hover, #B30022);
}

/* Search form: input + button in one row */
.search-form {
    display: flex;
    gap: 8px;
    align-items: stretch;
}

.search-form label {
    flex: 1;
    margin: 0;
}

.search-form .search-field {
    width: 100%;
}

/* --- Widget titles: same visual language as the footer (short accent bar) --- */
.widget .widget-title {
    position: relative;
    border-bottom: 1px solid #ECECEC;
    padding-bottom: 12px;
}

.widget .widget-title::after {
    content: '';
    display: block;
    position: absolute;
    left: 0;
    bottom: -2px;
    width: 36px;
    height: 3px;
    background: var(--color-primary, #E4002B);
    border-radius: 2px;
}

/* Widget links: clearer affordance (marker + muted color) */
.widget:not(.speed2-toc-widget) ul li a {
    color: #333333;
    display: inline-block;
    transition: color 0.2s ease, transform 0.2s ease;
}

.widget:not(.speed2-toc-widget) ul li a::before {
    content: '\203A\00A0';
    color: var(--color-primary, #E4002B);
    opacity: 0.7;
}

.widget:not(.speed2-toc-widget) ul li a:hover {
    color: var(--color-primary, #E4002B);
    transform: translateX(3px);
}

/* --- End-of-post CTA box --- */
.speed2-end-cta {
    margin-top: 3rem;
    padding: 2.25rem 2rem;
    text-align: center;
    background: #F8F9FA;
    border: 1px solid #E8E8E8;
    border-top: 4px solid var(--color-primary, #E4002B);
    border-radius: 12px;
}

.speed2-end-cta-title {
    max-width: none !important;
    margin: 0 auto 1.25rem !important;
    font-size: 1.4em;
    font-weight: 700;
    line-height: 1.35;
    color: #1A1A1A;
    text-wrap: balance;
}

.speed2-end-cta-btn,
.speed2-end-cta a.speed2-end-cta-btn,
.speed2-end-cta button.speed2-end-cta-btn {
    display: inline-block;
    padding: 16px 40px;
    background: var(--cta-bg, var(--button-bg, #E4002B));
    color: var(--button-text-color, #FFFFFF) !important;
    border: none;
    border-radius: 50px;
    font-family: inherit;
    font-size: 17px;
    font-weight: 600;
    letter-spacing: 0.3px;
    line-height: 1.4;
    cursor: pointer;
    text-decoration: none !important;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
    transition: filter 0.2s ease, transform 0.2s ease;
}

.speed2-end-cta-btn:hover {
    filter: brightness(1.12);
    transform: translateY(-2px);
}

.speed2-end-cta-btn:active {
    transform: scale(0.97);
}

.speed2-end-cta .cta-arrow {
    display: inline-block;
    margin-left: 8px;
    transition: transform 0.2s ease;
}

.speed2-end-cta-btn:hover .cta-arrow {
    transform: translateX(4px);
}

.speed2-end-cta-subtext {
    max-width: none !important;
    margin: 1rem 0 0 !important;
    font-size: 0.8125rem;
    color: #666666;
}

@media (max-width: 768px) {
    .speed2-end-cta {
        padding: 1.75rem 1.25rem;
    }

    .speed2-end-cta-btn {
        display: block;
        width: 100%;
    }
}

/* --- Bottom-of-screen coexistence: floating CTA vs back-to-top --- */
body:has(.evw-floating-btn-wrapper) .back-to-top {
    bottom: 100px;
}

@media (max-width: 768px) {
    body:has(.evw-floating-btn-wrapper) .back-to-top {
        bottom: calc(84px + env(safe-area-inset-bottom));
    }
}

/* ============================================
   22a. TOP MENU - PILL STYLE
============================================ */
.main-menu {
    gap: 4px;
}

.main-menu > li {
    display: flex;
    align-items: center;
    height: var(--nav-height, 50px);
}

.main-menu > li > a {
    height: auto;
    padding: 9px 18px;
    border-radius: 8px;
}

/* Pill highlight replaces the underline indicator */
.main-menu > li > a::after {
    display: none;
}

.main-menu > li > a:hover {
    background: rgba(0, 0, 0, 0.16);
}

.main-menu > li.current-menu-item > a,
.main-menu > li.current-menu-ancestor > a,
.main-menu > li.current_page_item > a,
.main-menu > li.active > a {
    background: rgba(0, 0, 0, 0.2);
}

.main-menu > li.menu-item-has-children > a,
.main-menu > li.page_item_has_children > a {
    padding-right: 34px;
}

.main-menu > li.menu-item-has-children > a::before,
.main-menu > li.page_item_has_children > a::before {
    right: 14px;
}

@media (max-width: 768px) {
    .main-menu {
        gap: 0;
    }

    .main-menu > li {
        display: block;
        height: auto;
    }

    .main-menu > li > a {
        padding: 14px 20px;
        border-radius: 0;
    }

    .main-menu > li.menu-item-has-children > a::before,
    .main-menu > li.page_item_has_children > a::before {
        right: 22px;
    }
}

/* ============================================
   22. IMAGES IN CONTENT
============================================ */

/* Block images centered by default */
.entry-content img {
    margin-left: auto;
    margin-right: auto;
}

.entry-content figure {
    margin-left: auto;
    margin-right: auto;
}

/* Floated images keep text flowing around them on desktop... */
.entry-content .alignleft {
    max-width: 46%;
}

.entry-content .alignright {
    max-width: 46%;
}

/* ...but go full-width on mobile (no text squeezed into a sliver) */
@media (max-width: 768px) {
    .entry-content .alignleft,
    .entry-content .alignright {
        float: none;
        max-width: 100%;
        margin-left: 0;
        margin-right: 0;
        margin-bottom: 1.5rem;
    }
}

/* Classic editor captions (.wp-caption) styled like figcaption */
.entry-content .wp-caption {
    max-width: 100%;
    background: transparent;
    border: none;
    padding: 0;
    margin-bottom: 2rem;
}

.entry-content .wp-caption img {
    margin-bottom: 0;
}

.entry-content .wp-caption .wp-caption-text {
    font-size: 0.875em;
    color: #777777;
    text-align: center;
    font-style: italic;
    margin: 0.75rem 0 0;
    padding-top: 0.5rem;
    border-top: 1px solid #EBEBEB;
}

/* Linked images hint they are clickable */
.entry-content a img {
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.entry-content a:hover img {
    opacity: 0.9;
}

/* Galleries: consistent rounding */
.entry-content .wp-block-gallery img,
.entry-content .gallery img {
    border-radius: 8px;
}

/* Full/wide alignment images keep no rounding on tiny screens edge cases */
@media (max-width: 480px) {
    .entry-content img {
        border-radius: 8px;
    }
}

/* ===================================================================
   Polylang – przełącznik języka w stopce (widget lub menu stopki)
   -------------------------------------------------------------------
   Naprawiane objawy i ich przyczyny:
   1) flaga nad nazwą zamiast obok  -> globalne `img { display:block }`,
   2) „›" przed każdym językiem     -> `.footer-widget ul li a::before`,
   3) lista renderowana płasko      -> rozwijanie miał tylko `.main-menu`,
   4) nazwy języków niewidoczne     -> `.footer a { color: … !important }`
      w motywie wygrywało ze zwykłą regułą, stąd biały tekst na białym tle;
      dlatego kolor w liście MUSI być podany z `!important`,
   5) lista zamykała się w drodze kursora -> odstęp między przyciskiem
      a listą tworzył martwy pas, na którym gasł `:hover`,
   6) dwa suwaki (pionowy i poziomy) -> `white-space:nowrap` rozpychało
      treść ponad szerokość panelu, a jedna kolumna robiła z listy słupek
      na kilkaset pikseli. Teraz: układ kolumnowy (2 kolumny od 9 języków,
      3 od 17), brak przewijania w poziomie, wyższy limit wysokości.
   Polylang przy dropdown=1 buduje `li.pll-parent-menu-item > a` + `ul.sub-menu`
   z pozycjami `li.lang-item` – struktura była dobra, brakowało stylu.
   =================================================================== */

.footer-widget .pll-parent-menu-item,
.footer-menu .pll-parent-menu-item {
    position: relative;
    margin-bottom: 0;
}

/* Flaga i nazwa w jednej linii – dotyczy i przycisku, i pozycji listy */
.footer-widget .pll-parent-menu-item > a,
.footer-widget .lang-item > a,
.footer-menu .pll-parent-menu-item > a,
.footer-menu .lang-item > a {
    display: flex;
    align-items: center;
    gap: 8px;
    line-height: 1.4;
}

/* Zdejmij dziedziczone „›" sprzed pozycji przełącznika */
.footer-widget .pll-parent-menu-item > a::before,
.footer-widget .lang-item > a::before,
.footer-menu .pll-parent-menu-item > a::before,
.footer-menu .lang-item > a::before {
    content: none;
}

.footer-widget .pll-parent-menu-item img,
.footer-widget .lang-item img,
.footer-menu .pll-parent-menu-item img,
.footer-menu .lang-item img {
    display: inline-block;
    width: 20px;
    height: auto;
    margin: 0;
    flex-shrink: 0;
    border-radius: 2px;
}

/* Przycisk – pokazuje bieżący język */
.footer-widget .pll-parent-menu-item > a,
.footer-menu .pll-parent-menu-item > a {
    justify-content: flex-start;
    max-width: 260px;
    padding: 8px 12px;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.08);
    cursor: pointer;
}

.footer-widget .pll-parent-menu-item > a:hover,
.footer-widget .pll-parent-menu-item > a:focus,
.footer-menu .pll-parent-menu-item > a:hover,
.footer-menu .pll-parent-menu-item > a:focus {
    background: rgba(255, 255, 255, 0.16);
}

/* Strzałka: w dół gdy zamknięte, w górę gdy otwarte (lista wychodzi w górę) */
.footer-widget .pll-parent-menu-item > a::after,
.footer-menu .pll-parent-menu-item > a::after {
    content: '';
    width: 7px;
    height: 7px;
    margin-left: auto;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg) translate(-2px, -2px);
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

/* Panel z językami.
   `bottom: 100%` BEZ odstępu jest celowe: przy szczelinie kursor w drodze
   z przycisku na listę przechodzi przez martwy pas, `:hover` gaśnie i panel
   znika, zanim da się kliknąć język. Separację robi ramka i cień. */
.footer-widget .pll-parent-menu-item > .sub-menu,
.footer-menu .pll-parent-menu-item > .sub-menu {
    display: none;
    grid-template-columns: 1fr;
    align-content: start;
    position: absolute;
    left: 0;
    bottom: 100%;
    z-index: 100;
    width: max-content;
    min-width: 100%;
    max-width: min(92vw, 460px);
    max-height: min(70vh, 480px);
    overflow-y: auto;
    overflow-x: hidden; /* koniec z poziomym suwakiem */
    margin: 0;
    padding: 6px;
    list-style: none;
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 6px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

/* Dużo języków = kolumny zamiast słupka na kilkaset pikseli.
   Ten sam mechanizm (`:has`) motyw stosuje już dla długich list w treści. */
.footer-widget .pll-parent-menu-item > .sub-menu:has(> li:nth-child(9)),
.footer-menu .pll-parent-menu-item > .sub-menu:has(> li:nth-child(9)) {
    grid-template-columns: 1fr 1fr;
}

.footer-widget .pll-parent-menu-item > .sub-menu:has(> li:nth-child(17)),
.footer-menu .pll-parent-menu-item > .sub-menu:has(> li:nth-child(17)) {
    grid-template-columns: 1fr 1fr 1fr;
}

@media (max-width: 600px) {
    .footer-widget .pll-parent-menu-item > .sub-menu,
    .footer-menu .pll-parent-menu-item > .sub-menu {
        grid-template-columns: 1fr !important;
    }
}

.footer-widget .pll-parent-menu-item:hover > .sub-menu,
.footer-widget .pll-parent-menu-item:focus-within > .sub-menu,
.footer-widget .pll-parent-menu-item.is-open > .sub-menu,
.footer-menu .pll-parent-menu-item:hover > .sub-menu,
.footer-menu .pll-parent-menu-item:focus-within > .sub-menu,
.footer-menu .pll-parent-menu-item.is-open > .sub-menu {
    display: grid;
}

.footer-widget .pll-parent-menu-item:hover > a::after,
.footer-widget .pll-parent-menu-item:focus-within > a::after,
.footer-widget .pll-parent-menu-item.is-open > a::after,
.footer-menu .pll-parent-menu-item:hover > a::after,
.footer-menu .pll-parent-menu-item:focus-within > a::after,
.footer-menu .pll-parent-menu-item.is-open > a::after {
    transform: rotate(-135deg) translate(-2px, -2px);
}

.footer-widget .pll-parent-menu-item > .sub-menu li,
.footer-menu .pll-parent-menu-item > .sub-menu li {
    margin: 0;
}

/* Kolor MUSI być z `!important` – w motywie jest `.footer a { color: … !important }`,
   przez co nazwy języków były białe na białym panelu (widoczne dopiero pod kursorem). */
.footer-widget .pll-parent-menu-item > .sub-menu li a,
.footer-menu .pll-parent-menu-item > .sub-menu li a {
    padding: 7px 10px;
    border-radius: 4px;
    color: #1d2327 !important;
    font-size: 14px;
}

.footer-widget .pll-parent-menu-item > .sub-menu li a:hover,
.footer-widget .pll-parent-menu-item > .sub-menu li a:focus,
.footer-menu .pll-parent-menu-item > .sub-menu li a:hover,
.footer-menu .pll-parent-menu-item > .sub-menu li a:focus {
    background: rgba(0, 0, 0, 0.06);
    color: var(--color-primary, #E4002B) !important;
}

/* Awaryjnie: switcher z dropdown=0 (płaska lista bez przycisku) –
   wtedy przynajmniej flagi stoją równo z napisami i nie ma „›" przy każdym. */
.footer-widget .lang-item > a,
.footer-menu .lang-item > a {
    padding: 2px 0;
}
