h1 { margin: 0; }
h2 { margin: 0; }
h3 { margin: 0; }

body {
    background: #f5f5f5;
    font-family: "Lato", sans-serif;
    font-weight: 400;
    color: #1f1f1f;
}

.heritage-object-page {
    max-width: 1440px;
    margin: 0 auto;
    padding: 32px 50px;
}

.heritage-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 468px;
    gap: 30px;
    align-items: start;
}

.heritage-title {
    font-size: 32px;
	
    line-height: 1.2;
    margin-bottom: 25px;
    color: #173451;
    font-weight: 700;
}

.heritage-location {
    display: flex;
    gap: 10px;
    font-size: 18px;
    margin-bottom: -15px;
    align-items: center;
}

.location-icon {
    font-size: 22px;
}

.heritage-sidebar {
        width: 100%;  
        display: flex;
        flex-direction: column;
        gap: 30px;             
    }

.heritage-main-column {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.heritage-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.heritage-description {
    font-size: 15px;
    line-height: 1.5;
}

.info-card {
    background: #FCFBFB;
    border-radius: 10px;
    padding: 10px;

    display: flex;
    flex-direction: column;
    gap: 21px;

    box-shadow:
        0 2px 6px rgba(0,0,0,0.06),
        0 10px 30px rgba(0,0,0,0.04);
}

.info-table {
    width: 100%;
    line-height: 1.2;
    display: flex;
    flex-direction: column;
    gap: 9px;
}

.info-row {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 10px;
    align-items: start;
    justify-content: start;
}

.info-label {
    font-size: 15px;
    font-weight: 500;
    color: #1f1f1f;
}

.info-value {
    font-size: 15px;
    color: #173451;
    text-align: right;
}

.sidebar-buttons {
    display: flex;
    gap: 16px;
    width: 100%;
    min-width: 0;
}

.sidebar-buttons > .heritage-button {
    flex: 0 0 auto;
}

.sidebar-buttons .right-button {
    flex: 0 0 60px;
    width: 60px;
    min-width: 50px;
    max-width: 60px;
}

.persons-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.person-card {
    text-align: center;
}

.person-card-image {
    width: 100px;
    overflow: hidden;
}

.person-card-image img {
    object-fit: contain;
    display: block;
}

.person-card-name {
    margin-top: 10px;
    font-size: 16px;
    line-height: 1.3;
}

.collection-form {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
}

.collection-select {
    min-width: 0;
    max-width: 100%;
    flex: 1 1 auto;
    box-sizing: border-box;

    border: none;
    border-radius: 15px 0 0 15px;
    padding: 5px 10px;
    background: #FCFBFB;
    color: #173451;
    font-family: "Lato", sans-serif;
    font-size: 14px;
    outline: 1px solid #5b8fc4;
}

.collection-select:focus {
    outline: 1px solid #5b8fc4;
}
.collection-form .heritage-button {
    border: none;
    cursor: pointer;
}


.heritage-button {
    flex: 1 1 auto;
    background: #5b8fc4;
    color: white;
    text-align: center;
    padding: 5px 15px;
    border-radius: 15px;

    border: none;
    cursor: pointer;
    font-family: "Lato", sans-serif;

    text-decoration: none;
    font-size: 14px;
    transition: 0.2s;
    white-space: nowrap; 
}

.heritage-button2 {
    flex: 1 1 auto;
    background: white;
    color: #5b8fc4;
    text-align: center;
    padding: 5px 15px;
    border-radius: 15px;
	outline: 2px solid #5b8fc4;
	
    border: none;
    cursor: pointer;
    font-family: "Lato", sans-serif;

    text-decoration: none;
    font-size: 14px;
    transition: 0.2s;
    white-space: nowrap; 
}

.right-button
  {
    border-radius: 0px 15px 15px 0px;
    outline: 1px solid #5b8fc4;    
  }

.heritage-button:hover {
    background: #4579ae;
}

.sidebar-section {
    
}

.sidebar-title 
  {
    font-size: 18px;
    color: #173451;
    font-weight: 500;   
  }

.section-title {
    font-size: 18px;
    color: #173451;
    font-weight: 500;
}

.sidebar-section-title {
    font-size: 18px;
    color: #173451;
    font-weight: 500;    
}

.sidebar-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
}

.sidebar-list {
    display: flex;
    flex-direction: column;
    padding-left: 10px;
    gap: 9px;
}

.sidebar-list-item {
    flex: 0 1 auto; 
    font-size: 15px;
}

.archive-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.image-text-frame {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 5px;
    align-items: center;
}

.frame-image {
    width: 150px;
    height: 150px;
    flex-shrink: 0;
}

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

.frame-text {
    text-align: left;
    font-size: 14px;
    margin: 0;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 20px;
}

.field--name-field-creators,
.field--name-field-related-persons,
.field--name-field-related-events,
.field--name-field-related-objects {
    display: contents;
}

.node--type-person,
.node--type-event,
.node--type-heritage-object {
    background: transparent;
}


.media,
.node {
    margin: 0;
}

img {
    border-radius: 14px;
    display: block;
}

@media (max-width: 1200px) {

    .heritage-layout {
        grid-template-columns: 1fr;
    }

    .heritage-sidebar {
        width: 100%;
		min-width:350px;
    }

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

}

@media (max-width: 768px) {

    .heritage-object-page {
        padding: 20px;
    }

    .heritage-title {
        font-size: 20px;
    }

	.heritage-location {
		font-size: 16px;
	}

    .heritage-description {
        font-size: 14px;
    }

    .archive-grid,
    .related-grid,
    .sidebar-grid {
        grid-template-columns: 1fr;
    }

    .info-row {
        grid-template-columns: 1fr;
    }

    .info-value {
        text-align: left;
    }

    .sidebar-buttons {
        flex-direction: column;
    }

    .collection-form {
        width: 100%;
    }
	
	.heritage-gallery,
    .heritage-main-swiper {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        box-sizing: border-box;
    }

    .heritage-main-swiper {
        height: auto;
        aspect-ratio: 4 / 3;
        overflow: hidden;
    }

    .heritage-main-swiper .swiper-wrapper,
    .heritage-main-swiper .swiper-slide {
        width: 100%;
        max-width: 100%;
        height: 100%;
    }

    .heritage-main-swiper .swiper-slide img {
        display: block;
        width: 100%;
        height: 100%;
        max-width: 100%;
        object-fit: contain;
    }
}


.swiper {
    max-width: 100%;
}

.heritage-gallery {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow: hidden;
}

.heritage-main-swiper {
    width: 100%;
    max-width: 100%;
    height: 450px;
    overflow: hidden;
}


.heritage-main-swiper .swiper-slide {
    width: 100%;
    height: 100%;
}


.heritage-main-swiper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Блок миниатюр */

.heritage-thumb-swiper {
    margin-top: 5px;
    width: 100%;
    height: 90px;
    overflow: hidden;
}


.heritage-thumb-swiper .swiper-slide {
    width: 90px;
    height: 90px;
    cursor: pointer;
}


.heritage-thumb-swiper img {
    max-width: 100%;
	width: 90px;
    height: 90px;
    object-fit: cover;
}


/* Ограничение ширины внутри основной колонки */

.heritage-main-column {
    min-width: 0;
}

.heritage-related-swiper {

    width: 100%;
    padding-bottom: 20px;

}


.heritage-related-swiper .swiper-slide {

    width: 130px;
    flex-shrink: 0; 

}

.related-card {

    display: flex;
    width: 100%;
    flex-direction: column;
    gap: 8px;

    text-decoration: none;
    color: inherit;

}


.related-card img {

    width: 100%;
    object-fit: cover;
    border-radius: 4px;
    aspect-ratio: 1 / 1;

}


.related-label {

    font-size: 13px;
    line-height: 1.35;

    overflow: hidden;

}

/* =========== Debug table style =================== */

.object-debug-section {
margin-top: 40px;
}

.object-debug-table {
width: 100%;
border-collapse: collapse;
font-size: 14px;
}

.object-debug-table th,
.object-debug-table td {
border: 1px solid #ccc;
padding: 8px 10px;
text-align: left;
vertical-align: top;
}

.object-debug-table th {
font-weight: 600;
}

.object-debug-table td:first-child {
width: 30%;
font-weight: 500;
}

.object-debug-table small {
opacity: 0.65;
word-break: break-all;
}

.object-debug-section details summary {
    cursor: pointer;
    list-style: none;
}

.object-debug-section details summary::-webkit-details-marker {
    display: none;
}

.object-debug-section details summary::after {
    content: "＋";
    float: right;
    font-size: 20px;
}

.object-debug-section details[open] summary::after {
    content: "−";
}

.object-debug-content {
    margin-top: 20px;
}

.section-title  ::marker {
    cursor: pointer;
	border: 1px;
	border-radius: 50%;
}

/* ============================================================
   Просмотр фотографий в полном размере
   ============================================================ */

.heritage-main-swiper .swiper-slide img {
    cursor: zoom-in;
}

.image-lightbox {
    position: fixed;
    inset: 0;
    z-index: 10000;

    display: none;
    align-items: center;
    justify-content: center;

    padding: 50px;
    box-sizing: border-box;

    background: rgba(0, 0, 0, 0.92);
}

.image-lightbox.active {
    display: flex;
}

.image-lightbox-image {
    display: block;
    position: absolute;

    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);

    max-width: calc(100vw - 100px);
    max-height: calc(100vh - 100px);

    width: auto;
    height: auto;

    object-fit: contain;
    border-radius: 0;
}

.image-lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;

    width: 44px;
    height: 44px;

    border: none;
    background: transparent;

    color: #fff;
    font-size: 42px;
    line-height: 1;

    cursor: pointer;
    opacity: 0.8;
}

.image-lightbox-close:hover {
    opacity: 1;
}

@media (max-width: 650px) {
    .image-lightbox {
        padding: 15px;
    }

    .image-lightbox-close {
        top: 10px;
        right: 15px;
    }
}