/* ============================================================
   12-modules.css
   Moduły Joomla, które mogą pojawić się na DOWOLNEJ podstronie:
   akordeony (FAQ, „O nas", finanse, treść artykułu), sekcja
   „O nas" ze statystykami, wyszukiwarka w FAQ.
   Ładowany ZAWSZE — dlatego moduł na /o-nas nie traci stylów.
   ============================================================ */


/* --- AKORDEONY — wspólna baza dla wszystkich na stronie ---
   Jeden zestaw reguł dla .accordion-item, .custom-faq-item,
   .faq-question i .fin-item, żeby wszędzie miały tę samą wysokość.
   Wysokość regulujesz dwiema zmiennymi poniżej.               */
.accordion {
    --wiw-acc-pad-x: 1.1rem;
    --wiw-acc-pad-y: .82rem;   /* było 1.25rem — ok. 1/3 mniej */
}

.accordion-item,
.custom-faq-item,
.faq-question {
    /* !important, bo w markupie modułów wiszą utilities Bootstrapa
       (.border, .rounded-3, .mb-2), które same mają !important */
    background-color: var(--blue-ice) !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius-sm) !important;
    margin-bottom: .6rem !important;
    overflow: hidden;
}
.accordion-item:last-child,
.custom-faq-item:last-child,
.faq-question:last-child { margin-bottom: 0 !important; }

.accordion-header { margin: 0; }

.accordion-button,
.custom-faq-item .accordion-button,
.faq-question button {
    padding: var(--wiw-acc-pad-y, .82rem) var(--wiw-acc-pad-x, 1.1rem) !important;
    font-size: .95rem;
    font-weight: 700;
    line-height: 1.35;
    color: var(--blue-deep) !important;
    background-color: transparent !important;
    box-shadow: none !important;
    text-decoration: none;
}
.accordion-button:not(.collapsed) {
    background-color: transparent !important;
    box-shadow: none !important;
}
.accordion-button:focus { box-shadow: none !important; }
.accordion-button::after {
    width: 1rem;
    height: 1rem;
    background-size: 1rem;
    flex-shrink: 0;
}

.accordion-body,
.custom-faq-item .accordion-body,
.faq-question .accordion-body {
    padding: 0 var(--wiw-acc-pad-x, 1.1rem) calc(var(--wiw-acc-pad-y, .82rem) * .95) !important;
    font-size: .9rem;
    line-height: 1.55;
    color: var(--text-mid);
}
/* w bazie jest `* { margin:0 }`, więc akapity w akordeonie trzeba rozsunąć ręcznie */
.accordion-body p { margin-bottom: .6rem; }
.accordion-body p:last-child { margin-bottom: 0; }

/* wariant biały (FAQ na stronie głównej) */
.faq-question { background-color: var(--white) !important; }

/* --- AKORDEONY — tryb ciemny --- */
body.dark-mode .accordion-item,
body.dark-mode .custom-faq-item,
body.dark-mode .faq-question {
    background-color: #101e32 !important;
    border-color: rgba(255,255,255,.1) !important;
}
body.dark-mode .accordion-button,
body.dark-mode .custom-faq-item .accordion-button,
body.dark-mode .faq-question button { color: var(--blue-pale) !important; }
body.dark-mode .accordion-body,
body.dark-mode .custom-faq-item .accordion-body { color: #c8deff !important; }
body.dark-mode .accordion-button::after { filter: invert(1) brightness(2); }


/* --- WYSZUKIWARKA W MODULE FAQ --- */
.faq-search { position: relative; }
.faq-search-input {
    width: 100%;
    padding: .7rem 1.1rem;
    font-family: 'DM Sans', sans-serif;
    font-size: .92rem;
    color: var(--text-dark);
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 40px;
    transition: border-color .18s ease, box-shadow .18s ease;
}
.faq-search-input::placeholder { color: var(--text-muted); }
.faq-search-input:focus {
    outline: none;
    border-color: var(--blue-mid);
    box-shadow: 0 0 0 3px rgba(26,79,170,.12);
}
.faq-search-input::-webkit-search-cancel-button { cursor: pointer; }

body.dark-mode .faq-search-input {
    background: #101e32;
    border-color: rgba(255,255,255,.12);
    color: #c8deff;
}
body.dark-mode .faq-search-input::placeholder { color: rgba(200,222,255,.45); }
body.dark-mode .faq-search-input:focus {
    border-color: var(--blue-light);
    box-shadow: 0 0 0 3px rgba(0,117,152,.2);
}


/* --- SEKCJA „O NAS" + STATYSTYKI ---
   Przeniesione z 20-home.css: ten moduł jest też na /o-nas,
   czyli na widoku, który nie ładuje arkusza strony głównej.   */
.about-section {
    background: linear-gradient(135deg, var(--blue-deep) 0%, var(--blue-mid) 100%);
    border-radius: var(--radius-lg);
    padding: 3rem 2.5rem;
    color: var(--white);
    margin: 3rem 0;
}
/* h2/h3 jako znacznik ORAZ jako klasa Bootstrapa na <div> */
.about-section h2,
.about-section .h2 { color: var(--white); margin-bottom: .5rem; }
.about-section h3,
.about-section .h3 {
    color: var(--white);
    font-size: 1rem;
    margin-bottom: .35rem;
    display: block;
}
.about-section p { color: rgba(255,255,255,.8); font-size: .95rem; }
.about-section p:not(:last-child) { margin-bottom: .75rem; }

.stat-block { text-align: center; padding: 0; background: transparent; border: none; }
.stat-block-inner {
    text-align: center;
    padding: 1.25rem .5rem;
    background: rgba(255,255,255,.07);
    border-radius: var(--radius-md);
    height: 100%;
}
.stat-number {
    font-family: 'DM Sans', sans-serif;
    font-weight: 700;
    font-size: 2.2rem;
    color: var(--blue-pale);
    line-height: 1;
}
.stat-label { font-size: .78rem; color: rgba(255,255,255,.7); margin-top: .4rem; }

.about-col h4 { color: var(--white); font-size: 1rem; margin-bottom: .35rem; }
.about-col p { color: rgba(255,255,255,.75); font-size: .85rem; }

@media (max-width: 767px) {
    .about-section { padding: 2rem 1.25rem; margin: 2rem 0; }
    .stat-number { font-size: 1.8rem; }
}


/* --- BOKSY NEWSOWE Z URL-i (.jsdiv_*) ---
   Przeniesione z 30-article.css: skrypt 20-linkbox.js dziala na kazdej
   stronie (takze na kategoriach i blogu), wiec style musza byc wszedzie. */
/* placeholder trzyma wysokosc docelowej karty — bez tego zamiana <p> na karte
   przesuwa tresc pod spodem (CLS). Progi zgodne z ukladem karty ponizej. */
.jsdiv_loading { display: flex; align-items: center; justify-content: center; margin: 0.85rem 0; min-height: 260px; border: 1px solid var(--border-color, #e5e7eb); border-radius: 10px; background: var(--card-bg, #fff); color: var(--text-muted, #9ca3af); font-size: 0.85rem; }
@media (max-width: 576px) { .jsdiv_loading { min-height: 84px; } }
@media (min-width: 640px) { .jsdiv_loading { min-height: 135px; } }


.jsdiv_card { display: block; margin: 0.85rem 0; border: 1px solid var(--border-color, #e5e7eb); border-radius: 10px; background: var(--card-bg, #fff); color: inherit; text-decoration: none !important; overflow: hidden; transition: box-shadow .2s ease, transform .2s ease, border-color .2s ease; }
.jsdiv_card:hover { box-shadow: 0 6px 20px rgba(0, 0, 0, .08); border-color: var(--blue-mid, #0A2A6E); transform: translateY(-1px); }
.jsdiv_card:focus-visible { outline: 2px solid var(--blue-mid, #0A2A6E); outline-offset: 2px; }
.jsdiv_inner { display: flex; flex-direction: column; }
.jsdiv_image { position: relative; flex: 0 0 auto; background: #f3f4f6; overflow: hidden; aspect-ratio: 3 / 2; width: 100%; }
.jsdiv_image img { width: 100% !important; height: 100% !important; max-width: none !important; aspect-ratio: auto !important; margin: 0 !important; padding: 0 !important; border-radius: 0 !important; object-fit: cover !important; display: block !important; transition: transform .3s ease; }
.jsdiv_card:hover .jsdiv_image img { transform: scale(1.03); }
.jsdiv_placeholder { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; color: #9ca3af; background: linear-gradient(135deg, #f9fafb 0%, #f3f4f6 100%); }
.jsdiv_play-icon { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; pointer-events: none; transition: transform .2s ease; }
.jsdiv_card:hover .jsdiv_play-icon { transform: scale(1.1); }
.jsdiv_content { padding: 0.7rem 0.9rem; display: flex; flex-direction: column; justify-content: center; min-width: 0; flex: 1 1 auto; }
.jsdiv_category { font-size: 0.7rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--blue-mid, #0A2A6E); margin-bottom: 0.2rem; line-height: 1.2; }
.jsdiv_title { font-size: 1rem; font-weight: 600; line-height: 1.35; margin: 0 0 0.25rem 0; color: var(--text-dark, #111827); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.jsdiv_desc { font-size: 0.85rem; line-height: 1.45; color: var(--text-mid, #4b5563); margin: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.jsdiv_card--youtube .jsdiv_category { color: #cc0000; }
.jsdiv_card--internal .jsdiv_category { color: var(--blue-mid, #0A2A6E); }
.jsdiv_card--external .jsdiv_category { color: #6b7280; }
.jsdiv_card--youtube .jsdiv_image { aspect-ratio: 16 / 9 !important; }
.jsdiv_card .jsdiv_inner:not(:has(.jsdiv_image)) .jsdiv_content { padding: 0.85rem 1.1rem; }
@media (min-width: 640px) {
  .jsdiv_inner { flex-direction: row; align-items: stretch; }
  .jsdiv_image { flex: 0 0 200px; width: 200px; aspect-ratio: 3 / 2; }
  .jsdiv_card--youtube .jsdiv_image { flex: 0 0 280px !important; width: 280px !important; aspect-ratio: 16 / 9 !important; }
  .jsdiv_content { padding: 0.8rem 1rem; }
  .jsdiv_title { font-size: 1.05rem; }
  .jsdiv_desc { font-size: 0.875rem; -webkit-line-clamp: 3; }
}

@media (max-width: 576px) {
  .jsdiv_card .jsdiv_inner { display: flex; flex-direction: row; align-items: center; gap: 0.85rem; padding: 0.7rem 0.85rem; }
  .jsdiv_card .jsdiv_image { flex: 0 0 64px; width: 64px; height: 64px; margin: 0; border-radius: 50%; overflow: hidden; aspect-ratio: 1 / 1; }
  .jsdiv_card .jsdiv_image img { width: 100%; height: 100%; object-fit: cover; display: block; }
  .jsdiv_card .jsdiv_play-icon svg { width: 22px; height: 22px; }
  .jsdiv_card .jsdiv_placeholder svg { width: 26px; height: 26px; }
  .jsdiv_card .jsdiv_content { flex: 1; min-width: 0; padding: 0; }
  .jsdiv_card .jsdiv_category { font-size: 0.68rem; margin-bottom: 0.1rem; }
  .jsdiv_card .jsdiv_title { font-size: 0.95rem; line-height: 1.25; margin: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .jsdiv_card .jsdiv_desc { display: none; }
}
