/* ============================================================
   PODSTRONA AKTUALNOŚCI
   ============================================================ */

.news-hero-reveal {
    opacity: 0;
    transform: translateY(24px);
    animation: news-hero-in 0.7s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
.news-hero-reveal.d1 { animation-delay: 0.05s; }
.news-hero-reveal.d2 { animation-delay: 0.2s; }
.news-hero-reveal.d3 { animation-delay: 0.36s; }
@keyframes news-hero-in { to { opacity: 1; transform: translateY(0); } }

.news-reveal {
    opacity: 0;
    transform: translateY(32px);
    transition: opacity 0.7s cubic-bezier(0.22,1,0.36,1),
                transform 0.7s cubic-bezier(0.22,1,0.36,1);
}
.news-reveal.is-visible { opacity: 1; transform: translateY(0); }

/* ---- HERO ---- */
.news-hero {
    padding: 130px 0 70px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.news-hero-floaters {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.news-hero-dot {
    position: absolute;
    border-radius: 50%;
    background: var(--accent-yellow);
    filter: blur(22px);
    opacity: 0.26;
    animation: news-hero-float ease-in-out infinite;
}

.news-hero-dot.dot-a { width: 200px; height: 200px; top: 75px; left: 3%;  animation-duration: 24s; animation-delay: 0s; }
.news-hero-dot.dot-b { width: 260px; height: 260px; top: 65px; right: 2%; animation-duration: 30s; animation-delay: -10s; }
.news-hero-dot.dot-c { width: 110px; height: 110px; bottom: 8%; left: 22%; animation-duration: 20s; animation-delay: -5s; }

@keyframes news-hero-float {
    0%   { transform: translate(0, 0) scale(1); }
    25%  { transform: translate(14px, 18px) scale(1.04); }
    50%  { transform: translate(-10px, 22px) scale(0.97); }
    75%  { transform: translate(-18px, -8px) scale(1.02); }
    100% { transform: translate(0, 0) scale(1); }
}

.news-hero-content {
    position: relative;
    z-index: 1;
    max-width: 680px;
    margin: 0 auto;
}

.news-hero-content h1 {
    font-family: 'Playfair Display', serif;
    font-size: 64px;
    line-height: 1.08;
    font-weight: 500;
    color: var(--text-green-dark);
    margin-bottom: 20px;
}

.news-hero-content > p {
    font-size: 18px;
    line-height: 1.75;
    color: rgba(74,74,74,0.72);
}

.news-hero-meta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 32px;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.4px;
    color: rgba(55,70,43,0.5);
}

.news-hero-meta-dot {
    color: var(--accent-yellow);
    font-size: 16px;
}

.news-hero-reveal.d4 { animation-delay: 0.52s; }

/* ---- POSTY ---- */
.news-posts {
    padding: 0 0 100px;
}

.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 28px;
}

.news-card {
    background: #fff;
    border-radius: 24px;
    border: 1px solid rgba(55,70,43,0.08);
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(55,70,43,0.05);
    display: flex;
    flex-direction: column;
    transition: transform 0.4s cubic-bezier(0.22,1,0.36,1),
                box-shadow 0.4s ease;
    position: relative;
}

.news-card::before {
    content: '';
    position: absolute;
    bottom: 0; left: 0;
    width: 0;
    height: 3px;
    background: var(--accent-yellow);
    transition: width 0.45s cubic-bezier(0.22,1,0.36,1);
}

.news-card:hover { transform: translateY(-5px); box-shadow: 0 16px 50px rgba(55,70,43,0.1); }
.news-card:hover::before { width: 100%; }

.news-card-image {
    width: 100%;
    height: 220px;
    overflow: hidden;
    flex-shrink: 0;
}

.news-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.6s cubic-bezier(0.22,1,0.36,1);
}

.news-card:hover .news-card-image img { transform: scale(1.05); }

.news-card-body {
    padding: 28px 30px 32px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.news-date {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.4px;
    color: rgba(55,70,43,0.5);
    margin-bottom: 12px;
    padding: 4px 12px;
    background: rgba(255,214,68,0.15);
    border-radius: 999px;
    width: fit-content;
}

.news-card-body h2 {
    font-family: 'Playfair Display', serif;
    font-size: 26px;
    line-height: 1.2;
    font-weight: 500;
    color: var(--text-green-dark);
    margin-bottom: 14px;
}

.news-card-body p {
    font-size: 15px;
    line-height: 1.75;
    color: rgba(74,74,74,0.72);
    flex: 1;
    white-space: pre-line;
}

.news-empty {
    text-align: center;
    padding: 80px 20px;
    color: rgba(55,70,43,0.45);
    font-size: 17px;
    border: 1px dashed rgba(55,70,43,0.15);
    border-radius: 24px;
}

/* ---- KALENDARZ ---- */
.news-calendar {
    padding: 0 0 100px;
}

.news-calendar-header {
    text-align: center;
    max-width: 600px;
    margin: 0 auto 48px;
}

.news-calendar-header h2 {
    font-family: 'Playfair Display', serif;
    font-size: 48px;
    line-height: 1.1;
    font-weight: 500;
    color: var(--text-green-dark);
    margin: 8px 0 16px;
}

.news-calendar-header p {
    font-size: 17px;
    line-height: 1.7;
    color: rgba(74,74,74,0.68);
}

.news-calendar-embed {
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 8px 48px rgba(55,70,43,0.1);
    border: 1px solid rgba(55,70,43,0.08);
    background: #fff;
}

.news-calendar-embed iframe {
    display: block;
    width: 100%;
}

.calendar-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 64px 24px;
    text-align: center;
    min-height: 320px;
}

.calendar-placeholder-icon {
    color: var(--text-green-dark);
    opacity: 0.45;
}

.calendar-placeholder p {
    margin: 0;
    color: rgba(74,74,74,0.68);
    font-size: 15px;
    max-width: 420px;
}

.calendar-placeholder-note {
    font-size: 13px;
    color: rgba(74,74,74,0.5);
}

/* ---- GALERIA ---- */
.news-gallery {
    padding: 0 0 120px;
}

.news-gallery-header {
    text-align: center;
    max-width: 600px;
    margin: 0 auto 48px;
}

.news-gallery-header h2 {
    font-family: 'Playfair Display', serif;
    font-size: 48px;
    line-height: 1.1;
    font-weight: 500;
    color: var(--text-green-dark);
    margin: 8px 0 12px;
}

.news-gallery-header p {
    font-size: 15px;
    color: rgba(74,74,74,0.6);
}

/* Grupy z przyciskiem zwijania */
.news-gallery-groups {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.news-gallery-group {
    border: 1px solid rgba(55,70,43,0.1);
    border-radius: 20px;
    overflow: hidden;
    background: #fff;
}

.news-gallery-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 24px;
    background: none;
    border: none;
    cursor: pointer;
    text-align: left;
    transition: background 0.2s;
}

.toggle-thumb {
    width: 52px;
    height: 52px;
    border-radius: 10px;
    overflow: hidden;
    flex-shrink: 0;
    background: rgba(55,70,43,0.08);
}

.toggle-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}

.news-gallery-toggle:hover .toggle-thumb img {
    transform: scale(1.08);
}

.news-gallery-toggle:hover {
    background: rgba(55,70,43,0.03);
}

.toggle-label {
    font-family: 'Playfair Display', serif;
    font-size: 22px;
    font-weight: 500;
    color: var(--text-green-dark);
    flex: 1;
}

.toggle-count {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(55,70,43,0.45);
    background: rgba(55,70,43,0.06);
    padding: 4px 12px;
    border-radius: 999px;
}

.toggle-icon {
    color: rgba(55,70,43,0.5);
    transition: transform 0.35s cubic-bezier(0.22,1,0.36,1);
    display: flex;
    align-items: center;
}

.news-gallery-toggle[aria-expanded="true"] .toggle-icon {
    transform: rotate(180deg);
}

.news-gallery-toggle[aria-expanded="true"] {
    border-bottom: 1px solid rgba(55,70,43,0.08);
}

/* Siatka wewnątrz grupy — animowane zwijanie/rozwijanie */
.news-gallery-group .news-gallery-grid {
    padding: 20px;
    max-height: 12000px;         /* duży limit — wystarcza na każdą galerię */
    opacity: 1;
    overflow: hidden;
    transition: max-height 0.55s cubic-bezier(0.22,1,0.36,1),
                opacity   0.35s ease,
                padding   0.35s ease;
}

.news-gallery-group .news-gallery-grid.is-collapsed {
    max-height: 0;
    opacity: 0;
    padding-top: 0;
    padding-bottom: 0;
}

.news-gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
}

.news-gallery-item {
    position: relative;
    border-radius: 18px;
    overflow: hidden;
    aspect-ratio: 4/3;
    cursor: pointer;
    background: linear-gradient(90deg,
        rgba(55,70,43,0.07) 25%,
        rgba(55,70,43,0.13) 50%,
        rgba(55,70,43,0.07) 75%);
    background-size: 200% 100%;
    animation: gallery-shimmer 1.6s infinite linear;
}

.news-gallery-item:has(img:not(.is-loading)) {
    animation: none;
    background: rgba(55,70,43,0.06);
}

@keyframes gallery-shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.news-gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.5s cubic-bezier(0.22,1,0.36,1),
                opacity 0.4s ease;
}

/* Ukryj placeholder — pokaż dopiero po załadowaniu */
.news-gallery-item img.is-loading {
    opacity: 0;
}

.news-gallery-item:hover img { transform: scale(1.06); }

.news-gallery-overlay {
    position: absolute;
    inset: 0;
    background: rgba(55,70,43,0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    color: #fff;
}

.news-gallery-item:hover .news-gallery-overlay { opacity: 1; }

/* Opis pod zdjęciem — pojawia się na hover */
.news-gallery-caption {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    background: linear-gradient(to top, rgba(30,40,20,0.85), transparent);
    color: #fff;
    font-size: 13px;
    font-weight: 500;
    padding: 28px 14px 12px;
    transform: translateY(4px);
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
    line-height: 1.4;
}

.news-gallery-item:hover .news-gallery-caption {
    opacity: 1;
    transform: translateY(0);
}

/* ---- LIGHTBOX ---- */
.lightbox {
    position: fixed;
    inset: 0;
    background: rgba(10,10,10,0.92);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    padding: 40px;
    box-sizing: border-box;
}

.lightbox.is-open {
    opacity: 1;
    pointer-events: all;
}

.lightbox-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    max-width: 90vw;
}

.lightbox img {
    max-width: 100%;
    max-height: 80vh;
    border-radius: 12px;
    object-fit: contain;
    box-shadow: 0 32px 80px rgba(0,0,0,0.5);
}

#lightbox-caption {
    color: rgba(255,255,255,0.75);
    font-size: 15px;
    text-align: center;
    margin: 0;
    min-height: 20px;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 24px;
    background: rgba(255,255,255,0.1);
    border: none;
    color: #fff;
    font-size: 20px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.lightbox-close:hover { background: rgba(255,255,255,0.2); }

/* Strzałki prev / next */
.lightbox-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.12);
    backdrop-filter: blur(6px);
    border: 1px solid rgba(255,255,255,0.15);
    color: #fff;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, transform 0.2s;
    z-index: 1;
}
.lightbox-arrow:hover {
    background: rgba(255,255,255,0.24);
}
.lightbox-arrow:active { transform: translateY(-50%) scale(0.93); }
.lightbox-prev { left: 24px; }
.lightbox-next { right: 24px; }

/* Footer (caption + licznik) */
.lightbox-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    min-height: 24px;
}

.lightbox-counter {
    font-size: 13px;
    color: rgba(255,255,255,0.45);
    white-space: nowrap;
}

/* ---- RESPONSIVE ---- */
@media (max-width: 768px) {
    .news-hero-content h1 { font-size: 46px; }
    .news-grid { grid-template-columns: 1fr; }
    .news-calendar-header h2,
    .news-gallery-header h2 { font-size: 38px; }
    .news-gallery-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .lightbox { padding: 20px; }
    .lightbox-arrow { width: 40px; height: 40px; }
    .lightbox-prev { left: 10px; }
    .lightbox-next { right: 10px; }
}

@media (max-width: 480px) {
    .news-hero { padding: 90px 0 50px; }
    .news-hero-content h1 { font-size: 36px; }
    .news-gallery-grid { grid-template-columns: 1fr; }
}
