/**
 * Tabbed Album Gallery - [Admin/Frontend/Block] Styles
 *
 * @package TabbedAlbumGallery
 * @author  Amit Rajbhandari
 * @email   amit.fist@gmail.com
 */
 
/* ============================================
   TABBED ALBUM GALLERY - FRONTEND STYLES
   ============================================ */

.tag-tabs-gallery {
    max-width: 100%;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    --tag-primary: #1e293b;
    --tag-secondary: #3b82f6;
}

/* ============================================
   TAB ITEM COUNTER
   ============================================ */
.tag-tab-count {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    background: rgba(255,255,255,0.2);
    color: inherit;
    padding: 2px 8px;
    border-radius: 10px;
    margin-left: 6px;
    vertical-align: middle;
    line-height: 1.4;
}

.tag-tab-btn.active .tag-tab-count {
    background: rgba(255,255,255,0.2);
}

/* ============================================
   TAB NAVIGATION - DEFAULT STYLE
   ============================================ */
.tag-tabs-nav-wrapper {
	width: 100%;
	display: flex;
}

.tag-tabs-nav {
    display: flex;
    flex-wrap: nowrap;
    gap: 6px;
    margin-bottom: 28px;
    padding-bottom: 8px;
    border-bottom: 2px solid #e2e8f0;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
    white-space: nowrap;
}

.tag-tabs-nav::-webkit-scrollbar {
    height: 4px;
}

.tag-tabs-nav::-webkit-scrollbar-track {
    background: transparent;
}

.tag-tabs-nav::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.tag-tab-btn {
    flex-shrink: 0;
    padding: 10px 20px;
    border: 1px solid #e2e8f0;
    background: #fff;
    color: #475569;
    font-size: 14px;
    font-weight: 500;
    border-radius: 8px;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
    font-family: inherit;
    line-height: 1.4;
}

.tag-tab-btn:hover {
    background: #f1f5f9;
    color: var(--tag-primary);
    border-color: var(--tag-primary);
}

.tag-tab-btn.active {
    background: var(--tag-primary);
    color: var(--tag-secondary);
    border-color: var(--tag-primary);
}

/* ============================================
   TAB STYLE: MATERIAL
   ============================================ */
.tag-tabs-material .tag-tabs-nav {
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 0;
    gap: 0;
}

.tag-tabs-material .tag-tab-btn {
    border: none;
    background: transparent;
    border-radius: 0;
    padding: 12px 20px;
    position: relative;
    color: #475569;
    font-weight: 500;
    transition: color 0.2s ease;
}

.tag-tabs-material .tag-tab-btn::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: transparent;
    transition: background-color 0.2s ease;
}

.tag-tabs-material .tag-tab-btn.active {
    color: var(--tag-primary);
    background: transparent;
}

.tag-tabs-material .tag-tab-btn.active::after {
    background-color: var(--tag-primary);
}

.tag-tabs-material .tag-tab-btn:hover {
    background: rgba(0,0,0,0.03);
    color: var(--tag-primary);
}

/* ============================================
   TAB STYLE: MINIMAL / MODERN
   ============================================ */
.tag-tabs-minimal .tag-tabs-nav {
    border-bottom: none;
    gap: 4px;
    padding: 4px;
    background: #f1f5f9;
    border-radius: 12px;
    display: inline-flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    max-width: 100%;
}

.tag-tabs-minimal .tag-tab-btn {
    border: none;
    background: transparent;
    border-radius: 9px;
    padding: 8px 18px;
    color: #1e293b;
    font-weight: 500;
    font-size: 13px;
}

.tag-tabs-minimal .tag-tab-btn .tag-tab-count {
	background: rgba(0,0,0,0.2)
}

.tag-tabs-minimal .tag-tab-btn.active {
    background: var(--tag-primary);
    color: var(--tag-secondary);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.tag-tabs-minimal .tag-tab-btn:hover:not(.active) {
    background: rgba(255,255,255,0.5);
	 color: var(--tag-primary);
}

/* ============================================
   TAB STYLE: PILLS
   ============================================ */
.tag-tabs-pills .tag-tabs-nav {
    border-bottom: none;
    gap: 8px;
    padding-bottom: 4px;
}

.tag-tabs-pills .tag-tab-btn {
    border-radius: 50px;
    padding: 10px 24px;
    border: 2px solid #e2e8f0;
    background: #fff;
    font-weight: 500;
    transition: all 0.2s ease;
}

.tag-tabs-minimal .tag-tab-btn .tag-tab-count {
	background: rgba(0,0,0,0.2)
}

.tag-tabs-pills .tag-tab-btn.active {
    background: var(--tag-primary);
    color: var(--tag-secondary);
    border-color: var(--tag-primary);
}

.tag-tabs-pills .tag-tab-btn:hover:not(.active) {
    background: var(--tag-primary);
    border-color: var(--tag-primary);
	color: var(--tag-secondary);
}

/* ============================================
   TAB ALIGNMENT: LEFT / RIGHT
   ============================================ */
.tag-tabs-nav-wrapper.tag-tabs-align-left {
    justify-content: flex-start;
}

.tag-tabs-nav-wrapper.tag-tabs-align-right {
    justify-content: flex-end;
}

/* ============================================
   GROUP HEADINGS
   ============================================ */
.tag-group-heading {
	display: flex;
    align-items: center;
    gap: 16px;
	font-family: 'Outfit',sans-serif;
    font-size: .68rem;
    letter-spacing: .2em;
    text-transform: uppercase;
    color: rgb(201 169 110);
    margin-bottom: 28px;
}
.tag-group-heading::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(to right, #ffffff17, #00000000);
}

/* ============================================
   TAB CONTENT
   ============================================ */
.tag-tab-content {
    display: none;
}

.tag-tab-content.active {
    display: flex;
	flex-direction: column;
	gap: 60px;
    animation: tagFadeIn 0.3s ease;
}

@keyframes tagFadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ============================================
   ITEMS GRID - GRID LAYOUT
   ============================================ */
.tag-list-grid .tag-items-grid-front {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

@media (max-width: 1024px) {
    .tag-list-grid .tag-items-grid-front {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .tag-list-grid .tag-items-grid-front {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ============================================
   ITEMS GRID - MASONRY LAYOUT
   ============================================ */
.tag-list-masonry .tag-items-grid-front {
    column-count: 4;
    column-gap: 12px;
}

.tag-list-masonry .tag-item-card-front {
    break-inside: avoid;
    margin-bottom: 12px;
}

@media (max-width: 1024px) {
    .tag-list-masonry .tag-items-grid-front {
        column-count: 3;
    }
}

@media (max-width: 768px) {
    .tag-list-masonry .tag-items-grid-front {
        column-count: 2;
    }
}

@media (max-width: 480px) {
    .tag-list-masonry .tag-items-grid-front {
        column-count: 2;
    }
}

/* ============================================
   ITEM CARD
   ============================================ */
.tag-item-card-front {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    background: #f1f5f9;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.tag-list-grid .tag-item-card-front {
    aspect-ratio: 1 / 1;
}

.tag-item-card-front:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.12);
}

.tag-item-thumb {
    width: 100%;
    overflow: hidden;
}

.tag-list-grid .tag-item-thumb {
    height: 100%;
}

.tag-item-thumb img,
.tag-thumb-img {
    width: 100%;
    display: block;
}

.tag-list-grid .tag-thumb-img {
    height: 100%;
    object-fit: cover;
}

.tag-list-masonry .tag-thumb-img {
    height: auto;
}

/* Video Thumbnail */
.tag-video-thumb {
    position: relative;
}

.tag-play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 48px;
    height: 48px;
    background: rgba(0,0,0,0.7);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 18px;
    transition: background 0.2s ease, transform 0.2s ease;
    pointer-events: none;
}

.tag-item-card-front:hover .tag-play-icon {
    background: var(--tag-secondary);
    transform: translate(-50%, -50%) scale(1.1);
}

.tag-video-placeholder {
    width: 100%;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #e2e8f0;
    color: #64748b;
    gap: 8px;
    overflow: hidden;
}

.tag-video-placeholder img {
    width: 100%;
    height: 100%;
    min-height: 200px;
    object-fit: cover;
    display: block;
}

.tag-video-placeholder .dashicons {
    font-size: 32px;
    width: 32px;
    height: 32px;
}

/* Item Caption */
.tag-item-caption {
    padding: 8px 10px;
    font-size: 13px;
    color: #475569;
    background: #fff;
    font-style: italic;
    text-align: center;
    line-height: 1.4;
}

/* ============================================
   LIGHTBOX
   ============================================ */
.tag-lightbox {
    display: none;
    position: fixed !important;
    top: 0;
    left: 0;
    width: 100% !important;
    height: 100%;
    z-index: 99999;
}

.tag-lightbox.active {
    display: block;
}

.tag-lightbox-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
	backdrop-filter: blur(8px);
}

.tag-lightbox-content {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    z-index: 1;
}

.tag-lightbox-media {
	min-width: 50vw;
    max-width: 90%;
    max-height: 75vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tag-lightbox-media img {
    max-width: 100%;
    max-height: 75vh;
    object-fit: contain;
    border-radius: 4px;
}

.tag-lightbox-media iframe,
.tag-lightbox-media video {
    width: 853px;
    max-width: 90vw;
    height: 480px;
    max-height: 75vh;
    border: none;
    border-radius: 4px;
}

@media (max-width: 768px) {
    .tag-lightbox-media iframe,
    .tag-lightbox-media video {
        height: 250px;
    }
}

.tag-lightbox-head {
	width: 100%;
	display: flex;
	position: absolute;
	top: 0;
	gap: 12px;
	justify-content: flex-end;
	align-items: center;
	padding: 15px;
    background: rgba(0,0,0,0.7);
	backdrop-filter: blur(20px);
}

.tag-lightbox-close,
.tag-lightbox-prev,
.tag-lightbox-next,
.tag-lightbox-download {
	width: 44px;
    height: 44px;
	border-radius: 50%;
	display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
	background: rgba(255,255,255,0.2);
	color: #fff;
	padding: 0;
    text-decoration: none;
    z-index: 2;
    padding: 8px;
    border-radius: 50%;
	cursor: pointer;
	backdrop-filter: blur(8px);
    transition: background 0.2s ease;
}

.tag-lightbox-close:hover,
.tag-lightbox-close:focus {
	background: rgba(255,255,255,0.15);
    color: var(--tag-secondary);
}

.tag-lightbox-prev,
.tag-lightbox-next {
	position: absolute;
    top: 50%;       
    color: rgb(244 240 235);
    transition: all .2s;    
    transform: translateY(-50%);
}

.tag-lightbox-prev:hover,
.tag-lightbox-next:hover,
.tag-lightbox-prev:focus,
.tag-lightbox-next:focus {
 	background: rgba(255,255,255,0.15);
    color: var(--tag-secondary);
}

.tag-lightbox-prev {
    left: 20px;
}

.tag-lightbox-next {
    right: 20px;
}

.tag-lightbox-download {
    top: 20px;
    right: 80px;
	font-size: 0.75rem;
}

.tag-lightbox-download:hover {
    background: rgba(255,255,255,0.15);
    color: var(--tag-secondary);
}

.tag-lightbox-footer {
	display: flex;
	flex-direction: column;
	gap: 10px;
	position: absolute;
    bottom: 15px;
}
.tag-lightbox-caption {
	margin: 0;
	text-align: center;
    margin-top: 14px;
    font-size: .82rem;
    color: rgb(244 240 235 / 60%);
    font-style: italic;
}
.tag-lightbox-counter {
	font-family: 'Outfit',sans-serif;
	font-size: .68rem;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: rgb(244 240 235 / 35%);
    text-align: center;
}
.tag-lightbox-album-title {
	margin: 0;
	font-size: .82rem;
}

/* ============================================
   LIGHTBOX TRANSITIONS
   ============================================ */

/* Fade in/out for media content */
.tag-lightbox-media {
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.tag-lightbox-media.fade-out {
    opacity: 0;
    transform: scale(0.96);
}

/* Slide animations for next/previous */
.tag-lightbox-media.slide-left-out {
    opacity: 0;
    transform: translateX(-40px);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.tag-lightbox-media.slide-right-out {
    opacity: 0;
    transform: translateX(40px);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.tag-lightbox-media.slide-left-in {
    animation: tagSlideLeftIn 0.3s ease forwards;
}

.tag-lightbox-media.slide-right-in {
    animation: tagSlideRightIn 0.3s ease forwards;
}

@keyframes tagSlideLeftIn {
    from { opacity: 0; transform: translateX(40px); }
    to   { opacity: 1; transform: translateX(0); }
}

@keyframes tagSlideRightIn {
    from { opacity: 0; transform: translateX(-40px); }
    to   { opacity: 1; transform: translateX(0); }
}

/* Caption and counter fade */
.tag-lightbox-caption,
.tag-lightbox-counter,
.tag-lightbox-album-title {
    transition: opacity 0.2s ease;
}

/* ============================================
   CAROUSEL LAYOUT (Moments-style)
   ============================================ */
.tag-list-carousel.tag-no-tabs .tag-tab-content {
    display: block;
}

.tag-list-carousel .tag-carousel {
    width: 100%;
}

.tag-list-carousel .tag-carousel-track {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    padding: 40px 0 24px;
    cursor: grab;
}

.tag-list-carousel .tag-carousel-track.is-dragging {
    cursor: grabbing;
    scroll-snap-type: none;
}

.tag-list-carousel .tag-carousel-track::-webkit-scrollbar {
    display: none;
}

.tag-list-carousel .tag-carousel-slide {
    flex: 0 0 auto;
    width: clamp(160px, 22vw, 220px);
    scroll-snap-align: start;
}

.tag-list-carousel .tag-item-card-front {
    width: 100%;
    aspect-ratio: 3 / 4;
    margin: 0;
    border-radius: 1.25rem;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.75);
    box-shadow: 0 12px 36px rgba(15, 23, 42, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
    cursor: pointer;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.tag-list-carousel .tag-item-card-front:hover {
    transform: translateY(-4px);
    box-shadow: 0 18px 42px rgba(15, 23, 42, 0.14),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.tag-list-carousel .tag-item-thumb,
.tag-list-carousel .tag-video-thumb,
.tag-list-carousel .tag-video-placeholder {
    width: 100%;
    height: 100%;
}

.tag-list-carousel .tag-item-thumb img,
.tag-list-carousel .tag-video-placeholder img,
.tag-list-carousel .tag-thumb-img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover;
    display: block;
}

.tag-list-carousel .tag-item-caption {
    display: none;
}

.tag-list-carousel .tag-play-icon {
    width: 48px;
    height: 48px;
    font-size: 18px;
}

.tag-list-carousel .tag-carousel-progress {
    max-width: 28rem;
    margin: 0 auto;
    height: 4px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    overflow: hidden;
    box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.06);
}

.tag-list-carousel .tag-carousel-progress-fill {
    height: 100%;
    width: 0%;
    border-radius: inherit;
    background: #0d1117;
    transition: width 0.15s ease;
}

.tag-list-carousel .tag-tabs-nav-wrapper {
    margin-bottom: 0;
}

.tag-list-carousel .tag-tabs-nav {
    margin-bottom: 0;
}