/* Journal Page Styles - Square Collage Layout */

* {
    box-sizing: border-box;
}

body {
    padding-top: 50px;
    padding-bottom: 20px;
    position: relative;
    background-color: #fff;
    font-family: Georgia, serif;
}

.navbar-inverse .navbar-brand {
    color: #fff;
    font-family: "Helvetica Neue", sans-serif;
    font-weight: 100;
}

/* Kids info panel - fixed sidebar */
#kids {
    position: fixed;
    font-size: 18px;
    top: 50px;
    left: 10px;
    font-family: Georgia, serif;
    z-index: 99;
    width: 200px;
}

#kids .olive,
#kids .iris,
#kids .lyon,
#kids .juniper,
#kids .zorro {
    display: none;
    clear: both;
    overflow: hidden;
}

#kids .kid_name {
    display: block;
    width: 70px;
    text-align: right;
    float: left;
    margin-right: 10px;
    line-height: 26px;
    font-weight: bold;
}

#kids .kid_date {
    display: block;
    width: 120px;
    float: left;
    line-height: 26px;
    margin-bottom: 8px;
    font-size: 14px;
}

#kids .jty {
    font-family: Georgia, serif;
    font-size: 48px;
    width: 200px;
    text-align: right;
    margin-bottom: 5px;
}

#kids .jtm {
    margin-top: 0;
    font-family: Georgia, serif;
    font-size: 28px;
    width: 200px;
    text-align: right;
    margin-bottom: 40px;
    color: #666;
}

#kids .tags,
#kids .dates {
    clear: both;
    padding-top: 15px;
}

#kids .tags select,
#kids .dates select {
    width: 100%;
    padding: 5px;
    font-size: 14px;
}

/* Kids colors */
.olive { color: olive; }
.iris { color: #9A9AC9; }
.juniper { color: #D90000; }
.lyon { color: tan; }
.zorro { color: darkgrey; }

/* Main journal container */
#journal-main {
    margin-left: 230px;
    padding: 20px;
    max-width: 1200px;
}

/* Journals grid container */
#journals-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
    padding: 10px 0;
}

/* Individual journal entry */
.journal-entry {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.journal-entry:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

/* Journal image wrapper */
.journal-image-wrap {
    position: relative;
    width: 100%;
    padding-bottom: 100%; /* Square aspect ratio */
    overflow: hidden;
    background: #f5f5f5 url(/global/images/tangfish.gif) center center no-repeat;
}

.journal-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: pointer;
    transition: opacity 0.3s ease;
}

.journal-img:not([src]) {
    opacity: 0;
}

.journal-img[src] {
    opacity: 1;
}

/* Play button overlay for videos */
.play-overlay {
    position: absolute;
    bottom: 20px;
    left: 20px;
    width: 60px;
    height: 60px;
    opacity: 0.8;
    cursor: pointer;
    transition: opacity 0.2s ease, transform 0.2s ease;
    z-index: 10;
}

.play-overlay:hover {
    opacity: 1;
    transform: scale(1.1);
}

/* Video iframe container */
.journal-image-wrap iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* Text-only journal entries */
.journal-text-only {
    width: 100%;
    padding: 30px;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f8f8f8 0%, #fff 100%);
}

.journal-text-only p {
    font-size: 18px;
    font-style: italic;
    color: #333;
    text-align: center;
    line-height: 1.6;
    margin: 0;
}

/* Journal metadata */
.journal-meta {
    padding: 15px;
}

.journal-date {
    display: block;
    font-size: 14px;
    font-weight: bold;
    color: #333;
    margin-bottom: 8px;
}

.journal-body {
    font-size: 14px;
    color: #555;
    line-height: 1.5;
    margin: 0 0 10px 0;
}

/* Tags */
.journal-tags {
    margin-top: 10px;
}

.journal-tags .tag {
    display: inline-block;
    padding: 3px 8px;
    margin: 2px;
    font-size: 12px;
    color: #F47F2F;
    background: #fff5ee;
    border-radius: 3px;
    text-decoration: none;
    transition: background-color 0.2s ease;
}

.journal-tags .tag:hover {
    background: #ffe4cc;
    text-decoration: none;
}

/* Loading triggers and spinners */
.load-trigger {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.load-trigger.loading {
    opacity: 1;
}

.spinner {
    width: 30px;
    height: 30px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #333;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Initial loading state */
.loading-initial {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: #666;
}

.loading-initial p {
    margin-top: 15px;
    font-size: 16px;
}

/* Error state */
.error {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px;
    color: #c00;
    font-size: 16px;
}

/* PhotoSwipe container */
#journalPhotoSwipe {
    display: none;
}


/* Responsive Design */

/* Large desktop */
@media (min-width: 1400px) {
    #journals-container {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Desktop */
@media (max-width: 1399px) and (min-width: 1100px) {
    #journals-container {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Tablet landscape */
@media (max-width: 1099px) and (min-width: 800px) {
    #journal-main {
        margin-left: 220px;
    }
    
    #kids {
        font-size: 16px;
        width: 180px;
    }
    
    #kids .jty {
        font-size: 40px;
        width: 180px;
    }
    
    #kids .jtm {
        font-size: 24px;
        width: 180px;
    }
    
    #kids .kid_name {
        width: 60px;
    }
    
    #kids .kid_date {
        width: 100px;
        font-size: 12px;
    }
    
    #journals-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
}

/* Tablet portrait */
@media (max-width: 799px) and (min-width: 600px) {
    #journal-main {
        margin-left: 0;
        padding: 15px;
        padding-top: 55px; /* Account for sticky header height */
    }
    
    #kids {
        position: fixed;
        top: 50px; /* Below navbar */
        left: 0;
        right: 0;
        width: 100%;
        padding: 8px 15px;
        display: flex;
        flex-wrap: nowrap;
        justify-content: space-between;
        align-items: center;
        gap: 15px;
        background: #f8f8f8;
        margin-bottom: 0;
        z-index: 98;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    }
    
    #kids .tags,
    #kids .dates {
        padding-top: 0;
        clear: none;
    }
    
    #kids .tags .kid_date,
    #kids .dates .kid_date {
        width: auto;
        margin-bottom: 0;
    }
    
    #kids .tags select,
    #kids .dates select {
        padding: 5px 10px;
        font-size: 14px;
        border: 1px solid #ccc;
        border-radius: 4px;
        background: #fff;
    }
    
    #kids .jty,
    #kids .jtm {
        width: auto;
        text-align: center;
        margin: 0;
    }
    
    #kids .jty {
        font-size: 32px;
    }
    
    #kids .jtm {
        font-size: 20px;
        margin-left: 10px;
    }
    
    #kids .olive,
    #kids .iris,
    #kids .juniper,
    #kids .lyon,
    #kids .zorro {
        display: none !important;
    }
    
    #kids .tags {
        padding-top: 0;
        clear: none;
    }
    
    #kids .tags .kid_name {
        display: none;
    }
    
    #kids .tags .kid_date {
        width: auto;
    }
    
    #journals-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
}

/* Mobile */
@media (max-width: 599px) {
    body {
        padding-top: 50px;
    }
    
    #journal-main {
        margin-left: 0;
        padding: 10px;
        padding-top: 50px; /* Account for sticky header height */
    }
    
    #kids {
        position: fixed;
        top: 50px; /* Below navbar */
        left: 0;
        right: 0;
        width: 100%;
        padding: 6px 10px;
        display: flex;
        flex-wrap: nowrap;
        justify-content: space-between;
        align-items: center;
        background: #f8f8f8;
        margin-bottom: 0;
        z-index: 98;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
        gap: 8px;
    }
    
    #kids .jty {
        font-size: 20px;
        width: auto;
        text-align: left;
        margin: 0;
        font-weight: bold;
        line-height: 1;
    }
    
    #kids .jtm {
        font-size: 16px;
        width: auto;
        text-align: left;
        margin: 0;
        line-height: 1;
        flex-shrink: 0;
    }
    
    #kids .olive,
    #kids .iris,
    #kids .juniper,
    #kids .lyon,
    #kids .zorro,
    #kids .kid_name {
        display: none !important;
    }
    
    #kids .tags,
    #kids .dates {
        padding-top: 0;
        clear: none;
        flex-shrink: 0;
    }
    
    #kids .tags .kid_date,
    #kids .dates .kid_date {
        width: auto;
        margin-bottom: 0;
        line-height: 1;
    }
    
    #kids .tags select,
    #kids .dates select {
        padding: 5px 8px;
        font-size: 14px;
        border: 1px solid #ccc;
        border-radius: 4px;
        background: #fff;
    }
    
    #journals-container {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .journal-entry {
        border-radius: 0;
    }
    
    .journal-meta {
        padding: 12px;
    }
    
    .journal-date {
        font-size: 13px;
    }
    
    .journal-body {
        font-size: 13px;
    }
    
    .journal-text-only p {
        font-size: 16px;
    }
}

/* Very small mobile */
@media (max-width: 350px) {
    #kids .jty {
        font-size: 18px;
    }
    
    #kids .jtm {
        font-size: 14px;
    }
    
    #kids .tags select,
    #kids .dates select {
        padding: 4px 6px;
        font-size: 13px;
    }
    
    .journal-tags .tag {
        font-size: 11px;
        padding: 2px 6px;
    }
}


/* Legacy support - keep old classes working for any remaining templates */

.iosSlider { display: none; }

.slide { display: none; }
