/* ===== Gallery styles (merged and cleaned from the old Plogger page) ===== */

:root {
    --primary: #D6CD22;
    --secondary: #FFC231;
    --accent: #e74c3c;
    --light: #f8f9fa;
    --dark: #393326;
    --gray: #828282;
    --transition: all 0.3s ease;
    --text1: #E4C949;
    --link-font: inherit;   /* links use the same font as the rest of the site */
}

/* ----- Links inside the gallery ----- */
#plog-wrapper a,
table a,
#breadcrumb-links a,
#thumbnail-container a,
#pagination a,
.meta-header a {
    font-family: var(--link-font);
    font-weight: 500;
    font-size: 1.1rem;
    letter-spacing: 0.3px;
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition);
}

#plog-wrapper a:hover,
table a:hover,
#breadcrumb-links a:hover,
#thumbnail-container a:hover,
#pagination a:hover,
.meta-header a:hover {
    color: var(--secondary);
}

/* ----- Header / title ----- */
#gallery-name {
    text-align: center;
    margin: 1rem 0;
}

/* ----- Breadcrumbs ----- */
#breadcrumb-links {
    list-style: none;
    padding: 0;
    margin: 0 0 1rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
}

#breadcrumb-links li {
    display: flex;
    align-items: center;
}

#breadcrumb-links li:not(:last-child)::after {
    content: " » ";
    margin: 0 5px;
    color: #555;
}

/* ----- Thumbnails grid ----- */
/* Responsive grid: as many columns as fit, each at least 150px wide */
#plog-wrapper #thumbnail-container ul.slides {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 auto !important;
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1.5rem;
    max-width: 1000px;
}

#plog-wrapper #thumbnail-container ul.slides > li.thumbnail {
    display: block !important;
    float: none !important;
    width: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
}

/* One card per picture */
#thumbnail-container .tag {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    height: auto;
}

#thumbnail-container .tag br {
    display: none;
}

#thumbnail-container .tag > a:first-child {
    display: block;
    width: 100%;
}

#thumbnail-container img.photos {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    box-sizing: border-box;
}

/* Caption: at most two lines */
#thumbnail-container .tag > a:not(:first-child) {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 1.3rem;   /* picture / album names under thumbnails */
    line-height: 1.3;
    text-align: center;
}

.tag {
    font-family: "Inter", "Raleway", "Helvetica Neue", Arial, sans-serif;
    font-size: 1.2rem;
    font-weight: 500;
    letter-spacing: 0.3px;
    text-align: center;
    line-height: 1.3;
}

.tag span {
    display: block;
    color: var(--primary);
    font-family: inherit;
    font-size: inherit;
    font-weight: inherit;
    letter-spacing: inherit;
}

.meta-header {
    color: #FF8A00;
}

.photos {
    border-radius: 4px;
    object-fit: cover;
}

/* ----- Pagination ----- */
#pagination {
    text-align: center;
    margin: 20px 0;
}

#pagination-table {
    border-collapse: collapse;
    margin: 0 auto;
}

#pagination-table td {
    display: inline;
    padding: 0 5px;
    background: none;
    border: none;
}

#pagination a {
    text-decoration: underline;
    font-weight: normal;
}

#pagination .page-link-current {
    display: inline-block;
    color: #fff;
    background-color: var(--primary);
    font-weight: bold;
    padding: 5px 10px;
    border-radius: 5px;
    line-height: 1;
}

/* ----- Search box ----- */
#jump-search-container {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    font-family: 'Raleway', sans-serif;
    font-size: 1rem;
    color: var(--primary);
}

#jump-search-container #search-box {
    display: flex;
    flex: 0 1 420px;
    gap: 0.5rem;
    min-width: 200px;
}

#jump-search-container #search-box input[type="text"] {
    flex: 1;
    padding: 0.5rem 0.8rem;
    border: 1px solid var(--primary);
    border-radius: 5px;
    background-color: var(--dark);
    color: var(--primary);
    font-family: inherit;
    font-size: 1rem;
    transition: var(--transition);
}

#jump-search-container #search-box input[type="text"]:focus {
    border-color: var(--secondary);
    outline: none;
    color: var(--secondary);
}

#jump-search-container #search-box button.submit {
    padding: 0.5rem 1rem;
    border: 1px solid var(--primary);
    border-radius: 5px;
    background-color: var(--primary);
    color: var(--dark);
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

#jump-search-container #search-box button.submit:hover {
    background-color: var(--secondary);
    border-color: var(--secondary);
}

/* ----- Picture page ----- */
#picture-holder {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

#picture-holder,
#picture-holder * {
    margin: 0;
    padding: 0;
    border: none;
    box-shadow: none;
    transform: none !important;
    transition: none !important;
}

#picture-holder .photos-large {
    display: block;
    width: 100%;
    height: auto;
    max-width: 500px;
    object-fit: contain;
    border: 10px solid #fff;
    box-sizing: border-box;
    margin: 0 auto;
}

#picture-holder #description {
    width: 100%;
    margin-top: 10px;
    text-align: center;
}

#picture-holder,
#picture-holder a,
#picture-holder img {
    touch-action: pan-y;               /* allow vertical scroll, JS handles horizontal swipe */
    -webkit-user-drag: none;
    -webkit-touch-callout: none;
    user-select: none;
}

#picture-caption {
    display: block;
    max-width: 100%;
    overflow-wrap: break-word;
    word-break: break-word;
    white-space: normal;
    text-align: center;
}

#caption-date-table {
    width: 100%;
    table-layout: fixed;
}

#caption-date-table td {
    max-width: 100%;
    white-space: normal;
}

#caption-date-table td.align-right {
    display: none;
}

/* ----- Previous / Next ----- */
#prev-next-table {
    width: 100%;
    margin: 10px 0;
    border-collapse: collapse;
}

#prev-next-table tr {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

#prev-link-container,
#next-link-container {
    flex: 1;
}

#prev-link-container { text-align: left; }
#next-link-container { text-align: right; }

#prev-button,
#next-button {
    display: inline-block;
    padding: 6px 12px;
    font-family: 'Raleway', sans-serif;
    font-size: 1rem;
    font-weight: 500;
    white-space: nowrap;
    color: var(--primary);
    border: 1px solid var(--primary);
    border-radius: 5px;
    background-color: var(--dark);
    text-decoration: none;
    transition: var(--transition);
}

#prev-button:hover,
#next-button:hover {
    color: var(--secondary);
    border-color: var(--secondary);
}

/* ----- Don't zoom thumbnails on hover ----- */
a:hover img,
.photos:hover,
.photos-large:hover {
    transform: none !important;
    scale: 1 !important;
    translate: 0 !important;
}

/* ----- Gallery title ----- */
#plog-wrapper #gallery-name,
#plog-wrapper h1.h1 {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-size: 2.2rem;
    letter-spacing: normal;
}

/* ----- Picture frames ----- */
/* Large picture: white frame + soft shadow */
#picture-holder img.photos-large {
    border: 10px solid #fff !important;
    background: #fff;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.35) !important;
}

/* Thumbnails: thinner white frame */
#thumbnail-container img.photos {
    border: 4px solid #fff;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

/* ----- Slideshow ----- */
.slideshow-start {
    text-align: center;
    margin-bottom: 1.5rem;
}

.submit-btn {
    padding: 0.5rem 1.2rem;
    border: 1px solid var(--primary);
    border-radius: 5px;
    background-color: var(--primary);
    color: var(--dark);
    font-family: 'Raleway', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.submit-btn:hover {
    background-color: var(--secondary);
    border-color: var(--secondary);
}

html.ss-lock,
html.ss-lock body {
    overflow: hidden;
}

#slideshow {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: rgba(0, 0, 0, 0.95);
    color: #fff;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    touch-action: pan-y;
}

#slideshow.ss-open {
    display: flex;
}

#slideshow .ss-top {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    font-family: 'Raleway', sans-serif;
}

#slideshow .ss-tools {
    display: flex;
    gap: 0.5rem;
}

#slideshow button {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 5px;
    color: #fff;
    font-size: 1.2rem;
    line-height: 1;
    min-width: 2.4rem;
    height: 2.4rem;
    cursor: pointer;
    transition: var(--transition);
}

#slideshow button:hover {
    color: var(--secondary);
    border-color: var(--secondary);
}

#slideshow .ss-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    height: 4rem;
    font-size: 1.6rem;
    z-index: 2;
}

#slideshow .ss-prev { left: 0.75rem; }
#slideshow .ss-next { right: 0.75rem; }

#slideshow .ss-stage {
    margin: 0;
    max-width: 90vw;
    text-align: center;
}

#slideshow .ss-img {
    display: block;
    margin: 0 auto;
    max-width: 90vw;
    max-height: 78vh;
    object-fit: contain;
    border: 10px solid #fff;
    background: #fff;
    box-sizing: border-box;
    opacity: 1;
    transition: opacity 0.35s ease;
    user-select: none;
    -webkit-user-drag: none;
}

#slideshow .ss-img.ss-fade {
    opacity: 0;
}

#slideshow .ss-caption {
    margin-top: 0.8rem;
    font-family: 'Raleway', sans-serif;
    font-size: 1.1rem;
    color: var(--primary);
}

/* ----- Mobile ----- */
@media (max-width: 768px) {
    #plog-wrapper a,
    table a,
    #breadcrumb-links a,
    #thumbnail-container a,
    #pagination a {
        font-size: 1.2rem;
    }

    .tag {
        font-size: 1.3rem;
    }

    #jump-search-container {
        flex-direction: column;
        align-items: stretch;
    }

    #jump-search-container #search-box {
        flex-direction: column;
        flex-basis: auto;
    }

    #prev-button,
    #next-button {
        font-size: 0.95rem;
    }
}
