@import url("https://fonts.googleapis.com/css2?family=Cinzel:wght@500;600;700&family=Inter:wght@400;500;600;700&family=Playfair+Display:wght@600;700;800&display=swap");
/*
Theme Name: Arsenał Historii Modern
Description: Autorski motyw portalu historyczno-encyklopedycznego.
Version: 2.3.1
Author: Arsenał Historii
Text Domain: arsenal-historii
*/

:root {
    --ah-green: #26382d;
    --ah-green-dark: #17241d;
    --ah-sand: #c7ad78;
    --ah-paper: #f3efe5;
    --ah-red: #8d352f;
    --ah-graphite: #242725;
    --ah-muted: #687069;
    --ah-white: #ffffff;
    --ah-border: #d8d1c1;
    --ah-width: 1240px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    color: var(--ah-graphite);
    background: var(--ah-paper);
    font-family: Arial, Helvetica, sans-serif;
    line-height: 1.65;
}

a {
    color: var(--ah-red);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

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

.ah-container {
    width: min(calc(100% - 32px), var(--ah-width));
    margin-inline: auto;
}

.ah-topbar {
    color: #e9e4d9;
    background: var(--ah-green-dark);
    font-size: 14px;
}

.ah-topbar-inner {
    min-height: 36px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.ah-site-header {
    color: var(--ah-white);
    background:
        linear-gradient(110deg, rgba(23, 36, 29, .98), rgba(38, 56, 45, .92)),
        radial-gradient(circle at 80% 20%, #566b59, transparent 55%);
    border-bottom: 4px solid var(--ah-sand);
}

.ah-branding {
    padding: 30px 0 25px;
}

.ah-site-title {
    margin: 0;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(34px, 6vw, 64px);
    line-height: 1;
    letter-spacing: .02em;
}

.ah-site-title a {
    color: var(--ah-white);
    text-decoration: none;
}

.ah-tagline {
    max-width: 760px;
    margin: 12px 0 0;
    color: #ddd5c3;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 18px;
}

.ah-navigation {
    background: rgba(0, 0, 0, .22);
}

.ah-menu {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    margin: 0;
    padding: 0;
    list-style: none;
}

.ah-menu a {
    display: block;
    padding: 15px 18px;
    color: var(--ah-white);
    font-weight: 700;
    text-decoration: none;
}

.ah-menu a:hover {
    color: var(--ah-green-dark);
    background: var(--ah-sand);
}

.ah-hero {
    padding: 72px 0;
    color: var(--ah-white);
    background:
        linear-gradient(90deg, rgba(23, 36, 29, .97), rgba(23, 36, 29, .55)),
        linear-gradient(135deg, #344b3b, #111a15);
}

.ah-hero-content {
    max-width: 790px;
}

.ah-eyebrow {
    color: var(--ah-sand);
    font-size: 13px;
    font-weight: 800;
    letter-spacing: .18em;
    text-transform: uppercase;
}

.ah-hero h1 {
    margin: 12px 0 18px;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(38px, 7vw, 72px);
    line-height: 1.05;
}

.ah-hero p {
    color: #e1ddd3;
    font-size: 19px;
}

.ah-button {
    display: inline-block;
    margin: 12px 10px 0 0;
    padding: 12px 20px;
    color: var(--ah-green-dark);
    background: var(--ah-sand);
    border: 1px solid var(--ah-sand);
    font-weight: 800;
    text-decoration: none;
}

.ah-button:hover {
    color: var(--ah-white);
    background: transparent;
    text-decoration: none;
}

.ah-main {
    min-height: 55vh;
    padding: 46px 0 70px;
}

.ah-section {
    margin-bottom: 48px;
}

.ah-section-title {
    margin: 0 0 22px;
    padding-bottom: 10px;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 32px;
    border-bottom: 2px solid var(--ah-sand);
}

.ah-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 22px;
}

.ah-card {
    overflow: hidden;
    background: var(--ah-white);
    border: 1px solid var(--ah-border);
    box-shadow: 0 8px 24px rgba(31, 39, 33, .08);
}

.ah-card-image {
    aspect-ratio: 16 / 10;
    background: linear-gradient(135deg, #506354, #1a281f);
    object-fit: cover;
}

.ah-card-body {
    padding: 18px;
}

.ah-card h2,
.ah-card h3 {
    margin: 0 0 8px;
    font-family: Georgia, "Times New Roman", serif;
    line-height: 1.2;
}

.ah-card h2 a,
.ah-card h3 a {
    color: var(--ah-graphite);
}

.ah-meta {
    color: var(--ah-muted);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.ah-article {
    max-width: 880px;
    padding: 32px;
    background: var(--ah-white);
    border: 1px solid var(--ah-border);
}

.ah-article h1 {
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(34px, 5vw, 54px);
    line-height: 1.1;
}

.ah-footer {
    padding: 42px 0;
    color: #d8d4ca;
    background: var(--ah-green-dark);
    border-top: 4px solid var(--ah-sand);
}

.ah-footer strong {
    color: var(--ah-white);
}

.screen-reader-text {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

@media (max-width: 960px) {
    .ah-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 620px) {
    .ah-grid {
        grid-template-columns: 1fr;
    }

    .ah-topbar-inner {
        align-items: flex-start;
        flex-direction: column;
        padding: 8px 0;
        gap: 2px;
    }

    .ah-menu {
        flex-direction: column;
    }

    .ah-menu a {
        padding: 11px 0;
    }

    .ah-article {
        padding: 22px;
    }
}

.ah-lead {
    color: var(--ah-muted);
    font-family: Georgia, "Times New Roman", serif;
    font-size: 20px;
}

.ah-featured {
    margin: 26px 0;
}

.ah-facts {
    margin: 30px 0;
    border-top: 4px solid var(--ah-sand);
}

.ah-facts h2,
.ah-classification h2 {
    font-family: Georgia, "Times New Roman", serif;
}

.ah-facts table {
    width: 100%;
    border-collapse: collapse;
}

.ah-facts th,
.ah-facts td {
    padding: 11px 14px;
    text-align: left;
    border: 1px solid var(--ah-border);
}

.ah-facts th {
    width: 38%;
    background: #e7e0d1;
}

.ah-facts tr:nth-child(even) td {
    background: #faf8f2;
}

.ah-classification {
    margin: 28px 0;
    padding: 18px 22px;
    background: #ece7da;
    border-left: 4px solid var(--ah-green);
}

.ah-post-navigation {
    max-width: 880px;
    margin-top: 24px;
}

.ah-nav-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.ah-search {
    display: flex;
    flex: 0 1 340px;
}

.ah-search input {
    width: 100%;
    min-width: 120px;
    padding: 10px 12px;
    color: var(--ah-graphite);
    background: var(--ah-white);
    border: 0;
}

.ah-search button {
    padding: 10px 14px;
    color: var(--ah-green-dark);
    background: var(--ah-sand);
    border: 0;
    font-weight: 800;
    cursor: pointer;
}

@media (max-width: 850px) {
    .ah-nav-inner {
        align-items: stretch;
        flex-direction: column;
        padding-bottom: 15px;
    }

    .ah-search {
        flex-basis: auto;
        width: 100%;
    }
}

/* Zwarty, przyklejony nagłówek */
.ah-site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 5px 18px rgba(0, 0, 0, .2);
}

.admin-bar .ah-site-header {
    top: 32px;
}

.ah-branding {
    padding: 10px 0;
}

.ah-logo {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    color: var(--ah-white);
    text-decoration: none;
}

.ah-logo:hover {
    text-decoration: none;
}

.ah-logo-mark {
    width: 52px;
    height: 58px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    color: var(--ah-sand);
    background: var(--ah-green-dark);
    border: 2px solid var(--ah-sand);
    border-radius: 8px 8px 18px 18px;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 22px;
    font-weight: 800;
    line-height: 1;
}

.ah-logo-copy {
    display: flex;
    flex-direction: column;
}

.ah-logo-copy strong {
    color: var(--ah-white);
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(23px, 3vw, 34px);
    line-height: 1.05;
}

.ah-logo-copy small {
    margin-top: 4px;
    color: #ddd5c3;
    font-size: 13px;
}

.ah-category-navigation {
    overflow: hidden;
    background: #111a15;
    border-top: 1px solid rgba(255, 255, 255, .09);
}

.ah-category-menu {
    display: flex;
    gap: 0;
    margin: 0;
    padding: 0;
    overflow-x: auto;
    list-style: none;
    scrollbar-width: thin;
}

.ah-category-menu li {
    flex: 0 0 auto;
}

.ah-category-menu a {
    display: block;
    padding: 9px 13px;
    color: #ddd5c3;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
    text-decoration: none;
}

.ah-category-menu a:hover {
    color: var(--ah-green-dark);
    background: var(--ah-sand);
}

@media (max-width: 782px) {
    .admin-bar .ah-site-header {
        top: 46px;
    }

    .ah-logo-copy small {
        display: none;
    }

    .ah-logo-mark {
        width: 44px;
        height: 48px;
    }
}

@media (max-width: 600px) {
    .admin-bar .ah-site-header {
        top: 0;
    }

    .ah-site-header {
        position: sticky;
    }

    .ah-logo-copy strong {
        font-size: 24px;
    }
}

/* Nagłówek z historycznym tłem */
.ah-site-header {
    background-image:
        linear-gradient(
            90deg,
            rgba(16, 27, 21, .97) 0%,
            rgba(24, 39, 30, .91) 45%,
            rgba(16, 27, 21, .82) 100%
        ),
        url("assets/header-background.png");
    background-position: center 45%;
    background-size: cover;
}

.ah-header-row {
    min-height: 104px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 32px;
    padding-top: 10px;
    padding-bottom: 10px;
}

.ah-header-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 10px 18px;
}

.ah-header-actions .ah-navigation {
    background: transparent;
}

.ah-header-actions .ah-menu {
    justify-content: flex-end;
}

.ah-header-actions .ah-menu a {
    padding: 11px 12px;
    border-radius: 3px;
}

.ah-header-actions .ah-search {
    flex: 0 1 280px;
    min-width: 230px;
}

@media (max-width: 1050px) {
    .ah-header-row {
        align-items: flex-start;
        flex-direction: column;
        gap: 10px;
    }

    .ah-header-actions {
        width: 100%;
        justify-content: space-between;
    }
}

@media (max-width: 760px) {
    .ah-header-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .ah-header-actions .ah-menu {
        justify-content: flex-start;
    }

    .ah-header-actions .ah-search {
        width: 100%;
        min-width: 0;
        flex-basis: auto;
    }
}

/* Dwukolumnowy układ z modułem kategorii */
.ah-content-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 290px;
    align-items: start;
    gap: 32px;
}

.ah-content-primary {
    min-width: 0;
}

.ah-content-primary .ah-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.ah-sidebar {
    position: sticky;
    top: 172px;
}

.admin-bar .ah-sidebar {
    top: 204px;
}

.ah-sidebar-module {
    margin-bottom: 22px;
    overflow: hidden;
    background: var(--ah-white);
    border: 1px solid var(--ah-border);
    box-shadow: 0 8px 24px rgba(31, 39, 33, .09);
}

.ah-sidebar-module h2 {
    margin: 0;
    padding: 14px 17px;
    color: var(--ah-white);
    background: var(--ah-green);
    border-bottom: 3px solid var(--ah-sand);
    font-family: Georgia, "Times New Roman", serif;
    font-size: 19px;
}

.ah-sidebar-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.ah-sidebar-list li + li {
    border-top: 1px solid var(--ah-border);
}

.ah-sidebar-list a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 11px 15px;
    color: var(--ah-graphite);
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
}

.ah-sidebar-list a:hover {
    color: var(--ah-green-dark);
    background: #e9e2d2;
}

.ah-sidebar-list b {
    min-width: 24px;
    padding: 2px 6px;
    color: var(--ah-white);
    background: var(--ah-red);
    border-radius: 10px;
    text-align: center;
    font-size: 11px;
}

.ah-sidebar-about p {
    margin: 0;
    padding: 16px;
    color: var(--ah-muted);
    font-size: 14px;
}

@media (max-width: 1050px) {
    .ah-content-layout {
        grid-template-columns: 1fr;
    }

    .ah-sidebar {
        position: static;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 20px;
    }

    .ah-content-primary .ah-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 620px) {
    .ah-sidebar {
        display: block;
    }

    .ah-content-primary .ah-grid {
        grid-template-columns: 1fr;
    }
}

/* Pełne logo oraz wyraźniejsze zdjęcie nagłówka */
.ah-logo-image {
    width: 76px;
    height: 76px;
    flex: 0 0 auto;
    object-fit: contain;
    filter: drop-shadow(0 3px 5px rgba(0, 0, 0, .4));
}

.ah-site-header {
    background-image:
        linear-gradient(
            90deg,
            rgba(13, 24, 18, .91) 0%,
            rgba(20, 35, 26, .76) 48%,
            rgba(12, 24, 17, .56) 100%
        ),
        url("assets/header-background.png");
    background-position: center 48%;
}

@media (max-width: 760px) {
    .ah-logo-image {
        width: 58px;
        height: 58px;
    }
}

/* Pełne logo oraz wyraźniejsze zdjęcie nagłówka */
.ah-logo-image {
    width: 76px;
    height: 76px;
    flex: 0 0 auto;
    object-fit: contain;
    filter: drop-shadow(0 3px 5px rgba(0, 0, 0, .4));
}

.ah-site-header {
    background-image:
        linear-gradient(
            90deg,
            rgba(13, 24, 18, .91) 0%,
            rgba(20, 35, 26, .76) 48%,
            rgba(12, 24, 17, .56) 100%
        ),
        url("assets/header-background.png");
    background-position: center 48%;
}

@media (max-width: 760px) {
    .ah-logo-image {
        width: 58px;
        height: 58px;
    }
}

/* Pełne logo oraz wyraźniejsze zdjęcie nagłówka */
.ah-logo-image {
    width: 76px;
    height: 76px;
    flex: 0 0 auto;
    object-fit: contain;
    filter: drop-shadow(0 3px 5px rgba(0, 0, 0, .4));
}

.ah-site-header {
    background-image:
        linear-gradient(
            90deg,
            rgba(13, 24, 18, .91) 0%,
            rgba(20, 35, 26, .76) 48%,
            rgba(12, 24, 17, .56) 100%
        ),
        url("assets/header-background.png");
    background-position: center 48%;
}

@media (max-width: 760px) {
    .ah-logo-image {
        width: 58px;
        height: 58px;
    }
}

/* Podtytuł w jednej linii */
.ah-logo-copy small {
    max-width: none;
    white-space: nowrap;
}

@media (max-width: 900px) {
    .ah-logo-copy small {
        white-space: normal;
    }
}

/* Rozwijane drzewo kategorii */
.ah-category-group {
    border-bottom: 1px solid var(--ah-border);
}

.ah-category-group:last-child {
    border-bottom: 0;
}

.ah-category-group summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 15px;
    color: var(--ah-graphite);
    background: var(--ah-white);
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
    list-style: none;
}

.ah-category-group summary::-webkit-details-marker {
    display: none;
}

.ah-category-group summary::before {
    content: "›";
    color: var(--ah-red);
    font-size: 22px;
    line-height: 1;
    transition: transform .2s ease;
}

.ah-category-group[open] summary::before {
    transform: rotate(90deg);
}

.ah-category-group summary:hover {
    background: #e9e2d2;
}

.ah-category-group summary b,
.ah-category-group li b {
    min-width: 23px;
    padding: 2px 6px;
    color: var(--ah-white);
    background: var(--ah-red);
    border-radius: 10px;
    text-align: center;
    font-size: 11px;
}

.ah-category-group ul {
    margin: 0;
    padding: 0;
    background: #f7f4ec;
    list-style: none;
}

.ah-category-group li {
    border-top: 1px solid #e1dacb;
}

.ah-category-group li a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 9px 13px 9px 31px;
    color: #454b46;
    font-size: 13px;
    text-decoration: none;
}

.ah-category-group li a:hover,
.ah-category-group li.is-current a {
    color: var(--ah-green-dark);
    background: #ded4bd;
}

.ah-category-group .ah-category-all a {
    padding-left: 20px;
    color: var(--ah-red);
    font-weight: 800;
}

/* ===== MODERN HEADER 2.0 ===== */

.modern-header {
    position: sticky;
    top: 0;
    z-index: 10000;
    width: 100%;
    color: #fff;
    background:
        linear-gradient(rgba(7,20,15,.94), rgba(7,20,15,.94)),
        url("assets/header-background.png") center / cover;
    border-bottom: 2px solid #c8a65e;
    box-shadow: 0 4px 18px rgba(0,0,0,.22);
}

.admin-bar .modern-header {
    top: 32px;
}

.modern-header-inner {
    display: flex;
    width: min(1400px, calc(100% - 48px));
    min-height: 92px;
    margin: 0 auto;
    align-items: center;
    justify-content: space-between;
    gap: 28px;
}

.modern-brand {
    display: flex;
    min-width: 0;
    color: #fff;
    text-decoration: none;
    align-items: center;
    gap: 14px;
}

.modern-logo {
    display: block;
    width: 54px;
    height: 66px;
    flex: 0 0 54px;
    object-fit: contain;
}

.modern-brand-copy {
    display: block;
    min-width: 0;
}

.modern-brand-copy strong {
    display: block;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(27px, 2vw, 36px);
    line-height: 1.05;
    white-space: nowrap;
}

.modern-brand-copy small {
    display: block;
    margin-top: 6px;
    color: rgba(255,255,255,.78);
    font-size: 12px;
    line-height: 1.3;
    white-space: nowrap;
}

.modern-desktop-actions {
    display: flex;
    align-items: center;
    gap: 25px;
}

.modern-menu {
    display: flex;
    margin: 0;
    padding: 0;
    align-items: center;
    gap: 24px;
    list-style: none;
}

.modern-menu li {
    margin: 0;
    padding: 0;
}

.modern-menu a {
    display: block;
    padding: 10px 0;
    color: rgba(255,255,255,.92);
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
}

.modern-menu a:hover,
.modern-menu .current-menu-item > a {
    color: #dec17f;
}

.modern-search {
    display: flex;
    height: 40px;
}

.modern-search input {
    width: 175px;
    min-width: 0;
    padding: 0 12px;
    color: #172019;
    background: #fff;
    border: 0;
}

.modern-search button,
.modern-mobile-search button {
    padding: 0 16px;
    color: #102219;
    font-weight: 700;
    cursor: pointer;
    background: #c8a65e;
    border: 0;
}

.modern-mobile-menu {
    display: none;
}

/* Tablet */

@media (max-width: 1050px) {
    .modern-header-inner {
        width: min(100% - 30px, 1400px);
    }

    .modern-brand-copy small {
        display: none;
    }

    .modern-menu {
        gap: 15px;
    }

    .modern-search {
        display: none;
    }
}

/* Telefon */

@media (max-width: 760px) {
    .admin-bar .modern-header {
        top: 0;
    }

    #wpadminbar {
        display: none !important;
    }

    html {
        margin-top: 0 !important;
    }

    .modern-header {
        background: #091c14;
    }

    .modern-header-inner {
        position: relative;
        width: 100%;
        min-height: 58px;
        padding: 6px 12px;
        gap: 10px;
    }

    .modern-brand {
        flex: 1;
        gap: 8px;
    }

    .modern-logo {
        width: 32px;
        height: 42px;
        flex-basis: 32px;
    }

    .modern-brand-copy strong {
        max-width: calc(100vw - 105px);
        overflow: hidden;
        font-size: 20px;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .modern-brand-copy small,
    .modern-desktop-actions {
        display: none;
    }

    .modern-mobile-menu {
        position: static;
        display: block;
        flex: 0 0 44px;
    }

    .modern-mobile-menu > summary {
        display: flex;
        width: 44px;
        height: 44px;
        padding: 10px;
        cursor: pointer;
        list-style: none;
        background: transparent;
        border: 1px solid rgba(200,166,94,.65);
        border-radius: 4px;
        align-items: center;
        flex-direction: column;
        justify-content: center;
        gap: 5px;
    }

    .modern-mobile-menu > summary::-webkit-details-marker {
        display: none;
    }

    .modern-mobile-menu > summary span {
        display: block;
        width: 22px;
        height: 2px;
        background: #dec17f;
        border-radius: 2px;
    }

    .modern-mobile-menu[open] > summary span:nth-child(1) {
        transform: translateY(7px) rotate(45deg);
    }

    .modern-mobile-menu[open] > summary span:nth-child(2) {
        opacity: 0;
    }

    .modern-mobile-menu[open] > summary span:nth-child(3) {
        transform: translateY(-7px) rotate(-45deg);
    }

    .modern-mobile-menu > nav {
        position: absolute;
        top: 100%;
        right: 0;
        left: 0;
        padding: 7px 13px 4px;
        background: #091c14;
        border-top: 1px solid rgba(200,166,94,.25);
        box-shadow: 0 14px 24px rgba(0,0,0,.3);
    }

    .modern-mobile-links {
        margin: 0;
        padding: 0;
        list-style: none;
    }

    .modern-mobile-links li {
        margin: 0;
        padding: 0;
    }

    .modern-mobile-links a {
        display: block;
        padding: 11px 7px;
        color: rgba(255,255,255,.92);
        font-size: 14px;
        font-weight: 700;
        text-decoration: none;
        border-bottom: 1px solid rgba(255,255,255,.09);
    }

    .modern-mobile-links a:hover,
    .modern-mobile-links .current-menu-item > a {
        color: #dec17f;
    }

    .modern-mobile-search {
        position: absolute;
        top: calc(100% + 213px);
        right: 0;
        left: 0;
        display: flex;
        padding: 0 13px 13px;
        background: #091c14;
    }

    .modern-mobile-search input {
        min-width: 0;
        height: 40px;
        padding: 0 11px;
        flex: 1;
        border: 0;
    }
}

/* ===== MODERN HOMEPAGE 2.0 ===== */

:root {
    --modern-dark: #081710;
    --modern-green: #0e2b20;
    --modern-green-light: #173b2e;
    --modern-gold: #c8a65e;
    --modern-gold-light: #dfc37f;
    --modern-paper: #f5f1e8;
    --modern-card: #fbf9f4;
    --modern-border: #dcd4c5;
    --modern-text: #18221b;
}

body.home {
    background: var(--modern-paper);
}

/* Baner */

.modern-featured {
    position: relative;
    width: 100%;
    overflow: hidden;
    padding: 0 0 20px;
    background:
        radial-gradient(circle at 50% 0, rgba(200,166,94,.08), transparent 42%),
        linear-gradient(135deg, #07140e, #0e291e);
    border-bottom: 1px solid rgba(200,166,94,.3);
}

.modern-slider-viewport {
    width: 100%;
    overflow: hidden;
}

.modern-slider-track {
    display: flex;
    width: max-content;
    gap: 3px;
    align-items: stretch;
    transition: transform .75s cubic-bezier(.22,.61,.36,1);
    will-change: transform;
}

.modern-feature-card {
    position: relative;
    width: 24vw;
    min-width: 285px;
    height: 390px;
    margin: 0;
    overflow: hidden;
    background: var(--modern-green);
    border-right: 1px solid rgba(200,166,94,.25);
}

.modern-feature-card:first-child {
    width: 37vw;
    min-width: 440px;
}

.modern-feature-card > a {
    position: relative;
    display: block;
    width: 100%;
    height: 100%;
    color: #fff;
    text-decoration: none;
}

.modern-feature-image,
.modern-placeholder {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    filter: sepia(.23) saturate(.8) contrast(1.05);
    transition:
        transform 1s cubic-bezier(.2,.65,.3,1),
        filter .5s ease;
}

.modern-placeholder {
    background: linear-gradient(135deg, #243c30, #101c16);
}

.modern-feature-card > a:hover .modern-feature-image {
    filter: sepia(.12) saturate(.96) contrast(1.08);
    transform: scale(1.045);
}

.modern-feature-shade {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(
            to bottom,
            rgba(4,13,9,.02) 16%,
            rgba(4,13,9,.28) 50%,
            rgba(4,13,9,.96) 100%
        );
}

.modern-feature-copy {
    position: absolute;
    right: 24px;
    bottom: 27px;
    left: 24px;
    z-index: 2;
    display: block;
}

.modern-feature-copy small {
    display: block;
    margin-bottom: 9px;
    color: var(--modern-gold-light);
    font-family: Arial, sans-serif;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .09em;
    text-transform: uppercase;
}

.modern-feature-copy strong {
    display: -webkit-box;
    margin-bottom: 10px;
    overflow: hidden;
    color: #fff;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(25px, 2vw, 36px);
    line-height: 1.08;
    overflow-wrap: anywhere;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.modern-feature-card:first-child .modern-feature-copy strong {
    font-size: clamp(34px, 2.7vw, 47px);
}

.modern-feature-copy > span {
    display: -webkit-box;
    max-width: 620px;
    overflow: hidden;
    color: rgba(255,255,255,.84);
    font-size: 14px;
    line-height: 1.55;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.modern-slider-progress {
    width: min(1460px, calc(100% - 56px));
    height: 3px;
    margin: 19px auto 0;
    overflow: hidden;
    background: rgba(255,255,255,.14);
}

.modern-slider-progress span {
    display: block;
    width: 22%;
    height: 100%;
    background: var(--modern-gold);
}

/* Układ treści */

.modern-home-main {
    width: 100%;
    margin: 0;
    padding: 0;
    background: var(--modern-paper);
}

.modern-home-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 350px;
    width: min(1400px, calc(100% - 56px));
    margin: 0 auto;
    padding: 46px 0 54px;
    align-items: start;
    gap: 30px;
}

.modern-home-content {
    min-width: 0;
}

.modern-latest > h2 {
    position: relative;
    margin: 0 0 24px;
    padding-bottom: 13px;
    color: var(--modern-text);
    font-family: Georgia, "Times New Roman", serif;
    font-size: 31px;
    line-height: 1.15;
    border-bottom: 1px solid rgba(168,137,71,.55);
}

.modern-latest > h2::after {
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 45px;
    height: 3px;
    content: "";
    background: var(--modern-gold);
}

/* Karty artykułów */

.modern-article-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-auto-rows: 1fr;
    gap: 19px;
    align-items: stretch;
}

.modern-article-card {
    display: flex;
    width: 100%;
    min-width: 0;
    height: 100%;
    margin: 0;
    overflow: hidden;
    flex-direction: column;
    background: var(--modern-card);
    border: 1px solid var(--modern-border);
    transition:
        transform .25s ease,
        box-shadow .25s ease;
}

.modern-article-card:hover {
    box-shadow: 0 15px 32px rgba(18,31,24,.12);
    transform: translateY(-4px);
}

.modern-card-photo {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: #263b31;
}

.modern-card-image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: transform .65s ease;
}

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

.modern-card-copy {
    display: flex;
    min-width: 0;
    padding: 17px 18px 19px;
    flex: 1;
    flex-direction: column;
}

.modern-card-copy > small {
    display: -webkit-box;
    min-height: 1.2em;
    margin-bottom: 8px;
    overflow: hidden;
    color: #a5833f;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 1;
}

.modern-card-copy h3 {
    display: -webkit-box;
    min-height: 2.3em;
    margin: 0 0 10px;
    overflow: hidden;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(20px, 1.45vw, 24px);
    line-height: 1.15;
    overflow-wrap: anywhere;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.modern-card-copy h3 a {
    color: var(--modern-text);
    text-decoration: none;
}

.modern-card-copy h3 a:hover {
    color: #785f29;
}

.modern-card-copy p {
    display: -webkit-box;
    min-height: 4.6em;
    margin: 0 0 16px;
    overflow: hidden;
    color: #4c534f;
    font-size: 14px;
    line-height: 1.52;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}

.modern-card-copy time {
    display: block;
    margin-top: auto;
    color: #888a83;
    font-size: 12px;
}

/* Dolne działy */

.modern-departments {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-auto-rows: 1fr;
    margin-top: 20px;
    gap: 19px;
    align-items: stretch;
}

.modern-department {
    position: relative;
    display: flex;
    width: 100%;
    min-width: 0;
    aspect-ratio: 16 / 7;
    overflow: hidden;
    color: #fff;
    text-decoration: none;
    background-color: var(--modern-green);
    background-position: center;
    background-size: cover;
}

.modern-department-shade {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(
            90deg,
            rgba(7,22,15,.95),
            rgba(7,22,15,.42)
        );
    transition: background .3s ease;
}

.modern-department:hover .modern-department-shade {
    background:
        linear-gradient(
            90deg,
            rgba(7,22,15,.88),
            rgba(7,22,15,.24)
        );
}

.modern-department-copy {
    position: relative;
    z-index: 2;
    display: flex;
    width: 100%;
    padding: 23px;
    flex-direction: column;
    justify-content: center;
}

.modern-department-copy strong {
    margin-bottom: 8px;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 26px;
}

.modern-department-copy small {
    display: -webkit-box;
    max-width: 230px;
    overflow: hidden;
    color: rgba(255,255,255,.8);
    font-size: 12px;
    line-height: 1.45;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.modern-department-copy b {
    margin-top: 7px;
    color: var(--modern-gold-light);
    font-size: 20px;
}

/* Sidebar */

body.home .modern-home-layout .ah-sidebar {
    position: sticky;
    top: 114px;
    margin: 0;
    padding: 0;
    overflow: hidden;
    color: #fff;
    background: linear-gradient(145deg, #173a2e, #0d241b);
    border: 1px solid rgba(200,166,94,.3);
    box-shadow: 0 15px 34px rgba(12,29,20,.15);
}

body.home .modern-home-layout .ah-sidebar-module {
    margin: 0;
    padding: 0;
    color: #fff;
    background: transparent;
    border: 0;
}

body.home .modern-home-layout
.ah-sidebar-module + .ah-sidebar-module {
    border-top: 1px solid rgba(200,166,94,.25);
}

body.home .modern-home-layout .ah-sidebar-module > h2 {
    margin: 0;
    padding: 20px 22px 16px;
    color: #fff;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 22px;
    background: rgba(255,255,255,.025);
    border-bottom: 1px solid rgba(200,166,94,.22);
}

body.home .modern-home-layout .ah-sidebar-module > h2::after {
    display: block;
    width: 40px;
    height: 2px;
    margin-top: 10px;
    content: "";
    background: var(--modern-gold);
}

body.home .modern-home-layout .ah-category-group {
    margin: 0;
    color: #fff;
    background: transparent;
    border: 0;
    border-bottom: 1px solid rgba(255,255,255,.11);
}

body.home .modern-home-layout .ah-category-group summary {
    display: flex;
    min-height: 50px;
    padding: 13px 17px;
    cursor: pointer;
    list-style: none;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: rgba(255,255,255,.91);
    background: transparent;
}

body.home .modern-home-layout
.ah-category-group summary::-webkit-details-marker {
    display: none;
}

body.home .modern-home-layout .ah-category-group summary::before {
    color: var(--modern-gold);
    content: "›";
    font-size: 21px;
    transition: transform .2s ease;
}

body.home .modern-home-layout
.ah-category-group[open] summary::before {
    transform: rotate(90deg);
}

body.home .modern-home-layout .ah-category-group summary span {
    flex: 1;
    font-size: 14px;
    font-weight: 700;
}

body.home .modern-home-layout .ah-category-group summary b {
    display: grid;
    min-width: 25px;
    height: 25px;
    padding: 0 6px;
    place-items: center;
    color: var(--modern-green);
    font-size: 11px;
    background: var(--modern-gold);
    border-radius: 20px;
}

body.home .modern-home-layout .ah-category-group ul {
    margin: 0;
    padding: 5px 17px 13px 43px;
    list-style: none;
    background: rgba(0,0,0,.14);
}

body.home .modern-home-layout .ah-category-group li {
    margin: 0;
    padding: 0;
    border: 0;
}

body.home .modern-home-layout .ah-category-group li a {
    display: flex;
    padding: 8px 0;
    color: rgba(255,255,255,.74);
    font-size: 13px;
    text-decoration: none;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

body.home .modern-home-layout .ah-category-group li a:hover {
    color: var(--modern-gold-light);
}

body.home .modern-home-layout .ah-sidebar-list {
    margin: 0;
    padding: 8px 20px 18px;
    list-style: none;
}

body.home .modern-home-layout .ah-sidebar-list li {
    border-bottom: 1px solid rgba(255,255,255,.1);
}

body.home .modern-home-layout .ah-sidebar-list a {
    display: block;
    padding: 12px 3px;
    color: rgba(255,255,255,.86);
    font-weight: 700;
    text-decoration: none;
}

body.home .modern-home-layout .ah-sidebar-about p {
    margin: 0;
    padding: 18px 22px 24px;
    color: rgba(255,255,255,.7);
    font-size: 13px;
    line-height: 1.65;
}

/* Laptop */

@media (max-width: 1250px) {
    .modern-home-layout {
        grid-template-columns: minmax(0, 1fr) 310px;
        gap: 22px;
    }

    .modern-article-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .modern-feature-card {
        width: 33vw;
    }

    .modern-feature-card:first-child {
        width: 46vw;
    }
}

/* Tablet */

@media (max-width: 960px) {
    .modern-home-layout {
        display: block;
        width: min(100% - 32px, 850px);
        padding-top: 34px;
    }

    body.home .modern-home-layout .ah-sidebar {
        position: static;
        width: 100%;
        margin-top: 30px;
    }

    .modern-feature-card,
    .modern-feature-card:first-child {
        width: 58vw;
        min-width: 440px;
        height: 370px;
    }

    .modern-departments {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .modern-department:last-child {
        grid-column: 1 / -1;
        aspect-ratio: 16 / 5;
    }
}

/* Telefon */

@media (max-width: 650px) {
    .modern-feature-card,
    .modern-feature-card:first-child {
        width: 88vw;
        min-width: 88vw;
        height: 350px;
    }

    .modern-feature-copy {
        right: 18px;
        bottom: 21px;
        left: 18px;
    }

    .modern-feature-copy strong,
    .modern-feature-card:first-child .modern-feature-copy strong {
        font-size: 28px;
    }

    .modern-feature-copy > span {
        font-size: 13px;
    }

    .modern-slider-progress {
        width: calc(100% - 28px);
        margin-top: 14px;
    }

    .modern-home-layout {
        width: calc(100% - 28px);
        padding: 28px 0 38px;
    }

    .modern-latest > h2 {
        font-size: 27px;
    }

    .modern-article-grid,
    .modern-departments {
        grid-template-columns: 1fr;
        gap: 17px;
    }

    .modern-card-photo {
        aspect-ratio: 16 / 9;
    }

    .modern-card-copy h3 {
        min-height: 0;
        font-size: 23px;
        -webkit-line-clamp: 3;
    }

    .modern-card-copy p {
        min-height: 0;
    }

    .modern-department,
    .modern-department:last-child {
        grid-column: auto;
        aspect-ratio: 16 / 8;
    }
}

@media (max-width: 380px) {
    .modern-feature-card,
    .modern-feature-card:first-child {
        width: 92vw;
        min-width: 92vw;
        height: 325px;
    }

    .modern-feature-copy strong,
    .modern-feature-card:first-child .modern-feature-copy strong {
        font-size: 25px;
    }
}

/* ===== MODERN SHOWCASE 2.1 ===== */

.modern-featured {
    isolation: isolate;
    padding: 18px 0 20px;
    background: #081710;
}

.modern-showcase-background {
    position: absolute;
    inset: 0;
    z-index: -2;
    display: block;
    opacity: 0;
    background-position: center;
    background-size: cover;
    filter: sepia(.18) saturate(.82) contrast(1.04);
    transform: scale(1.025);
    transition:
        opacity .65s ease,
        transform 5.5s ease;
}

.modern-showcase-background.is-visible {
    opacity: 1;
    transform: scale(1);
}

.modern-featured::after {
    position: absolute;
    inset: 0;
    z-index: -1;
    content: "";
    pointer-events: none;
    background:
        linear-gradient(
            to bottom,
            rgba(5,16,11,.08),
            rgba(5,16,11,.3) 44%,
            rgba(5,16,11,.88)
        );
}

.modern-slider-viewport {
    width: min(1420px, calc(100% - 48px));
    margin: 0 auto;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,.2);
    border-radius: 7px;
    box-shadow: 0 15px 38px rgba(0,0,0,.24);
}

.modern-slider-track {
    position: relative;
    z-index: 2;
    display: grid;
    width: 100%;
    height: 480px;
    gap: 0;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    transform: none !important;
}

.modern-feature-card,
.modern-feature-card:first-child {
    position: relative;
    width: auto;
    min-width: 0;
    height: 480px;
    margin: 0;
    overflow: hidden;
    background: transparent;
    border: 0;
    border-right: 1px solid rgba(255,255,255,.22);
    transition:
        background .3s ease,
        box-shadow .3s ease;
}

.modern-feature-card:last-child {
    border-right: 0;
}

.modern-feature-card::after {
    position: absolute;
    inset: 0;
    z-index: 1;
    content: "";
    pointer-events: none;
    opacity: 0;
    background:
        linear-gradient(
            to bottom,
            rgba(200,166,94,.05),
            rgba(200,166,94,.14)
        );
    transition: opacity .3s ease;
}

.modern-feature-card:hover::after,
.modern-feature-card.is-active::after {
    opacity: 1;
}

.modern-feature-card .modern-feature-image {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.modern-feature-card .modern-feature-shade {
    z-index: 1;
    background:
        linear-gradient(
            to bottom,
            transparent 20%,
            rgba(5,15,10,.18) 48%,
            rgba(5,15,10,.91) 100%
        );
}

.modern-feature-card .modern-feature-copy {
    right: 25px;
    bottom: 27px;
    left: 25px;
    z-index: 3;
}

.modern-feature-card .modern-feature-copy small {
    display: inline-block;
    width: auto;
    margin-bottom: 12px;
    padding: 5px 8px;
    color: #142019;
    font-size: 11px;
    background: rgba(255,255,255,.92);
    border-radius: 3px;
}

.modern-feature-card .modern-feature-copy strong,
.modern-feature-card:first-child .modern-feature-copy strong {
    min-height: 2.25em;
    font-size: clamp(23px, 1.7vw, 30px);
}

.modern-feature-card .modern-feature-copy > span {
    min-height: 3.1em;
    font-size: 13px;
    line-height: 1.55;
}

.modern-feature-card.is-active {
    box-shadow: inset 0 -3px 0 var(--modern-gold);
}

.modern-slider-progress {
    position: relative;
    z-index: 3;
    width: min(1420px, calc(100% - 48px));
    margin-top: 16px;
}

/* Tablet */

@media (max-width: 960px) {
    .modern-slider-track {
        height: 430px;
    }

    .modern-feature-card,
    .modern-feature-card:first-child {
        height: 430px;
    }

    .modern-feature-card .modern-feature-copy {
        right: 17px;
        left: 17px;
    }

    .modern-feature-card .modern-feature-copy strong,
    .modern-feature-card:first-child .modern-feature-copy strong {
        font-size: 22px;
    }

    .modern-feature-card .modern-feature-copy > span {
        -webkit-line-clamp: 3;
    }
}

/* Telefon */

@media (max-width: 650px) {
    .modern-featured {
        padding-top: 0;
    }

    .modern-slider-viewport {
        width: 100%;
        border-right: 0;
        border-left: 0;
        border-radius: 0;
    }

    .modern-slider-track {
        display: flex;
        width: max-content;
        height: 390px;
        overflow: visible;
    }

    .modern-feature-card,
    .modern-feature-card:first-child {
        width: 82vw;
        min-width: 82vw;
        height: 390px;
        flex: 0 0 82vw;
    }

    .modern-feature-card .modern-feature-copy strong,
    .modern-feature-card:first-child .modern-feature-copy strong {
        min-height: 0;
        font-size: 27px;
    }

    .modern-feature-card .modern-feature-copy > span {
        min-height: 0;
        font-size: 13px;
    }

    .modern-slider-progress {
        width: calc(100% - 28px);
    }
}

/* ===== MODERN SHOWCASE STATIC 2.2 ===== */

.modern-featured {
    padding: 22px 0 25px;
    background: #081710;
}

.modern-showcase-background {
    display: none !important;
}

.modern-featured::after {
    display: none !important;
}

.modern-slider-viewport {
    width: min(1420px, calc(100% - 48px));
    margin: 0 auto;
    overflow: visible;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
}

.modern-slider-track {
    display: grid;
    width: 100%;
    height: auto;
    gap: 14px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    transform: none !important;
}

.modern-feature-card,
.modern-feature-card:first-child {
    position: relative;
    width: auto;
    min-width: 0;
    height: 430px;
    margin: 0;
    overflow: hidden;
    background: #12271e;
    border: 1px solid rgba(200,166,94,.28);
    border-radius: 11px;
    box-shadow: 0 10px 25px rgba(0,0,0,.2);
    transition:
        transform .3s ease,
        box-shadow .3s ease,
        border-color .3s ease;
}

.modern-feature-card:last-child {
    border-right: 1px solid rgba(200,166,94,.28);
}

.modern-feature-card:hover,
.modern-feature-card:focus-within {
    z-index: 3;
    border-color: rgba(222,193,127,.8);
    box-shadow: 0 18px 38px rgba(0,0,0,.34);
    transform: translateY(-5px);
}

.modern-feature-card::after,
.modern-feature-card:hover::after,
.modern-feature-card.is-active::after {
    display: none;
}

.modern-feature-card .modern-feature-image {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    opacity: 1;
    pointer-events: none;
    object-fit: cover;
    object-position: center;
    filter: sepia(.18) saturate(.82) contrast(1.05);
    transform: scale(1);
    transition:
        transform .7s ease,
        filter .4s ease;
}

.modern-feature-card:hover .modern-feature-image,
.modern-feature-card:focus-within .modern-feature-image {
    filter: sepia(.06) saturate(.95) contrast(1.08);
    transform: scale(1.055);
}

.modern-feature-card .modern-feature-shade {
    z-index: 1;
    display: block;
    background:
        linear-gradient(
            to bottom,
            rgba(5,15,10,.03) 18%,
            rgba(5,15,10,.28) 48%,
            rgba(5,15,10,.94) 100%
        );
    transition: background .35s ease;
}

.modern-feature-card:hover .modern-feature-shade,
.modern-feature-card:focus-within .modern-feature-shade {
    background: rgba(5,15,10,.55);
}

.modern-feature-card .modern-feature-copy {
    right: 22px;
    bottom: 24px;
    left: 22px;
    z-index: 3;
    opacity: 1;
    transform: translateY(0);
    transition:
        opacity .25s ease,
        transform .3s ease;
}

.modern-feature-card:hover .modern-feature-copy,
.modern-feature-card:focus-within .modern-feature-copy {
    opacity: 0;
    transform: translateY(15px);
    pointer-events: none;
}

.modern-feature-card .modern-feature-copy small {
    display: inline-block;
    width: auto;
    margin-bottom: 11px;
    padding: 5px 8px;
    color: #172019;
    font-size: 11px;
    background: rgba(255,255,255,.93);
    border-radius: 4px;
}

.modern-feature-card .modern-feature-copy strong,
.modern-feature-card:first-child .modern-feature-copy strong {
    min-height: 0;
    font-size: clamp(23px, 1.55vw, 29px);
}

.modern-feature-card .modern-feature-copy > span {
    min-height: 0;
    font-size: 13px;
    line-height: 1.5;
}

.modern-feature-card > a::after {
    position: absolute;
    top: 50%;
    left: 50%;
    z-index: 5;
    display: block;
    padding: 13px 19px;
    color: #102219;
    content: "Czytaj całość";
    font-family: Arial, sans-serif;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
    white-space: nowrap;
    opacity: 0;
    background: var(--modern-gold-light);
    border: 1px solid rgba(255,255,255,.3);
    border-radius: 4px;
    box-shadow: 0 8px 24px rgba(0,0,0,.25);
    transform: translate(-50%, -40%);
    transition:
        opacity .25s ease,
        background .2s ease,
        transform .3s ease;
}

.modern-feature-card:hover > a::after,
.modern-feature-card:focus-within > a::after {
    opacity: 1;
    transform: translate(-50%, -50%);
}

.modern-feature-card > a:hover::after {
    background: #efd28e;
}

.modern-slider-progress {
    display: none !important;
}

/* Tablet – układ 2 × 2 */

@media (max-width: 1000px) {
    .modern-slider-track {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .modern-feature-card,
    .modern-feature-card:first-child {
        width: auto;
        min-width: 0;
        height: 390px;
    }
}

/* Telefon – jeden kafelek w rzędzie */

@media (max-width: 650px) {
    .modern-featured {
        padding: 12px 0 18px;
    }

    .modern-slider-viewport {
        width: calc(100% - 24px);
        margin: 0 auto;
        overflow: visible;
    }

    .modern-slider-track {
        display: grid;
        width: 100%;
        height: auto;
        gap: 13px;
        grid-template-columns: 1fr;
    }

    .modern-feature-card,
    .modern-feature-card:first-child {
        width: 100%;
        min-width: 0;
        height: 330px;
        flex: none;
        border-radius: 9px;
    }

    .modern-feature-card .modern-feature-copy {
        right: 18px;
        bottom: 19px;
        left: 18px;
    }

    .modern-feature-card .modern-feature-copy strong,
    .modern-feature-card:first-child .modern-feature-copy strong {
        font-size: 27px;
    }

    /*
     * Telefony nie mają klasycznego najechania kursorem.
     * Przycisk pozostaje widoczny w dolnym rogu.
     */

    .modern-feature-card > a::after {
        top: auto;
        right: 17px;
        bottom: 17px;
        left: auto;
        padding: 9px 12px;
        font-size: 11px;
        opacity: 1;
        transform: none;
    }

    .modern-feature-card:hover > a::after,
    .modern-feature-card:focus-within > a::after {
        transform: none;
    }

    .modern-feature-card:hover .modern-feature-copy,
    .modern-feature-card:focus-within .modern-feature-copy {
        opacity: 1;
        transform: none;
    }

    .modern-feature-card .modern-feature-copy {
        padding-right: 105px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .modern-feature-card,
    .modern-feature-image,
    .modern-feature-copy,
    .modern-feature-card > a::after {
        transition: none !important;
    }
}

/* ===== MODERN SHARED HOVER 2.3 ===== */

.modern-slider-viewport {
    position: relative;
    isolation: isolate;
}

.modern-shared-background {
    position: absolute;
    inset: 0;
    z-index: 0;
    display: block;
    opacity: 0;
    pointer-events: none;
    background-position: center;
    background-size: cover;
    filter: sepia(.13) saturate(.88) contrast(1.06);
    transform: scale(1.025);
    transition:
        opacity .55s ease,
        transform .8s ease;
}

.modern-shared-background::after {
    position: absolute;
    inset: 0;
    display: block;
    content: "";
    background:
        linear-gradient(
            to bottom,
            rgba(5,15,10,.03) 15%,
            rgba(5,15,10,.2) 48%,
            rgba(5,15,10,.82) 100%
        );
}

.modern-shared-background.is-visible {
    opacity: 1;
    transform: scale(1);
}

.modern-slider-track {
    position: relative;
    z-index: 2;
}

.modern-slider-viewport.has-shared-background
.modern-feature-card .modern-feature-image {
    opacity: 0;
}

.modern-slider-viewport.has-shared-background
.modern-feature-card {
    background: transparent;
}

.modern-slider-viewport.has-shared-background
.modern-feature-card .modern-feature-shade {
    background:
        linear-gradient(
            to bottom,
            transparent 22%,
            rgba(5,15,10,.12) 50%,
            rgba(5,15,10,.72) 100%
        );
}

.modern-slider-viewport.has-shared-background
.modern-feature-card.is-hovered .modern-feature-shade {
    background: rgba(5,15,10,.48);
}

.modern-slider-viewport.has-shared-background
.modern-feature-card:not(.is-hovered) {
    background: rgba(6,18,12,.08);
}

.modern-slider-viewport.has-shared-background
.modern-feature-card:not(.is-hovered) .modern-feature-copy {
    opacity: 1;
    transform: none;
}

.modern-slider-viewport.has-shared-background
.modern-feature-card.is-hovered .modern-feature-copy {
    opacity: 0;
    transform: translateY(15px);
}

.modern-slider-viewport.has-shared-background
.modern-feature-card.is-hovered > a::after {
    opacity: 1;
    transform: translate(-50%, -50%);
}

/* Na urządzeniach dotykowych pozostają cztery osobne zdjęcia */

@media (hover: none), (pointer: coarse) {
    .modern-shared-background {
        display: none;
    }

    .modern-slider-viewport.has-shared-background
    .modern-feature-card .modern-feature-image {
        opacity: 1;
    }
}

/* ===== MODERN CONNECTED SHOWCASE 2.4 ===== */

.modern-slider-viewport {
    position: relative;
    isolation: isolate;
    width: min(1420px, calc(100% - 48px));
    margin: 0 auto;
    overflow: hidden !important;
    background: #10251c;
    border: 1px solid rgba(200,166,94,.38);
    border-radius: 13px;
    box-shadow: 0 16px 38px rgba(0,0,0,.3);
}

.modern-slider-track {
    display: grid;
    width: 100%;
    gap: 0 !important;
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.modern-feature-card,
.modern-feature-card:first-child {
    width: auto;
    min-width: 0;
    margin: 0;
    overflow: hidden;
    background: transparent;
    border: 0;
    border-right: 1px solid rgba(255,255,255,.24);
    border-radius: 0 !important;
    box-shadow: none;
    transform: none;
}

.modern-feature-card:last-child {
    border-right: 0;
}

.modern-feature-card:hover,
.modern-feature-card:focus-within {
    border-color: rgba(255,255,255,.32);
    box-shadow: none;
    transform: none;
}

.modern-feature-card .modern-feature-image {
    inset: 0;
    width: 100%;
    height: 100%;
    max-width: none;
    object-fit: cover;
    object-position: center;
    image-rendering: auto;
    filter: sepia(.1) saturate(.9) contrast(1.04);
    transform: none;
}

.modern-feature-card:hover .modern-feature-image,
.modern-feature-card:focus-within .modern-feature-image {
    filter: sepia(.04) saturate(.96) contrast(1.05);
    transform: scale(1.025);
}

/* Wspólne zdjęcie nie może wychodzić poza baner */

.modern-shared-background {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-repeat: no-repeat;
    background-position: center center;
    background-size: cover;
    image-rendering: auto;
    filter: none;
    transform: none;
}

.modern-shared-background.is-visible {
    transform: none;
}

.modern-shared-background::after {
    background:
        linear-gradient(
            to bottom,
            rgba(5,15,10,.02) 16%,
            rgba(5,15,10,.16) 48%,
            rgba(5,15,10,.76) 100%
        );
}

/* Delikatne podświetlenie wybranej kolumny */

.modern-slider-viewport.has-shared-background
.modern-feature-card.is-hovered {
    box-shadow:
        inset 0 -3px 0 var(--modern-gold),
        inset 0 0 45px rgba(200,166,94,.08);
}

.modern-slider-viewport.has-shared-background
.modern-feature-card:not(.is-hovered) {
    background: rgba(4,14,9,.05);
}

/* Tablet */

@media (max-width: 1000px) {
    .modern-slider-track {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .modern-feature-card:nth-child(2) {
        border-right: 0;
    }

    .modern-feature-card:nth-child(-n+2) {
        border-bottom: 1px solid rgba(255,255,255,.24);
    }
}

/* Telefon */

@media (max-width: 650px) {
    .modern-slider-viewport {
        width: calc(100% - 24px);
        border-radius: 10px;
    }

    .modern-slider-track {
        grid-template-columns: 1fr;
    }

    .modern-feature-card,
    .modern-feature-card:first-child,
    .modern-feature-card:nth-child(2) {
        border-right: 0;
        border-bottom: 1px solid rgba(255,255,255,.22);
    }

    .modern-feature-card:last-child {
        border-bottom: 0;
    }
}

/* ===== MODERN TYPOGRAPHY 2.5 ===== */

body {
    font-family: "Inter", Arial, sans-serif;
    font-weight: 400;
}

h1,
h2,
h3,
h4,
h5,
h6,
.modern-brand-copy strong,
.modern-feature-copy strong,
.modern-card-copy h3,
.modern-department-copy strong,
.ah-sidebar-module > h2 {
    font-family: "Playfair Display", Georgia, serif !important;
    font-weight: 700;
    letter-spacing: -.015em;
}

.modern-brand-copy strong {
    font-weight: 700;
    letter-spacing: .015em;
}

.modern-menu,
.modern-mobile-links,
.modern-search,
.modern-card-copy p,
.modern-feature-copy > span,
.modern-card-copy time,
.ah-category-tree,
.ah-sidebar-list {
    font-family: "Inter", Arial, sans-serif !important;
}

.modern-feature-copy small,
.modern-card-copy > small,
.modern-department-copy small,
.ah-meta,
.ah-card-category {
    font-family: "Cinzel", Georgia, serif !important;
    font-weight: 600 !important;
    letter-spacing: .055em !important;
}

.modern-feature-card > a::after {
    font-family: "Inter", Arial, sans-serif !important;
}

/* Czytelniejsze nagłówki */

.modern-latest > h2 {
    font-weight: 700;
    letter-spacing: -.02em;
}

.modern-card-copy h3 {
    font-weight: 700;
}

.modern-feature-copy strong {
    font-weight: 700;
}

/* Poprawka podkategorii w prawym menu */

body.home .modern-home-layout
.ah-category-group ul {
    overflow: hidden;
}

body.home .modern-home-layout
.ah-category-group li {
    margin: 0 -17px !important;
    padding: 0 17px !important;
    background: transparent !important;
    transition:
        color .2s ease,
        background .2s ease;
}

body.home .modern-home-layout
.ah-category-group li:hover,
body.home .modern-home-layout
.ah-category-group li.is-current {
    background: rgba(200,166,94,.18) !important;
}

body.home .modern-home-layout
.ah-category-group li a,
body.home .modern-home-layout
.ah-category-group li a:visited {
    color: rgba(255,255,255,.82) !important;
    background: transparent !important;
}

body.home .modern-home-layout
.ah-category-group li:hover a,
body.home .modern-home-layout
.ah-category-group li:hover a span,
body.home .modern-home-layout
.ah-category-group li.is-current a,
body.home .modern-home-layout
.ah-category-group li.is-current a span {
    color: #fff !important;
    background: transparent !important;
}

body.home .modern-home-layout
.ah-category-group li:hover a::before,
body.home .modern-home-layout
.ah-category-group li.is-current a::before {
    color: #dfc37f !important;
}

body.home .modern-home-layout
.ah-category-group li a b {
    color: rgba(255,255,255,.62) !important;
    background: transparent !important;
}

body.home .modern-home-layout
.ah-category-group li:hover a b,
body.home .modern-home-layout
.ah-category-group li.is-current a b {
    color: #dfc37f !important;
}

body.home .modern-home-layout
.ah-category-group summary:hover {
    color: #fff !important;
    background: rgba(200,166,94,.13) !important;
}

body.home .modern-home-layout
.ah-category-group summary:hover span {
    color: #fff !important;
}

/* Telefon */

@media (max-width: 650px) {
    .modern-brand-copy strong {
        font-size: 20px !important;
    }

    .modern-feature-copy strong,
    .modern-feature-card:first-child
    .modern-feature-copy strong {
        font-size: 26px !important;
    }

    .modern-card-copy h3 {
        font-size: 22px !important;
    }
}

/* ===== DYNAMICZNE DRZEWO KATEGORII 3.0 ===== */

.ah-category-tree .ah-category-level {
    list-style: none;
    margin: 0;
    padding: 0;
}

.ah-category-tree .ah-category-level-2,
.ah-category-tree .ah-category-level-3,
.ah-category-tree .ah-category-level-4 {
    margin-left: 14px;
    border-left: 1px solid rgba(200, 166, 94, .28);
}

.ah-category-tree .ah-category-level-2 > li > a,
.ah-category-tree .ah-category-level-3 > li > a,
.ah-category-tree .ah-category-level-4 > li > a {
    padding-left: 15px !important;
    font-size: .92em;
}

.ah-category-tree li.is-in-path > a,
.ah-category-tree li.is-current > a {
    color: #fff !important;
    background: rgba(200, 166, 94, .18) !important;
}

.ah-category-tree li.is-current > a {
    box-shadow: inset 3px 0 0 #dfc37f;
}

.ah-category-tree li a {
    min-width: 0;
}

.ah-category-tree li a span {
    min-width: 0;
    overflow-wrap: anywhere;
}

.ah-category-tree li a b {
    flex: 0 0 auto;
    margin-left: 8px;
}

@media (max-width: 760px) {
    .ah-category-tree .ah-category-level-2,
    .ah-category-tree .ah-category-level-3,
    .ah-category-tree .ah-category-level-4 {
        margin-left: 8px;
    }

    .ah-category-tree .ah-category-level-2 > li > a,
    .ah-category-tree .ah-category-level-3 > li > a,
    .ah-category-tree .ah-category-level-4 > li > a {
        padding-left: 11px !important;
    }
}
