/* ============================================================
   NOCLEGI – Custom Styles
   Mobile-first: 0–991.98px (default) | 992px+ (desktop)
   Działa zarówno z body.post-type-archive-noclegi
   jak i z shortcode [noclegi_archive] wewnątrz strony Elementor
   ============================================================ */

/* ---------- Hide theme sub-header on noclegi pages ---------- */

.post-type-archive-noclegi #sub-header,
.single-noclegi #sub-header {
    display: none !important;
}

/* ---------- Breadcrumbs ---------- */

.noclegi-breadcrumbs {
    padding: 16px 0 8px;
}

.noclegi-breadcrumbs__list {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    list-style: none;
    margin: 0;
    padding: 0;
    font-size: 13px;
    line-height: 1.4;
    color: #555;
}

.noclegi-breadcrumbs__item {
    display: inline-flex;
    align-items: center;
}

.noclegi-breadcrumbs__item:not(:last-child)::after {
    content: "›";
    display: inline-block;
    margin: 0 8px;
    color: #999;
}

.noclegi-breadcrumbs__item a {
    color: #0065a8;
    text-decoration: none;
    transition: color 0.2s ease;
}

.noclegi-breadcrumbs__item a:hover,
.noclegi-breadcrumbs__item a:focus {
    color: #004a7a;
    text-decoration: underline;
}

.noclegi-breadcrumbs__item [aria-current="page"] {
    color: #333;
    font-weight: 600;
}

/* ---------- Archive wrapper ---------- */

.noclegi-archive {
    padding: 0 0 48px;
    width: 100%;
}

.noclegi-archive__container {
    max-width: 100%;
    margin: 0 auto;
}

/* ---------- Tytuł H1/H2 archiwum + single ---------- */
/* Wysoka specyficzność – działa zarówno przez CPT jak i shortcode */

.noclegi-archive .noclegi-archive__title,
.noclegi-single .noclegi-single__title {
    position: relative !important;
    display: inline-flex !important;
    align-items: center !important;
    padding-left: 15px !important;
    font-size: 28px !important;
    font-weight: 700 !important;
    margin: 0 0 24px !important;
    color: #1A3E6B !important;
    line-height: 1.2 !important;
    font-family: 'Inria Sans', Arial, sans-serif !important;
}

.noclegi-archive .noclegi-archive__title::before,
.noclegi-single .noclegi-single__title::before {
    content: '' !important;
    position: absolute !important;
    left: 0 !important;
    transform: translateX(-100%) !important;
    top: 0 !important;
    height: 100% !important;
    width: 6px !important;
    background-color: #fecc00 !important;
}

/* ---------- Grid ---------- */

.noclegi-archive .noclegi-grid {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 24px !important;
    align-items: start !important;
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* ---------- Card ---------- */

.noclegi-archive .noclegi-card {
    border-radius: 8px !important;
    overflow: hidden !important;
    background: #fff !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08) !important;
    transition: box-shadow 0.3s ease, transform 0.3s ease !important;
}

.noclegi-archive .noclegi-card:hover,
.noclegi-archive .noclegi-card:focus-within {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12) !important;
    transform: translateY(-2px) !important;
}

.noclegi-archive .noclegi-card__link {
    display: flex !important;
    flex-direction: column !important;
    height: 100% !important;
    text-decoration: none !important;
    color: inherit !important;
}

.noclegi-archive .noclegi-card__link:focus {
    outline: 3px solid #0065a8 !important;
    outline-offset: -3px !important;
    border-radius: 8px !important;
}

/* CLS: aspect-ratio wymusza jednakowe wysokości obrazów */
.noclegi-archive .noclegi-card__image-wrapper {
    position: relative !important;
    aspect-ratio: 4 / 3 !important;
    overflow: hidden !important;
    background: #f0f0f0 !important;
    width: 100% !important;
    flex-shrink: 0 !important;
}

.noclegi-archive .noclegi-card__image {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    object-position: center !important;
    max-width: none !important;
    max-height: none !important;
}

.noclegi-archive .noclegi-card__placeholder {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    height: 100% !important;
    background: #e8e8e8 !important;
    color: #bbb !important;
    font-size: 48px !important;
}

.noclegi-archive .noclegi-card__body {
    display: flex !important;
    flex-direction: column !important;
    flex: 1 !important;
    padding: 16px !important;
}

.noclegi-archive .noclegi-card__title {
    font-size: 18px !important;
    font-weight: 600 !important;
    margin: 0 0 12px !important;
    color: #1a1a1a !important;
    line-height: 1.3 !important;
}

.noclegi-archive .noclegi-card__btn {
    display: inline-block !important;
    margin-top: auto !important;
    padding: 8px 20px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    color: #fff !important;
    background: #0065a8 !important;
    border-radius: 4px !important;
    text-align: center !important;
    transition: background-color 0.2s ease !important;
    min-height: 44px !important;
    line-height: 28px !important;
    align-self: flex-start !important;
}

.noclegi-archive .noclegi-card__link:hover .noclegi-card__btn,
.noclegi-archive .noclegi-card__link:focus .noclegi-card__btn {
    background: #004a7a !important;
}

/* ---------- Loader ---------- */

.noclegi-loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 32px 16px;
    text-align: center;
}

.noclegi-loader[hidden] {
    display: none;
}

.noclegi-loader__spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e0e0e0;
    border-top-color: #0065a8;
    border-radius: 50%;
    animation: noclegi-spin 0.8s linear infinite;
}

@keyframes noclegi-spin {
    to {
        transform: rotate(360deg);
    }
}

.noclegi-loader__text {
    font-size: 14px;
    color: #666;
}

/* ---------- End message ---------- */

.noclegi-end {
    text-align: center;
    padding: 24px 16px;
    color: #888;
    font-size: 14px;
}

.noclegi-end[hidden] {
    display: none;
}

/* ---------- Pagination ---------- */

.noclegi-pagination {
    padding: 32px 0 0;
}

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

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

.noclegi-pagination .page-numbers a,
.noclegi-pagination .page-numbers span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
    padding: 8px 14px;
    font-size: 14px;
    font-weight: 500;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-decoration: none;
    color: #333;
    background: #fff;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.noclegi-pagination .page-numbers a:hover,
.noclegi-pagination .page-numbers a:focus {
    background: #0065a8;
    color: #fff;
    border-color: #0065a8;
}

.noclegi-pagination .page-numbers .current {
    background: #0065a8;
    color: #fff;
    border-color: #0065a8;
    font-weight: 700;
}

/* ---------- Empty state ---------- */

.noclegi-empty {
    text-align: center;
    padding: 64px 16px;
    color: #666;
    font-size: 18px;
}

/* ---------- Single ---------- */

.noclegi-single {
    padding: 0 16px 48px;
}

.noclegi-single__container {
    max-width: 960px;
    margin: 0 auto;
}

.noclegi-single .noclegi-single__title {
    position: relative !important;
    display: inline-flex !important;
    align-items: center !important;
    padding-left: 15px !important;
    font-size: 28px !important;
    font-weight: 700 !important;
    margin: 0 0 24px !important;
    color: #1A3E6B !important;
    line-height: 1.2 !important;
    font-family: 'Inria Sans', Arial, sans-serif !important;
}

.noclegi-single .noclegi-single__title::before {
    content: '' !important;
    position: absolute !important;
    left: 0 !important;
    transform: translateX(-100%) !important;
    top: 0 !important;
    height: 100% !important;
    width: 6px !important;
    background-color: #fecc00 !important;
}

/* ---------- Gallery ---------- */

.noclegi-gallery {
    position: relative;
    margin-bottom: 32px;
    border-radius: 8px;
    overflow: hidden;
    background: #f0f0f0;
}

.noclegi-gallery__viewport {
    position: relative;
    overflow: hidden;
    aspect-ratio: 16 / 10;
}

.noclegi-gallery__track {
    display: flex;
    transition: transform 0.4s ease;
    height: 100%;
}

.noclegi-gallery__slide {
    flex: 0 0 100%;
    min-width: 100%;
    position: relative;
}

.noclegi-gallery__slide img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.noclegi-gallery__featured {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 8px;
}

.noclegi-gallery--single {
    aspect-ratio: auto;
    background: none;
}

.noclegi-gallery__controls {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    transform: translateY(-50%);
    display: flex;
    justify-content: space-between;
    padding: 0 8px;
    pointer-events: none;
    z-index: 2;
}

.noclegi-gallery__btn {
    display: inline-flex;
    width: 40px !important;
    height: 40px !important;
    border: none;
    border-radius: 50% !important;
    background: #fff !important;
    color: #1A3E6B !important;
    font-size: 16px !important;
    cursor: pointer;
    pointer-events: auto;
    transition: background-color 0.2s ease, color 0.2s ease;
    line-height: 1 !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15) !important;
    justify-content: center;
    align-items: center;
}

.noclegi-gallery__btn:hover,
.noclegi-gallery__btn:focus {
    background: #fecc00;
    color: #1A3E6B;
    outline: none;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
}

.noclegi-gallery__dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    padding: 12px 0;
}

.noclegi-gallery__dot {
    width: 12px;
    height: 12px;
    border: none;
    border-radius: 50% !important;
    background: #1A3E6B !important;
    cursor: pointer;
    padding: 0 !important;
    transition: background-color 0.2s ease;
    min-width: 12px;
    flex-shrink: 0;
}

.noclegi-gallery__dot:hover,
.noclegi-gallery__dot:focus {
    background: #fecc00 !important;
    outline: 2px solid #fecc00 !important;
    outline-offset: 2px !important;
}

.noclegi-gallery__dot.is-active {
    background: #fecc00 !important;
}

.noclegi-gallery__counter {
    text-align: center;
    font-size: 13px;
    color: #666;
    padding-bottom: 8px;
}

/* ---------- Description ---------- */

.noclegi-single__description {
    margin-bottom: 32px;
}

.noclegi-single__content {
    font-size: 16px;
    line-height: 1.7;
    color: #333;
}

.noclegi-single__content p {
    margin: 0 0 16px;
}

.noclegi-single__content img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
}

/* ---------- Contact ---------- */

.noclegi-contact {
    background: #E2F1FF;
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 32px;
}

.noclegi-contact__heading {
    font-size: 22px;
    font-weight: 700;
    margin: 0 0 20px;
    color: #1A3E6B !important;
}

.noclegi-contact__details {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 24px;
}

.noclegi-contact__item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    font-size: 15px;
    line-height: 1.5;
    color: #333;
}

.noclegi-contact__icon {
    flex-shrink: 0;
    width: 24px;
    text-align: center;
    color: #0065a8;
    font-size: 16px;
    line-height: 1.5;
}

.noclegi-contact__label {
    font-weight: 600;
    white-space: nowrap;
}

.noclegi-contact__link {
    color: #0065a8;
    text-decoration: none;
    transition: color 0.2s ease;
    word-break: break-all;
}

.noclegi-contact__link:hover,
.noclegi-contact__link:focus {
    color: #004a7a;
    text-decoration: underline;
}

.noclegi-contact__map {
    border-radius: 8px;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    background: #e0e0e0;
}

.noclegi-contact__map iframe {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
}

/* ---------- Back button ---------- */

.noclegi-single__back {
    padding: 16px 0 0;
}

.noclegi-single__back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 24px;
    font-size: 15px;
    font-weight: 600;
    color: #0065a8;
    border: 2px solid #0065a8;
    border-radius: 4px;
    text-decoration: none;
    transition: background-color 0.2s ease, color 0.2s ease;
    min-height: 44px;
}

.noclegi-single__back-link:hover,
.noclegi-single__back-link:focus {
    background: #0065a8!important;
    color: #fff!important;
}

/* ---------- Animacje ---------- */

.noclegi-animate {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.noclegi-animate.is-visible {
    opacity: 1;
    transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
    .noclegi-animate {
        opacity: 1;
        transform: none;
        transition: none;
    }

    .noclegi-gallery__track {
        transition: none;
    }

    .noclegi-loader__spinner {
        animation: none;
    }
}

/* ---------- Screen reader only ---------- */

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

/* ============================================================
   DESKTOP (≥ 992px)
   ============================================================ */

@media (min-width: 992px) {

    .noclegi-archive {
        padding: 0 0 64px;
    }

    .noclegi-archive .noclegi-archive__title, .noclegi-single .noclegi-single__title {
        font-size: 48px !important;
        margin-bottom: 32px !important;
    }

    .noclegi-archive .noclegi-grid {
        grid-template-columns: repeat(3, 1fr) !important;
    }

    .noclegi-archive .noclegi-card__body {
        padding: 20px !important;
    }

    .noclegi-archive .noclegi-card__title {
        font-size: 20px !important;
    }

    .noclegi-single {
        padding: 0 24px 64px;
    }

    .noclegi-gallery__viewport {
        aspect-ratio: 16 / 9;
    }

    .noclegi-gallery__controls {
        padding: 0 16px;
    }

    .noclegi-gallery__btn {
        width: 48px;
        height: 48px;
        font-size: 24px;
    }

    .noclegi-contact {
        padding: 32px;
    }

    .noclegi-contact__details {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 24px;
    }

    .noclegi-contact__item {
        flex: 0 0 auto;
    }

    .noclegi-contact__map {
        aspect-ratio: 16 / 7;
    }
}
