/**
 * Magazine-style detail layout – base
 * Shared by event and other detail modules. Table layout, header, image+description, sections, related-media-item.
 */

.main:has(.magazine-detail-style) {
    background-color: #ebe9e0;
}

.inner:has(.magazine-detail-style) {
    margin-top: 0;
}

.magazine-detail-style .breadcrumbs + .horizontal-line {
    margin: 1.5rem 0;
    height: 5px;
}

.magazine-detail-style {
    color: #000000;
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.magazine-detail-style .breadcrumbs li:first-child:before {
    display: none;
}

/* Section 1: Header Section */
.magazine-detail-style .magazine-detail-table-layout,
.magazine-detail-style .magazine-detail-header-section {
    margin-bottom: 3rem;
}

.magazine-detail-style .magazine-detail-header-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.magazine-detail-style .magazine-detail-header-top .btn-b {
    background-color: #2563eb;
    color: #ffffff;
    padding: 0.75rem 1.5rem;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.875rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: background-color 0.2s ease;
}

.magazine-detail-style .magazine-detail-header-top .btn-b:hover {
    background-color: #1d4ed8;
    color: #ffffff;
    text-decoration: none;
}

.magazine-detail-style .magazine-detail-header-top .btn-b::after {
    content: " \2192"; /* → */
}

.magazine-detail-style .magazine-detail-title {
    font-size: 2rem;
    font-weight: 700;
    color: #000000;
    margin: 0 0 1rem 0;
    line-height: 1.2;
}

/* Two-column table-like structure */
.magazine-detail-style .magazine-detail-table-layout {
    display: table;
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.magazine-detail-style .magazine-detail-table-row {
    display: table-row;
}

.magazine-detail-style .magazine-detail-table-cell {
    display: table-cell;
    vertical-align: top;
    padding: 0;
}

.magazine-detail-style .magazine-detail-table-cell + .magazine-detail-table-cell {
    padding-left: 2rem;
}

.magazine-detail-style .magazine-detail-table-layout .magazine-detail-table-cell {
    width: 50%;
}

/* First Row: Image and Description - enforce height on cells */
.magazine-detail-style .magazine-detail-image-cell {
    width: 50%;
    height: 350px !important;
    max-height: 350px !important;
    overflow: hidden;
    position: relative;
}

.magazine-detail-style .magazine-detail-image-cell img {
    width: 100%;
    height: 350px !important;
    max-height: 350px !important;
    object-fit: cover;
    display: block;
}

.magazine-detail-style .magazine-detail-description-cell {
    width: 50%;
    color: #000000;
    font-size: 1rem;
    line-height: 1.6;
    position: relative;
    box-sizing: border-box;
}

.magazine-detail-style .magazine-detail-description-cell .magazine-detail-description-inner {
    height: 100%;
    min-height: 0;
    padding-right: 5px;
    box-sizing: border-box;
}

.magazine-detail-style .magazine-detail-description-cell .magazine-detail-description-inner::-webkit-scrollbar {
    width: 4px;
}

.magazine-detail-style .magazine-detail-description-cell .magazine-detail-description-inner::-webkit-scrollbar-thumb {
    background: #aaa;
}

.magazine-detail-style .magazine-detail-description-cell p {
    margin-bottom: 1rem;
}

/* Image+description block: separate from table so 350px does not affect other rows */
.magazine-detail-style .magazine-detail-image-description-block {
    display: flex;
    width: 100%;
    gap: 2rem;
}

.magazine-detail-style .magazine-detail-image-description-block .magazine-detail-table-cell {
    display: block;
}

.magazine-detail-style .magazine-detail-image-description-block .magazine-detail-table-cell + .magazine-detail-table-cell {
    padding-left: 0;
}

.magazine-detail-style .magazine-detail-image-description-block.magazine-detail-square-image .magazine-detail-image-cell {
    width: 350px;
    flex: 0 0 350px;
}

.magazine-detail-style .magazine-detail-image-description-block.magazine-detail-square-image .magazine-detail-description-cell {
    flex: 1 1 0;
    min-width: 0;
    width: auto;
}

/* Horizontal line for second row cells and below */
.magazine-detail-style .horizontal-line {
    width: 100%;
    height: 3px;
    background-color: #000000;
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.magazine-detail-style .section-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: #000000;
    margin: 0 0 1rem 0;
    text-transform: capitalize;
}

/* 4th Row: Related media and Connect */
.magazine-detail-style .magazine-detail-table-row-related {
    margin-top: 3rem;
}

.magazine-detail-style .related-media-item {
    max-width: 160px;
    overflow: hidden;
}

.magazine-detail-style .related-media-item img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    display: block;
}

/* Tablet breakpoint: keep two-column layout but tighten spacing */
@media (max-width: 1024px) {
    .magazine-detail-style {
        padding: 1rem;
    }

    .magazine-detail-style .magazine-detail-header-top {
        gap: 0.75rem;
    }

    .magazine-detail-style .magazine-detail-title {
        font-size: 1.75rem;
    }

    .magazine-detail-style .magazine-detail-image-cell img {
        height: 300px !important;
        max-height: 300px !important;
    }

    body .wc-l:not(.no-right-column) .magazine-detail-style .magazine-detail-table-row .magazine-detail-table-cell {
        display: block;
        width: 100% !important;
        padding-left: 0 !important;
    }

    body .wc-l:not(.no-right-column) .magazine-detail-style .magazine-detail-related-media-cell .related-media-item {
        max-width: unset;
        width: calc(50% - 2rem);
    }

    .no-right-column .magazine-detail-style .magazine-detail-table-layout .horizontal-line {
        margin-top: 1.5rem;
    }

    body .wc-l:not(.no-right-column) .magazine-detail-style .magazine-detail-image-description-block {
        flex-direction: column;
    }

    body .wc-l:not(.no-right-column) .magazine-detail-style .magazine-detail-image-description-block .magazine-detail-image-cell,
    body .wc-l:not(.no-right-column) .magazine-detail-style .magazine-detail-image-description-block .magazine-detail-description-cell {
        width: 100%;
        flex: none;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .magazine-detail-style {
        padding: 0;
    }
    .magazine-detail-style .magazine-detail-image-cell img {
        width: auto;
        margin: 0 auto;
    }
    .magazine-detail-style .magazine-detail-header-top {
        flex-direction: column;
        gap: 1rem;
    }

    .magazine-detail-style .magazine-detail-table-layout,
    .magazine-detail-style .magazine-detail-header-section {
        margin-bottom: 2rem;
    }

    .magazine-detail-style .magazine-detail-header-top .btn-b {
        align-self: flex-start;
    }

    .magazine-detail-style .magazine-detail-table-cell {
        display: block;
        width: 100% !important;
        padding-left: 0 !important;
    }

    .magazine-detail-style .magazine-detail-title {
        font-size: 1.5rem;
    }

    .magazine-detail-style .magazine-detail-image-description-block {
        display: block;
    }

    .magazine-detail-style .magazine-detail-image-description-block.magazine-detail-square-image .magazine-detail-image-cell,
    .magazine-detail-style .magazine-detail-image-description-block.magazine-detail-square-image .magazine-detail-description-cell {
        width: 100%;
    }
}

#what_near_by_mapbox .mapboxgl-popup-content {
    background: #878480 !important;
    font-size: 11px !important;
    padding: 15px !important;
}

/* Show/Hide Search Button */
.magazine-detail-style .show-search-btn {
    font-size: 1rem;
    margin-bottom: 2rem;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: none;
    color: #000000 !important;
    cursor: pointer;
    background-color: #FFF !important;
    padding: 4px 10px;
}

.magazine-detail-style .show-search-btn:hover {
    outline: 1px solid #000;
}

.magazine-detail-style .show-search-btn .search-icon {
    width: 18px;
    height: 18px;
    stroke: #000;
    stroke-width: 2;
    fill: none;
}