@import url('https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,300;0,400;0,500;0,600;0,700&display=swap');

/* ============================================================ */
/* PROFESSIONAL IMMERSIVE PHOTO LAYOUT (node-fotografija.css)  */
/* ============================================================ */

/* Force global font for this component */
*:not(i):not(.fa):not(.fas):not(.fab):not(.far):not(.fal):not(.fad):not(.glyphicon):not([class*="icon-"]):not(.vvj-flipbox-icon) {
    font-family: 'Montserrat', sans-serif !important;
}

/* Immersion Base */
body.node--type-fotografija {
    margin: 0;
    padding: 0;
    overflow: hidden !important;
    /* Prevent global scroll */
    height: 100vh !important;
}

body.node--type-fotografija .page-container {
    height: 100vh !important;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Hide Unnecessary Regions for Immersive View */
body.node--type-fotografija .banner,
body.node--type-fotografija .content-top,
body.node--type-fotografija .system-messages,
body.node--type-fotografija footer,
body.node--type-fotografija .subfooter,
body.node--type-fotografija .page-start,
body.node--type-fotografija .media-background {
    display: none !important;
}

/* Header Adjustments - Fixed height to allow flex calculation */
body.node--type-fotografija header.header {
    height: 90px !important;
    flex: 0 0 90px;
    background: #fff !important;
    border-bottom: 1px solid #eaeaea;
    z-index: 100;
}

/* Main Content Area */
body.node--type-fotografija .main-content {
    flex: 1;
    height: calc(100vh - 90px);
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden;
}

body.node--type-fotografija .main-content__container,
body.node--type-fotografija .main-content__section,
body.node--type-fotografija .region-content,
body.node--type-fotografija #block-beon-theme-content,
body.node--type-fotografija article.node--type-fotografija,
body.node--type-fotografija .node__container,
body.node--type-fotografija .node__main-content {
    height: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
    max-width: none !important;
}

/* Split Layout Container */
.photo-node-split-layout {
    display: flex !important;
    flex-direction: row !important;
    height: 100% !important;
    width: 100% !important;
}

/* LEFT COLUMN: Main Photo Area */
.photo-column {
    flex: 1 !important;
    height: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    padding: 0;
}

.main-photo-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    overflow: hidden;
    padding: 40px;
}

.main-photo-container img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 2px;
}

/* THUMBNAILS AREA */
.node-thumbnails {
    height: 140px;
    flex: 0 0 140px;
    width: 100%;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    z-index: 10;
    overflow: hidden;
}

/* Force horizontal layout for thumbnails from any Drupal block */
.node-thumbnails .block,
.node-thumbnails .content,
.node-thumbnails .view-content,
.node-thumbnails .beon-box-wrapper {
    display: flex !important;
    flex-direction: row !important;
    gap: 15px !important;
    justify-content: center !important;
    align-items: center !important;
    background: transparent !important;
    /* Remove grey backgrounds from inner blocks */
    padding: 0 !important;
    margin: 0 !important;
    width: auto !important;
}

.node-thumbnails .main-photo-container {
    display: none !important;
    /* Hide the primary image if it was accidentally placed here */
}

.node-thumbnails img {
    height: 90px !important;
    width: 90px !important;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    object-fit: cover;
    opacity: 0.7;
}

.node-thumbnails img:hover {
    opacity: 1;
    transform: translateY(-5px);
    border-color: #789c48;
}

/* RIGHT COLUMN: Info Sidebar */
.info-sidebar {
    width: 440px;
    min-width: 440px;
    height: 100%;
    display: flex;
    flex-direction: column;
    border-left: 1px solid #eee;
}

.sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding: 50px 40px;
}

/* Clean Labels (Replacing Green Headers) */
.info-sidebar h3.js-views-accordion-group-header,
.info-sidebar .block-title,
.info-sidebar .field-label {
    background: none !important;
    border: none !important;
    color: #789c48 !important;
    /* Professional green for labels */
    font-size: 11px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 1.2px !important;
    padding: 0 !important;
    margin: 0 0 10px 0 !important;
    display: block;
}

/* Sidebar Headings (Node Title) */
.info-sidebar .views-field-title,
.info-sidebar h1.page-title {
    font-size: 28px !important;
    font-weight: 700 !important;
    color: #222 !important;
    margin: 0 0 25px 0 !important;
    line-height: 1.2;
}

/* Content Blocks in Sidebar */
.info-sidebar .block {
    margin-bottom: 35px !important;
    padding-bottom: 35px !important;
    border-bottom: 1px solid #f2f2f2;
}

.info-sidebar .block:last-child {
    border-bottom: none;
}

.info-sidebar .views-field,
.info-sidebar .field-content {
    font-size: 15px;
    line-height: 1.6;
    color: #444;
}

/* RELATED SECTION AT BOTTOM */
.related-section {
    padding: 30px 40px;
    background: #fcfcfc;
    border-top: 1px solid #f0f0f0;
}

.related-section .block {
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
}

.related-section h3 {
    color: #333 !important;
    font-size: 13px !important;
    margin-bottom: 15px !important;
}

/* Responsive fixes */
@media (max-width: 1100px) {
    .info-sidebar {
        width: 350px;
        min-width: 350px;
    }
}

/* Hide clutter for non-admin immersive view */
body.node--type-fotografija .tabs,
body.node--type-fotografija .breadcrumb,
body.node--type-fotografija .page-title-container {
    display: none !important;
}

/* If user is logged in, we might want to show tabs slightly differently or keep hidden */
body.node--type-fotografija.user-logged-in .tabs {
    position: absolute;
    top: 100px;
    left: 20px;
    z-index: 1000;
    display: flex !important;
    background: rgba(255, 255, 255, 0.8);
    padding: 5px;
    border-radius: 4px;
}

/* FIXING PHOTO DISPLAY */
.photo-column .main-photo-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100% !important;
    height: 100% !important;
    padding: 0 !important;
    /* Remove padding to allow full scaling */
}

/* Target Drupal's nested structures to force image size */
.photo-column .main-photo-container img,
.photo-column .field--name-field-image img,
.photo-column .view-content img {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
    max-width: 100% !important;
    max-height: 100% !important;
}

/* Fix for grey block/misplaced content */
.node-thumbnails .views-row,
.node-thumbnails .view-content {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    display: flex !important;
    flex-direction: row !important;
    gap: 10px;
}

/* Ensure no standard Bootstrap row/col padding disrupts the split */
.photo-node-split-layout .row,
.photo-node-split-layout .col-md-12 {
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
}

@media (max-width: 992px) {
    body.node--type-fotografija {
        overflow: auto !important;
        height: auto !important;
    }

    body.node--type-fotografija .page-container,
    body.node--type-fotografija .main-content {
        height: auto !important;
        overflow: visible !important;
    }

    .photo-node-split-layout {
        flex-direction: column !important;
    }

    .info-sidebar {
        width: 100% !important;
        min-width: 0 !important;
        height: auto !important;
        border-left: none;
        border-top: 1px solid #ddd;
    }

    .photo-column {
        height: 60vh !important;
    }
}

/* ============================================================ */
/* BEONPHOTO LAYOUT (70/30 Split)                              */
/* ============================================================ */

.layout-beonphoto {
    display: flex !important;
    flex-direction: row !important;
    height: 100% !important;
    width: 100% !important;
}

.layout-beonphoto__left {
    flex: 0 0 70% !important;
    /* 70% Width */
    max-width: 70% !important;
    height: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

.layout-beonphoto__photo {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100% !important;
    height: 100% !important;
    padding: 0 !important;
}

.layout-beonphoto__photo img {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
    max-width: 100% !important;
    max-height: 100% !important;
}

.layout-beonphoto__icons {
    height: 140px;
    flex: 0 0 140px;
    width: 100%;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    z-index: 10;
    overflow: hidden;
}

.layout-beonphoto__right {
    flex: 0 0 30% !important;
    /* 30% Width */
    max-width: 30% !important;
    height: 100%;
    display: flex;
    flex-direction: column;
    border-left: 1px solid #eee;
}

.layout-beonphoto__sidebar {
    flex: 1;
    overflow-y: auto;
    padding: 50px 40px;
}

/* Re-use polished sidebar typography for Beonphoto */
.layout-beonphoto__sidebar h3.js-views-accordion-group-header,
.layout-beonphoto__sidebar .block-title,
.layout-beonphoto__sidebar .field-label {
    background: none !important;
    border: none !important;
    color: #789c48 !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 1.2px !important;
    padding: 0 !important;
    margin: 0 0 10px 0 !important;
    display: block;
}

@media (max-width: 992px) {
    .layout-beonphoto {
        flex-direction: column !important;
    }

    .layout-beonphoto__left,
    .layout-beonphoto__right {
        flex: 0 0 100% !important;
        max-width: 100% !important;
    }

    .layout-beonphoto__left {
        height: 60vh !important;
    }
}