body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f4f4f4;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    transition: background-image 7s ease;
}

/* Cache-busted to force refresh */
body.bg1 { background-image: url('rotating background photos/bg1.jpg?v=2025-10-31-2005'); }
body.bg2 { background-image: url('rotating background photos/bg2.jpg?v=2025-10-31-2005'); }
body.bg3 { background-image: url('rotating background photos/bg3.jpg?v=2025-10-31-2005'); }

header {
    background-color: #ce1126;
    color: white;
    padding: 20px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

.logo {
    font-size: 24px;
    font-weight: bold;
}

.hamburger {
    font-size: 24px;
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    display: none;
}

.nav-menu {
    display: flex;
}

.nav-menu ul {
    list-style: none;
    display: flex;
    margin: 0;
    padding: 0;
}

.nav-menu li {
    margin-left: 20px;
}

.nav-menu a {
    color: white;
    text-decoration: none;
}

.nav-menu a:hover {
    text-decoration: underline;
}

main {
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 120px);
}

section {
    text-align: center;
}

.content-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 800px;
    background-color: #f4f4f4;
    padding: 20px;
    border-radius: 8px;
}

.hero, .countdown, .donation, .form-wrapper {
    margin-bottom: 20px;
    width: 100%;
}

h1 {
    color: #ce1126;
}

form {
    display: flex;
    flex-direction: column;
    max-width: 400px;
    width: 100%;
    margin: 0 auto;
}

.form-wrapper {
    display: flex;
    justify-content: center;
}

.button-container {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-top: 20px;
    width: 100%;
    max-width: 400px;
}

button {
    background-color: #ce1126;
    color: white;
    border: none;
    cursor: pointer;
    padding: 5px 10px;
    flex: 1;
}

.event-button {
    padding: 10px 20px;
    font-size: 18px;
    text-decoration: none;
    display: inline-block;
}

button:hover {
    background-color: #a00a1a;
}

label {
    margin-top: 10px;
}

input, button {
    margin-top: 5px;
    padding: 5px;
}

.hide {
    display: none;
}

footer {
    background-color: #ce1126;
    color: white;
    text-align: center;
    padding: 10px;
    position: relative;
    margin-top: 20px;
    width: 100%;
}

/* Simple social button styling for footer links */
.footer-links { margin-top: 6px; }
.social-button {
    display: inline-block;
    background: #1877F2;
    color: #fff !important;
    padding: 6px 10px;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 600;
}
.social-button:hover { filter: brightness(0.95); }

/* PDF Viewer and Form Styles */
#pdf-viewer {
    position: relative;
    margin: 0 auto;
    padding: 20px;
    background: #fff;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
}

.pdf-page {
    position: relative;
    margin: 0 auto;
    background-color: #fff;
}

/* Slightly lighten PNG fallback so paper appears white */
.pdf-page.png-fallback {
    filter: brightness(1.15) contrast(1.05);
}

/* Lighten only the PDF canvas background image, not overlays */
.pdf-page canvas.pdf-canvas {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
    filter: brightness(1.25) contrast(1.1);
    background: #ffffff;
}

.interactive-layer {
    z-index: 2;
}

/* PNG fallback background image element */
.fallback-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    z-index: 1;
    filter: brightness(1.25) contrast(1.1);
    background: #ffffff;
}

.interactive-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.interactive-element {
    position: absolute;
    background: transparent;
    border: none;
    transition: all 0.3s ease;
}

.interactive-element:hover {
    background: transparent;
    border-color: transparent;
}

.interactive-element.text-input {
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(0, 0, 0, 0.2);
    border-radius: 4px;
    padding: 2px;
}

.interactive-element.text-input input {
    width: 100%;
    height: 100%;
    padding: 4px 8px;
    border: none;
    background: transparent;
    font-size: 14px;
    line-height: 1.2;
}

.interactive-element.checkbox-input {
    width: 24px !important;
    height: 24px !important;
    background: #fff;
    border: 2px solid #333;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 10px;
}

.interactive-element.checkbox-input.checked {
    background: #ce1126;
    border-color: #ce1126;
}

.interactive-element.checkbox-input.checked .checkbox-inner:after {
    content: '✓';
    color: #fff;
    font-size: 14px;
    font-weight: bold;
}

/* Calculation Popup */
.calculation-popup {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    min-width: 300px;
    z-index: 1000;
}

.calculation-popup h3 {
    margin: 0 0 15px 0;
    color: #333;
    font-size: 18px;
}

.calculation-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 14px;
}

.total-row {
    display: flex;
    justify-content: space-between;
    margin-top: 15px;
    padding-top: 10px;
    border-top: 1px solid #eee;
    font-weight: bold;
}

#clown-container {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 1000;
}

.clown {
    cursor: pointer;
    transition: transform 0.2s;
    width: 100px;
    height: 100px;
}

.clown:hover {
    transform: scale(1.1);
}

.modal {
display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    z-index: 1000;
}

.modal-content {
background-color: #fff;
    margin: 5% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 80%;
    max-width: 600px;
    max-height: 80%;
    overflow-y: auto;
    position: relative;
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover,
.close:focus {
    color: black;
    text-decoration: none;
}

.game-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

#game-board {
width: 100%;
    margin-top: 10px;
}

#tic-board {
    width: 100% !important; /* Override any inline styles */
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 5px;
}

.tic-cell {
    border: 1px solid #ccc;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    background-color: #fff;
    font-size: 24px;
}

#checkers-board {
    width: 100% !important; /* Override any inline styles */
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 2px;
}

.checkers-cell {
    width: 40px;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.checkers-cell.light {
    background-color: #f0d9b5;
}

.checkers-cell.dark {
    background-color: #8b4513;
}

.checkers-piece {
    width: 80%;
    height: 80%;
    border-radius: 50%;
    margin: auto;
}

.red {
    background-color: red;
}

.black {
    background-color: black;
}

.king {
    border: 2px solid gold;
}

#game-status {
    margin-top: 10px;
}

#reset-game {
    margin-top: 10px;
}

.event-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    margin-bottom: 20px;
}

.event-item {
    background-color: #ce1126;
    color: white;
    padding: 10px;
    text-align: center;
    cursor: pointer;
    border-radius: 5px;
}

.event-item:hover {
    background-color: #a00a1a;
}

.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 10px;
    width: 100%;
}

.gallery img {
    width: 100%;
    height: auto;
    object-fit: cover;
    border-radius: 8px;
}

#gallery-modal .gallery {
    margin-top: 20px;
}

/* Gallery-only layout overrides (scoped to #gallery-modal so other modals like #game-modal are unaffected) */
#gallery-modal .modal-content {
    /* make the gallery modal wider so multiple columns can display */
    max-width: 900px;
}

#gallery-modal .gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
    width: 100%;
}

#gallery-modal .gallery img {
    width: 100%;
    height: 140px; /* consistent thumbnail height */
    object-fit: cover;
    border-radius: 8px;
    display: block;
}

@media (max-width: 768px) {
    .hamburger {
        display: block;
    }

    .nav-menu {
        display: none;
        position: absolute;
        top: 60px;
        left: 0;
        width: 100%;
        background-color: #ce1126;
    }

    .nav-menu.active {
        display: flex;
        flex-direction: column;
    }

    .nav-menu li {
        margin: 10px 0;
        text-align: center;
    }

    .button-container {
        flex-direction: column;
        gap: 10px;
    }

    .content-container {
        max-width: 100%;
    }

    .modal-content {
        width: 95%;
        margin: 10% auto;
    }

    .calculation-popup {
        width: 90%;
        top: auto;
        bottom: 20px;
        right: 5%;
        left: 5%;
        min-width: 0;
    }

    .interactive-element.checkbox-input {
        transform: scale(1.5);
        margin: 10px;
    }
}

/* Lightbox (gallery enlarge) styles - scoped to #lightbox */
#lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

#lightbox img {
    max-width: 90%;
    max-height: 80%;
    border-radius: 6px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.6);
}

#lightbox .close {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 32px;
    color: #fff;
    background: transparent;
    border: none;
    cursor: pointer;
}

#lightbox button[aria-label="Previous"],
#lightbox button[aria-label="Next"] {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.1);
    border: none;
    color: #fff;
    font-size: 28px;
    padding: 8px 12px;
    cursor: pointer;
}

#lightbox button[aria-label="Previous"] { left: 20px; }
#lightbox button[aria-label="Next"] { right: 20px; }

#lightbox button:focus { outline: 2px solid #fff; }