/* /gatunki/{slug}/gdzie-lowic — critical ATF (sync, po base + layout + shared) */

.gatunek-detail-section {
    padding: var(--spacing-md);
    border-radius: 0;
    margin-top: var(--spacing-2xl);
}

.gatunek-detail-card {
    max-width: 1400px;
    margin: 0 auto var(--spacing-2xl);
    border-radius: 16px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.18), 0 2px 8px rgba(0, 0, 0, 0.08);
}

.gatunek-detail-card .gatunek-hero {
    margin: 0;
    max-width: none;
    border-radius: 0;
    box-shadow: none;
}

.gatunek-detail-card .gatunek-description--gdzie-wstep {
    margin-top: 0;
    margin-bottom: 0;
    border: none;
    border-radius: 0;
    border-top: 1px solid #e5e7eb;
    box-shadow: none;
    box-sizing: border-box;
    background: #ffffff;
    contain: layout;
}

.gatunek-hero {
    position: relative;
    width: 100%;
    height: 300px;
    overflow: hidden;
    background: #0f172a;
    contain: layout style paint;
}

.gatunek-hero picture,
.gatunek-hero img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}

.gatunek-hero-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 2;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.82), rgba(0, 0, 0, 0.38), transparent);
    padding: var(--spacing-lg) var(--spacing-md) var(--spacing-md);
    display: flex;
    align-items: flex-end;
}

.gatunek-hero-title {
    color: #ffffff;
    font-size: var(--font-size-3xl);
    font-weight: 700;
    margin: 0;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    line-height: 1.15;
}

.gatunek-gdzie-lowic-top-band--flush {
    margin: 0;
    padding: var(--spacing-md);
    border: none;
    border-top: 1px solid #e2e8f0;
    border-bottom: 1px solid rgba(14, 165, 233, 0.15);
    background: linear-gradient(180deg, #f8fafc 0%, #f0f9ff 50%, #ecfeff 100%);
    contain: layout;
    min-height: 5.5rem;
}

.gatunek-gdzie-lowic-top-band--rounded {
    max-width: 52rem;
    margin: var(--spacing-lg) auto;
    padding: var(--spacing-lg);
    border-radius: 14px;
    border: 1px solid #e5e7eb;
    background: #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

/* Breadcrumb w top-band — padding rodzica; blokada responsive.css (defer) na mobile */
.gatunek-gdzie-lowic-top-band .gatunek-gdzie-lowic-breadcrumb {
    padding-left: 0 !important;
    padding-right: 0 !important;
}

.gatunek-gdzie-lowic-breadcrumb ol {
    display: flex;
    flex-wrap: wrap;
    list-style: none;
    padding: 0;
    margin: 0 0 var(--spacing-md);
    gap: var(--spacing-xs);
    align-items: center;
    color: #374151;
    font-size: var(--font-size-sm);
    line-height: 1.4;
}

.gatunek-detail-section .gatunek-gdzie-lowic-breadcrumb ol li {
    margin: 0;
    padding: 0;
}

.gatunek-gdzie-lowic-breadcrumb a {
    color: #2563eb;
    text-decoration: none;
}

.gatunek-gdzie-lowic-breadcrumb a:hover {
    text-decoration: underline;
}

.gatunek-gdzie-lowic-breadcrumb [aria-current="page"] {
    color: #374151;
    font-weight: 500;
}

.gatunek-gdzie-lowic-breadcrumb__sep {
    opacity: 0.6;
    user-select: none;
}

/* Subnawigacja Opis | Gdzie łowić */
.gatunek-gdzie-lowic-top-band .gatunek-subnav {
    margin: 0 0 var(--spacing-md);
    padding: 0;
}
.gatunek-subnav__list {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--spacing-xs);
    list-style: none;
    margin: 0;
    padding: 0;
    border-bottom: 1px solid #e2e8f0;
}
.gatunek-subnav__item {
    margin: 0;
}
.gatunek-subnav__link {
    display: inline-block;
    padding: var(--spacing-sm) var(--spacing-md);
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: #475569;
    text-decoration: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
}
.gatunek-subnav__link:hover {
    color: #2563eb;
}
.gatunek-subnav__link--active {
    color: #1d4ed8;
    border-bottom-color: #2563eb;
}

.gatunek-gdzie-lowic-top-band .page-toc-panel {
    margin: 0;
    padding: 0;
    background: transparent;
    border: none;
    box-shadow: none;
    contain: layout;
}

.page-toc-panel.gatunek-gdzie-toc-panel .gatunek-gdzie-toc-lead {
    margin: 0;
    padding: 0;
    font-size: 0.95rem;
    font-weight: 400;
    color: #475569;
    line-height: 1.55;
}

.page-toc-panel.gatunek-gdzie-toc-panel .gatunek-gdzie-toc-lead a {
    font-weight: 600;
    color: #0369a1;
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* TOC reserve — zsynchronizowane z gatunki_gdzie_lowic_toc_state() (itemCount 0–4) */
.gatunek-gdzie-toc-panel--reserve-lead { min-height: 5.5rem; }
.gatunek-gdzie-toc-panel--reserve-1 { min-height: 7rem; }
.gatunek-gdzie-toc-panel--reserve-2 { min-height: 10rem; }
.gatunek-gdzie-toc-panel--reserve-3 { min-height: 11.5rem; }
.gatunek-gdzie-toc-panel--reserve-4 { min-height: 13rem; }

@media (min-width: 640px) {
    .gatunek-gdzie-toc-panel--reserve-1 { min-height: 8rem; }
    .gatunek-gdzie-toc-panel--reserve-2 { min-height: 10.5rem; }
    .gatunek-gdzie-toc-panel--reserve-3 { min-height: 12rem; }
    .gatunek-gdzie-toc-panel--reserve-4 { min-height: 14rem; }
}

@media (min-width: 1024px) {
    .gatunek-gdzie-toc-panel--reserve-1 { min-height: 6.5rem; }
    .gatunek-gdzie-toc-panel--reserve-2 { min-height: 6.75rem; }
    .gatunek-gdzie-toc-panel--reserve-3 { min-height: 6.75rem; }
    .gatunek-gdzie-toc-panel--reserve-4 { min-height: 6.5rem; }
}

.gatunek-gdzie-lowic-top-band .page-toc__list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: flex-start;
}

.gatunek-gdzie-lowic-top-band .page-toc__item {
    width: auto;
    flex: 1 1 auto;
    min-width: min(100%, 9rem);
}

.gatunek-gdzie-lowic-top-band .page-toc__link {
    min-height: 3.25rem;
    padding: 0.65rem 0.85rem;
    border-radius: 10px;
    border: 1px solid rgba(14, 165, 233, 0.25);
    background: #ffffff;
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.06);
    display: flex;
    align-items: center;
}

.gatunek-gdzie-lowic-top-band .page-toc__hint {
    display: none;
}

.gatunek-gdzie-lowic-top-band .page-toc__icon {
    flex: 0 0 1.5rem;
    width: 1.5rem;
    height: 1.5rem;
    font-size: 0.9rem;
}

.gatunek-gdzie-lowic-top-band .page-toc__content {
    flex-direction: row;
    align-items: center;
    gap: 0.35rem;
}

.gatunek-header {
    margin-bottom: var(--spacing-2xl);
}

.gatunek-gdzie-lowic-page .section-divider .divider-line {
    background: #e5e7eb;
}

.gatunek-gdzie-lowic-page .section-title--dark {
    color: #1a1a1a !important;
    font-size: var(--font-size-3xl);
    margin-bottom: var(--spacing-lg);
    font-weight: 700;
    text-align: center;
    text-shadow: none;
}

#gdzie-lowic-praktycznie .section-title,
#faq .section-title {
    color: #ffffff !important;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

#gdzie-lowic-praktycznie .divider-line {
    background: linear-gradient(90deg, transparent, var(--text-white, #ffffff), transparent);
}

.gatunek-description {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: var(--spacing-xl);
    margin-bottom: var(--spacing-2xl);
}

.gatunek-description--standalone {
    max-width: 52rem;
    margin-left: auto;
    margin-right: auto;
}

.gatunek-description-content {
    color: #1f2937;
    font-size: var(--font-size-base);
    line-height: 1.75;
    text-align: justify;
}

.gatunek-description-content p {
    margin: 0 0 var(--spacing-md) 0;
    color: #374151;
    text-indent: 1.5em;
}

/* Lista łowisk pod mapą — biała karta, ciemny nagłówek (nie .section-title) */
#lista-lowisk.gatunek-gdzie-lowiska-seo-list {
    margin-top: var(--spacing-3xl);
    padding: var(--spacing-2xl);
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
}

#lista-lowisk .gatunek-gdzie-lowiska-seo-list__title {
    margin: 0 0 var(--spacing-lg);
    font-size: var(--font-size-xl);
    font-weight: 700;
    line-height: 1.3;
    text-align: left;
    color: #1a1a1a !important;
    text-shadow: none !important;
}

.gatunek-description-content p:first-child {
    margin-top: 0;
    text-indent: 0;
}

.gatunek-description-content h2 {
    color: #1a1a1a;
    font-size: var(--font-size-2xl);
    margin: var(--spacing-xl) 0 var(--spacing-md);
    text-indent: 0;
}

.gatunek-description-content h3 {
    color: #1a1a1a;
    font-size: var(--font-size-xl);
    margin: var(--spacing-lg) 0 var(--spacing-sm);
    text-indent: 0;
}

.gatunek-description-content ul,
.gatunek-description-content ol {
    margin: 0 0 var(--spacing-md);
    padding-left: 1.5em;
}

#mapa-lowisk,
#gdzie-lowic-praktycznie,
#faq {
    scroll-margin-top: calc(var(--navbar-height, 70px) + 12px);
}

@media (min-width: 769px) {
    .gatunek-detail-section {
        padding: var(--spacing-2xl);
    }

    .gatunek-hero {
        height: 400px;
    }

    .gatunek-hero-title {
        font-size: var(--font-size-4xl);
    }

    .gatunek-hero-overlay {
        padding: var(--spacing-2xl) var(--spacing-xl) var(--spacing-xl);
    }

    .gatunek-gdzie-lowic-top-band--flush {
        padding: var(--spacing-lg) var(--spacing-xl);
    }
}

@media (min-width: 640px) {
    .gatunek-gdzie-lowic-top-band .page-toc__item {
        flex: 1 1 calc(33.333% - 0.5rem);
        max-width: calc(33.333% - 0.34rem);
    }

    .gatunek-gdzie-toc-panel--reserve-3 .page-toc__item,
    .gatunek-gdzie-toc-panel--reserve-4 .page-toc__item {
        flex: 1 1 calc(50% - 0.35rem);
        max-width: calc(50% - 0.35rem);
    }

    .gatunek-gdzie-lowic-top-band .page-toc__hint {
        display: block;
        font-size: 0.8rem;
        line-height: 1.35;
    }

    .gatunek-gdzie-lowic-top-band .page-toc__content {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    .gatunek-gdzie-lowic-top-band .page-toc__link {
        min-height: 5.5rem;
    }
}

@media (min-width: 1024px) {
    .gatunek-gdzie-toc-panel--reserve-3 .page-toc__item {
        flex: 1 1 calc(33.333% - 0.5rem);
        max-width: calc(33.333% - 0.34rem);
    }

    .gatunek-gdzie-toc-panel--reserve-4 .page-toc__item {
        flex: 1 1 0;
        max-width: none;
        min-width: 0;
    }
}

@media (max-width: 768px) {
    .gatunek-detail-section {
        margin-top: 0;
        padding: 0;
    }

    /* Mobile ATF — .gatunek-detail-card (sync components.css page-toc) */
    .gatunek-detail-card {
        margin: 0;
        max-width: 100%;
        border-radius: 0;
        box-shadow: none;
        contain: layout style;
    }

    .gatunek-detail-card .gatunek-hero {
        height: 300px;
        max-width: 100%;
        contain: layout style paint;
    }

    .gatunek-hero {
        height: 300px;
        max-width: 100%;
    }

    .gatunek-gdzie-lowic-top-band--flush {
        min-height: auto;
        contain: layout style;
    }

    .gatunek-gdzie-lowic-breadcrumb ol {
        gap: 4px !important;
        margin-bottom: var(--spacing-sm);
    }

    .gatunek-detail-section .gatunek-gdzie-lowic-breadcrumb ol li {
        margin: 0 !important;
        padding: 0 !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    .gatunek-gdzie-lowic-top-band .gatunek-gdzie-lowic-breadcrumb {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    .gatunek-gdzie-lowic-top-band .page-toc {
        margin: 0;
        padding: 0;
    }

    .gatunek-gdzie-lowic-top-band .page-toc__heading {
        margin: 0 0 var(--spacing-sm);
        font-size: 0.78rem;
        font-weight: 700;
        letter-spacing: 0.08em;
        text-transform: uppercase;
        color: rgba(7, 89, 133, 0.82);
    }

    .gatunek-gdzie-lowic-top-band .page-toc__list {
        display: flex;
        list-style: none;
        margin: 0;
        padding: 0;
        flex-wrap: wrap;
        gap: 0.35rem;
        justify-content: flex-start;
    }

    .gatunek-gdzie-lowic-top-band .page-toc__item {
        margin: 0;
        flex: 1 1 0;
        min-width: 0;
        max-width: none;
        width: auto;
    }

    .gatunek-gdzie-toc-panel--reserve-3 .page-toc__item,
    .gatunek-gdzie-toc-panel--reserve-4 .page-toc__item {
        flex: 1 1 calc(50% - 0.2rem);
        max-width: calc(50% - 0.2rem);
    }

    .gatunek-gdzie-lowic-top-band .page-toc__link {
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: var(--spacing-xs);
        min-height: 3.75rem;
        padding: 0.45rem 0.25rem;
        text-align: center;
        color: #111827;
        font-weight: 600;
        font-size: var(--font-size-base);
        line-height: 1.35;
        text-decoration: none;
        box-sizing: border-box;
        -webkit-tap-highlight-color: transparent;
    }

    .gatunek-gdzie-lowic-top-band .page-toc__icon {
        flex: 0 0 2.25rem;
        width: 2.25rem;
        height: 2.25rem;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border-radius: 999px;
        background: linear-gradient(135deg, rgba(2, 132, 199, 0.16) 0%, rgba(14, 116, 144, 0.22) 100%);
        color: #075985;
        font-size: 1rem;
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55);
    }

    .gatunek-gdzie-lowic-top-band .page-toc__content {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 2px;
        min-width: 0;
    }

    .gatunek-gdzie-lowic-top-band .page-toc__title {
        color: #0f172a;
        font-size: var(--font-size-base);
        font-weight: 700;
        line-height: 1.35;
    }

    .gatunek-gdzie-lowic-top-band .page-toc__hint {
        display: none;
    }

    .gatunek-gdzie-toc-panel--reserve-lead {
        min-height: 5rem;
    }

    .gatunek-gdzie-toc-panel--reserve-1 {
        min-height: 7.5rem;
    }

    .gatunek-gdzie-toc-panel--reserve-2 {
        min-height: 9.5rem;
    }

    .gatunek-gdzie-toc-panel--reserve-3 {
        min-height: 11rem;
    }

    .gatunek-gdzie-toc-panel--reserve-4 {
        min-height: 11.5rem;
    }

    .gatunek-detail-card .gatunek-description--gdzie-wstep {
        padding: var(--spacing-md);
        box-sizing: border-box;
    }

    /* Tarcza: odroczony responsive.css nie przesuwa ATF (breadcrumb + wstęp) */
    .gatunek-gdzie-lowic-page .gatunek-description-content p {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    .gatunek-gdzie-lowic-page .gatunek-gdzie-lowic-breadcrumb ol li {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    .gatunek-gdzie-lowic-page [class*="content"] h2,
    .gatunek-gdzie-lowic-page [class*="content"] h3 {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }
}

@media (max-width: 480px) {
    .gatunek-hero,
    .gatunek-detail-card .gatunek-hero {
        height: 250px;
    }

    .gatunek-hero-title {
        font-size: var(--font-size-2xl);
    }

    .gatunek-gdzie-lowic-breadcrumb ol {
        gap: 2px !important;
    }

    .gatunek-detail-card .gatunek-description--gdzie-wstep {
        padding: var(--spacing-md);
    }
}

/* FAQ layout (critical — unikaj CLS gdy deferred CSS dojdzie później) */
.gatunek-faq-details-wrap {
    margin-top: var(--spacing-xl);
    background: #ffffff;
    padding: var(--spacing-2xl);
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    box-sizing: border-box;
    contain: layout;
}

.gatunek-faq-details-wrap .faq-details-item {
    margin-bottom: var(--spacing-md);
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
}

.gatunek-faq-details-wrap .faq-details-item:last-child {
    margin-bottom: 0;
}

.gatunek-faq-details-wrap summary {
    list-style: none;
    padding: var(--spacing-lg);
    background: #f9fafb;
    cursor: pointer;
    font-size: var(--font-size-lg);
    font-weight: 600;
    color: #1a1a1a;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--spacing-md);
}

.gatunek-faq-details-wrap .faq-details-q {
    flex: 1;
    text-align: left;
    min-width: 0;
}

.gatunek-faq-details-wrap summary::-webkit-details-marker {
    display: none;
}

.gatunek-faq-details-wrap .faq-details-item[open] summary {
    background: #f3f4f6;
}

.gatunek-faq-details-wrap .faq-details-summary-icon {
    color: #6b7280;
    font-size: 1.25rem;
    flex-shrink: 0;
    font-weight: 400;
    line-height: 1;
}

.gatunek-faq-details-wrap .faq-details-item:not([open]) .faq-details-summary-icon::after {
    content: '+';
}

.gatunek-faq-details-wrap .faq-details-item[open] .faq-details-summary-icon::after {
    content: '\2212';
}

.gatunek-faq-details-wrap .faq-details-body {
    padding: 0 var(--spacing-lg) var(--spacing-lg);
    border-top: 1px solid #e5e7eb;
    background: #fff;
}
