/**
 * Poznaj parafię — dedykowany CSS
 *
 * Style unikalne dla strony "Poznaj parafię".
 * Ładowane warunkowo tylko na stronie o slug `poznaj-parafie`.
 *
 * @package Parafia_Belzyce
 */

/* ==========================================================================
   0. Override WP layout constraints for wider content
   ========================================================================== */

/* Prevent horizontal overflow from 100vw elements */
body {
    overflow-x: hidden;
}

/* Hide default page title — hero has its own */
.entry-header {
    display: none;
}

/* Remove top padding so hero touches header */
.entry-content {
    padding-top: 0 !important;
}

/* Hero cover — dark compact box, single-line title */
.wp-block-cover .wp-block-cover__inner-container {
    background: rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    padding: 1rem 2.5rem;
    border-radius: 6px;
    border-top: 3px solid var(--color-accent, #D49B4B);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
    text-shadow: 0 1px 6px rgba(0, 0, 0, 0.6);
    max-width: fit-content;
    text-align: center;
}

.wp-block-cover .wp-block-cover__inner-container * {
    font-family: var(--font-accent, 'Roboto Slab', serif);
}

.wp-block-cover .wp-block-cover__inner-container h1,
.wp-block-cover .wp-block-cover__inner-container h2 {
    margin-bottom: 0.15rem;
}

.wp-block-cover .wp-block-cover__inner-container p {
    margin-top: 0;
    font-weight: 300;
    font-size: 0.95rem;
    letter-spacing: 0.04em;
    opacity: 0.85;
}

@media (max-width: 600px) {
    .wp-block-cover .wp-block-cover__inner-container {
        padding: 0.75rem 1.25rem;
    }
    .wp-block-cover .wp-block-cover__inner-container h1,
    .wp-block-cover .wp-block-cover__inner-container h2 {
        white-space: normal;
        font-size: 1.4rem;
    }
    .wp-block-cover .wp-block-cover__inner-container p {
        font-size: 0.75rem;
    }
}

/* Let shortcode/HTML blocks expand to full parent width inside constrained layouts */
.is-layout-constrained > .wp-block-shortcode,
.is-layout-constrained > .wp-block-html {
    max-width: none;
    width: 100%;
}

/* ==========================================================================
   1. Sticky Section Nav (mini-menu z kotwicami)
   ========================================================================== */

.pb-section-nav {
    position: relative;
    z-index: 90;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--color-border-light, #e8e0d8);
    padding: 0;
    margin: 0;
    transition: box-shadow 0.3s ease;
}

.pb-section-nav.is-scrolled {
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.pb-section-nav__list,
.pb-section-nav__list li {
    list-style: none !important;
    list-style-type: none !important;
    margin: 0;
    padding: 0;
}

.pb-section-nav__list::marker,
.pb-section-nav__list li::marker {
    content: none !important;
    display: none !important;
}

.pb-section-nav__list {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0;
    overflow-x: auto;
    scrollbar-width: none;
}

.pb-section-nav__list::-webkit-scrollbar {
    display: none;
}

.pb-section-nav__list a {
    display: block;
    padding: 0.85rem 1.25rem;
    font-family: var(--font-accent, 'Kumbh Sans', sans-serif);
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--color-text-light, #6b5e53);
    text-decoration: none;
    white-space: nowrap;
    position: relative;
    transition: color 0.3s ease;
}

.pb-section-nav__list a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2.5px;
    background: var(--color-accent, #D49B4B);
    border-radius: 2px;
    transform: translateX(-50%);
    transition: width 0.3s ease;
}

.pb-section-nav__list a:hover {
    color: var(--color-accent-dark, #CCA331);
}

.pb-section-nav__list a:hover::after {
    width: 60%;
}

.pb-section-nav__list a.is-active {
    color: var(--color-accent-dark, #CCA331);
}

.pb-section-nav__list a.is-active::after {
    width: 100%;
}

@media (max-width: 782px) {
    .pb-section-nav__list {
        flex-direction: column;
        align-items: stretch;
        padding: 0.5rem 0;
        gap: 0;
    }
    .pb-section-nav__list li {
        border-bottom: 1px solid var(--color-border-light, #e8e0d8);
    }
    .pb-section-nav__list li:last-child {
        border-bottom: none;
    }
    .pb-section-nav__list a {
        padding: 0.65rem 1.25rem;
        font-size: 0.7rem;
        letter-spacing: 0.06em;
        text-align: left;
    }
    .pb-section-nav__list a::after {
        left: 0;
        transform: none;
        width: 0;
        height: 2px;
        bottom: -1px;
    }
    .pb-section-nav__list a.is-active::after {
        width: 3px;
        height: 100%;
        top: 0;
        bottom: auto;
        left: 0;
        border-radius: 0;
    }
}

/* ==========================================================================
   2. Anchor scroll offsets (kompensacja sticky headera + mini-nav)
   ========================================================================== */

[id="parafia"],
[id="kaplani"],
[id="kosciol-kaplice"],
[id="patroni"],
[id="historia"] {
    scroll-margin-top: calc(var(--header-height, 100px) + 50px + 1rem);
}

/* ==========================================================================
   3. Full-bleed Section Breaks (separatory z cytatem)
   ========================================================================== */

.pb-section-break {
    position: relative;
    width: 100vw;
    max-width: 100%;
    margin-left: calc(-50vw + 50%);
    min-height: 320px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    overflow: hidden;
    background-color: #1A1410;
}

.pb-section-break img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.35;
}

.pb-section-break__content {
    position: relative;
    z-index: 2;
    max-width: 700px;
    padding: 3rem 2rem;
}

.pb-section-break__quote {
    font-family: var(--font-heading, 'Kumbh Sans', sans-serif);
    font-size: clamp(1.2rem, 2.5vw, 1.8rem);
    font-weight: 300;
    font-style: italic;
    color: #fff;
    line-height: 1.5;
    margin: 0 0 1rem;
}

.pb-section-break__source {
    font-family: var(--font-accent, 'Kumbh Sans', sans-serif);
    font-size: 0.85rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--color-accent, #D49B4B);
}

@media (max-width: 600px) {
    .pb-section-break {
        min-height: 240px;
    }
    .pb-section-break__content {
        padding: 2rem 1.5rem;
    }
}

/* ==========================================================================
   4. Interactive Timeline (enhanced reveal)
   ========================================================================== */

.pb-timeline--interactive .pb-timeline__item {
    opacity: 0;
    transform: translateX(-20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.pb-timeline--interactive .pb-timeline__item:nth-child(even) {
    transform: translateX(20px);
}

.pb-timeline--interactive .pb-timeline__item.pb-timeline--visible {
    opacity: 1;
    transform: translateX(0);
}

.pb-timeline--interactive .pb-timeline__item.pb-timeline--visible::before {
    animation: pb-timeline-dot-pulse 0.5s ease 0.3s;
}

@keyframes pb-timeline-dot-pulse {
    0%   { transform: scale(1); box-shadow: 0 0 0 2px var(--color-accent); }
    50%  { transform: scale(1.6); box-shadow: 0 0 0 4px var(--color-accent), 0 0 12px rgba(212, 155, 75, 0.4); }
    100% { transform: scale(1); box-shadow: 0 0 0 2px var(--color-accent); }
}

.pb-timeline--interactive::before {
    background: linear-gradient(
        to bottom,
        var(--color-accent) 0%,
        var(--color-accent-light, #e8c97a) 100%
    ) !important;
}

@media (prefers-reduced-motion: reduce) {
    .pb-timeline--interactive .pb-timeline__item {
        opacity: 1;
        transform: none;
        transition: none;
    }
}

/* ==========================================================================
   5. Patron Magazine Style
   ========================================================================== */

.pb-patron-magazine {
    margin: 2rem 0;
}

.pb-patron-magazine .wp-block-media-text {
    gap: 3rem !important;
}

.pb-patron-magazine .wp-block-media-text__media img {
    border-radius: 16px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
    transition: transform 0.5s ease;
}

.pb-patron-magazine:hover .wp-block-media-text__media img {
    transform: scale(1.02);
}

/* Drop cap */
.pb-patron-magazine .pb-drop-cap::first-letter {
    float: left;
    font-family: var(--font-heading, 'Kumbh Sans', sans-serif);
    font-size: 4.5rem;
    font-weight: 700;
    line-height: 0.8;
    color: var(--color-accent-dark, #CCA331);
    margin-right: 0.15em;
    margin-top: 0.05em;
}

/* Pull quote */
.pb-patron-magazine .pb-pull-quote {
    border-left: 4px solid var(--color-accent, #D49B4B);
    padding-left: 1.5rem;
    margin: 2rem 0;
    font-family: var(--font-heading, 'Kumbh Sans', sans-serif);
    font-size: 1.25rem;
    font-style: italic;
    font-weight: 300;
    color: var(--color-text-light, #6b5e53);
    line-height: 1.6;
}

/* ==========================================================================
   6. Before/After Comparison Slider
   ========================================================================== */

.pb-before-after {
    position: relative;
    width: 100%;
    max-width: 800px;
    margin: 2rem auto;
    overflow: hidden;
    border-radius: 16px;
    cursor: col-resize;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    aspect-ratio: 16 / 10;
    background: #1A1410;
}

.pb-before-after img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    pointer-events: none;
    user-select: none;
}

.pb-before-after__before {
    position: absolute;
    inset: 0;
    z-index: 2;
    clip-path: inset(0 50% 0 0);
}

.pb-before-after__after {
    position: absolute;
    inset: 0;
    z-index: 1;
}

.pb-before-after__slider {
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 4px;
    background: #fff;
    z-index: 10;
    transform: translateX(-50%);
    cursor: col-resize;
    box-shadow: 0 0 8px rgba(0, 0, 0, 0.3);
}

.pb-before-after__slider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 44px;
    height: 44px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
}

.pb-before-after__slider::after {
    content: '\25C2  \25B8';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 14px;
    color: var(--color-text, #240C00);
    font-weight: 700;
    letter-spacing: 4px;
    z-index: 1;
    white-space: nowrap;
}

/* Labels */
.pb-before-after__label {
    position: absolute;
    bottom: 1rem;
    z-index: 15;
    padding: 0.35rem 0.85rem;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(4px);
    color: #fff;
    font-family: var(--font-accent, 'Kumbh Sans', sans-serif);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    border-radius: 6px;
}

.pb-before-after__label--before {
    left: 1rem;
}

.pb-before-after__label--after {
    right: 1rem;
}

@media (max-width: 600px) {
    .pb-before-after {
        border-radius: 10px;
        aspect-ratio: 4 / 3;
    }
    .pb-before-after__slider::before {
        width: 36px;
        height: 36px;
    }
}

/* ==========================================================================
   7. Leaflet Interactive Parish Map (OpenStreetMap)
   ========================================================================== */

#pb-parish-map-leaflet {
    width: 100%;
    height: 450px;
    max-width: none;
    margin: 2.5rem auto;
    border-radius: 8px;
    border: 1px solid var(--color-border, #E3D6D3);
    z-index: 1;
}

@media (max-width: 600px) {
    #pb-parish-map-leaflet {
        height: 350px;
        margin: 1.5rem auto;
        border-radius: 6px;
    }
}

/* Custom markers */
.pb-leaflet-marker {
    background: transparent !important;
    border: none !important;
}

.pb-leaflet-marker span {
    display: block;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2.5px solid #fff;
    box-shadow: 0 2px 6px rgba(0,0,0,0.35);
    transition: transform 0.2s ease;
}

.pb-leaflet-marker:hover span {
    transform: scale(1.3);
}

/* Map legend */
.pb-parish-map__legend {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.25rem 2.5rem;
    margin-top: 1.25rem;
    font-family: var(--font-accent, 'Roboto Slab', serif);
    font-size: 1rem;
    font-weight: 500;
    color: var(--color-text, #240C00);
}

.pb-parish-map__legend span::before {
    content: '';
    display: inline-block;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    margin-right: 0.5rem;
    vertical-align: middle;
    border: 2px solid #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.pb-parish-map__legend .legend-church::before { background: #D49B4B; }
.pb-parish-map__legend .legend-chapel::before { background: #C0392B; }
.pb-parish-map__legend .legend-building::before { background: #6b8cae; }

@media (max-width: 480px) {
    .pb-parish-map {
        margin: 1.5rem auto;
    }
    .pb-parish-map__legend {
        gap: 0.5rem 1rem;
        font-size: 0.7rem;
    }
}

/* ==========================================================================
   7b. Photo Slider border-radius fix
   ========================================================================== */
.grupa-photo-slider-wrap .wp-block-gallery,
.grupa-photo-slider-wrap .wp-block-gallery.is-slider {
    border-radius: 12px !important;
    overflow: hidden !important;
}

/* ==========================================================================
   8. Content Card (pb-content-card)
   ========================================================================== */

.pb-content-card {
    background: #fff;
    padding: clamp(1.5rem, 3vw, 2.5rem);
    border-radius: 8px;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.05);
}

@media (max-width: 600px) {
    .pb-content-card {
        padding: 1.25rem;
        box-shadow: 0 1px 10px rgba(0, 0, 0, 0.04);
    }
}

/* ==========================================================================
   9. Chapel Expandable Cards (pb-chapel-cards)
   ========================================================================== */

.pb-chapel-cards {
    flex-direction: column !important;
    gap: 1rem !important;
    max-width: 700px;
    margin-left: auto !important;
    margin-right: auto !important;
}

.pb-chapel-cards .wp-block-column {
    cursor: pointer;
    flex-basis: auto !important;
    width: 100% !important;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.pb-chapel-cards .wp-block-column .wp-block-group {
    border: 1px solid var(--color-border-light, #e8e0d8);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.pb-chapel-cards .wp-block-column:hover .wp-block-group {
    border-color: var(--color-accent, #D49B4B);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

/* Toggle arrow */
.pb-chapel-cards .wp-block-group {
    position: relative;
}

.pb-chapel-cards .wp-block-group::after {
    content: '\25BC';
    position: absolute;
    top: 1.25rem;
    right: 1.25rem;
    font-size: 0.7rem;
    color: var(--color-accent, #D49B4B);
    transition: transform 0.3s ease;
}

.pb-chapel-cards .wp-block-column.is-open .wp-block-group::after {
    transform: rotate(180deg);
}

/* Gallery hidden by default */
.pb-chapel-cards .pb-chapel-slider {
    display: none;
    margin-top: 1rem;
    position: relative;
}

.pb-chapel-cards .wp-block-column.is-open .pb-chapel-slider {
    display: block;
}

/* Original WP gallery — hide it, JS reads images from it */
.pb-chapel-cards .wp-block-gallery {
    display: none !important;
}

/* Slider viewport */
.pb-chapel-slider__track {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
}

.pb-chapel-slider__track img {
    border-radius: 0;
}

.pb-chapel-slider__track img {
    width: 100%;
    height: 360px;
    object-fit: cover;
    display: block;
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.pb-chapel-slider__track img.is-sliding {
    opacity: 0;
    transform: scale(1.02);
}

/* Arrows — white circles with chevron */
.pb-chapel-slider__arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    color: var(--color-text, #240C00);
    cursor: pointer;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transition: background 0.2s, box-shadow 0.2s, transform 0.2s;
    padding: 0;
}

.pb-chapel-slider__arrow:hover {
    background: #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.pb-chapel-slider__arrow--prev { left: 0.6rem; }
.pb-chapel-slider__arrow--next { right: 0.6rem; }

.pb-chapel-slider__arrow--prev:hover { transform: translateY(-50%) translateX(-2px); }
.pb-chapel-slider__arrow--next:hover { transform: translateY(-50%) translateX(2px); }

/* Dots under image */
.pb-chapel-slider__dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 0.6rem;
}

.pb-chapel-slider__dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: none;
    background: var(--color-border-light, #d5cec7);
    cursor: pointer;
    padding: 0;
    transition: background 0.25s, transform 0.25s;
}

.pb-chapel-slider__dot:hover {
    transform: scale(1.2);
}

.pb-chapel-slider__dot.is-active {
    background: var(--color-accent, #D49B4B);
}

/* Active card highlight */
.pb-chapel-cards .wp-block-column.is-open > .wp-block-group {
    border-color: var(--color-accent, #D49B4B);
    box-shadow: 0 4px 16px rgba(212, 155, 75, 0.15);
}

@media (max-width: 782px) {
    .pb-chapel-slider__track img {
        height: 260px;
    }
}

@media (max-width: 480px) {
    .pb-chapel-slider__track img {
        height: 200px;
    }
}

/* ==========================================================================
   9. Kapłani Card Hover Enhancements
   ========================================================================== */

.kp-card {
    position: relative;
    overflow: hidden;
}

.kp-card__photo {
    position: relative;
    overflow: hidden;
}

.kp-card__photo img {
    transition: transform 0.5s ease, filter 0.5s ease;
}

.kp-card:hover .kp-card__photo img {
    transform: scale(1.05);
    filter: brightness(0.85);
}

.kp-card__body {
    transition: transform 0.4s ease;
}

.kp-card:hover .kp-card__body {
    transform: translateY(-4px);
}

/* Accent bar on hover */
.kp-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, var(--color-accent, #D49B4B), var(--color-accent-dark, #CCA331));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s ease;
}

.kp-card:hover::after {
    transform: scaleX(1);
}

/* ==========================================================================
   10. Global Responsive — mobile font scaling
   ========================================================================== */

@media (max-width: 768px) {
    /* Remove wide-content padding on this page */
    .entry-content--wide > * {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }
}

@media (max-width: 782px) {
    /* Section headings — tighter spacing */
    .entry-content .wp-block-heading {
        margin-top: 1rem !important;
        margin-bottom: 0.5rem !important;
    }

    .entry-content .wp-block-separator {
        margin-top: 0.5rem !important;
        margin-bottom: 1rem !important;
    }

    /* Section headings */
    .entry-content h2 {
        font-size: clamp(1.3rem, 4vw, 1.8rem);
    }

    .entry-content h3 {
        font-size: clamp(1.1rem, 3.5vw, 1.4rem);
    }

    .entry-content h4 {
        font-size: clamp(0.95rem, 3vw, 1.15rem);
    }

    /* Body text */
    .entry-content p,
    .entry-content li {
        font-size: clamp(0.85rem, 2.5vw, 1rem);
    }

    /* Section padding */
    .is-style-pb-section {
        padding: 2rem 1rem;
    }

    /* Content card */
    .pb-content-card {
        padding: 1.25rem;
    }

    /* Patron magazine */
    .pb-patron-magazine .wp-block-media-text {
        gap: 1.5rem !important;
    }

    /* Pull quote */
    .pb-patron-magazine .pb-pull-quote {
        font-size: 1rem;
        padding-left: 1rem;
    }

    /* Drop cap */
    .pb-patron-magazine .pb-drop-cap::first-letter {
        font-size: 3rem;
    }

    /* Map legend */
    .pb-parish-map__legend {
        font-size: 0.85rem;
        gap: 0.75rem 1.5rem;
    }

    /* Chapel cards */
    .pb-chapel-cards .wp-block-column .wp-block-group {
        padding: 1rem !important;
    }
}

@media (max-width: 480px) {
    .entry-content h2 {
        font-size: 1.2rem;
    }

    .entry-content h3 {
        font-size: 1.05rem;
    }

    .entry-content p,
    .entry-content li {
        font-size: 0.85rem;
    }

    .pb-parish-map__legend {
        font-size: 0.75rem;
    }

    .pb-parish-map__legend span::before {
        width: 10px;
        height: 10px;
    }
}
