/* Custom Fonts */
@font-face {
    font-family: 'TAPSans';
    src: url('../assets/Fonts/TAPSans.otf') format('opentype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'TAPSans Colour';
    src: url('../assets/Fonts/TAPSans-Colour.otf') format('opentype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'TAPSans Outline';
    src: url('../assets/Fonts/TAPSans-Outline.otf') format('opentype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'PlusJakartaSans';
    src: url('../assets/Fonts/PlusJakartaSans-VariableFont_wght.ttf') format('truetype');
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'PlusJakartaSans';
    src: url('../assets/Fonts/PlusJakartaSans-Italic-VariableFont_wght.ttf') format('truetype');
    font-weight: 100 900;
    font-style: italic;
    font-display: swap;
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    overflow-x: hidden;
    max-width: 100vw;
}

body {
    font-family: 'PlusJakartaSans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #F6F5F0;
}

/* Link Styling */

a:link {
  color: #FF3927;
  text-decoration: none;
}

a:visited {
  color: #FF3927;
}

a:hover {
  text-decoration: underline;
}

/* Heading Fonts */
h1 {
    font-family: 'TAPSans Outline', sans-serif;
}

h2, h3, h4, h5, h6 {
    font-family: 'TAPSans', sans-serif;
}

ul.a {
    list-style-type: circle;
    padding-left: 25px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header Styles */
.site-header {
    background-color: #F6F5F0;
    padding: 20px 0;
    border-bottom: 1px solid #ddd;
}

.site-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
}

.logo img {
    height: 50px;
    width: auto;
    display: block;
}

.main-nav ul {
    display: flex;
    list-style: none;
    gap: 30px;
}

.main-nav a {
    text-decoration: none;
    color: #333;
    transition: color 0.3s;
}

.main-nav a:hover {
    color: #666;
}

.search-box {
    display: flex;
    gap: 5px;
}

.search-box input {
    padding: 5px 10px;
    border: 1px solid #ccc;
    border-radius: 3px;
    font-family: 'PlusJakartaSans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

.search-box button {
    background: none;
    border: none;
    cursor: pointer;
}

/* Hamburger Menu Button */
.hamburger-btn {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 21px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1100;
}

.hamburger-btn span {
    display: block;
    width: 100%;
    height: 3px;
    background-color: #333;
    border-radius: 2px;
    transition: all 0.3s ease;
}

.nav-close-btn {
    display: none;
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: #333;
}

/* Main Content */
.home-content {
    max-width: 1200px;
    margin: 40px auto;
    padding: 40px 20px;
    background-color: #F6F5F0;
}

.page-title {
    text-align: center;
    margin-bottom: 10px;
    font-size: 3rem;
}

.page-subtitle {
    text-align: center;
    margin-bottom: 10px;
    font-size: 2rem;
}

/* Communities Section */
.communities {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-bottom: 60px;
    padding-top: 50px;
}

.community-card {
    text-align: center;
    text-decoration: none;
    color: inherit;
    display: block;
    transition: transform 0.3s ease;
    position: relative;
    overflow: visible;
}

.community-card:hover {
    transform: translateY(-5px);
}

.community-card h3 {
    margin: 0;
    color: #333;
}

/* Door Tooltips */
.door-tooltip {
    position: absolute;
    top: -40px;
    left: 50%;
    transform: translateX(-50%) scale(0);
    background-color: #FF3927;
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    white-space: nowrap;
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 10;
    pointer-events: none;
}

.door-tooltip::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    border-width: 8px 8px 0 8px;
    border-style: solid;
    border-color: #FF3927 transparent transparent transparent;
}

.community-card:hover .door-tooltip {
    opacity: 1;
    transform: translateX(-50%) scale(1);
}

.door-image {
    width: 100%;
    aspect-ratio: 3/4;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
    position: relative;
    overflow: visible;
}

/* Submit Section */
.submit-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: center;
}

.submit-content h2 {
    font-size: 2rem;
    margin-bottom: 15px;
}

.submit-image {
    width: 100%;
    border: 1px solid #333;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.submit-caption{
    font-size: 0.8rem;
    font-style: italic;
}

.submit-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.submit-image::before {
    transform: rotate(45deg);
}

.submit-image::after {
    transform: rotate(-45deg);
}

.btn {
    padding: 10px 30px;
    border: 2px solid #FF3927;
    border-radius: 25px;
    background-color: #FF3927;
    cursor: pointer;
    font-size: 1rem;
    font-family: 'PlusJakartaSans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    transition: background-color 0.3s;
}

.btn:hover {
    background-color: #f0f0f0;
}

/* Footer Styles */
.site-footer {
    background-color: #F6F5F0;
    padding: 40px 0 20px;
    border-top: 1px solid #ddd;
}

.site-footer .container {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 60px;
    margin-bottom: 30px;
    padding: 0 40px;
}

.footer-section h4 {
    margin-bottom: 15px;
}

.footer-logo {
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 15px;
}

.footer-logo img {
    height: 60px;
    width: auto;
    display: block;
}

.tap-logo img {
    height: 50px;
    width: auto;
    display: block;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 8px;
}

.footer-section a {
    text-decoration: none;
    color: #16241B;
}

.project-description {
    font-size: 0.95rem;
    color: #16241B;
}

.funder-logos,
.school-logos {
    display: flex;
    gap: 10px;
    margin: 15px 0;
}

.logo-item {
    padding: 15px;
    font-size: 0.8rem;
    text-align: center;
    max-width: 200px;
    max-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-item img {
    max-width: 100%;
    max-height: 60px;
    width: auto;
    height: auto;
    object-fit: contain;
}

.social-icons {
    display: flex;
    gap: 10px;
    margin: 10px 0;
}

.social-icons a {
    text-decoration: none;
    font-size: 1.5rem;
}

.copyright {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid #ccc;
    font-size: 0.9rem;
    color: #666;
}

/* Overlay Styles */
.overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    overflow-x: hidden;
    overflow-y: auto;
}

.overlay.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.overlay-content {
    background-color: white;
    padding: 40px;
    border-radius: 8px;
    max-width: 800px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    margin: 20px;
    box-sizing: border-box;
}

.close-btn {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 2rem;
    background: none;
    border: none;
    cursor: pointer;
    color: #666;
}

.close-btn:hover {
    color: #333;
}

/* About Overlay */
.about-text p {
    margin-bottom: 15px;
    line-height: 1.8;
}

/* Overlay Banner Image */
.overlay-banner-image {
    width: 100%;
    border: 1px solid #333;
    overflow: hidden;
    margin-bottom: 20px;
}

.overlay-banner-image img {
    width: 100%;
    height: auto;
    max-height: 300px;
    object-fit: cover;
    display: block;
}

.overlay-banner-image .image-caption {
    font-size: 0.8rem;
    font-style: italic;
    color: #666;
    padding: 8px 10px;
    background-color: #f9f9f9;
    margin: 0;
}

/* Submission Form Overlay */
.submission-form .overlay-content {
    max-width: 1000px;
}

.form-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 3px;
}

.form-group textarea {
    min-height: 100px;
    resize: vertical;
}

.form-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 3px;
    font-family: 'PlusJakartaSans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    font-size: 1rem;
    background-color: white;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23333' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
}

.form-group select:focus {
    outline: none;
    border-color: #FF3927;
}

.file-upload {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
}

.file-upload input[type="file"] {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 3px;
    background-color: white;
    cursor: pointer;
    font-family: 'PlusJakartaSans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    font-size: 0.9rem;
}

.file-upload input[type="file"]::file-selector-button {
    padding: 8px 16px;
    border: 1px solid #333;
    border-radius: 3px;
    background-color: white;
    cursor: pointer;
    font-family: 'PlusJakartaSans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    margin-right: 10px;
    transition: background-color 0.3s;
}

.file-upload input[type="file"]::file-selector-button:hover {
    background-color: #f0f0f0;
}

.file-name,
.file-status {
    font-size: 0.9rem;
    color: #666;
}

.checkbox-group {
    margin-top: 15px;
}

.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    font-size: 0.9rem;
    line-height: 1.4;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-top: 2px;
    cursor: pointer;
    accent-color: #FF3927;
}

.checkbox-label span {
    flex: 1;
}

.form-right .image-placeholder {
    width: 100%;
    aspect-ratio: 4/3;
    border: 2px solid #333;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #fafafa;
    margin-bottom: 20px;
}

.submission-info h3 {
    margin-bottom: 5px;
    font-size: 1.5rem;
}

.submission-info h4 {
    margin-top: 20px;
    margin-bottom: 10px;
}

/* Archive Page Styles */
.archive-header {
    text-align: center;
    margin-bottom: 30px;
}

.archive-filters {
    background-color: #e8e8e8;
    padding: 30px;
    border-radius: 5px;
}

.filter-group {
    margin-bottom: 25px;
}

.filter-group h4 {
    margin-bottom: 10px;
}

.filter-options label {
    display: block;
    margin-bottom: 8px;
}

.date-inputs input {
    width: 100%;
    padding: 8px;
    margin-top: 5px;
    border: 1px solid #ccc;
    border-radius: 3px;
    font-family: 'PlusJakartaSans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

.filter-buttons {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    font-family: 'PlusJakartaSans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

.filter-buttons button {
    flex: 1;
    padding: 10px;
    border: 1px solid #333;
    background-color: white;
    cursor: pointer;
    font-family: 'PlusJakartaSans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

/* Archive Layout */
.archive-layout {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 30px;
    margin-top: 30px;
}

.archive-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.sort-control select {
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 3px;
    font-family: 'PlusJakartaSans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

/* Archive Items */
.archive-items {
    display: grid;
    gap: 20px;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 25px;
    padding: 15px 0;
}

.pagination button {
    padding: 8px 14px;
    border: 1px solid #333;
    background-color: white;
    cursor: pointer;
    border-radius: 3px;
    font-family: 'PlusJakartaSans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    font-size: 0.9rem;
}

.pagination button:hover {
    background-color: #f0f0f0;
}

.pagination button.active {
    background-color: #333;
    color: white;
}

.archive-item {
    border: 1px solid #ddd;
    border-radius: 5px;
    padding: 20px;
    background-color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.item-meta {
    flex: 1;
}

.item-meta .theme {
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 5px;
}

.item-meta .format {
    font-size: 0.85rem;
    color: #666;
    margin-left: 15px;
}

.item-meta .title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 5px;
}

.item-meta .community {
    font-size: 0.9rem;
    color: #666;
}

.item-meta .date {
    font-size: 0.85rem;
    color: #999;
    float: right;
}

/* Community Room */
.community-room {
    min-height: calc(100vh - 200px);
    height: auto;
    position: relative;
    background-color: #F6F5F0;
    display: flex;
    flex-direction: column;
}

.room-background {
    width: 100%;
    aspect-ratio: 16 / 9;
    position: relative;
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
}

.media-player {
    position: absolute;
    cursor: pointer;
    background: transparent;
    border: none;
    padding: 0;
}

.media-player img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.5));
    transition: transform 0.2s ease, filter 0.2s ease;
}

.media-player:hover img {
    transform: scale(1.1);
    filter: drop-shadow(3px 3px 6px rgba(0, 0, 0, 0.7));
}

/* Default positions (fallback) - using percentages to scale with container */
.movie-player {
    top: 10%;
    left: 5%;
    width: 15%;
}

.audio-player {
    top: 10%;
    right: 5%;
    width: 12%;
}

.dice-display {
    bottom: 15%;
    left: 50%;
    transform: translateX(-50%);
    width: 10%;
}

/* Efford room positions */
.room-efford .movie-player {
    top: 22%;
    left: 34%;
    width: 10%;
}

.room-efford .audio-player {
    top: 30%;
    right: 25%;
    width: 18%;
}

.room-efford .dice-display {
    bottom: 10%;
    left: 15%;
    transform: translateX(-50%);
    width: 15%;
}

/* St Judes room positions */
.room-stjudes .movie-player {
    top: 55%;
    left: 65%;
    width: 25%;
}

.room-stjudes .audio-player {
    top: 5%;
    left: 30%;
    width: 18%;
}

.room-stjudes .dice-display {
    bottom: -7%;
    left: 30%;
    transform: translateX(-50%);
    width: 30%;
}

/* Whitleigh room positions */
.room-whitleigh .movie-player {
    top: 35%;
    left: 15%;
    width: 20%;
}

.room-whitleigh .audio-player {
    top: 47%;
    right: 22%;
    width: 27%;
}

.room-whitleigh .dice-display {
    bottom: -2%;
    left: 30%;
    transform: translateX(-50%);
    width: 15%;
}

/* Mobile Community Room - Pannable Layout */
@media (max-width: 768px) {
    .community-room {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
    }

    .room-background {
        width: 150vw; /* Wider than viewport to enable panning */
        min-width: 150vw;
        aspect-ratio: 16 / 9;
        background-size: cover;
        background-position: center;
        overflow: visible;
    }

    /* Ensure dice icons stay within bounds on mobile */
    .room-efford .dice-display {
        bottom: 8%;
    }

    .room-stjudes .dice-display {
        bottom: 5%;
    }

    .room-whitleigh .dice-display {
        bottom: 5%;
    }

    /* Increase icon sizes on mobile for easier tapping */
    .media-player img {
        min-width: 60px;
        min-height: 60px;
    }
}

@media (max-width: 480px) {
    .room-background {
        width: 200vw; /* Even wider on small phones */
        min-width: 200vw;
    }

    /* Larger touch targets on small screens */
    .media-player img {
        min-width: 50px;
        min-height: 50px;
    }
}

/* Audio Player Styles */
.audio-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border: 1px solid #ddd;
    margin: 10px 0;
}

.play-btn {
    width: 30px;
    height: 30px;
    border: none;
    background-color: #333;
    color: white;
    cursor: pointer;
}

.progress-bar {
    flex: 1;
    height: 5px;
    background-color: #ddd;
    position: relative;
}

.progress {
    height: 100%;
    background-color: #333;
    width: 30%;
}

.time {
    font-size: 0.9rem;
    color: #666;
}

/* Dice Overlay Content */
.dice-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-top: 20px;
}

.dice-item {
    text-align: center;
}

.dice-thumbnail {
    width: 100%;
    aspect-ratio: 1;
    background-color: #aaa;
    margin-bottom: 10px;
}

/* Media Overlays */
.media-overlay .overlay-content {
    max-width: 900px;
}

.video-embed {
    width: 100%;
    aspect-ratio: 16/9;
    background-color: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #ddd;
    margin-bottom: 20px;
}

.audio-list {
    max-width: 600px;
    margin: 0 auto;
}

.audio-item {
    border: 1px solid #ddd;
    border-radius: 5px;
    padding: 20px;
    margin-bottom: 15px;
}

.audio-item h3 {
    margin-bottom: 5px;
}

.audio-item .metadata {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 10px;
}

.audio-item .transcript-link {
    display: block;
    margin-top: 10px;
    color: #333;
    text-decoration: none;
}

/* Audio Player Enhancements */
.audio-item {
    background-color: #fff;
}

.audio-item h3 {
    color: #333;
    margin-bottom: 10px;
    font-size: 1.5rem;
}

.audio-item .metadata {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.audio-item .description {
    color: #555;
    line-height: 1.6;
    margin: 15px 0;
    padding: 15px;
    background-color: #f9f9f9;
    border-left: 3px solid #007bff;
    border-radius: 3px;
}

.audio-player-container {
    margin: 20px 0;
    padding: 15px;
    background-color: #f5f5f5;
    border-radius: 8px;
}

.audio-player-container audio {
    width: 100%;
    outline: none;
}

.audio-player-container audio::-webkit-media-controls-panel {
    background-color: #fff;
}

.media-description {
    margin-top: 20px;
    padding: 15px;
    background-color: #f9f9f9;
    border-radius: 5px;
}

.media-description h4 {
    margin: 0 0 10px 0;
    color: #333;
    font-size: 1.1rem;
}

.media-description p {
    color: #555;
    line-height: 1.6;
    margin: 0;
}

.audio-list {
    max-width: 100%;
}

.audio-list .audio-item {
    margin-bottom: 15px;
}

.audio-list .audio-item:last-child {
    margin-bottom: 0;
}

/* Scrollbar for overlay content */
.overlay-content::-webkit-scrollbar {
    width: 8px;
}

.overlay-content::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.overlay-content::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

/* 3D Dice Overlay Styles */
#dice-overlay .overlay-content {
    max-width: 90%;
    width: 1200px;
    height: 80vh;
    display: flex;
    flex-direction: column;
    padding: 20px;
}

#dice-overlay h2 {
    margin-bottom: 10px;
    text-align: center;
}

.dice-instructions {
    text-align: center;
    color: #666;
    margin-bottom: 20px;
    font-size: 1.1rem;
}

/* Side-by-side layout: canvas left, info right */
.dice-layout {
    display: flex;
    flex-direction: row;
    gap: 20px;
    flex: 1;
    min-height: 0;
}

#dice-canvas {
    flex: 1;
    min-width: 0;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    background: #f0f0f0;
}

/* Dice About Section */
.dice-about {
    width: 320px;
    flex-shrink: 0;
    border: 1px solid #ddd;
    border-radius: 8px;
    align-self: stretch;
}

.dice-about summary {
    padding: 12px 20px;
    background: #f5f5f5;
    cursor: pointer;
    font-family: 'TAPSans', sans-serif;
    font-size: 1.1rem;
    color: #333;
    list-style: none;
    display: flex;
    align-items: center;
    gap: 8px;
}

.dice-about summary::-webkit-details-marker {
    display: none;
}

.dice-about summary::before {
    content: '▸';
    transition: transform 0.2s ease;
}

.dice-about[open] summary::before {
    transform: rotate(90deg);
}

.dice-about-content {
    padding: 20px;
    max-height: calc(80vh - 160px);
    overflow-y: auto;
}

.dice-about-content p {
    margin-bottom: 12px;
    line-height: 1.6;
    color: #444;
}

.dice-about-content h4 {
    margin: 20px 0 10px;
    color: #333;
}

/* Mobile Dice Overlay */
@media (max-width: 768px) {
    #dice-overlay .overlay-content {
        width: 95%;
        max-width: 95%;
        height: 90vh;
        padding: 15px;
        margin: 5vh auto;
    }

    #dice-overlay h2 {
        font-size: 1.5rem;
        margin-bottom: 8px;
    }

    .dice-instructions {
        font-size: 0.95rem;
        margin-bottom: 15px;
    }

    .dice-layout {
        flex-direction: column;
    }

    #dice-canvas {
        min-height: 250px;
        border-radius: 8px;
    }

    .dice-about {
        width: 100%;
    }
}

@media (max-width: 480px) {
    #dice-overlay .overlay-content {
        width: 100%;
        max-width: 100%;
        height: 100vh;
        padding: 10px;
        margin: 0;
        border-radius: 0;
    }

    #dice-overlay h2 {
        font-size: 1.3rem;
    }

    .dice-instructions {
        font-size: 0.85rem;
        margin-bottom: 10px;
    }

    #dice-canvas {
        min-height: 200px;
    }

    /* Film Overlay Small Phones */
    #film-overlay .overlay-content {
        padding: 45px 5px 15px;
    }

    #film-overlay h2 {
        font-size: 1.2rem;
    }

    /* Audio Overlay Small Phones */
    #audio-overlay .overlay-content {
        padding: 45px 10px 15px;
    }

    #audio-overlay h2 {
        font-size: 1.2rem;
    }

    .audio-item {
        padding: 12px;
        margin-bottom: 12px;
    }

    .audio-item h3 {
        font-size: 1rem;
    }

    .audio-item .metadata {
        font-size: 0.8rem;
    }

    /* About Overlay Small Phones */
    #about-overlay .overlay-content {
        padding: 45px 15px 15px;
    }

    #about-overlay h2 {
        font-size: 1.3rem;
    }

    .about-text {
        font-size: 0.9rem;
    }
}

/* Gallery Page Styles */
.gallery-content {
    background-color: #F6F5F0;
    min-height: calc(100vh - 200px);
}

.gallery-header {
    text-align: center;
    padding: 60px 20px 40px;
    max-width: 800px;
    margin: 0 auto;
}

.gallery-header h1 {
    margin-bottom: 15px;
    font-size: 2.5rem;
}

.gallery-intro {
    font-size: 1.1rem;
    color: #666;
}

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

.gallery-item {
    position: relative;
    aspect-ratio: 1;
    overflow: hidden;
    cursor: pointer;
    background-color: #f0f0f0;
    transition: transform 0.3s ease;
}

.gallery-item:hover {
    transform: scale(1.02);
    z-index: 10;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: opacity 0.3s ease;
}

.gallery-item:hover img {
    opacity: 0.9;
}

.gallery-item-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
    color: white;
    padding: 20px;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.gallery-item:hover .gallery-item-overlay {
    transform: translateY(0);
}

.gallery-item-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 5px;
}

.gallery-item-caption {
    font-size: 0.9rem;
    opacity: 0.9;
}

.gallery-loading {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    font-size: 1.2rem;
    color: #666;
}

/* Gallery Overlay */
#gallery-overlay {
    z-index: 2000;
}

.gallery-overlay-content {
    background-color: white;
    width: 95%;
    max-width: 1400px;
    max-height: 95vh;
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.gallery-overlay-inner {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 0;
    height: 100%;
    overflow: hidden;
}

.gallery-image-container {
    background-color: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    max-height: 95vh;
}

.gallery-image-container img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.gallery-info {
    padding: 40px;
    overflow-y: auto;
    background-color: #F6F5F0;
}

.gallery-info h2 {
    margin-bottom: 15px;
    font-size: 1.8rem;
}

.overlay-caption {
    font-size: 1.1rem;
    color: #555;
    margin-bottom: 20px;
    font-style: italic;
}

.overlay-description {
    line-height: 1.8;
    margin-bottom: 25px;
    color: #333;
}

.overlay-meta {
    padding-top: 20px;
    border-top: 1px solid #ddd;
    font-size: 0.9rem;
    color: #666;
}

.overlay-meta p {
    margin-bottom: 8px;
}

.overlay-meta strong {
    color: #333;
}

/* Responsive Design */
@media (max-width: 768px) {
    /* Header mobile layout */
    .site-header .container {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: space-between;
        align-items: center;
    }

    .hamburger-btn {
        display: flex;
        order: 2;
    }

    .logo {
        order: 1;
    }

    .search-box {
        display: none;
    }

    /* Mobile nav overlay */
    .main-nav {
        display: none !important;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100vw;
        height: 100vh;
        background-color: #F6F5F0;
        z-index: 9999;
        flex-direction: column;
        justify-content: center;
        align-items: center;
    }

    .main-nav.active {
        display: flex !important;
    }

    .main-nav ul {
        flex-direction: column;
        align-items: center;
        gap: 30px;
        padding: 0;
        margin: 0;
        list-style: none;
    }

    .main-nav a {
        font-size: 1.5rem;
        color: #333;
        text-decoration: none;
    }

    .nav-close-btn {
        display: block;
        position: absolute;
        top: 20px;
        right: 20px;
        font-size: 2.5rem;
        background: none;
        border: none;
        cursor: pointer;
        color: #333;
        z-index: 10000;
    }

    .communities {
        grid-template-columns: 1fr;
    }

    .submit-section {
        grid-template-columns: 1fr;
    }

    .form-container {
        grid-template-columns: 1fr;
    }

    .archive-layout {
        grid-template-columns: 1fr;
    }

    .dice-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .site-footer .container {
        grid-template-columns: 1fr;
    }

    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }

    .gallery-overlay-inner {
        grid-template-columns: 1fr;
    }

    .gallery-info {
        padding: 20px;
    }

    .gallery-header h1 {
        font-size: 2rem;
    }

    .form-right {
        display: none;
    }

    /* Overlay mobile fixes */
    .overlay {
        padding: 0;
    }

    .overlay.active {
        align-items: flex-start;
    }

    .overlay .overlay-content {
        width: 100vw;
        max-width: 100vw;
        min-height: 100vh;
        padding: 50px 20px 20px 20px;
        margin: 0;
        border-radius: 0;
        overflow-x: hidden;
    }

    .submission-form.overlay-content,
    .submission-form .overlay-content {
        width: 100vw;
        max-width: 100vw;
    }

    .overlay .close-btn {
        position: fixed;
        top: 10px;
        right: 15px;
        z-index: 1001;
    }

    /* Film Overlay Mobile */
    #film-overlay .overlay-content {
        padding: 50px 10px 20px;
    }

    #film-overlay .video-embed {
        width: 100%;
        aspect-ratio: 16/9;
    }

    #film-overlay .video-embed iframe {
        width: 100%;
        height: 100%;
    }

    /* Audio Overlay Mobile */
    #audio-overlay .overlay-content {
        padding: 50px 15px 20px;
    }

    #audio-overlay h2 {
        font-size: 1.4rem;
        margin-bottom: 15px;
    }

    .audio-list {
        max-height: calc(100vh - 120px);
        overflow-y: auto;
    }

    .audio-item {
        padding: 15px;
        margin-bottom: 15px;
    }

    .audio-item h3 {
        font-size: 1.1rem;
    }

    .audio-item .metadata {
        font-size: 0.85rem;
    }

    .audio-item audio {
        width: 100%;
    }

    /* About Overlay Mobile */
    #about-overlay .overlay-content {
        padding: 50px 20px 20px;
    }

    #about-overlay h2 {
        font-size: 1.5rem;
        margin-bottom: 20px;
    }

    .about-text {
        font-size: 0.95rem;
        line-height: 1.7;
    }

    .about-text p {
        margin-bottom: 15px;
    }
}
