/**
 * Single Collection Post Styles
 *
 * @package Zonkey_Child
 */

/* ==========================================================================
   Breadcrumb Navigation
   ========================================================================== */
.collection-breadcrumb {
    padding: 20px;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.collection-breadcrumb-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0;
    flex-wrap: wrap;
}

.collection-breadcrumb-item {
    display: flex;
    align-items: center;
    font-size: 0.75rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    margin: 0;
    position: relative;
}

.collection-breadcrumb-item a {
    color: var(--awd-text-muted);
    text-decoration: none;
    transition: color 0.3s ease;
}

.collection-breadcrumb-item a:hover {
    color: var(--awd-text-light);
}

.collection-breadcrumb-item.current {
    color: var(--awd-text-light);
}

.collection-breadcrumb-item.current::before {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--awd-text-light);
}

.collection-breadcrumb-item:not(:last-child)::after {
    content: '';
    display: inline-block;
    width: 21px;
    height: 9px;
    margin: 0 15px;
    background-image: url("data:image/svg+xml,%3Csvg width='21' height='9' viewBox='0 0 21 9' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M16.5 0.5L20.5 4.5M20.5 4.5L16.5 8.5M20.5 4.5H0.5' stroke='%23686868' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
}

/* ==========================================================================
   Main Content Layout
   ========================================================================== */
.collection-single {
    padding: 4rem 2rem;
}

.collection-single-container {
    max-width: var(--awd-site-max-width);
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: start;
}

/* ==========================================================================
   Gallery Column
   ========================================================================== */
.collection-gallery-main {
    position: relative;
    margin-bottom: 1rem;
    cursor: pointer;
}

.collection-gallery-main-link {
    display: block;
    position: relative;
    overflow: hidden;
    cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='M21 21l-4.35-4.35'/%3E%3Cpath d='M11 8v6'/%3E%3Cpath d='M8 11h6'/%3E%3C/svg%3E") 0 0, zoom-in;
}

.collection-main-image {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.3s ease;
}

.collection-gallery-main-link:hover .collection-main-image {
    transform: scale(1.02);
}

.collection-gallery-thumbnails {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.collection-thumbnail {
    width: 100px;
    height: 100px;
    padding: 0;
    border: 2px solid transparent;
    background: transparent;
    cursor: pointer;
    overflow: hidden;
    transition: border-color 0.3s ease, opacity 0.3s ease;
}

.collection-thumbnail:hover {
    opacity: 0.8;
}

.collection-thumbnail.active {
    border-color: var(--awd-text-light);
}

.collection-thumb-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* ==========================================================================
   Details Column
   ========================================================================== */
.collection-details {
    color: var(--awd-text-light);
}

.collection-title {
    font-size: 1.5rem;
    font-weight: 400;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--awd-text-light);
    margin: 0 0 0.5rem;
    line-height: 1.3;
}

.collection-type-link {
    display: inline-block;
    font-size: 0.75rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--awd-text-muted);
    text-decoration: none;
    margin-bottom: 1.5rem;
    transition: color 0.3s ease;
}

.collection-type-link:hover {
    color: var(--awd-text-light);
}

.collection-description {
    line-height: 1.4;
    margin-bottom: 2rem;
    font-size: 0.9rem;
    color: var(--awd-text-muted);
}

.collection-description p {
    margin: 0 0 1rem;
}

.collection-description p:last-child {
    margin-bottom: 0;
}

/* Meta Items */
.collection-meta-item {
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
}

.collection-meta-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--awd-text-light);
    margin-bottom: 0.25rem;
}

.collection-meta-value {
    display: block;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
}

/* Finishes & Tops Link */
.collection-finishes-link {
    font-size: inherit;
    color: rgba(255, 255, 255, 0.5);
    margin-left: 0.15em;
}

.collection-finishes-link a {
    color: var(--awd-text-light, #ffffff);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.collection-finishes-link a:hover {
    opacity: 0.8;
}

/* Action Buttons */
.collection-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

/* ==========================================================================
   Related Items Section
   ========================================================================== */
.collection-related {
    padding: 4rem 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.collection-related-container {
    max-width: var(--awd-site-max-width);
    margin: 0 auto;
}

.collection-related-title {
    font-size: 0.875rem;
    font-weight: 400;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--awd-text-light);
    text-align: center;
    margin: 0 0 3rem;
}

.collection-related-grid {
    display: grid;
    grid-template-columns: repeat(var(--columns, 3), 1fr);
    gap: 2rem;
}

.collection-related-item {
    background: transparent;
}

.collection-related-link {
    display: block;
    text-decoration: none;
}

.collection-related-image {
    position: relative;
    aspect-ratio: 4/3;
    overflow: hidden;
    margin-bottom: 1rem;
}

.collection-related-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.collection-related-item:hover .collection-related-img {
    transform: scale(1.05);
}

.collection-related-name {
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--awd-text-light);
    margin: 0;
    font-family: var(--font-body);
}

/* ==========================================================================
   Lightbox
   ========================================================================== */
.collection-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.collection-lightbox.is-open {
    opacity: 1;
    visibility: visible;
}

.collection-lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 10;
}

.lightbox-close-icon {
    position: relative;
    display: block;
    width: 30px;
    height: 30px;
    margin: 7px;
}

.lightbox-close-icon::before,
.lightbox-close-icon::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 1px;
    background: var(--awd-text-light);
    transition: background 0.3s ease;
}

.lightbox-close-icon::before {
    transform: rotate(45deg);
}

.lightbox-close-icon::after {
    transform: rotate(-45deg);
}

.collection-lightbox-close:hover .lightbox-close-icon::before,
.collection-lightbox-close:hover .lightbox-close-icon::after {
    background: rgba(255, 255, 255, 0.6);
}

.collection-lightbox-prev,
.collection-lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    cursor: pointer;
    color: var(--awd-text-light);
    transition: background 0.3s ease, border-color 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

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

.collection-lightbox-prev:hover,
.collection-lightbox-next:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.5);
}

.collection-lightbox-content {
    max-width: 90%;
    max-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.collection-lightbox-image {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
}

.collection-lightbox-counter {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.875rem;
    letter-spacing: 0.1em;
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 900px) {
    .collection-single-container {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .collection-gallery {
        position: static;
    }

    .collection-related-grid {
        grid-template-columns: repeat(min(var(--columns, 3), 2), 1fr);
    }
}

@media (max-width: 600px) {
    .collection-breadcrumb {
        padding: 15px 1rem;
    }

    .collection-breadcrumb-item {
        font-size: 0.65rem;
    }

    .collection-breadcrumb-item:not(:last-child)::after {
        width: 16px;
        height: 7px;
        margin: 0 10px;
    }

    .collection-single {
        padding: 2rem 1.5rem;
    }

    .collection-title {
        font-size: 1.2rem;
    }

    .collection-thumbnail {
        width: 70px;
        height: 70px;
    }

    .collection-related {
        padding: 2rem 1.5rem;
    }

    .collection-related-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .collection-lightbox-prev,
    .collection-lightbox-next {
        width: 40px;
        height: 40px;
    }

    .collection-lightbox-prev {
        left: 10px;
    }

    .collection-lightbox-next {
        right: 10px;
    }
}

/* ==========================================================================
   Vertical Scroll Gallery Layout
   Scoped under .collection-gallery-vertical body class.
   Active when the Customizer setting is set to "Vertical Scroll Gallery".
   Uses the same two-column grid as the default layout, but replaces the
   main image + thumbnails with all images stacked vertically.
   ========================================================================== */

/* Stacked images in the gallery column */
.collection-vertical-gallery {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.collection-vertical-image-wrapper {
    width: 100%;
    overflow: hidden;
    line-height: 0;
    position: relative;
    cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='M21 21l-4.35-4.35'/%3E%3Cpath d='M11 8v6'/%3E%3Cpath d='M8 11h6'/%3E%3C/svg%3E") 0 0, zoom-in;
}

.collection-vertical-image {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.3s ease;
}

/* Slight zoom on hover */
.collection-vertical-image-wrapper:hover .collection-vertical-image {
    transform: scale(1.02);
}

/* Smooth scrolling for the vertical gallery column */
.collection-gallery-vertical .collection-single-container {
    scroll-behavior: smooth;
}

/* Details column stays fixed while images scroll past */
.collection-gallery-vertical .collection-details {
    position: sticky;
    top: 2rem;
    padding: 40px 0 0 0;
    align-self: start;
}

@media (max-width: 900px) {
    .collection-gallery-vertical .collection-details {
        position: static;
    }
}

/* ==========================================================================
   Bespoke Services Block Overrides (Collection Posts)
   ========================================================================== */
.bespoke-services-images {
    display: none;
}
