/* Artifact Version: 92 */
/*
Theme Name: Free Sparks of Light
Theme URI: https://freesparksoflight.com
Author: FSL & Ćato
Author URI: https://freesparksoflight.com
Description: Custom theme for Free Sparks of Light travel blog with unique three-column layout
Version: 4.0
Requires at least: 6.0
Tested up to: 6.8
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: freesparksoflight
*/

/* ====================================
   RESET & BASE STYLES
==================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: #333;
    background: rgb(232, 251, 255); /* Fixed background */
    overflow-x: auto;
    overflow-y: hidden;
    min-width: 1400px;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    text-decoration: none;
    color: inherit;
}

/* ====================================
   HEADER - Removed (no header in new design)
==================================== */
.site-header {
    display: none;
}

/* ====================================
   MAIN LAYOUT - NEW DESIGN
==================================== */
.page-wrapper {
    width: 1400px;
    height: 100vh;
    background: rgb(232, 251, 255); /* Fixed background */
    margin: 0 auto;
    padding: 0;
    min-width: 1400px;
    max-width: 1400px;
}

.content-window {
    width: 1300px;
    height: 100%;
    background: rgb(200, 239, 249); /* Content window */
    margin: 0 auto;
    display: flex;
    overflow: hidden;
    min-width: 1300px;
    max-width: 1300px;
    padding: 0 10px;
}

/* ====================================
   LEFT SIDE - First Main Column (30%)
==================================== */
.first-main-column {
    width: 30%;
    min-width: 300px;
    display: flex;
    flex-direction: column;
    background: transparent; /* Transparent */
    flex-shrink: 0;
    margin-right: 10px;
}

/* Logo Section (55px) - Single JPG image, aligned with category name */
.logo-section {
    height: 55px;
    background: rgb(217, 217, 217);
    flex-shrink: 0;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 5px;
}

.logo-link {
    display: block;
    width: 100%;
    height: 100%;
}

.logo-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

/* Slider Section (250px) - aligned with map */
.slider-section {
    height: 250px;
    background: rgb(217, 217, 217);
    flex-shrink: 0;
    overflow: hidden;
    margin-left: 10px;
}

/* Make MetaSlider fill the entire space */
.slider-section .metaslider,
.slider-section .flexslider,
.slider-section ul.slides,
.slider-section ul.slides li {
    height: 250px !important;
    margin: 0 !important;
    padding: 0 !important;
}

.slider-section img {
    width: 100% !important;
    height: 250px !important;
    object-fit: cover !important;
}

/* Categories List */
.categories-container {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.categories-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 15px;
    text-transform: uppercase;
    padding: 15px 20px 0;
    background: transparent;
    flex-shrink: 0;
}

.category-list-wrapper {
    flex: 1;
    overflow-y: auto;
    padding: 0 20px 20px;
}

.category-list {
    list-style: none;
}

.category-item {
    margin-bottom: 8px;
}

.category-link {
    display: block;
    padding: 10px 12px;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 3px;
    font-size: 14px;
    transition: all 0.2s;
    cursor: pointer;
    box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.15);
}

.category-link:hover {
    background: #f0f0f0;
    border-color: #999;
}

.category-link.active {
    background: #fff;
    color: #333;
    border: 3px solid #4a90e2;
    font-weight: 600;
    box-shadow: none;
}

.category-name {
    display: block;
    font-size: 14px;
    font-weight: 600;
}

.category-description {
    display: block;
    font-size: 11px;
    font-style: italic;
    font-weight: normal;
    color: #666;
    margin-top: 4px;
    line-height: 1.3;
}

/* ====================================
   RIGHT SIDE - Second Main Column (70%)
==================================== */
.second-main-column {
    width: calc(70% - 10px);
    background: rgb(222, 235, 247); /* Second main column */
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

/* Category Name + Map Section (360px combined) - SPANS FULL WIDTH */
.category-map-section {
    height: 360px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    width: 100%;
    background: rgb(200, 239, 249);
}

.category-name-bar {
    height: 55px;
    background: rgb(242, 242, 242); /* Category name background */
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 700;
    flex-shrink: 0;
    margin-bottom: 5px;
}

.category-bar-name {
    font-size: 18px;
    font-weight: 700;
}

.category-bar-description {
    font-size: 13px;
    font-weight: normal;
    font-style: italic;
    margin-left: 10px;
    color: #666;
}

.map-container {
    height: 300px;
    background: rgb(217, 217, 217); /* Map placeholder */
    overflow: visible;
    position: relative;
    flex-shrink: 0;
}

.map-container iframe,
.map-container .map-embed,
.map-container > div {
    width: 100% !important;
    height: 100% !important;
    border: none !important;
}

.map-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #666;
    font-size: 16px;
}

/* Container for Posts, Content, and Gallery (below map) */
.content-columns-wrapper {
    flex: 1;
    display: flex;
    flex-direction: row;
    overflow: hidden;
    padding-top: 5px;
    background: rgb(200, 239, 249);
}

/* ====================================
   Sub Column 1 - Posts List (25% of second column)
==================================== */
.posts-subcolumn {
    width: 25%;
    background: rgb(242, 242, 242); /* 1st subcolumn */
    display: flex;
    flex-direction: column;
    border-right: 1px solid rgb(200, 239, 249);
    flex-shrink: 0;
}

.posts-column-title {
    padding: 12px;
    background: rgb(242, 242, 242);
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    flex-shrink: 0;
}

.posts-list-container {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
}

.post-item {
    margin-bottom: 15px;
    cursor: pointer;
    transition: opacity 0.2s;
    background: #fff;
    border-radius: 3px;
    overflow: hidden;
    box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.15);
}

.post-item:hover {
    opacity: 0.8;
}

.post-item.active {
    box-shadow: 0 0 0 3px #4a90e2;
}

.post-thumbnail {
    width: 100%;
    height: 100px;
    object-fit: cover;
    background: #ddd;
}

.post-item-info {
    padding: 8px;
    font-size: 11px;
    line-height: 1.4;
    white-space: normal;
}

.post-item-date {
    font-weight: 600;
    display: inline;
}

.post-item-title {
    display: inline;
    font-weight: normal;
    word-wrap: break-word;
}

/* ====================================
   Sub Column 2 - Content (50% of second column)
==================================== */
.content-subcolumn {
    width: 56.25%;
    background: rgb(249, 251, 255); /* 2nd subcolumn */
    display: flex;
    flex-direction: column;
    overflow: hidden;
    flex-shrink: 0;
}

/* Post header - stays on top */
.post-header {
    padding: 25px 25px 15px;
    background: rgb(249, 251, 255);
    border-bottom: 1px solid #ddd;
    flex-shrink: 0;
}

.post-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 8px;
    line-height: 1.2;
}

.post-date {
    font-size: 11px;
    color: #888;
}

/* Post Content Area - scrollable */
.post-content-area {
    flex: 1;
    overflow-y: auto;
    padding: 25px;
}

.post-content {
    font-size: 13px;
    line-height: 1.6;
    font-family: sans-serif;
}

.post-content p {
    margin-bottom: 15px;
}

.post-content h2 {
    font-size: 16px;
    margin: 20px 0 10px;
}

.post-content h3 {
    font-size: 14px;
    margin: 18px 0 8px;
}

.post-content ul,
.post-content ol {
    margin-bottom: 15px;
    padding-left: 25px;
}

.post-content li {
    margin-bottom: 6px;
}

/* ====================================
   Sub Column 3 - Photo Gallery (25% of second column)
==================================== */
.gallery-subcolumn {
    width: 18.75%;
    background: rgb(249, 251, 255); /* 3rd subcolumn */
    display: flex;
    flex-direction: column;
    border-left: 1px solid #ccc;
    flex-shrink: 0;
}

.gallery-title {
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    padding: 15px;
    background: rgb(249, 251, 255);
    flex-shrink: 0;
}

.gallery-items {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
}

.gallery-item {
    margin-bottom: 12px;
    cursor: pointer;
    transition: opacity 0.2s;
    border-radius: 3px;
    overflow: hidden;
    box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.15);
}

.gallery-item:hover {
    opacity: 0.85;
}

.gallery-item img {
    width: 100%;
    height: auto;
}

/* ====================================
   LIGHTBOX for Gallery
==================================== */
.lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
}

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

.lightbox-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
}

.lightbox-image {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
}

.lightbox-close {
    position: absolute;
    top: -40px;
    right: 0;
    width: 40px;
    height: 40px;
    background: #fff;
    border: none;
    border-radius: 3px;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 3px;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-prev {
    left: -60px;
}

.lightbox-next {
    right: -60px;
}

/* Empty State */
.empty-state {
    padding: 40px 20px;
    text-align: center;
    color: #999;
}

.empty-state h2 {
    font-size: 20px;
    margin-bottom: 10px;
}

.empty-state p {
    font-size: 14px;
}

/* Mobile Menu Toggle (hidden on desktop) */
.mobile-menu-toggle {
    display: none;
}

/* Mobile Layout - Hidden on Desktop */
.mobile-layout {
    display: none;
}

/* ====================================
   SCROLLBAR STYLING
==================================== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* ====================================
   MOBILE/TABLET STYLES (< 1024px)
==================================== */
@media (max-width: 1023px) {
    /* Reset body */
    body {
        min-width: 100%;
        overflow-x: hidden;
        overflow-y: auto;
    }
    
    /* Hide Desktop Layout */
    .first-main-column,
    .second-main-column {
        display: none !important;
    }
    
    /* Show Mobile Layout */
    .mobile-layout {
        display: flex;
        flex-direction: column;
        width: 100%;
        min-height: 100vh;
        background: rgb(200, 239, 249);
    }
    
    .page-wrapper {
        width: 100%;
        min-width: 100%;
        max-width: 100%;
        height: auto;
        padding: 0;
    }
    
    .content-window {
        width: 100%;
        min-width: 100%;
        max-width: 100%;
        flex-direction: column;
        overflow: visible;
    }
    
    /* ====================================
       MOBILE LAYOUT ROWS
    ==================================== */
    
    /* Fixed header container for first two rows */
    .mobile-fixed-header {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        z-index: 100;
        background: #fff;
    }
    
    /* Row 1: Logo (auto height) - scrolls */
    .mobile-logo-row {
        width: calc(100% - 20px);
        height: auto;
        min-height: 50px;
        max-height: 120px;
        background: #fff;
        display: flex;
        align-items: center;
        justify-content: center;
        margin: 0 10px;
        padding: 0;
    }
    
    .mobile-logo-link {
        display: block;
        width: 100%;
        height: 100%;
        line-height: 0;
    }
    
    .mobile-logo-link img {
        width: 100%;
        height: auto;
        max-height: 120px;
        object-fit: contain;
        display: block;
        vertical-align: top;
    }
    
    /* Row 2: Category Button (75px+) - fixed on scroll */
    .mobile-category-row {
        width: calc(100% - 20px);
        min-height: 75px;
        background: rgb(218, 227, 243);
        display: flex;
        align-items: center;
        padding: 10px 15px;
        border: 1px solid #666;
        cursor: pointer;
        margin: 5px 10px;
    }
    
    .mobile-category-hamburger {
        width: 30px;
        height: 20px;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        margin-right: 15px;
        flex-shrink: 0;
    }
    
    .mobile-category-hamburger span {
        display: block;
        width: 100%;
        height: 3px;
        background: #333;
        border-radius: 2px;
    }
    
    .mobile-category-content {
        flex: 1;
    }
    
    .mobile-category-name {
        font-size: 18px;
        font-weight: 700;
        color: rgb(0, 112, 192);
        line-height: 1.3;
        word-wrap: break-word;
    }
    
    .mobile-category-description {
        font-size: 16px;
        font-style: italic;
        color: rgb(0, 112, 192);
        line-height: 1.3;
        margin-top: 3px;
        word-wrap: break-word;
    }
    
    /* Row 3: Post Button (75px+) - fixed on scroll */
    .mobile-post-row {
        width: calc(100% - 20px);
        min-height: 75px;
        background: rgb(242, 242, 242);
        display: flex;
        align-items: center;
        padding: 10px 15px;
        border: 1px solid #666;
        cursor: pointer;
        margin: 5px 10px;
    }
    
    .mobile-post-hamburger {
        width: 30px;
        height: 20px;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        margin-right: 15px;
        flex-shrink: 0;
    }
    
    .mobile-post-hamburger span {
        display: block;
        width: 100%;
        height: 3px;
        background: #333;
        border-radius: 2px;
    }
    
    .mobile-post-content-header {
        flex: 1;
    }
    
    .mobile-post-date-header {
        font-size: 16px;
        color: #000;
        line-height: 1.3;
    }
    
    .mobile-post-title-header {
        font-size: 18px;
        font-weight: 700;
        color: #000;
        line-height: 1.3;
        margin-top: 3px;
        word-wrap: break-word;
    }
    
    /* Fixed header container for rows 2 and 3 */
    .mobile-fixed-rows {
        position: sticky;
        top: 0;
        left: 0;
        width: 100%;
        z-index: 100;
        background: rgb(200, 239, 249);
    }
    
    /* Spacer no longer needed */
    .mobile-header-spacer {
        display: none;
    }
    
    /* Content Area */
    .mobile-content-area {
        width: calc(100% - 20px);
        margin: 0 10px;
        position: relative;
        padding: 20px;
        background: #fff;
    }
    
    /* Featured Photo - left aligned, 50% max width */
    .mobile-featured-photo-container {
        max-width: 50%;
        margin-bottom: 20px;
        box-shadow: 3px 3px 6px rgba(0, 0, 0, 0.2);
    }
    
    .mobile-featured-photo-container img {
        width: 100%;
        height: auto;
        display: block;
    }
    
    /* MAP Button - floating top right */
    .mobile-map-button {
        position: fixed;
        /* top and right positions set dynamically by JavaScript */
        width: 15%;
        aspect-ratio: 1;
        z-index: 50;
        cursor: pointer;
        border-radius: 50%;
        overflow: hidden;
        box-shadow: 3px 3px 6px rgba(0, 0, 0, 0.2);
        transition: transform 0.2s;
        background: transparent;
        border: none;
        padding: 0;
    }
    
    .mobile-map-button:active {
        transform: scale(0.95);
    }
    
    .mobile-map-button img {
        display: block;
        width: 100%;
        height: 100%;
        object-fit: contain;
    }
    
    /* Post Text Content */
    .mobile-post-content {
        width: 100%;
        padding: 0;
        background: #fff;
    }
    
    .mobile-post-text {
        font-size: 16px;
        line-height: 1.6;
        color: #333;
        margin-bottom: 20px;
    }
    
    .mobile-post-text p {
        margin-bottom: 15px;
    }
    
    .mobile-post-nav {
        margin-top: 30px;
        display: flex;
        gap: 10px;
        justify-content: space-between;
    }
    
    .mobile-post-nav:has(.mobile-nav-btn:only-child) {
        justify-content: flex-start;
    }
    
    .mobile-nav-btn {
        flex: 1;
        max-width: 48%;
        height: 50px;
        background: #4a90e2;
        color: #fff;
        border: none;
        border-radius: 5px;
        font-size: 16px;
        font-weight: 600;
        cursor: pointer;
        transition: background 0.2s;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
    }
    
    .mobile-nav-btn.prev::before {
        content: '←';
        font-size: 20px;
    }
    
    .mobile-nav-btn.next::after {
        content: '→';
        font-size: 20px;
    }
    
    .mobile-nav-btn:only-child {
        max-width: 100%;
    }
    
    .mobile-nav-btn:active {
        background: #357abd;
    }
    
    .mobile-nav-btn.prev {
        background: #6c757d;
    }
    
    .mobile-nav-btn.prev:active {
        background: #545b62;
    }
    
    /* Photos Section - 70% width */
    .mobile-photos {
        width: 100%;
        padding: 20px 0;
        background: #fff;
        display: flex;
        flex-direction: column;
        align-items: center;
    }
    
    .mobile-photos .mobile-post-nav {
        width: 100%;
        padding: 0 20px;
        box-sizing: border-box;
    }
    
    .mobile-photo-item {
        width: 70%;
        margin: 0 auto 15px auto;
        border-radius: 5px;
        overflow: hidden;
        cursor: pointer;
        box-shadow: 3px 3px 6px rgba(0, 0, 0, 0.2);
    }
    
    .mobile-photo-item img {
        width: 100%;
        height: auto;
        display: block;
    }
    
    /* ====================================
       MOBILE DROPDOWNS
    ==================================== */
    
    /* Overlay */
    .mobile-dropdown-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.7);
        z-index: 998;
        display: none;
    }
    
    .mobile-dropdown-overlay.active {
        display: block;
    }
    
    /* Dropdown Container */
    .mobile-dropdown {
        position: fixed;
        top: calc(170px + 75px); /* Below row 2 */
        left: 0;
        width: 70%;
        height: calc(100% - 170px - 75px);
        background: #fff;
        box-shadow: 2px 0 20px rgba(0, 0, 0, 0.3);
        z-index: 999;
        display: none;
        overflow: hidden;
        flex-direction: column;
    }
    
    /* Categories dropdown - with title */
    .mobile-dropdown-categories {
        top: calc(170px + 75px);
        height: calc(100% - 170px - 75px);
    }
    
    .mobile-dropdown-title {
        padding: 15px;
        background: rgb(218, 227, 243);
        font-size: 16px;
        font-weight: 700;
        color: rgb(0, 112, 192);
        border-bottom: 2px solid #ddd;
        text-align: center;
    }
    
    /* Posts/Dnevnik dropdown - below row 3, no title */
    .mobile-dropdown-dnevnik {
        top: calc(170px + 75px + 75px); /* Below row 3 */
        width: 70%;
        height: calc(100% - 170px - 75px - 75px);
    }
    
    .mobile-dropdown.active {
        display: flex;
    }
    
    .mobile-dropdown-list {
        list-style: none;
        flex: 1;
        overflow-y: auto;
        padding: 10px;
    }
    
    .mobile-dropdown-item {
        padding: 15px;
        border-bottom: 1px solid #e8e8e8;
        cursor: pointer;
        transition: background 0.2s;
        font-size: 15px;
    }
    
    .mobile-dropdown-item:last-child {
        border-bottom: none;
    }
    
    .mobile-dropdown-item:active {
        background: #f0f0f0;
    }
    
    /* Category dropdown items with description */
    .mobile-category-dropdown-item {
        display: flex;
        flex-direction: column;
        gap: 5px;
    }
    
    .mobile-category-item-name {
        font-size: 16px;
        font-weight: 600;
    }
    
    .mobile-category-item-description {
        font-size: 12px;
        font-style: italic;
        color: #666;
        line-height: 1.3;
    }
    
    /* Dnevnik dropdown with thumbnails */
    .mobile-post-dropdown-item {
        display: flex;
        align-items: center;
        gap: 12px;
    }
    
    .mobile-post-thumb {
        width: 60px;
        height: 60px;
        object-fit: cover;
        border-radius: 4px;
        flex-shrink: 0;
    }
    
    .mobile-post-info {
        flex: 1;
    }
    
    .mobile-post-info-date {
        font-size: 15px;
        color: #888;
        margin-bottom: 4px;
    }
    
    .mobile-post-info-title {
        font-size: 19px;
        font-weight: 600;
        line-height: 1.3;
    }
    
    /* ====================================
       MOBILE MAP OVERLAY
    ==================================== */
    .mobile-map-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: #fff;
        z-index: 1000;
        display: none;
        flex-direction: column;
    }
    
    .mobile-map-overlay.active {
        display: flex;
    }
    
    .mobile-map-content {
        width: 100%;
        height: 100%;
        display: flex;
        flex-direction: column;
    }
    
    .mobile-map-close {
        position: absolute;
        top: 15px;
        right: 15px;
        width: 40px;
        height: 40px;
        background: #fff;
        border: 2px solid #333;
        border-radius: 50%;
        font-size: 24px;
        cursor: pointer;
        z-index: 1001;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    #mobile-map-container {
        width: 100%;
        height: 100%;
    }
    
    #mobile-map-container iframe,
    #mobile-map-container > div {
        width: 100% !important;
        height: 100% !important;
    }
    
    /* ====================================
       MOBILE PHOTO LIGHTBOX
    ==================================== */
    .mobile-photo-lightbox {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.95);
        z-index: 1000;
        display: none;
        align-items: center;
        justify-content: center;
    }
    
    .mobile-photo-lightbox.active {
        display: flex;
    }
    
    .mobile-photo-close {
        position: absolute;
        top: 15px;
        right: 15px;
        width: 40px;
        height: 40px;
        background: #fff;
        border: none;
        border-radius: 50%;
        font-size: 24px;
        cursor: pointer;
        z-index: 1001;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    #mobile-lightbox-img {
        max-width: 90%;
        max-height: 90vh;
        object-fit: contain;
    }
}

/* ====================================
   UTILITY CLASSES
==================================== */
.hidden {
    display: none !important;
}

.loading {
    opacity: 0.5;
    pointer-events: none;
}
