/**
 * PR Photo Albums - Frontend Styles
 * Using BEM naming convention
 */

/* ——————————————————————————————————————————————————
   Albums Grid (Archive/List View)
—————————————————————————————————————————————————— */

.pr-albums-grid {
    width: 100%;
    margin: 0 auto;
}

.pr-albums-grid__container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(19rem, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.pr-album-card {
    --card-padding: 1.5rem;
    --card-background: #fff;
    --card-background-alt: #f8f9fa;
    --card-overlay-background: rgba(0, 0, 0, 0.8);
    --card-title-color: #151515;
    --card-body-color: inherit;
    --card-body-color-alt: #808080;
    --card-border-color: rgba(0, 0, 0, 0.1);

    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    color: var(--card-body-color);
    text-decoration: none;
    background: var(--card-background);
    border-radius: 0.5rem;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.03);
    transition: all 0.3s ease;
}

.pr-album-card:hover,
.pr-album-card--hover {
    color: var(--card-body-color);
    text-decoration: none;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.1);
    transform: translateY(-0.5rem);
}

.pr-album-card__content {
    position: relative;
}

.pr-album-card__image {
    position: relative;
    padding-bottom: 60%;
    overflow: hidden;
    background-color: var(--card-background-alt);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    transition: transform 0.3s ease;
}

.pr-album-card__image[data-placeholder="true"] {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--card-background-alt);
}

.pr-album-card:hover .pr-album-card__image {
    transform: scale(1.05);
}

.pr-album-card__placeholder-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    font-size: 3rem;
    opacity: 0.3;
    transform: translate(-50%, -50%);
}

.pr-album-card__overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    transform: translateY(100%);
    padding: var(--card-padding);
    color: #fff;
    background: linear-gradient(transparent, var(--card-overlay-background));
    transition: transform 0.3s ease;
}

.pr-album-card:hover .pr-album-card__overlay {
    transform: translateY(0);
}

.pr-album-card__photo-count {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.pr-album-card__count-number {
    font-size: 1.5rem;
    font-weight: 700;
}

.pr-album-card__count-label {
    font-size: 1rem;
    opacity: 0.9;
}

.pr-album-card__body {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: .5rem;
    padding: var(--card-padding);
}

.pr-album-card__title {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1.3;
    color: var(--card-title-color);
}

.pr-album-card__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: 0.875rem;
}

.pr-album-card__date {
    color: var(--card-body-color-alt);
    font-size: 1.1rem;
}

.pr-album-card__excerpt {
    line-height: 1.6;
    margin-bottom: 1rem;
    flex: 1;
}

.pr-album-card__footer {
    padding: 1rem var(--card-padding);
    border-top: 1px solid var(--card-border-color);
    font-size: 0.875rem;
}

.pr-album-card__photographers {
    color: var(--card-body-color-alt);
}

/* Empty State */

.pr-albums-grid__empty {
    text-align: center;
    padding: 4rem 2rem;
    grid-column: 1 / -1;
}

.pr-albums-grid__empty-icon {
    font-size: 4rem;
    margin-bottom: 1.5rem;
    opacity: 0.3;
}

.pr-albums-grid__empty-title {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--card-title-color);
}

.pr-albums-grid__empty-text {
    font-size: 1rem;
}





/* ——————————————————————————————————————————————————
   Single Album View
—————————————————————————————————————————————————— */

.pr-album-single {
    width: 100%;
}

.pr-album-single__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 30px;
    gap: 30px;
}

.pr-album-single__title-section {
    flex: 1;
}

.pr-album-single__title {
    font-size: 2.5rem;
    font-weight: 700;
    color: #333;
    margin: 0 0 20px;
    line-height: 1.2;
}

.pr-album-single__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    font-size: 14px;
}

.pr-album-single__meta-label {
    font-weight: 600;
    color: #666;
    margin-right: 5px;
}

.pr-album-single__category,
.pr-album-single__date,
.pr-album-single__photographers,
.pr-album-single__photo-count {
    color: #333;
}

.pr-album-single__hashtag {
    color: #1da1f2;
    font-weight: 600;
    font-size: 16px;
}

.pr-album-single__controls {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-shrink: 0;
}

.pr-album-single__layout-toggle {
    display: flex;
    background: #f8f9fa;
    border-radius: 8px;
    padding: 4px;
    gap: 2px;
}

.pr-album-single__layout-btn {
    padding: 8px 12px;
    border: none;
    background: transparent;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pr-album-single__layout-btn:hover {
    background: #e9ecef;
}

.pr-album-single__layout-btn--active {
    background: #007cba;
    color: #fff;
}

.pr-album-single__layout-icon {
    font-size: 16px;
}

.pr-album-single__fullscreen-btn {
    padding: 10px;
    border: 2px solid #ddd;
    background: #fff;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pr-album-single__fullscreen-btn:hover {
    border-color: #007cba;
    background: #f8f9fa;
}

.pr-album-single__fullscreen-icon {
    font-size: 16px;
}

.pr-album-single__description {
    margin-bottom: 40px;
    font-size: 1.1rem;
    line-height: 1.7;
    color: #555;
}

/* Gallery Layouts */
.pr-album-single__gallery {
    margin-bottom: 40px;
    transition: all 0.3s ease;
}

/* Grid Layout */
.pr-album-single__gallery--grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

/* Masonry Layout */
.pr-album-single__gallery--masonry {
    column-count: auto;
    column-width: 250px;
    column-gap: 20px;
}

.pr-album-single__gallery--masonry .pr-album-single__photo-item {
    break-inside: avoid;
    margin-bottom: 20px;
}

/* Fullscreen Gallery */
.pr-album-single__gallery--fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #fff;
    z-index: 9999;
    overflow-y: auto;
    padding: 20px;
    margin: 0;
}

.pr-gallery-fullscreen {
    overflow: hidden;
}

.pr-album-single__photo-item {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #f8f9fa;
}

.pr-album-single__photo-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.pr-album-single__photo-image {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.3s ease;
}

.pr-album-single__photo-item:hover .pr-album-single__photo-image {
    transform: scale(1.02);
}

.pr-album-single__photo-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    color: #fff;
    padding: 30px 20px 15px;
    font-size: 14px;
    line-height: 1.4;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.pr-album-single__photo-item:hover .pr-album-single__photo-caption {
    transform: translateY(0);
}

.pr-album-single__photo-overlay {
    position: absolute;
    top: 15px;
    right: 15px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.pr-album-single__photo-item:hover .pr-album-single__photo-overlay {
    opacity: 1;
}

.pr-album-single__photo-expand {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.pr-album-single__photo-expand:hover {
    background: #fff;
    transform: scale(1.1);
}

.pr-album-single__expand-icon {
    font-size: 16px;
}

/* Lightbox */
.pr-album-single__lightbox {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pr-album-single__lightbox-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
}

.pr-album-single__lightbox-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    z-index: 1;
}

.pr-album-single__lightbox-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 8px;
}

.pr-album-single__lightbox-caption {
    position: absolute;
    bottom: -50px;
    left: 0;
    right: 0;
    text-align: center;
    color: #fff;
    font-size: 16px;
    padding: 0 20px;
}

.pr-album-single__lightbox-close,
.pr-album-single__lightbox-prev,
.pr-album-single__lightbox-next {
    position: absolute;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #fff;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.pr-album-single__lightbox-close {
    top: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 24px;
}

.pr-album-single__lightbox-prev,
.pr-album-single__lightbox-next {
    top: 50%;
    transform: translateY(-50%);
    width: 60px;
    height: 80px;
    border-radius: 8px;
    font-size: 28px;
}

.pr-album-single__lightbox-prev {
    left: 20px;
}

.pr-album-single__lightbox-next {
    right: 20px;
}

.pr-album-single__lightbox-close:hover,
.pr-album-single__lightbox-prev:hover,
.pr-album-single__lightbox-next:hover {
    background: rgba(255, 255, 255, 0.2);
}

.pr-album-single__lightbox-counter {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    backdrop-filter: blur(10px);
}

/* Empty State */
.pr-album-single__empty {
    text-align: center;
    padding: 80px 20px;
}

.pr-album-single__empty-icon {
    font-size: 64px;
    margin-bottom: 20px;
    opacity: 0.3;
}

.pr-album-single__empty-title {
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: #333;
}

.pr-album-single__empty-text {
    color: #666;
    font-size: 1.1rem;
}

.pr-album-single__error {
    text-align: center;
    padding: 40px 20px;
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 8px;
    color: #856404;
    margin: 20px 0;
}

/* Body Classes */
.pr-lightbox-open {
    overflow: hidden;
}

/* ——————————————————————————————————————————————————
   Responsive Design
—————————————————————————————————————————————————— */

@media (max-width: 768px) {
    .pr-albums-grid {
        padding: 15px;
    }

    .pr-albums-grid__container {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 20px;
    }

    .pr-album-single {
        padding: 15px;
    }

    .pr-album-single__header {
        flex-direction: column;
        gap: 20px;
    }

    .pr-album-single__title {
        font-size: 2rem;
    }

    .pr-album-single__meta {
        flex-direction: column;
        gap: 10px;
    }

    .pr-album-single__controls {
        align-self: center;
    }

    .pr-album-single__gallery--grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 15px;
    }

    .pr-album-single__gallery--masonry {
        column-width: 200px;
        column-gap: 15px;
    }

    .pr-album-single__lightbox-prev {
        left: 10px;
    }

    .pr-album-single__lightbox-next {
        right: 10px;
    }

    .pr-album-single__lightbox-close {
        top: 10px;
        right: 10px;
        width: 40px;
        height: 40px;
    }
}

@media (max-width: 480px) {
    .pr-albums-grid__container {
        grid-template-columns: 1fr;
    }

    .pr-album-single__gallery--grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 10px;
    }

    .pr-album-single__gallery--masonry {
        column-count: 2;
        column-gap: 10px;
    }

    .pr-album-single__photo-item {
        margin-bottom: 10px;
    }

    .pr-album-single__lightbox-content {
        max-width: 95%;
        max-height: 85%;
    }

    .pr-album-single__lightbox-prev,
    .pr-album-single__lightbox-next {
        width: 50px;
        height: 60px;
        font-size: 20px;
    }
}
