/**
 * Gallery Styling for FungusHead Theme
 * Custom gallery implementation without plugins
 */

/* --- Gallery Archive Page --- */
.gallery-archive-page .site-main {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
}

.gallery-archive-header {
    margin-bottom: 40px;
    text-align: center;
    position: relative;
}

.gallery-main-title {
    font-family: "bebas-neue", sans-serif;
    font-size: 5rem;
    text-transform: uppercase;
    margin-bottom: 15px;
    letter-spacing: normal;
    position: relative;
    display: inline-block;
}

.gallery-main-title:after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 3px;
    background-color: #ff69b4;
}

/* Gallery Grid Layout */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
    margin-bottom: 50px;
}

.gallery-item-card {
    background-color: #fff;
    border: 3px solid #000;
    box-shadow: 6px 6px 0 #000;
    transition: all 0.2s ease-in-out;
    overflow: hidden;
    position: relative;
}

.gallery-item-card:hover {
    transform: translateY(-5px);
    box-shadow: 6px 11px 0 rgba(0, 0, 0, 0.9);
}

.gallery-item-card:hover .gallery-item-title {
    color: #ff69b4;
}

.gallery-item-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.gallery-item-thumbnail {
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    position: relative;
}

.gallery-item-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.gallery-item-card:hover .gallery-item-thumbnail img {
    transform: scale(1.05);
}

.gallery-item-thumbnail.placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f8f8f8;
    color: #666;
    font-family: 'Inter', sans-serif;
    height: 100%;
}

.gallery-item-title {
    font-family: "bebas-neue", sans-serif;
    font-size: 1.8rem;
    color: #000;
    padding: 15px;
    margin: 0;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: normal;
    border-top: 1px solid #e5e5e5;
    transition: color 0.2s ease;
}

/* Pagination */
.gallery-archive-page .pagination,
.gallery-archive-page .nav-links {
    margin-top: 40px;
    text-align: center;
    display: flex;
    justify-content: center;
    gap: 10px;
}

.gallery-archive-page .page-numbers {
    display: inline-block;
    padding: 8px 14px;
    border: 2px solid #000;
    color: #000;
    text-decoration: none;
    font-family: "bebas-neue", sans-serif;
    font-size: 1.1rem;
    transition: all 0.2s ease;
}

.gallery-archive-page .page-numbers:hover {
    background-color: #000;
    color: #fff;
}

.gallery-archive-page .page-numbers.current {
    background-color: #000;
    color: #fff;
}

/* --- Single Gallery Item Page --- */
.gallery-single-page .site-main {
    max-width: 1000px;
    margin: 40px auto;
    padding: 0 20px;
}

.gallery-item-full-header {
    margin-bottom: 30px;
    text-align: center;
}

.gallery-item-full-title {
    font-family: "bebas-neue", sans-serif;
    font-size: 3rem;
    text-transform: uppercase;
    margin-bottom: 10px;
    letter-spacing: normal;
}

.gallery-item-featured-image {
    margin-bottom: 30px;
    text-align: center;
}

.gallery-item-featured-image img {
    max-width: 100%;
    height: auto;
    border: 3px solid #000;
    box-shadow: 8px 8px 0 rgba(0, 0, 0, 0.9);
}

.gallery-item-description {
    font-family: 'Inter', sans-serif;
    font-size: 1.1rem;
    line-height: 1.8;
    color: #333;
    margin-bottom: 40px;
}

.gallery-item-footer {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #e5e5e5;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.back-to-gallery-link {
    display: inline-block;
    padding: 10px 20px;
    background-color: #000;
    color: #fff;
    text-decoration: none;
    font-family: "bebas-neue", sans-serif;
    font-size: 1.2rem;
    letter-spacing: normal;
    transition: all 0.2s ease;
    border: 2px solid #000;
}

.back-to-gallery-link:hover {
    background-color: #fff;
    color: #000;
    box-shadow: 4px 4px 0 #ff69b4;
}

.edit-link a {
    color: #666;
    text-decoration: underline;
}

/* --- Additional Images Grid --- */
.gallery-additional-images {
    margin-top: 40px;
    margin-bottom: 40px;
}

.gallery-additional-title {
    font-family: "bebas-neue", sans-serif;
    font-size: 2rem;
    margin-bottom: 20px;
    letter-spacing: normal;
    text-transform: uppercase;
    position: relative;
    display: inline-block;
}

.gallery-additional-title:after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 60px;
    height: 3px;
    background-color: #ff69b4;
}

.gallery-image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
}

.gallery-image-item {
    border: 3px solid #000;
    overflow: hidden;
    box-shadow: 5px 5px 0 rgba(0, 0, 0, 0.8);
    transition: all 0.2s ease;
    position: relative;
    aspect-ratio: 1 / 1;
}

.gallery-image-item:hover {
    transform: translateY(-5px);
    box-shadow: 5px 10px 0 rgba(0, 0, 0, 0.7);
}

.gallery-image-link {
    display: block;
    height: 100%;
}

.gallery-grid-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.gallery-image-item:hover .gallery-grid-image {
    transform: scale(1.05);
}

/* --- Responsive Adjustments --- */
@media (max-width: 768px) {
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 20px;
    }
    
    .gallery-main-title {
        font-size: 5rem;
    }
    
    .gallery-item-full-title {
        font-size: 2.5rem;
    }
    
    .gallery-item-title {
        font-size: 1.5rem;
    }
    
    .gallery-image-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
        gap: 15px;
    }
    
    .gallery-additional-title {
        font-size: 1.8rem;
    }
}

@media (max-width: 480px) {
    .gallery-grid {
        grid-template-columns: 1fr;
    }
    
    .gallery-main-title {
        font-size: 2.4rem;
    }
    
    .gallery-item-full-title {
        font-size: 2.2rem;
    }
    
    .gallery-image-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
}

/* --- Product Tag Styling --- */
.product-tagged-image {
    position: relative;
    display: inline-block;
    max-width: 100%;
}

.product-tag {
    position: absolute;
    z-index: 10;
    cursor: pointer;
    transform: translate(-50%, -50%);
}

.product-tag-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background-color: #ff69b4;
    color: white;
    font-size: 20px;
    line-height: 1;
    border: 2px solid #fff;
    box-shadow: 4px 4px 0px 0px rgba(0, 0, 0, 1);
    transition: all 0.2s ease;
    cursor: pointer;
}

.product-tag:hover .product-tag-icon {
    background-color: #000;
    transform: scale(1.1);
}

/* Active state with JavaScript */
.product-tag.tag-active .product-tag-icon {
    background-color: #000;
    transform: scale(1.1);
}

.product-tag-details {
    position: absolute;
    bottom: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%) scale(0.9);
    width: 220px;
    background-color: white;
    border: 3px solid #000;
    box-shadow: 6px 6px 0 rgba(0, 0, 0, 0.8);
    padding: 10px;
    border-radius: 3px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    pointer-events: none;
    z-index: 10;
}

.product-tag:hover .product-tag-details {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) scale(1);
    pointer-events: auto;
}

/* Active state with JavaScript */
.product-tag.tag-active .product-tag-details {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) scale(1);
    pointer-events: auto;
}

/* Product image in tag popup */
.product-tag-image {
    width: 100%;
    margin-bottom: 10px;
    border: 1px solid #e5e5e5;
    background-color: #f8f8f8;
    position: relative;
    overflow: hidden;
}

.product-tag-image img {
    display: block;
    width: 100%;
    height: auto;
    transition: transform 0.3s ease;
}

.product-tag:hover .product-tag-image img,
.product-tag.tag-active .product-tag-image img {
    transform: scale(1.05);
}

.product-tag-title {
    font-family: "bebas-neue", sans-serif;
    font-size: 1.2rem;
    margin: 0 0 5px;
    letter-spacing: normal;
    text-transform: uppercase;
}

.product-tag-price {
    margin-bottom: 10px;
    font-weight: 600;
    color: #ff69b4;
}

.product-tag-link {
    display: inline-block;
    background-color: #000;
    color: white;
    padding: 6px 12px;
    text-decoration: none;
    font-size: 0.8rem;
    text-transform: uppercase;
    font-weight: 600;
    transition: all 0.2s ease;
    border: 2px solid #000;
}

.product-tag-link:hover {
    background-color: #fff;
    color: #000;
    box-shadow: 2px 2px 0 #ff69b4;
    text-decoration: none;
}

/* Ensure product tag popup is above gallery image on hover */
.product-tagged-image-wrapper {
    position: relative;
    overflow: visible !important;
}

/* Adjusting featured image with product tags */
.featured-image-wrapper {
    display: inline-block;
    position: relative;
    max-width: 100%;
}

/* Make product tags visible on smaller screens */
@media (max-width: 768px) {
    .product-tag-icon {
        width: 24px;
        height: 24px;
        font-size: 16px;
    }
    
    .product-tag-details {
        width: 190px;
        padding: 10px;
    }
    
    .product-tag-title {
        font-size: 1rem;
    }
    
    .product-tag-link {
        padding: 4px 10px;
        font-size: 0.7rem;
    }
}

@media (max-width: 480px) {
    .product-tag-details {
        width: 160px;
        left: 0;
        transform: translateX(0) scale(0.9);
    }
    
    .product-tag:hover .product-tag-details,
    .product-tag.tag-active .product-tag-details {
        transform: translateX(0) scale(1);
    }
    
    /* Adjust positioning for right-side tags */
    .product-tag[style*="left: 70%"] .product-tag-details,
    .product-tag[style*="left: 80%"] .product-tag-details,
    .product-tag[style*="left: 90%"] .product-tag-details {
        left: auto;
        right: 0;
    }
} 