/**
 * Generic Single CPT Styles
 *
 * Shared styles for all custom post type single pages
 * (marbre, carriere, monument, person)
 */

/* Container */
.cpt-single {
    max-width: 1440px;
    margin: 20px auto;
    padding: 20px;
}

/* Three Column Header Grid: Left Info | Image | Right Info */
.header-grid {
    display: flex;
    gap: 20px;
    justify-content: center;
    align-items: stretch;
    margin-bottom: 2rem;
    height: 500px;
}

.header-grid__left,
.header-grid__info {
    flex: 1 1 0;
    min-width: 0;
    overflow-wrap: break-word;
    word-wrap: break-word;
    hyphens: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
    overflow: hidden;
}

.header-grid__image {
    flex: 0 0 450px;
    min-width: 0;
}

.header-grid__title {
    margin-bottom: 1.5rem;
    text-align: center;
}

.header-grid__title h1 {
    margin: 0;
    line-height: 1.3;
}

.person-subtitle {
    margin: 4px 0 0;
    font-size:20px;
    font-weight: normal;
    opacity: 0.75;
}

.header-grid__image .featured-image {
    height: 100%;
}

.header-grid__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.08);
    border-radius: 4px;
}

/* Collapsible sections below header-grid (locations + chronology) */
.header-locations-section,
.header-chronology-section {
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    padding: 0 24px;
    background: #f9f9f9;
    border-radius: 8px;
    border: 1px solid #e5e5e5;
    transition: max-height 0.45s ease, opacity 0.35s ease, padding 0.35s ease, margin-bottom 0.35s ease;
    margin-bottom: 0;
}

.header-locations-section.is-open,
.header-chronology-section.is-open {
    max-height: 4000px;
    opacity: 1;
    padding: 20px 24px;
    margin-bottom: 2rem;
}

.header-section-title {
    margin: 0 0 20px 0;
    font-size: 14px;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    border-bottom: 1px solid #e8e8e8;
    padding-bottom: 12px;
}

/* Horizontal flex layout for location blocks in this section */
.header-locations-section .locations-structured {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 12px;
}

.header-locations-section .location-block {
    flex: 1 1 200px;
}

/* Chronology — Timeline */
.header-grid__info .chronology,
.header-chronology-section .chronology {
    display: flex;
    flex-direction: column;
    gap: 0;
    column-count: unset;
    background: #f7f7f7d6;
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    position: relative;
}

.header-grid__info .chronology::before,
.header-chronology-section .chronology::before {
    content: '';
    position: absolute;
    left: 116px;
    top: 12px;
    bottom: 12px;
    width: 1px;
    background: linear-gradient(to bottom, transparent, #ddd 8%, #ddd 92%, transparent);
    pointer-events: none;
}

.header-grid__info .chronology-item,
.header-chronology-section .chronology-item {
    display: grid;
    grid-template-columns: 110px 1fr;
    gap: 0 24px;
    padding: 7px 10px;
    align-items: start;
    position: relative;
    break-inside: unset;
    border-bottom: none;
}

.header-grid__info .chronology-item::before,
.header-chronology-section .chronology-item::before {
    content: '';
    position: absolute;
    left: 116px;
    top: 11px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ccc;
    border: 2px solid #fff;
    transform: translateX(-50%);
    z-index: 1;
}

.single-marbre   .chronology-item::before { background: var(--cpt-color-marbre); }
.single-carriere .chronology-item::before { background: var(--cpt-color-carriere); }
.single-monument .chronology-item::before { background: var(--cpt-color-monument); }
.single-personne .chronology-item::before { background: var(--cpt-color-personne); }

.header-grid__info .chron-date,
.header-chronology-section .chron-date {
    font-size: 0.82em;
    font-weight: 700;
    color: #888;
    min-width: unset;
    text-align: right;
    padding-right: 22px;
    padding-top: 1px;
    letter-spacing: 0.3px;
}

.header-grid__info .chron-label,
.header-chronology-section .chron-label {
    font-size: 0.9em;
    line-height: 1.5;
    color: #333;
    padding-left: 18px;
}

.header-grid__info .chronology {
    padding: 10px 10px 28px 10px;
}

.header-chronology-section {
    background: #f7f7f7d6;
    border-color: #ebebeb;
}

.header-chronology-section .chronology {
    border: none;
    border-radius: 0;
    padding: 0 0 4px 0;
}

/* Chronology title */
.chronology-title {
    margin: 0 0 4px;
    font-size: 14px;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

.chronology-expand-btn {
    position: absolute;
    bottom: 8px;
    right: 8px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 1.5px solid #333;
    background: white;
    cursor: pointer;
    padding: 0;
    transition: background 0.2s, border-color 0.2s;
}

.chronology-expand-btn::before,
.chronology-expand-btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    background: #666;
    border-radius: 1px;
    transition: transform 0.25s ease;
}

.chronology-expand-btn::before {
    width: 10px;
    height: 1.5px;
    transform: translate(-50%, -50%);
}

.chronology-expand-btn::after {
    width: 1.5px;
    height: 10px;
    transform: translate(-50%, -50%);
}

.chronology-expand-btn:hover,
.chronology-expand-btn:focus {
    border-color: #999;
    background: #f5f5f5;
}

.chronology-expand-btn.is-open::before {
    transform: translate(-50%, -50%) rotate(45deg);
}

.chronology-expand-btn.is-open::after {
    transform: translate(-50%, -50%) rotate(45deg);
}


/* Gallery Section */
.cpt-single .gallery-section {
    margin-bottom: 2rem;
}

/* Main Content Section */
.cpt-single .main-content {
    margin-bottom: 2rem;
}

/* Related Posts Section */
.cpt-single .related-section {
    margin-top: 3rem;
}

/* Responsive: Stack on smaller screens */
@media (max-width: 1199px) {
    .header-grid {
        flex-direction: column;
        align-items: stretch;
        height: auto;
    }

    .header-grid__left,
    .header-grid__info {
        min-width: 0;
        max-width: 100%;
        overflow: visible;
    }

    .header-grid__image {
        flex: 0 0 auto;
        height: 400px;
    }

    .header-grid__image { order: 1; }
    .header-grid__left  { order: 2; }
    .header-grid__info  { order: 3; }


}

@media (max-width: 767px) {
    .header-grid__image {
        height: 300px;
    }
}