/* =========================================================
   Parish Gallery – Frontend Styles
   ========================================================= */

:root {
    --pg-primary:        #0093CB;
    --pg-primary-light:  #2255882e;
    --pg-accent:         #0093CB;
    --pg-text:           #2c2c2c;
    --pg-text-muted:     #6b7280;
    --pg-bg:             #f8f7f4;
    --pg-white:          #ffffff;
    --pg-border:         #e5e0d8;
    --pg-radius:         20px;
    --pg-radius-lg:      14px;
    --pg-shadow:         0 2px 12px rgba(0,0,0,.08);
    --pg-shadow-hover:   0 8px 32px rgba(0,0,0,.14);
    --pg-gap:            20px;
    --pg-transition:     .25s ease;
}

/* ----- Base ------------------------------------------ */
.pg-section { padding: 48px 0; }
.pg-container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* ----- Section header -------------------------------- */
.pg-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 32px;
    gap: 16px;
}
.pg-section-title {
    font-size: clamp(1.4rem, 3vw, 1.9rem);
    font-weight: 700;
    color: var(--pg-primary);
    margin: 0;
    line-height: 1.2;
    position: relative;
    padding-left: 18px;
}
.pg-section-title::before {
    content: '';
    position: absolute;
    left: 0; top: 50%;
    transform: translateY(-50%);
    width: 5px; height: 60%;
    background: var(--pg-accent);
    border-radius: 3px;
}

/* ----- Grid ------------------------------------------ */
.pg-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--pg-gap);
}
.pg-grid--cols-2 { grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); }
.pg-grid--cols-4 { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }


.pg-grid--featured-5 {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: var(--pg-gap);
}

.pg-grid--featured-5 .pg-card:nth-child(1) { grid-column: 1 / 3; }
.pg-grid--featured-5 .pg-card:nth-child(2) { grid-column: 3 / 5; }
.pg-grid--featured-5 .pg-card:nth-child(3) { grid-column: 5 / 7; }
.pg-grid--featured-5 .pg-card:nth-child(4) { grid-column: 1 / 4; }
.pg-grid--featured-5 .pg-card:nth-child(5) { grid-column: 4 / 7; }

/* Tablet i mobile – standardowy grid */

/* ----- Card ------------------------------------------ */
.pg-card {
    background: var(--pg-white);
    overflow: hidden;
    transition: transform var(--pg-transition), box-shadow var(--pg-transition);
    display: flex;
    flex-direction: column;
    text-decoration: none !important;
    color: var(--pg-text);
}
.pg-card:hover {
    transform: translateY(-4px);
    text-decoration: none;
    color: var(--pg-text);
}

.pg-card__thumb {
    position: relative;
    overflow: hidden;
    aspect-ratio: 4/3;
    background: var(--pg-border);
    border-radius: var(--pg-radius-lg);
}
.pg-card__thumb img {
    width: 100%; height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .4s ease;
}
.pg-card:hover .pg-card__thumb img { transform: scale(1.05); }
.pg-card__no-image {
    width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
    background: var(--pg-primary-light);
    color: var(--pg-primary);
    font-size: 2.5rem;
}
.pg-card__count {
    position: absolute;
    bottom: 10px; right: 10px;
    background: rgba(0,0,0,.55);
    color: #fff;
    font-size: .75rem;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 20px;
    backdrop-filter: blur(4px);
}
.pg-card__body { 
    padding-top: 15px; 
    flex: 1; 
    display: flex; 
    flex-direction: column; 
    gap: 6px; 
}
.pg-card__title {
    font-size: 1.3rem;
    font-weight: 700;
    margin: 0;
    line-height: 1.35;
}
.pg-card__date {
    font-size: .8rem;
    color: var(--pg-accent);
    font-weight: 600;
    letter-spacing: .02em;
}
.pg-card__desc {
    font-size: .875rem;
    color: var(--pg-text-muted);
    line-height: 1.55;
    margin: 4px 0 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.pg-card__link-text {
    margin-top: auto;
    padding-top: 10px;
    font-size: .8rem;
    color: var(--pg-primary);
    font-weight: 600;
    display: inline-flex; align-items: center; gap: 4px;
}
.pg-card__link-text::after { content: '→'; }

/* ----- Category badge -------------------------------- */
.pg-card__cats { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 2px; }

.pg-single__header .pg-card__cats { justify-content: center; }

.pg-cat-badge {
    font-size: .72rem;
    background: var(--pg-primary);
    color: #ffffff;
    padding: 6px 15px;
    border-radius: 20px;
    font-weight: 600;
}

/* ----- "See more" button ----------------------------- */
.pg-btn-wrap { text-align: center; margin-top: 36px; }
.pg-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 32px;
    background: var(--pg-primary);
    color: var(--pg-white) !important;
    border-radius: var(--pg-radius);
    font-weight: 700;
    font-size: .95rem;
    text-decoration: none !important;
    transition: background var(--pg-transition), transform var(--pg-transition);
    letter-spacing: .02em;
}
.pg-btn:hover {
    background: var(--pg-accent);
    transform: translateY(-2px);
    text-decoration: none !important;
    color: var(--pg-white) !important;
}

/* ----- Breadcrumb ------------------------------------ */
.pg-breadcrumb { font-size: .85rem; color: var(--pg-text-muted); margin-bottom: 24px; }
.pg-breadcrumb a { color: var(--pg-primary); text-decoration: none; }
.pg-breadcrumb a:hover { text-decoration: underline; }
.pg-breadcrumb span + span::before { content: ' / '; margin: 0 4px; }

/* ----- Archive header -------------------------------- */
.pg-archive-header { margin-bottom: 36px; text-align: center; }
.pg-archive-header h1 { font-size: clamp(1.6rem, 4vw, 2.4rem); margin: 0 0 8px; }
.pg-archive-header p { color: var(--pg-text-muted); font-size: 1rem; }

/* ----- Category filter ------------------------------- */
.pg-cat-filter { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 32px; justify-content: center; }
.pg-cat-filter a {
    padding: 6px 16px;
    border-radius: 20px;
    border: 2px solid var(--pg-primary);
    color: var(--pg-primary);
    font-size: .85rem;
    font-weight: 600;
    text-decoration: none;
    transition: background var(--pg-transition), color var(--pg-transition);
}
.pg-cat-filter a:hover,
.pg-cat-filter a.active {
    background: var(--pg-primary);
    color: var(--pg-white);
}

/* ----- Pagination ------------------------------------ */
.pg-pagination { display: flex; justify-content: center; gap: 8px; margin-top: 40px; }
.pg-pagination a, .pg-pagination span {
    display: inline-flex; align-items: center; justify-content: center;
    width: 40px; height: 40px;
    border-radius: var(--pg-radius);
    border: 2px solid var(--pg-border);
    color: var(--pg-primary);
    font-weight: 700;
    text-decoration: none;
    transition: background var(--pg-transition);
}
.pg-pagination a:hover { background: var(--pg-primary-light); }
.pg-pagination .current { background: var(--pg-primary); color: var(--pg-white); border-color: var(--pg-primary); }

/* ----- Single album ---------------------------------- */
.pg-single { max-width: 1100px; margin: 0 auto; padding: 40px 20px 64px; }
.pg-single__header { margin-bottom: 28px; text-align: center; }
.pg-single__title { font-size: clamp(1.6rem, 4vw, 2.4rem);  margin: 10 0 8px; }
.pg-single__meta { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; font-size: .875rem; color: var(--pg-text-muted); justify-content: center; }
.pg-single__meta .pg-date { color: var(--pg-accent); font-weight: 700; }
.pg-single__desc { font-size: 1rem; color: var(--pg-text); line-height: 1.7; margin: 20px auto 32px; max-width: 780px; text-align: center;}

/* Grid layout */
.pg-photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
}
.pg-photo-item {
    border-radius: var(--pg-radius);
    overflow: hidden;
    aspect-ratio: 1;
    background: var(--pg-border);
    cursor: zoom-in;
}
.pg-photo-item img {
    width: 100%; height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .35s ease, opacity .25s;
}
.pg-photo-item:hover img { transform: scale(1.06); opacity: .9; }

/* Masonry layout */
.pg-photo-masonry {
    columns: 4 220px;
    gap: 20px;
}
.pg-photo-masonry .pg-photo-item {
    aspect-ratio: unset;
    break-inside: avoid;
    margin-bottom: 12px;
}
.pg-photo-masonry .pg-photo-item img { height: auto; }

/* Slider layout */
.pg-photo-slider { position: relative; overflow: hidden; border-radius: var(--pg-radius-lg); }
.pg-photo-slider__track { display: flex; transition: transform .4s ease; }
.pg-photo-slider__slide { flex: 0 0 100%; }
.pg-photo-slider__slide img { width: 100%; max-height: 600px; object-fit: contain; background: #111; display: block; }
.pg-slider-btn {
    position: absolute; top: 50%; transform: translateY(-50%);
    background: rgba(255,255,255,.85); border: none; border-radius: 50%;
    width: 44px; height: 44px; cursor: pointer; font-size: 1.4rem;
    display: flex; align-items: center; justify-content: center;
    box-shadow: var(--pg-shadow);
    transition: background var(--pg-transition);
}
.pg-slider-btn:hover { background: #fff; }
.pg-slider-prev { left: 12px; }
.pg-slider-next { right: 12px; }

/* ----- Post navigation ------------------------------- */
.pg-post-nav { display: flex; justify-content: space-between; gap: 16px; margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--pg-border); }
.pg-post-nav a { color: var(--pg-primary); text-decoration: none; font-weight: 600; font-size: .9rem; }
.pg-post-nav a:hover { color: var(--pg-accent); }

/* ----- No-photo fallback ----------------------------- */
.pg-no-galleries { color: var(--pg-text-muted); font-style: italic; padding: 24px 0; }

/* ----- Responsive ------------------------------------ */
@media (max-width: 768px) {
    .pg-grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
    .pg-photo-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
    .pg-photo-masonry { columns: 2 150px; }
    .pg-section-header { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 480px) {
    .pg-grid { grid-template-columns: 1fr; }
    .pg-photo-grid { grid-template-columns: repeat(2, 1fr); }
    .pg-photo-masonry { columns: 2; }
}
