* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html,
body {
    scrollbar-gutter: stable;
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    line-height: 1.5;
    background-color: var(--bg);
    color: var(--text);
}

.site-inner {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    padding: 2px;
    box-sizing: border-box;
}

header {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* full-width bar */
.site-wide {
    width: 100%;
}

.site-wide .site-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

main {
    margin-top: 54px;
    margin-bottom: 54px;
    flex: 1 0 auto;
    overflow: auto;
}

.main-content {
    margin-top: 25px;
    margin-bottom: 25px;
}

h1 a {
    font-size: 30px;
    font-weight: bold;
    background-repeat: no-repeat;
    background-position: 0px 0px;
    height: 36px;
    position: relative;
}

h1 a:hover {
    text-decoration: none;
    color: var(--text);
}

h2 {
    font-size: 22px;
    margin-bottom: 20px;
    position: relative;
}

nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    border-bottom: 1px solid var(--border-light);
    padding-top: 17px;
    padding-bottom: 15px;
    background: var(--bg-light);
    height: 60px;
    color: var(--text);
}

nav div {
    display: flex;
    align-items: center;
    gap: 1.5em;
    width: auto;
    text-align: left;
}

nav div:last-child {
    justify-content: flex-end;
    text-align: right;
}

nav a {
    display: inline-flex;
    align-items: center;
    position: relative;
    margin: 0;
    text-decoration: none;
}

nav form {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
}

nav a.live {
    color: var(--accent);
    cursor: default;
}

nav a.live:hover {
    text-decoration: none;
}

nav a.live:after {
    content: '';
    width: 14px;
    height: 14px;
    background: var(--bg-light);
    border-left: 1px solid var(--border-light);
    border-bottom: 1px solid var(--border-light);

    position: absolute;
    left: 50%;
    transform: translateX(-50%) rotate(-45deg);
    top: 100%;
    margin-top: 9px;
    pointer-events: none;
}

button:not(.button-linklike):not(.slide-nav):not(.slide-dot):not(.lightbox-close) {
    background-color: var(--button-bg);
    border-radius: 3px;
    color: var(--text-on-color);
    border: none;
    display: inline-block;
    font-weight: 700;
}

button:not(.button-linklike):not(.slide-nav):not(.slide-dot):not(.lightbox-close):hover {
    background-color: var(--button-bg-hover);
    color: var(--text-on-color);
    cursor: pointer;
    text-decoration: none;
}

a.button,
input[type="submit"] {
    background-color: var(--button-bg);
    border-radius: 3px;
    color: var(--text-on-color);
    border: 1px solid var(--button-border);
    padding: 18px 27px;
    display: inline-block;
    margin-top: 18px;
    font-weight: 700;
}

a.button:hover,
input[type="submit"]:hover {
    background-color: var(--button-bg-hover);
    color: var(--text-on-color);
    cursor: pointer;
    text-decoration: none;
}

form div {
    margin-bottom: 18px;
}

form div:last-child {
    border-top: 1px dashed var(--border-light);
}

form input[type="radio"] {
    margin-left: 18px;
}

form input[type="text"],
form input[type="password"],
form input[type="email"] {
    padding: 0.75em 18px;
    width: 100%;
}

* form input[type=text],
form input[type="password"],
form input[type="email"],
textarea {
    color: var(--text);
    background: var(--bg-light);
    border: 1px solid var(--border-light);
    border-radius: 3px;
}

form label {
    display: inline-block;
    margin-bottom: 9px;
}

input[type="submit"].muted,
.controls .muted,
.muted {
    background-color: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-medium);
    transition: color 0.2s, border-color 0.2s;
}

input[type="submit"].muted:hover,
.controls .muted:hover,
.muted:hover {
    background-color: transparent;
    color: var(--accent-attention);
    border-color: var(--accent-attention);
}

.error {
    color: var(--accent-attention);
    font-weight: bold;
    display: block;
}

.error+textarea,
.error+input {
    border-color: var(--accent-attention) !important;
    border-width: 2px !important;
}

textarea {
    padding: 18px;
    width: 100%;
    height: 266px;
}

.button-linklike {
    background: none;
    padding: 0;
    border: none;
    color: var(--link);
    text-decoration: none;
    font-size: 18px;
    font-family: "Ubuntu Mono", monospace;
}

.button-linklike:hover {
    color: var(--link-hover);
    text-decoration: underline;
    cursor: pointer;
}

div.flash {
    color: var(--text-on-color);
    font-weight: bold;
    background-color: var(--accent);
    padding: 18px;
    margin-bottom: 36px;
    text-align: center;
}

div.error {
    color: var(--text-on-color);
    background-color: var(--accent-attention);
    padding: 18px;
    margin-bottom: 36px;
    font-weight: bold;
    text-align: center;
}

table {
    background: var(--bg-light);
    border: 1px solid var(--border-light);
    border-collapse: collapse;
    width: 100%;
}

td,
th {
    text-align: left;
    padding: 9px 18px;
}

th:last-child,
td:last-child {
    text-align: right;
    color: var(--text);
}

tr {
    border-bottom: 1px solid var(--border-light);
}

tr:nth-child(2n) {
    background-color: var(--bg-light);
}

footer {
    border-top: 1px solid var(--border-light);
    padding-top: 10px;
    padding-bottom: 10px;
    background: var(--bg-light);
    color: var(--text-secondary);
    text-align: center;

    .layout-row {
        gap: 20px;
    }
}

footer.site-wide .site-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    text-align: center;
}

/* layout */
.container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 0;
    padding: 0;
}

.space-between-div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    align-items: center;
}

ul {
    list-style-type: disc;
    padding-left: 1.5em;
}

/* Slideshow Container */
.slideshow-container {
    margin: 0.5rem;
    /* padding: 0 1rem; */
}

.slideshow-viewer {
    position: relative;
    width: 100%;
    background: var(--bg-item);
    aspect-ratio: 16 / 9;
    border-radius: 8px;
    overflow: hidden;
    /* Reserve space to prevent layout shift */
    min-height: 550px;
}

/* Slides */
.slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
    pointer-events: none;
}

.slide.active {
    opacity: 1;
    pointer-events: auto;
}

.slide picture {
    width: 100%;
    height: 100%;
    display: block;
}

.slide picture {
    width: 100%;
    height: 100%;
    display: block;
}

.slide img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    cursor: pointer;
    display: block;
    /* Prevent layout shift before image loads */
    min-height: 400px;
}

/* Navigation Arrows */
.slide-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: var(--button-bg);
    color: var(--text-on-color);
    opacity: 0;
    border: none;
    width: 36px;
    height: 48px;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.4s;
    z-index: 10;
}

.slideshow-viewer:hover .slide-nav {
    opacity: 1;
}

.slide-nav:hover {
    opacity: 1;
    background: var(--button-bg-hover);
}

.slide-nav.prev {
    left: 0;
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

.slide-nav.next {
    right: 0;
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

/* Dot Indicators */
.slide-dots {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1rem;
}

.slide-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: var(--button-bg);
    color: var(--text-on-color);
    opacity: 0.7;
    border: none;
    cursor: pointer;
    transition: all 0.3s;
    padding: 0;
}

.slide-dot.active {
    background: var(--accent);
    opacity: 1;
    transform: scale(1.2);
}

.slide-dot:hover {
    opacity: 1;
    background: var(--accent);
}

/* Lightbox */
.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.lightbox.active {
    display: flex;
}

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

.lightbox-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background-color: var(--button-bg);
    color: var(--text-on-color);
    border: none;
    width: 48px;
    height: 48px;
    border-radius: 4px;
    font-size: 32px;
    line-height: 1;
    cursor: pointer;
    transition: background 0.2s;
}

.lightbox-close:hover {
    background: var(--button-bg-hover);
}

/* Responsive */
@media (max-width: 768px) {
    .slideshow-viewer {
        min-height: 250px;
    }

    .slide img {
        min-height: 250px;
    }

    .slide-nav {
        width: 40px;
        height: 40px;
    }
}

/* Slide captions */
.slide-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 0.5rem;
    background: rgba(0, 0, 0, 0.3);
    color: hsl(0 0% 92%);
    text-align: center;
    font-size: 0.95rem;
    line-height: 1.4;
    backdrop-filter: blur(4px);
}

/* Video support */
.slide video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    cursor: pointer;
    display: block;
    min-height: 400px;
}

@media (max-width: 768px) {
    .slide video {
        min-height: 250px;
    }

    .slide-caption {
        padding: 0.75rem;
        font-size: 0.85rem;
    }
}

.donate-img {
    border: 0px;
    height: 72px;
    width: 300px;
    border-radius: 20px;
}