/*
Theme Name: Union Pole Live
Description: Custom theme for the Union Pole Live Music Series.
Author: Union Pole Tapes
Template: blankslate
Version: 1.0.0
*/

/* ========================================
   1. Global styles
======================================== */

:root {
    --page-background: #eeeeeb;
    --grid-line: #8dbb98;
    --text-color: #222222;
    --desktop-image-width: 180px;
    --mobile-image-width: 100px;
}

html {
    box-sizing: border-box;
}

*,
*::before,
*::after {
    box-sizing: inherit;
}

body {
    margin: 0;
    border: 0;
    background: var(--page-background);
    color: var(--text-color);
    font-family: myriad-pro, "Myriad Pro", -apple-system, system-ui,
        "Segoe UI", Oxygen, Ubuntu, Cantarell, "Helvetica Neue", Arial,
        sans-serif;
    font-size: 16px;
    line-height: 1.45;
}

/* Remove default BlankSlate site furniture */

#header,
#sidebar,
#footer {
    display: none !important;
}

#container {
    margin-top: 0;
    padding-top: 0;
}

/* Main content width */

#site-main {
    width: 100%;
    max-width: 570px;
    margin: 0 auto;
    padding: 16px 0 32px;
}

/* ========================================
   2. Header and logo
======================================== */

.site-header {
    text-align: center;
}

.site-logo {
    display: inline-block;
    line-height: 0;
}

.site-logo img {
    display: block;
    width: auto;
    max-width: 140px;
    max-height: 110px;
    object-fit: contain;
}

.site-subtitle {
    margin-top: 8px;
    font-size: 14px;
    letter-spacing: 0.12em;
}

/* Horizontal rules */

.section-rule {
    height: 0;
    margin: 14px 0;
    border: 0;
    border-top: 0.5px solid var(--grid-line);
}

/* ========================================
   3. Homepage event grid
======================================== */

#event-flyer-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    border-top: 0.5px solid var(--grid-line);
    border-left: 0.5px solid var(--grid-line);
}

.event-cell {
    position: relative;
    display: flex;
    min-width: 0;
    aspect-ratio: 1 / 1;
    align-items: center;
    justify-content: center;
    padding: 1px;
    border-right: 0.5px solid var(--grid-line);
    border-bottom: 0.5px solid var(--grid-line);
    color: var(--text-color);
    text-decoration: none;
}

.event-flyer img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.upcoming-event {
    font-size: 16px;
    font-weight: 400;
}

.event-number {
    display: block;
}

/* Homepage About section */

#about h2 {
    margin: 0 0 12px;
    font-size: 18px;
    font-weight: 400;
    text-align: center;
}

#about p {
    max-width: 440px;
    margin: 0 auto;
}

/* Footer and Instagram link */

.site-footer {
    text-align: center;
}

.instagram-link {
    display: inline-block;
    color: var(--text-color);
    font-size: 14px;
    letter-spacing: 0.08em;
    text-decoration: none;
}

/* ========================================
   4. Event History
======================================== */

#event-history {
    display: block;
    width: 100%;
    margin-top: 5px;
    border-top: 0.5px solid var(--grid-line);
}

.history-entry {
    display: block;
    width: 100%;
    height: auto;
    min-height: 0;
    padding: 10px 0;
    color: var(--text-color);
    scroll-margin-top: 16px;
}

/* Main row: images, description, external link */

#event-history .history-main {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    width: 100%;
}

/* Left column: flyer, archive image and gallery */

#event-history .history-images {
    display: flex;
    flex: 0 0 var(--desktop-image-width);
    flex-direction: column;
    gap: 6px;
    width: var(--desktop-image-width);
    min-width: 0;
}

/* Both flyer images */

#event-history .history-flyer {
    display: block;
    flex: none;
    width: 100%;
    min-width: 0;
    height: auto;
    overflow: hidden;
    line-height: 0;
}

#event-history .history-flyer img {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
    object-fit: contain;
}

/* Performer descriptions */

#event-history .history-details {
    display: block;
    flex: 1 1 0;
    min-width: 0;
    height: auto;
    overflow: visible;
}

#event-history .history-description {
    font-size: 14px;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

#event-history .history-description p {
    margin: 0 0 12px;
}

#event-history .history-description p:last-child {
    margin-bottom: 0;
}

#event-history .history-description img {
    max-width: 100%;
    height: auto;
}

/* External link arrow */

#event-history .history-arrow {
    display: block;
    flex: 0 0 16px;
    width: 16px;
    margin-left: auto;
    color: var(--text-color);
    font-size: 18px;
    line-height: 1;
    text-align: right;
    text-decoration: none;
}

#event-history .history-arrow:hover {
    text-decoration: underline;
}

/* Divider between events */

#event-history .history-rule {
    display: block;
    width: 100%;
    height: 0;
    margin: 0;
    border: 0;
    border-top: 0.5px solid var(--grid-line);
}

/* ========================================
   5. Event photo gallery
   Same width as the flyer images
======================================== */

#event-history .history-gallery {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 6px;
    width: 100%;
    min-width: 0;
    margin-top: 0;
}

#event-history .history-gallery a {
    display: block;
    width: 100%;
    min-width: 0;
    aspect-ratio: auto;
    overflow: hidden;
    line-height: 0;
}

#event-history .history-gallery img {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
    object-fit: contain;
    transition: opacity 0.2s ease;
}

#event-history .history-gallery a:hover img {
    opacity: 0.8;
}

/* ========================================
   6. YouTube video controls and players
======================================== */

#event-history .history-videos {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 12px;
}

#event-history .history-video {
    flex: 1 1 100%;
    min-width: 0;
}

#event-history .history-video summary {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    cursor: pointer;
    font-size: 12px;
    line-height: 1.5;
    list-style: none;
}

#event-history .history-video summary::-webkit-details-marker {
    display: none;
}

#event-history .play-icon {
    font-size: 13px;
}

#event-history .history-video-player {
    position: relative;
    width: 100%;
    margin-top: 10px;
    aspect-ratio: 16 / 9;
    background: #000;
}

#event-history .history-video-player iframe {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
}

/* ========================================
   7. Photo lightbox
======================================== */

.event-lightbox {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 99999;
    align-items: center;
    justify-content: center;
    padding: 40px;
    background: rgba(0, 0, 0, 0.92);
}

.event-lightbox.is-open {
    display: flex;
}

.event-lightbox > img {
    display: block;
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
}

.lightbox-close {
    position: absolute;
    top: 12px;
    right: 20px;
    border: 0;
    background: transparent;
    color: #fff;
    font-size: 38px;
    line-height: 1;
    cursor: pointer;
}

body.lightbox-open {
    overflow: hidden;
}

/* ========================================
   8. Mobile layout
======================================== */

@media (max-width: 600px) {

    /* Main page */

    #site-main {
        width: 100%;
        padding: 12px 12px 24px;
    }

    /* Two-column square homepage grid */

    #event-flyer-grid {
        display: grid !important;
        width: 100%;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        grid-auto-rows: auto;
        align-items: start;
    }

    #event-flyer-grid .event-cell {
        width: 100%;
        min-width: 0;
        height: auto;
        min-height: 0;
        aspect-ratio: 1 / 1 !important;
        align-self: start;
        overflow: hidden;
    }

    #event-flyer-grid .event-flyer img {
        display: block;
        width: 100%;
        height: 100%;
        min-width: 0;
        object-fit: contain;
    }

    /* Event History image column */

    #event-history .history-images {
        flex-basis: var(--mobile-image-width);
        width: var(--mobile-image-width);
    }

    #event-history .history-main {
        gap: 8px;
    }

    #event-history .history-arrow {
        flex-basis: 16px;
        width: 16px;
    }

    /* Lightbox */

    .event-lightbox {
        padding: 15px;
    }

    .event-lightbox > img {
        max-height: 85vh;
    }

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

.language-switcher {
    max-width: 570px;
    margin: 0 auto;
    padding: 8px 0 0;
    text-align: right;
    font-size: 13px;
}

.language-switcher a {
    color: var(--text-color);
    text-decoration: none;
}

.language-switcher a:hover {
    text-decoration: underline;
}

@media (max-width: 600px) {
    .language-switcher {
        padding-left: 16px;
        padding-right: 16px;
    }
}