/**
 * Palace Tours Display - Category Page Styles
 * Scoped to: .ptd-category-page
 * Version: 21.1.0
 */

/* ===================================
   CATEGORY PAGE STYLES
   =================================== */
.ptd-category-page {
    max-width: 100%;
    margin: 0 auto;
    padding: 0;
    overflow: visible;
    box-sizing: border-box;
}

/* Category Banner - Video */
.ptd-category-video {
    position: relative;
    width: 100%;
    max-height: 500px;
    overflow: hidden;
    margin-bottom: var(--ptd-space-xl);
    border-radius: 12px;
}

.ptd-category-video .ptd-video {
    width: 100%;
    height: auto;
    max-height: 500px;
    object-fit: cover;
    display: block;
}

/* Video container for YouTube/Vimeo embeds - 16:9 aspect ratio */
.ptd-category-video .ptd-video-container {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    height: 0;
    overflow: hidden;
    max-height: 500px;
}

.ptd-category-video .ptd-video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.ptd-category-video .ptd-category-banner-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: var(--ptd-space-xl);
    background: transparent;
    color: #fff;
    pointer-events: none; /* Allow clicking through to video */
    z-index: 10;
}

.ptd-category-video .ptd-category-banner-overlay h2 {
    pointer-events: auto; /* But title is still selectable */
    text-shadow: 
        0 2px 4px rgba(0,0,0,0.8),
        0 4px 8px rgba(0,0,0,0.6),
        0 0 20px rgba(0,0,0,0.5);
}

/* Category Banner - Image/Carousel */
.ptd-category-banner,
.ptd-category-banner-carousel {
    position: relative;
    left: 50% !important; right: 50% !important; margin-left: -50vw !important; margin-right: -50vw !important;
    width: 100vw !important; max-width: none !important;
    height: 50vh;
    min-height: 400px;
    overflow: hidden;
    margin-bottom: 0;
    border-radius: 0;
    box-sizing: border-box;
}

.ptd-category-banner {
    position: relative;
    left: 50% !important; right: 50% !important; margin-left: -50vw !important; margin-right: -50vw !important;
    width: 100vw !important; max-width: none !important;
    height: 50vh;
    min-height: 400px;
    overflow: hidden;
    margin-bottom: 0;
    border-radius: 0;
    box-sizing: border-box;
}

/* When height is normalized via JS, respect the calculated height */
/* Height normalization is skipped for page-level banners via JS */
/* These rules are kept as fallback safety */
.ptd-category-banner-carousel.ptd-height-normalized {
    height: 50vh !important;
    min-height: 400px;
}

.ptd-category-banner img,
.ptd-category-banner-carousel img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
}

/* When normalized, images still use cover crop at fixed height */
.ptd-category-banner-carousel.ptd-height-normalized img {
    height: 100%;
    object-fit: cover;
    object-position: center center;
}

.ptd-category-banner-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: var(--ptd-space-2xl) clamp(40px, 5vw, 120px) var(--ptd-space-xl);
    background: linear-gradient(to top, rgba(0,0,0,0.6) 0%, rgba(0,0,0,0.2) 60%, transparent 100%);
    color: #fff;
    z-index: 10;
}

.ptd-category-banner-overlay h1,
.ptd-category-banner-overlay h2 {
    font-family: var(--ptd-font-family);
    font-size: var(--ptd-font-size-3xl);
    font-weight: 500;
    margin: 0;
    text-shadow: 
        0 2px 4px rgba(0,0,0,0.8),
        0 4px 8px rgba(0,0,0,0.6),
        0 0 20px rgba(0,0,0,0.5);
}

/* Category Header */
.ptd-category-header {
    text-align: center;
    padding: var(--ptd-space-lg) var(--ptd-space-md) var(--ptd-space-xl);
    max-width: 900px;
    margin: 0 auto;
}

/* Add top spacing only when title is present */
.ptd-category-title {
    font-family: var(--ptd-font-family);
    font-size: var(--ptd-font-size-3xl);
    font-weight: 400;
    color: var(--ptd-primary);
    margin: var(--ptd-space-md) 0 var(--ptd-space-lg);
}

.ptd-category-description {
    font-size: var(--ptd-font-size-sm);
    line-height: var(--ptd-line-height);
    color: var(--ptd-text-body);
    margin-top: var(--ptd-space-lg);
    padding: 0 var(--ptd-space-md);
}

.ptd-category-description p {
    margin: 0 0 var(--ptd-space-md);
}

/* Tours Count */
.ptd-tours-count {
    text-align: center;
    padding: var(--ptd-space-md);
    background: var(--ptd-bg-cream);
    border-radius: 8px;
    margin-bottom: var(--ptd-space-xl);
    font-size: var(--ptd-font-size-base);
    color: var(--ptd-text-muted);
}

.ptd-tours-count strong {
    color: var(--ptd-primary);
    font-size: var(--ptd-font-size-lg);
}

/* Tours Grid - Full Width Responsive */
.ptd-tours-grid {
    display: grid;
    gap: var(--ptd-space-xl);
    margin-bottom: var(--ptd-space-2xl);
    width: 100%;
    padding: 0 var(--ptd-space-md);
    box-sizing: border-box;
}

/* Single tour - full width */
.ptd-tours-grid.ptd-tours-count-1 {
    grid-template-columns: 1fr;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

/* Two tours - 2 columns */
.ptd-tours-grid.ptd-tours-count-2 {
    grid-template-columns: repeat(2, 1fr);
}

/* Three or more tours - 2 columns */
.ptd-tours-grid.ptd-tours-count-many {
    grid-template-columns: repeat(2, 1fr);
}

/* Legacy column classes */
.ptd-tours-grid.ptd-columns-2 {
    grid-template-columns: repeat(2, 1fr);
}
.ptd-tours-grid.ptd-columns-3 {
    grid-template-columns: repeat(3, 1fr);
}
.ptd-tours-grid.ptd-columns-4 {
    grid-template-columns: repeat(2, 1fr);
}

/* Tour Card */
.ptd-tour-card {
    background: var(--ptd-bg-white);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
}

.ptd-tour-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 40px rgba(0,0,0,0.15);
}

.ptd-tour-card-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.ptd-tour-card-image {
    position: relative;
    width: 100%;
    height: 220px;
    overflow: hidden;
    background: var(--ptd-bg-cream);
}

.ptd-tour-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.ptd-tour-card:hover .ptd-tour-card-image img {
    transform: scale(1.05);
}

.ptd-tour-card-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--ptd-bg-cream) 0%, #e8e4df 100%);
    font-size: 60px;
}

.ptd-tour-card-duration {
    position: absolute;
    top: var(--ptd-space-md);
    right: var(--ptd-space-md);
    background: var(--ptd-primary);
    color: #fff;
    padding: var(--ptd-space-sm) var(--ptd-space-md);
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.ptd-tour-card-duration .ptd-days {
    display: block;
    font-size: var(--ptd-font-size-xl);
    font-weight: bold;
    line-height: 1;
}

.ptd-tour-card-duration .ptd-days-label {
    display: block;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.9;
}

.ptd-tour-card-content {
    padding: var(--ptd-space-lg);
}

.ptd-tour-card-title {
    font-family: var(--ptd-font-family);
    font-size: var(--ptd-font-size-lg);
    font-weight: 400;
    color: var(--ptd-primary);
    margin: 0 0 var(--ptd-space-sm);
    line-height: 1.3;
}

.ptd-tour-card-cities {
    font-size: var(--ptd-font-size-sm);
    color: var(--ptd-text-muted);
    margin-bottom: var(--ptd-space-md);
    display: flex;
    align-items: flex-start;
    gap: var(--ptd-space-xs);
}

.ptd-cities-icon {
    flex-shrink: 0;
}

.ptd-tour-card-excerpt {
    font-size: var(--ptd-font-size-sm);
    color: var(--ptd-text-body);
    line-height: 1.5;
    margin: 0 0 var(--ptd-space-md);
}

.ptd-tour-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: var(--ptd-space-md);
    border-top: 1px solid #eee;
}

.ptd-tour-card-nights {
    font-size: var(--ptd-font-size-sm);
    color: var(--ptd-text-muted);
}

.ptd-tour-card-cta {
    font-size: var(--ptd-font-size-sm);
    color: #c9a227;
    font-weight: 600;
    transition: color 0.2s;
}

.ptd-tour-card:hover .ptd-tour-card-cta {
    color: var(--ptd-primary);
}

.ptd-no-tours {
    text-align: center;
    padding: var(--ptd-space-2xl);
    color: var(--ptd-text-muted);
    font-style: italic;
}

/* Category Page Responsive */
@media (max-width: 1024px) {
    .ptd-tours-grid.ptd-tours-count-many {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .ptd-category-banner,
    .ptd-category-banner-carousel {
        height: 30vh;
        min-height: 220px;
        border-radius: 0;
        left: 50% !important; right: 50% !important; margin-left: -50vw !important; margin-right: -50vw !important;
        width: 100vw !important; max-width: none !important;
    }
    
    .ptd-category-banner-overlay h1,
    .ptd-category-banner-overlay h2 {
        font-size: var(--ptd-font-size-2xl);
    }
    
    .ptd-category-title {
        font-size: var(--ptd-font-size-2xl);
    }
    
    .ptd-tours-grid.ptd-tours-count-2,
    .ptd-tours-grid.ptd-tours-count-many {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .ptd-tour-card-image {
        height: 180px;
    }
}

@media (max-width: 540px) {
    .ptd-tours-grid.ptd-tours-count-1,
    .ptd-tours-grid.ptd-tours-count-2,
    .ptd-tours-grid.ptd-tours-count-many {
        grid-template-columns: 1fr;
    }
    
    .ptd-tour-card-image {
        height: 200px;
    }
}

