/**
 * Palace Tours Display - Editorial Layout Styles
 * Scoped to: .ptd-category-editorial
 * Version: 21.1.0
 */

/* =========================================
   EDITORIAL LAYOUT STYLES
   ========================================= */

/* Editorial Hero Header - Full Width */
.ptd-editorial-hero {
    position: relative !important;
    left: 50% !important;
    right: 50% !important;
    margin-left: -50vw !important;
    margin-right: -50vw !important;
    width: 100vw !important;
    height: 50vh !important;
    min-height: 350px;
    max-width: none !important;
    background-size: cover !important;
    background-position: center !important;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    text-align: center;
    padding: 0;
    background-attachment: scroll;
    box-sizing: border-box;
    margin-bottom: 0;
    margin-top: 0 !important;
    overflow: hidden;
}

.ptd-category-editorial .ptd-editorial-hero {
    left: 50% !important;
    right: 50% !important;
    margin-left: -50vw !important;
    margin-right: -50vw !important;
    width: 100vw !important;
    max-width: none !important;
    padding: 0;
}

.ptd-editorial-hero h1 {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: clamp(1.5rem, 6vw, 3.5rem) !important;
    font-weight: 600;
    letter-spacing: 1px;
    text-shadow: 2px 2px 15px rgba(0,0,0,0.5);
    margin: 0;
    padding: 20px;
    background: rgba(0, 0, 0, 0.3);
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    line-height: 1.1;
}

/* Editorial Intro Section */
.ptd-editorial-intro {
    max-width: 900px;
    margin: 0 auto 60px;
    background: white;
    padding: 50px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.05);
    position: relative;
    z-index: 10;
    text-align: center;
    line-height: 1.8;
    font-size: 1.1rem;
    color: #555;
    box-sizing: border-box;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.ptd-editorial-intro p {
    margin-bottom: 20px;
}

.ptd-editorial-intro p:last-child {
    margin-bottom: 0;
}

.ptd-editorial-intro strong {
    color: var(--ptd-primary);
    font-weight: 600;
}

/* Editorial Tour Grid */
.ptd-editorial-grid {
    display: grid;
    gap: 30px;
    padding: 0 40px 80px;
    max-width: 100%;
    margin: 0 auto;
    justify-items: center;
    overflow: hidden;
    box-sizing: border-box;
    width: 100%;
}

/* Default 3-column layout */
.ptd-editorial-grid[data-columns="3"],
.ptd-editorial-grid:not([data-columns]) {
    grid-template-columns: repeat(3, 1fr);
}

/* 2-column layout */
.ptd-editorial-grid[data-columns="2"] {
    grid-template-columns: repeat(2, 1fr);
}

/* 4-column layout */
.ptd-editorial-grid[data-columns="4"] {
    grid-template-columns: repeat(4, 1fr);
}

/* Ensure cards fill their grid cell */
.ptd-editorial-grid > .ptd-editorial-card {
    width: 100%;
}

/* Center orphan cards in last row using flexbox wrapper approach */
/* 3-column with 1 orphan - center it */
.ptd-editorial-grid[data-columns="3"] .ptd-card-expand-1 {
    grid-column: 2 / 3;
}

/* 3-column with 2 orphans - center them */
.ptd-editorial-grid[data-columns="3"] .ptd-card-expand-2:first-of-type {
    grid-column: 1 / 2;
}

/* 2-column with 1 orphan - center it */
.ptd-editorial-grid[data-columns="2"] .ptd-card-expand-1 {
    grid-column: 1 / -1;
    max-width: 50%;
    justify-self: center;
}

/* 4-column with 1 orphan - center */
.ptd-editorial-grid[data-columns="4"] .ptd-card-expand-1 {
    grid-column: 2 / 4;
    max-width: 50%;
    justify-self: center;
}

/* 4-column with 2 orphans - center them */
.ptd-editorial-grid[data-columns="4"] .ptd-card-expand-2 {
    justify-self: center;
}

/* 4-column with 3 orphans - center them */
.ptd-editorial-grid[data-columns="4"] .ptd-card-expand-3 {
    justify-self: center;
}

/* Editorial Tour Card */
.ptd-editorial-card {
    position: relative;
    overflow: hidden;
    background: #fff;
    transition: transform 0.4s ease, box-shadow 0.4s ease;
    border: 1px solid #e8e4da;
    border-bottom: 3px solid transparent;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    cursor: pointer;
    min-width: 0;
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
}

/* Full-card clickable link */
.ptd-editorial-card-link {
    display: block;
    text-decoration: none;
    color: inherit;
    overflow: hidden;
    width: 100%;
}

.ptd-editorial-card-link:hover {
    text-decoration: none;
    color: inherit;
}

.ptd-editorial-card:hover {
    transform: translateY(-10px);
    border-bottom-color: var(--ptd-gold);
    border-color: #ddd;
    box-shadow: 0 15px 40px rgba(0,0,0,0.15);
}

/* Editorial Image Wrapper */
.ptd-editorial-image-wrapper {
    position: relative;
    width: 100%;
    min-height: 300px;
    height: 300px;
    overflow: hidden;
    background: var(--ptd-bg-cream);
    line-height: 0;
}

.ptd-editorial-image-wrapper img {
    width: 100%;
    min-height: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
    display: block;
    transition: transform 0.8s ease;
    vertical-align: middle;
}

.ptd-editorial-card:hover .ptd-editorial-image-wrapper img {
    transform: scale(1.1);
}

.ptd-editorial-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
    background: linear-gradient(135deg, var(--ptd-bg-cream) 0%, #e8e4da 100%);
}

/* Editorial Badges */
.ptd-editorial-days-badge {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(26, 37, 48, 0.85);
    color: white;
    padding: 8px 15px;
    font-size: 0.75rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    font-weight: 500;
    z-index: 2;
}

.ptd-editorial-offer-badge {
    position: absolute;
    bottom: 0;
    left: 0;
    background: var(--ptd-primary);
    color: white;
    padding: 10px 20px;
    font-size: 0.9rem;
    font-weight: 600;
    z-index: 2;
}

/* Editorial Card Details */
.ptd-editorial-card-details {
    padding: 25px;
    text-align: left;
    background: #fff;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.ptd-editorial-card-details h3 {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.4rem;
    margin: 10px 0 15px;
    color: var(--ptd-primary);
    font-weight: 500;
    line-height: 1.3;
    white-space: normal !important;
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ptd-editorial-location-meta {
    font-size: 0.85rem;
    color: #888;
    margin-bottom: 5px;
    display: block;
    line-height: 1.5;
    font-weight: 500;
    white-space: normal !important;
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
}

.ptd-editorial-location-meta span {
    margin-right: 5px;
}

.ptd-editorial-card-details p {
    font-size: 0.95rem;
    line-height: 1.6;
    color: #666;
    margin: 0 0 20px;
    flex-grow: 1;
    white-space: normal !important;
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
}

/* Editorial CTA Button */
.ptd-editorial-cta {
    display: inline-block;
    margin-top: auto;
    padding: 12px 30px;
    border: 2px solid var(--ptd-gold);
    color: var(--ptd-gold);
    text-decoration: none;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 2px;
    transition: all 0.3s ease;
    font-weight: 600;
    text-align: center;
}

.ptd-editorial-cta:hover {
    background: var(--ptd-gold);
    color: white;
    border-color: var(--ptd-gold);
    transform: translateX(5px);
}

/* Responsive Editorial Layout */

/* Tablet landscape - 3/4 col grids become 2 columns */
@media (max-width: 1024px) {
    .ptd-editorial-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        padding: 0 30px 60px;
        gap: 25px;
    }
    
    /* Reset orphan expansion on tablet */
    .ptd-editorial-grid .ptd-card-expand-1,
    .ptd-editorial-grid .ptd-card-expand-2,
    .ptd-editorial-grid .ptd-card-expand-3 {
        grid-column: span 1 !important;
    }
    
    .ptd-editorial-image-wrapper {
        min-height: 250px;
        height: 250px;
    }
}

/* Mobile - all editorial grids become single column */
@media (max-width: 768px) {
    .ptd-editorial-hero {
        height: 40vh;
        min-height: 300px;
        margin-bottom: 0;
    }
    
    .ptd-editorial-hero h1 {
        font-size: 2.2rem;
        padding: 0 20px;
    }
    
    .ptd-editorial-intro {
        padding: 30px 20px;
        margin-bottom: 40px;
        font-size: 1rem;
    }
    
    /* All editorial grids become single column on mobile */
    .ptd-editorial-grid {
        grid-template-columns: 1fr !important;
        padding: 15px;
        gap: 20px;
    }
    
    /* Remove expansion classes on mobile */
    .ptd-editorial-grid .ptd-card-expand-1,
    .ptd-editorial-grid .ptd-card-expand-2,
    .ptd-editorial-grid .ptd-card-expand-3 {
        grid-column: span 1 !important;
    }
    
    .ptd-editorial-image-wrapper {
        min-height: 200px;
        height: 220px;
    }
    
    .ptd-editorial-card-details {
        padding: 15px;
        min-height: auto;
    }
    
    .ptd-editorial-card-details h3 {
        font-size: 1.1rem;
        margin: 5px 0 10px;
    }
    
    /* Hide excerpt text on mobile - show only cities and tour name */
    .ptd-editorial-card-details p {
        display: none !important;
    }
    
    /* Hide CTA button on mobile - entire card is clickable */
    .ptd-editorial-cta {
        display: none !important;
    }
    
    .ptd-editorial-location-meta {
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .ptd-editorial-days-badge {
        font-size: 0.65rem;
        padding: 6px 12px;
    }
    
    .ptd-editorial-offer-badge {
        font-size: 0.8rem;
        padding: 8px 15px;
    }
    
    .ptd-editorial-image-wrapper {
        min-height: 180px;
        height: 200px;
    }
    
    .ptd-editorial-card-details {
        padding: 15px;
        min-height: auto;
    }
    
    .ptd-editorial-cta {
        padding: 10px 20px;
        font-size: 0.7rem;
    }
}

/* =========================================
   DESTINATIONS PAGE STYLES
   ========================================= */

.ptd-destinations-page {
    font-family: 'Montserrat', sans-serif;
    color: var(--ptd-primary);
    background: #fff;
}

/* Destinations Hero Section */
.ptd-dest-hero {
    padding: 80px 20px 40px;
    text-align: center;
    max-width: 900px;
    margin: 0 auto;
}

.ptd-dest-hero h1 {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 3.5rem;
    margin-bottom: 20px;
    color: var(--ptd-primary);
    font-weight: 400;
}

.ptd-dest-hero p {
    font-size: 1.2rem;
    line-height: 1.8;
    color: #4A4A4A;
    font-weight: 300;
}

.ptd-dest-divider {
    width: 80px;
    height: 3px;
    background: var(--ptd-gold);
    margin: 30px auto;
}

/* Destinations Grid */
.ptd-dest-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 40px;
    padding: 40px;
    max-width: 1400px;
    margin: 0 auto;
}

/* Destination Card */
.ptd-dest-card {
    position: relative;
    height: 500px;
    overflow: hidden;
    cursor: pointer;
    background: #000;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    transition: box-shadow 0.4s ease;
}

.ptd-dest-card:hover {
    box-shadow: 0 20px 50px rgba(0,0,0,0.2);
}

.ptd-dest-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.8;
    transition: all 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.ptd-dest-card:hover img {
    transform: scale(1.1);
    opacity: 0.6;
}

.ptd-dest-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 6rem;
    background: linear-gradient(135deg, #2a2a4e 0%, var(--ptd-primary) 100%);
    opacity: 0.8;
}

/* Card Content Overlay */
.ptd-dest-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 40px;
    box-sizing: border-box;
    background: linear-gradient(transparent, rgba(0,0,0,0.8));
    color: white;
    transition: all 0.4s ease;
}

.ptd-dest-card:hover .ptd-dest-overlay {
    background: rgba(122, 15, 20, 0.9);
}

.ptd-dest-overlay h2 {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 2.2rem;
    margin: 0 0 10px;
    font-weight: 400;
}

.ptd-dest-count {
    text-transform: uppercase;
    letter-spacing: 2px;
    font-size: 0.8rem;
    color: var(--ptd-gold);
    display: block;
    margin-bottom: 15px;
    font-weight: 500;
}

/* Tour List - Hidden by default, expands on hover */
.ptd-dest-list {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.6s ease;
    list-style: none;
    padding: 0;
    margin: 0;
}

.ptd-dest-card:hover .ptd-dest-list {
    max-height: 250px;
    margin-top: 15px;
}

.ptd-dest-list li {
    font-size: 0.9rem;
    margin-bottom: 8px;
    opacity: 0.9;
    font-weight: 300;
    border-bottom: 1px solid rgba(255,255,255,0.15);
    padding-bottom: 5px;
    line-height: 1.4;
}

.ptd-dest-list li a {
    color: #fff;
    text-decoration: none;
    transition: color 0.3s ease, padding-left 0.3s ease;
    display: block;
}

.ptd-dest-list li a:hover {
    color: var(--ptd-gold);
    padding-left: 5px;
}

.ptd-dest-list li:last-child {
    border-bottom: none;
}

/* Destination CTA */
.ptd-dest-cta {
    display: inline-block;
    margin-top: 20px;
    padding: 10px 20px;
    border: 1px solid var(--ptd-gold);
    color: #fff;
    font-size: 0.75rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    font-weight: 500;
    transition: all 0.3s ease;
}

.ptd-dest-card:hover .ptd-dest-cta {
    background: var(--ptd-gold);
    border-color: var(--ptd-gold);
}

/* Responsive Destinations */
@media (max-width: 768px) {
    .ptd-dest-hero h1 {
        font-size: 2.5rem;
    }
    
    .ptd-dest-grid {
        padding: 20px;
        gap: 20px;
        grid-template-columns: 1fr;
    }
    
    .ptd-dest-card {
        height: 400px;
    }
    
    .ptd-dest-overlay {
        padding: 30px;
    }
    
    .ptd-dest-overlay h2 {
        font-size: 1.8rem;
    }
}
