
/* ==========================================================
   FAVA HOME GALLERY V3
   ========================================================== */


/* Piwigo wrapper cleanup */

body.fava-home-active #content,
body.fava-home-active #content.content-grid,
body.fava-home-active #content.content-grid.pt-3 {
    margin: 0 !important;
    padding-top: 0 !important;
}

body.fava-home-active .action-buttons {
    display: none !important;
}


/* کل صفحه */

#fava-home-gallery {
    width: 100%;

    margin: 0 auto;

    padding: 10px 20px 12px;

    box-sizing: border-box;
}


.fava-viewer {
    width: 100%;
    max-width: 1220px;

    margin: 0 auto;
}


/* عنوان */

.fava-viewer-heading {
    height: 42px;

    display: flex;
    align-items: center;
    justify-content: center;

    gap: 14px;

    margin: 0 0 8px;
}


.fava-viewer-heading h2 {
    margin: 0;

    font-size: 23px;
    font-weight: 700;
}


#fava-photo-counter {
    padding: 5px 10px;

    background: #eeeeee;

    border-radius: 20px;

    font-size: 13px;
}


/* ==========================================================
   تصویر + thumbnails
   ========================================================== */

.fava-stage {
    display: flex;

    align-items: stretch;
    justify-content: center;

    gap: 12px;

    width: 100%;

    margin: 0 auto 8px;
}


/* ستون تصویر اصلی */

.fava-main-column {
    display: flex;
    flex-direction: column;

    align-items: center;

    gap: 7px;

    min-width: 0;
}


/* قاب تصویر اصلی */

.fava-main-frame {
    height: clamp(360px, 48vh, 500px);

    aspect-ratio: 3 / 2;

    padding: 5px;

    box-sizing: border-box;

    display: flex;
    align-items: center;
    justify-content: center;

    background: #ffffff;

    border: 1px solid #e1e1e1;
    border-radius: 13px;

    box-shadow:
        0 8px 25px
        rgba(0,0,0,.05);

    overflow: hidden;
}


#fava-main-link {
    width: 100%;
    height: 100%;

    display: flex;
    align-items: center;
    justify-content: center;
}


#fava-main-image {
    width: 100%;
    height: 100%;

    object-fit: contain;

    display: block;

    border-radius: 8px;
}


/* کنترل‌ها */

.fava-player-controls {
    height: 54px;

    display: flex;
    align-items: center;
    justify-content: center;

    gap: 10px;

    margin: 0;
}


.fava-control {
    width: 42px;
    height: 42px;

    min-width: 42px;

    padding: 0;

    border-radius: 50%;
}


.fava-play {
    width: 54px;
    height: 54px;

    min-width: 54px;
}


/* ==========================================================
   تصاویر کوچک کنار تصویر
   ========================================================== */

.fava-photo-strip {
    width: 118px;

    height: clamp(360px, 48vh, 500px);

    flex: 0 0 118px;

    display: flex;
    flex-direction: column;

    gap: 8px;

    padding: 6px;

    box-sizing: border-box;

    overflow-x: hidden;
    overflow-y: auto;

    background: #ffffff;

    border: 1px solid #e1e1e1;
    border-radius: 13px;

    scrollbar-width: thin;
}


.fava-photo-thumb {
    flex: 0 0 69px;

    width: 104px;
    height: 69px;

    margin: 0;
    padding: 3px;

    box-sizing: border-box;

    border: 2px solid transparent;
    border-radius: 9px;

    background: #fff;

    opacity: .78;

    cursor: pointer;

    overflow: hidden;

    transition:
        opacity .18s ease,
        border-color .18s ease,
        transform .18s ease;
}


.fava-photo-thumb img {
    width: 100%;
    height: 100%;

    object-fit: cover;

    display: block;

    border-radius: 5px;
}


.fava-photo-thumb:hover {
    opacity: 1;

    transform: scale(1.02);
}


.fava-photo-thumb.active {
    opacity: 1;

    border-color: #d85b45;

    box-shadow:
        0 0 0 2px
        rgba(216,91,69,.12);
}


/* ==========================================================
   Albums
   ========================================================== */

.fava-albums-heading {
    max-width: 1110px;

    margin: 2px auto 5px;

    font-size: 20px;
    font-weight: 700;

    text-align: right;
}


.fava-album-strip {
    width: 100%;
    max-width: 1110px;

    height: 112px;

    margin: 0 auto;

    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;

    gap: 9px;

    padding: 2px;

    box-sizing: border-box;

    overflow-x: auto;
    overflow-y: hidden;

    direction: rtl;

    scrollbar-width: thin;
}


.fava-album-card {
    flex: 0 0 145px;

    width: 145px;
    height: 103px;

    margin: 0;
    padding: 4px;

    box-sizing: border-box;

    background: #ffffff;

    border: 1px solid #e6e6e6;
    border-radius: 10px;

    overflow: hidden;
}


.fava-album-card.active {
    border-color: #d85b45;

    box-shadow:
        0 0 0 1px
        #d85b45;
}


.fava-album-cover {
    width: 100%;
    height: 68px;

    overflow: hidden;

    border-radius: 7px;
}


.fava-album-cover img {
    width: 100%;
    height: 100%;

    object-fit: cover;

    display: block;
}


.fava-album-info {
    padding: 3px 2px 0;
}


.fava-album-info strong {
    display: block;

    font-size: 12px;

    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}


.fava-album-info span {
    display: block;

    margin-top: 1px;

    font-size: 9px;
    opacity: .65;
}


/* ==========================================================
   مانیتورهای کم ارتفاع
   ========================================================== */

@media (min-width: 769px) and (max-height: 800px) {

    .fava-main-frame,
    .fava-photo-strip {
        height: 360px;
    }

}


/* ==========================================================
   Mobile
   ========================================================== */

@media (max-width: 768px) {

    #fava-home-gallery {
        padding: 8px;
    }

    .fava-stage {
        display: flex;
        flex-direction: column;
    }

    .fava-main-column {
        width: 100%;
    }

    .fava-main-frame {
        width: 100%;
        height: auto;

        aspect-ratio: 3 / 2;
    }

    .fava-photo-strip {
        width: 100%;
        height: 78px;

        flex: none;

        flex-direction: row;

        overflow-x: auto;
        overflow-y: hidden;
    }

    .fava-photo-thumb {
        flex: 0 0 95px;

        width: 95px;
        height: 64px;
    }

}



/* ==========================================================
   FAVA Download Button
   ========================================================== */

#fava-download-photo {
    display: flex !important;

    align-items: center !important;
    justify-content: center !important;

    width: 42px !important;
    height: 42px !important;

    min-width: 42px !important;

    padding: 0 !important;
    margin: 0 !important;

    box-sizing: border-box !important;

    border: 1px solid #dddddd !important;
    border-radius: 50% !important;

    background: #ffffff !important;

    color: #666666 !important;

    text-decoration: none !important;

    cursor: pointer;

    box-shadow:
        0 3px 10px
        rgba(0,0,0,.06);

    transition:
        color .18s ease,
        border-color .18s ease,
        transform .18s ease,
        box-shadow .18s ease;
}


#fava-download-photo:hover {
    color: #d85b45 !important;

    border-color: #d85b45 !important;

    text-decoration: none !important;

    transform: translateY(-1px);

    box-shadow:
        0 5px 14px
        rgba(0,0,0,.10);
}


#fava-download-photo.disabled {
    opacity: .35;

    pointer-events: none;

    cursor: default;
}

