/* --- Font Family --- */
@font-face {
    font-family: 'Archivo';
    src: url('assets/Archivo-VariableFont_wdth,wght.woff2') format('woff2');
    font-weight: 100 900;
    font-stretch: 75% 125%;
    font-display: swap;
    font-style: normal;
}

/* --- CSS Variables (for easy theme changes) --- */
:root {
    --bg-image: url('images/background.jpg');
    --card-bg: rgba(255, 255, 255, 0.95);
    --text-color: #333;
    --primary-color: #bd002f;
    --primary-accent: #ff6f61;
    --border-color: #e0e0e0;
    --shadow-color: rgba(0, 0, 0, 0.1);
    --border-radius: 6px;
    --font-family: 'Archivo', 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

/* --- Global & Body Styles --- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-family);
    font-stretch: 125%;
    background-image: var(--bg-image);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    color: var(--text-color);
    padding: 0;
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    line-height: 1.3;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: -1;
}

/* Background image container - will be used on mobile */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: var(--bg-image);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: -2;
    display: none; /* Hidden by default, shown on mobile */
}

.lazy-media {
    filter: blur(4px);
    opacity: 0.85;
    transition: filter 0.35s ease, opacity 0.35s ease;
    will-change: filter, opacity;
}

.lazy-media.lazy-media--loaded {
    filter: blur(0);
    opacity: 1;
}
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}

/* Typography System */
h1, h2, h3, h4, h5, h6 {
    line-height: 1.2;
    margin-bottom: 0.5rem;
}

p {
    line-height: 1.5;
    margin-bottom: 1rem;
}

/* Specific text elements */
.homepage-intro,
.homepage-intro p,
.about-text p,
.item-detail-content,
.item-detail-content p {
    line-height: 1.5;
}

.item-detail-header h1 {
    line-height: 1.2;
}

.item-detail-header p {
    line-height: 1.4;
}

/* --- Site Header (Outside Card) --- */
#site-header {
    padding: 1.5rem 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    min-height: 80px;
    gap: 0.5rem;
}

#site-logo-container {
    text-align: center;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 80px;
}

#site-navigation {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    align-items: center;
    width: 100%;
    flex-wrap: wrap;
    position: relative;
}

#site-navigation a {
    color: white;
    text-decoration: none;
    transition: transform 0.2s, opacity 0.2s;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.7);
    text-transform: uppercase;
}

#site-navigation img {
    width: 80px;
    height: 80px;
    filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.5));
}

/* Navigation logo styling */
#site-navigation a.nav-logo img {
    width: 72px;
    height: 72px;
    filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.5));
}

/* Portfolio dropdown wrapper */
.nav-portfolio-wrapper {
    position: relative;
    display: inline-block;
}

/* Portfolio dropdown button */
.nav-portfolio-btn {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    display: inline-block;
}

.nav-portfolio-btn img {
    width: 80px;
    height: 80px;
    filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.5));
    transition: transform 0.2s, opacity 0.2s;
}

/* Portfolio dropdown menu */
.portfolio-dropdown {
    position: absolute;
    top: calc(100% + 1rem);
    left: 50%;
    background: rgba(0, 0, 0, 0.9);
    border-radius: var(--border-radius);
    padding: 0.75rem 0;
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
    transform: translateX(-50%) translateY(-10px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    z-index: 1000;
    overflow: hidden;
}

/* Mobile dropdown backdrop - hidden on desktop */
.portfolio-dropdown-backdrop {
    display: none;
}

.portfolio-dropdown.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateX(-50%) translateY(0);
}

.portfolio-dropdown-item {
    display: block;
    color: white;
    text-decoration: none;
    text-align: center;
    padding: 0.75rem 1.5rem;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: background-color 0.2s ease;
    margin: 0;
}

.portfolio-dropdown-item:first-child {
    border-top-left-radius: var(--border-radius);
    border-top-right-radius: var(--border-radius);
}

.portfolio-dropdown-item:last-child {
    border-bottom-left-radius: var(--border-radius);
    border-bottom-right-radius: var(--border-radius);
}

.portfolio-dropdown-separator {
    height: 1px;
    background: rgba(255, 255, 255, 0.3);
    margin: 0.5rem 0;
}

.portfolio-dropdown-random {
    display: flex;
    align-items: center;
    justify-content: center;
    width: auto;
    min-width: 44px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-family: var(--font-family);
    padding: 0.75rem 1rem;
    margin: 0.5rem auto;
    transition: background-color 0.2s, transform 0.2s;
}

.portfolio-dropdown-random .material-symbols-outlined {
    font-size: 1.2rem;
    color: white;
}

.portfolio-dropdown-random:hover {
    background-color: #d9003d;
    transform: scale(1.05);
}

/* Material Icons styling */
.material-symbols-outlined {
    font-family: 'Material Symbols Outlined' !important;
    font-weight: normal;
    font-style: normal;
    font-size: 24px;
    line-height: 1;
    letter-spacing: normal;
    text-transform: none;
    display: inline-block;
    white-space: nowrap;
    word-wrap: normal;
    direction: ltr;
    -webkit-font-feature-settings: 'liga';
    font-feature-settings: 'liga';
    -webkit-font-smoothing: antialiased;
    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
    -moz-font-feature-settings: 'liga';
    -moz-osx-font-smoothing: grayscale;
}

/* Random button styling */
.btn-random {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-random .material-symbols-outlined {
    font-size: 1.2rem;
    font-family: 'Material Symbols Outlined' !important;
    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}

/* Homepage title inside content card */
.homepage-title {
    text-align: center;
    font-size: 1rem;
    font-weight: bold;
    margin-bottom: 1.5rem;
    color: var(--text-color);
    text-transform: uppercase;
    letter-spacing: 2px;
}

/* Homepage nav inside content card */
.homepage-nav {
    display: flex;
    justify-content: center;
    gap: 2rem;
    padding: 0.5rem 0 0 0;
}

.homepage-nav a {
    color: var(--text-color);
    text-decoration: none;
    transition: transform 0.2s, opacity 0.2s;
    text-transform: uppercase;
}

.homepage-nav img {
    width: 80px;
    height: 80px;
}

/* --- Page Title Container (Outside Card) --- */
#page-title-container {
    padding: 0 2rem 1rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

#page-title-container h1,
#page-title-container h2 {
    color: white;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.7);
    text-align: center;
    margin: 0;
}

#page-title-container h1 {
    font-size: 1rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 2px;
}

#page-title-container h2 {
    font-size: 2rem;
    font-weight: 400;
}

/* --- Main Layout Card --- */
#page-container {
    background: radial-gradient(circle, rgba(255, 255, 255, 0.9) 0%, rgba(255, 255, 255, 0.8) 100%);
    backdrop-filter: blur(10px);
    border-radius: var(--border-radius);
    box-shadow: 0 8px 32px 0 var(--shadow-color);
    width: calc(100% - 4rem);
    max-width: 1200px;
    margin: 0 auto 2rem auto;
    padding: 2rem 3rem;
    border: 1px solid rgba(255, 255, 255, 0.18);
    display: flex;
    flex-direction: column;
}

main#app {
    flex-grow: 1;
    padding: 1.5rem 0;
}

footer#page-footer {
    text-align: center;
    padding-top: 1rem;
    font-size: 0.8rem;
    color: #888;
    border-top: 1px solid var(--border-color);
}

/* --- Reusable Design Blocks / Components --- */
.site-logo {
    text-align: center;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
}
.site-logo a {
    display: inline-block;
    line-height: 0;
}
.site-logo img {
    max-width: 200px;
    min-width: 60px;
    min-height: 60px;
    width: auto;
    height: auto;
    display: block;
    cursor: pointer;
    /* SVG specific styling - ensure SVGs without dimensions still display */
    object-fit: contain;
    /* SVG specific styling */
    fill: currentColor;
    transition: transform 0.2s ease, opacity 0.2s ease;
    filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.5));
}

/* Homepage logo - larger size */
.homepage .site-logo img {
    max-width: 200px;
    min-width: 200px;
}


/* Portal Grid */
.portal-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}
.portal-item {
    aspect-ratio: 1 / 1;
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: white;
    font-size: 1.2rem;
    font-weight: 600;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.7);
    transition: transform 0.18s ease, box-shadow 0.3s ease;
    text-transform: uppercase;
    position: relative;
    overflow: hidden;
    background: none;
}

.portal-item::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: var(--portal-bg);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border-radius: inherit;
    z-index: 0;
    transition: filter 0.3s ease;
}

.portal-item::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.4) 0%, rgba(0, 0, 0, 0.8) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1;
}

.portal-item span {
    position: relative;
    z-index: 2;
}

/* Coming Soon Portal Items */
.portal-item--coming-soon {
    cursor: not-allowed;
    pointer-events: none;
    opacity: 0.6;
}

.portal-item--coming-soon::before {
    filter: brightness(0.5);
}

.portal-item--coming-soon::after {
    opacity: 0.6;
}

.coming-soon-banner {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 3;
    pointer-events: none;
}

.coming-soon-banner::before {
    content: 'Coming Soon';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 141.42%;
    height: 50px;
    background: var(--text-color);
    color: white;
    font-weight: 700;
    font-size: 1.4rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    transform: translate(-50%, -50%) rotate(-45deg);
    transform-origin: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}
/* Gallery Controls */
.gallery-controls {
    margin-bottom: 2rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius);
    backdrop-filter: blur(5px);
}

.filter-group {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: space-between;
}

.filter-select,
.filter-input {
    padding: 8px 36px 8px 6px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: white;
    font-size: 0.9rem;
    min-width: 150px;
}

.filter-select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    width: 100%;
}

.filter-select:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(0, 122, 255, 0.25);
    border-color: var(--primary-color);
}

.select-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
    width: auto;
}

.select-wrapper::after {
    content: '';
    position: absolute;
    pointer-events: none;
    right: 14px;
    top: 50%;
    width: 8px;
    height: 8px;
    border-right: 2px solid #333;
    border-bottom: 2px solid #333;
    transform: translateY(-60%) rotate(45deg);
}

.metaformatter {
    background-image: none;
    background-color: #1c1c1e;
    color: var(--text-color);
    padding-bottom: 3rem;
}

.metaformatter .metaformatter-header {
    max-width: 1200px;
    margin: 2rem auto 1rem;
}

.metaformatter-nav {
    color: white;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.metaformatter-title {
    text-align: center;
    color: white;
}

.metaformatter-title h1 {
    font-size: 1.4rem;
    margin-bottom: 0.5rem;
}

.metaformatter-title p {
    margin: 0 auto;
    max-width: 640px;
    line-height: 1.5;
}

.metaformatter-container {
    margin-top: 1rem;
}

.formatter-section {
    margin-bottom: 2rem;
}

.formatter-section h2 {
    font-size: 1.1rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 1rem;
    text-align: left;
}

.input-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
}

.input-grid.single-column {
    grid-template-columns: 1fr;
}

.field-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.field-group label {
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.75rem;
}

.field-group input[type="text"],
.field-group input[type="number"],
.field-group input[type="date"],
.field-group input[type="search"],
.field-group textarea,
.field-group select,
.inline-input input {
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 10px;
    font-size: 0.9rem;
    font-family: var(--font-family);
    background: white;
}

.field-group textarea {
    resize: vertical;
}

.field-group input[type="file"] {
    font-size: 0.9rem;
}

.checkbox-group {
    flex-direction: row;
    align-items: center;
    gap: 0.75rem;
}

.checkbox-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
}

.field-hint {
    font-size: 0.75rem;
    color: #666;
}

.preview-panel {
    margin-top: 1.5rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    align-items: start;
}

.image-preview {
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    min-height: 220px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    text-align: center;
    color: #555;
}

.preview-image {
    max-width: 100%;
    max-height: 320px;
    border-radius: calc(var(--border-radius) / 2);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.metadata-summary {
    list-style: none;
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 1rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.metadata-summary li strong {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #444;
}

.keyword-controls {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.blog-content-tools {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.blog-content-tools .btn {
    margin-top: 0;
}

.blog-creator .metadata-summary {
    align-self: stretch;
}

.blog-creator .metadata-summary li {
    list-style: none;
}

.blog-creator .metadata-summary strong {
    display: inline-block;
    min-width: 100px;
}

.existing-artwork-grid {
    grid-template-columns: 2fr 1fr;
}

.existing-artwork-grid .load-btn-group {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: 0.5rem;
}

.existing-artwork-grid .field-hint {
    margin: 0;
}

.inline-input {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.tag-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tag-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.35rem 0.85rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid var(--border-color);
    font-size: 0.85rem;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.tag-button.active {
    border-color: var(--primary-color);
    background: rgba(0, 122, 255, 0.2);
    color: #004a99;
    font-weight: 600;
}

.keyword-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 0.75rem;
}

.keyword-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid var(--border-color);
    border-radius: 999px;
    padding: 0.35rem 0.75rem;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.keyword-chip input {
    width: 16px;
    height: 16px;
}

.gallery-footer {
    margin-top: 2rem;
    text-align: center;
}

.gallery-tools-hidden .gallery-controls,
.gallery-tools-hidden .gallery-footer,
.gallery-tools-hidden .item-detail-content[data-toggle-section],
.gallery-tools-hidden .artwork-keywords[data-toggle-section],
.gallery-tools-hidden .article-keywords[data-toggle-section] {
    display: none;
}

.music-gallery {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    padding: 1rem 0 2rem;
}

.soundcloud-embed {
    width: 100%;
    max-width: 820px;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0 1rem;
}

.soundcloud-embed iframe {
    width: 100%;
    border-radius: var(--border-radius);
}

.soundcloud-embed-caption {
    font-size: 10px;
    color: #cccccc;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    display: flex;
    gap: 0.25rem;
    align-items: center;
    font-family: 'Interstate', 'Lucida Grande', 'Lucida Sans Unicode', 'Lucida Sans', Garuda, Verdana, Tahoma, sans-serif;
    font-weight: 100;
}

.soundcloud-embed-caption a {
    color: #cccccc;
    text-decoration: none;
}

.selected-keywords {
    margin-top: 1rem;
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 1rem;
}

.selected-keywords h3 {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.75rem;
}

.code-block {
    background: #111;
    color: #f5f5f5;
    border-radius: 6px;
    border: 1px solid #333;
    font-family: SFMono-Regular, Consolas, 'Liberation Mono', Menlo, Courier, monospace;
    padding: 1rem;
    width: 100%;
    resize: vertical;
}

.output-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.status-message {
    font-size: 0.8rem;
    color: #666;
    margin-bottom: 1rem;
}

.status-message.success {
    color: #0a9d5b;
}

.status-message.error {
    color: #c0392b;
}

@media (max-width: 768px) {
    .metaformatter-title h1 {
        font-size: 1.1rem;
    }

    .keyword-grid {
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    }
}

.filter-input {
    flex: 1;
    min-width: 200px;
}

/* Random button now uses .btn.btn-sm class */

/* Image Masonry Grid */
.masonry-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    grid-auto-rows: 150px;
    grid-auto-flow: dense;
    gap: 1rem;
}

.masonry-item {
    position: relative;
    overflow: hidden;
    border-radius: calc(var(--border-radius) / 2);
    transition: transform 0.18s ease, box-shadow 0.3s ease;
}

.masonry-item a {
    display: block;
    width: 100%;
    height: 100%;
    position: relative;
}

.masonry-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: pointer;
    transition: opacity 0.3s, filter 0.3s;
}

.artwork-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.4) 0%, rgba(0, 0, 0, 0.8) 100%);
    color: white;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    gap: 0.5rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.artwork-overlay h3 {
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
    font-weight: 600;
}

.artwork-overlay-meta {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    align-items: center;
    font-size: 0.8rem;
    opacity: 0.9;
    text-transform: uppercase;
}

.artwork-overlay-meta span {
    display: block;
}

.masonry-item.wide { grid-column: span 2; }
.masonry-item.tall { grid-row: span 2; }

/* Image Fallback Styles */
.image-fallback {
    background-color: #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-size: 0.9rem;
    border-radius: calc(var(--border-radius) / 2);
    position: relative;
}

.image-fallback::before {
    content: "📷";
    font-size: 2rem;
    opacity: 0.5;
}

.image-fallback::after {
    content: "Image not found";
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.8rem;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    white-space: nowrap;
}

/* News Grid */
.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}
.news-card {
    background: #f9f9f9;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    overflow: hidden;
    text-decoration: none;
    color: var(--text-color);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.news-card img {
    width: 100%;
    height: 180px;
    object-fit: cover;
}

/* News card fallback */
.news-card .image-fallback {
    height: 180px;
}
.news-card-content {
    padding: 1rem;
}
.news-card h3 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}
.news-card p {
    font-size: 0.9rem;
    color: #666;
}

.news-date {
    font-size: 0.8rem;
    color: #888;
    margin-bottom: 0.5rem;
}

.news-keywords {
    margin-top: 0.5rem;
}

.news-keyword-tag {
    background: none;
    color: var(--text-color);
    padding: 0.2rem 0.5rem;
    border: 1px solid var(--text-color);
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 500;
    margin-right: 0.25rem;
    margin-bottom: 0.25rem;
    display: inline-block;
}

/* --- Page Specific Styles --- */
.homepage-intro {
    text-align: center;
    max-width: 600px;
    margin: 1rem auto;
}

.homepage-random-btn-container {
    text-align: center;
    margin: 2rem auto;
    max-width: 600px;
}

.about-layout {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
}
.about-photo {
    flex-basis: 35%;
}
.about-photo img {
    width: 100%;
    border-radius: var(--border-radius);
}

/* About photo fallback */
.about-photo .image-fallback {
    aspect-ratio: 1;
    min-height: 200px;
}
.about-text {
    flex-basis: 65%;
}
.about-text h1 {
    font-size: 1rem;
    margin-bottom: 0;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 2px;
}
.about-text h2 {
    font-size: 1.2rem;
    font-weight: 300;
    color: #555;
    margin-bottom: 1.5rem;
}

.about-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.about-actions .btn {
    margin-top: 0;
}

.about-social {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.social-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    text-decoration: none;
    color: white;
    font-weight: 700;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background-color: #333;
    transition: transform 0.2s ease, opacity 0.2s ease;
    border: none;
    padding: 0;
    cursor: pointer;
}

.social-link img {
    width: 24px;
    height: 24px;
    display: block;
}

.social-email {
    background-image: linear-gradient(135deg, #6fb8ff 0%, #003c99 100%);
}

.social-instagram {
    background-image: linear-gradient(45deg, #f77737, #d62976);
}

.social-youtube {
    background-color: #ff0000;
}

.social-soundcloud {
    background-color: #ff5500;
}

/* Item Detail Pages */
.item-detail-header h1 { 
    font-size: 1rem; 
    margin-bottom: 0.5rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-align: center;
}

.artwork-meta,
.article-meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.05);
    border-radius: var(--border-radius);
}

.artwork-meta p,
.article-meta p {
    margin: 0;
    color: #666;
    font-size: 0.9rem;
}

.artwork-meta strong,
.article-meta strong {
    color: #333;
    font-weight: 600;
}

/* New artwork metadata format */
.meta-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.meta-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: #333;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    line-height: 1.2;
}

.meta-value {
    font-size: 0.9rem;
    color: #666;
    line-height: 1.4;
    margin-top: 0.25rem;
}

.item-detail-image { 
    margin: 1rem 0; 
    text-align: center;
}

.item-detail-image img { 
    max-width: 100%; 
    max-height: 100vh;
    object-fit: contain;
    border-radius: calc(var(--border-radius) / 2);
    box-shadow: 0 4px 12px var(--shadow-color);
}

/* Item detail image fallback */
.item-detail-image .image-fallback {
    min-height: 300px;
    max-width: 100%;
}

.item-detail-content {  
    margin: 1rem auto; 
    line-height: 1.6;
    padding: 1rem;
}

/* Artwork Keywords */
.artwork-keywords,
.article-keywords {
    margin: 0 0 2rem 0;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.05);
    border-radius: var(--border-radius);
}

.artwork-keywords h3,
.article-keywords h3 {
    font-size: 1rem;
    margin-bottom: 0.75rem;
    color: #333;
    font-weight: 600;
}

.keyword-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.keyword-tag {
    background: none;
    color: var(--text-color);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    border: 1px solid var(--text-color);
    font-size: 0.8rem;
    font-weight: 500;
    transition: background-color 0.2s;
}

/* --- Buttons --- */
.btn {
    display: inline-block;
    background-color: var(--primary-color);
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 4px;
    text-decoration: none;
    font-family: var(--font-family);
    font-weight: 600;
    font-size: 0.9rem;
    font-stretch: 125%;
    line-height: 1.2;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.2s;
    margin-top: 1rem;
}

/* Secondary button variant */
.btn.btn-secondary {
    background-color: #6c757d;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 12px 18px;
}
.btn.btn-secondary img {
    width: 20px;
    height: 20px;
    display: block;
    pointer-events: none;
}

/* Small button variant */
.btn.btn-sm {
    padding: 8px 16px;
    font-size: 0.8rem;
    font-family: var(--font-family);
    font-stretch: 125%;
    margin-top: 0;
}

/* Large button variant */
.btn.btn-lg {
    padding: 16px 32px;
    font-size: 1.1rem;
    font-family: var(--font-family);
    font-stretch: 125%;
}

/* Button without margin for inline use */
.btn.btn-inline {
    margin-top: 0;
}
.btn.share-btn {
    background-image: linear-gradient(135deg, var(--primary-color), var(--primary-accent));
    background-size: 200% 200%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 12px 18px;
    border: none;
    position: relative;
    overflow: hidden;
    transition: background-position 0.3s ease, transform 0.2s ease, box-shadow 0.2s ease;
}
.btn.share-btn img {
    width: 20px;
    height: 20px;
    pointer-events: none;
}
.btn.share-btn::before,
.btn.share-btn::after {
    opacity: 0;
    pointer-events: none;
    position: absolute;
    transition: opacity 0.2s ease, transform 0.2s ease;
}
.btn.share-btn::after {
    content: 'Copied!';
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translate(-50%, 8px);
    background: rgba(0, 0, 0, 0.85);
    color: #fff;
    padding: 0.25rem 0.6rem;
    border-radius: 999px;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    white-space: nowrap;
    z-index: 2;
}
.btn.share-btn::before {
    content: '';
    bottom: 100%;
    left: 50%;
    transform: translate(-50%, 6px);
    border: 6px solid transparent;
    border-top-color: rgba(0, 0, 0, 0.85);
    z-index: 1;
}
.btn.share-btn.share-btn--copied::after {
    opacity: 1;
    transform: translate(-50%, 0);
}
.btn.share-btn.share-btn--copied::before {
    opacity: 1;
    transform: translate(-50%, -2px);
}
.btn.share-btn.share-btn--copied {
    box-shadow: 0 12px 24px rgba(189, 0, 47, 0.25);
}

/* Button groups for better spacing */
.btn-group {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    width: 100%;
    justify-content: center;
}

.btn-group .btn {
    margin-top: 0;
}

/* Ensure all button elements use consistent typography */
button.btn,
a.btn,
input[type="button"].btn,
input[type="submit"].btn {
    font-family: var(--font-family) !important;
    font-weight: 600 !important;
    font-size: 0.9rem !important;
    font-stretch: 125% !important;
    line-height: 1.2 !important;
    text-transform: none !important;
    letter-spacing: normal !important;
}

/* Override any inherited styles that might affect button typography */
.btn * {
    font-family: inherit !important;
    font-weight: inherit !important;
    font-size: inherit !important;
    font-stretch: inherit !important;
}

/* Ensure Material Symbols icons in buttons use the correct font */
.btn .material-symbols-outlined,
.btn-random .material-symbols-outlined {
    font-family: 'Material Symbols Outlined' !important;
    font-weight: normal !important;
    font-style: normal !important;
    font-stretch: normal !important;
}

.action-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
    align-items: center;
    margin-top: 2rem;
    border-radius: var(--border-radius);
}

/* Back button now uses .btn.btn-secondary class */

/* --- Contact Modal --- */
#contact-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
}
#contact-modal {
    background: white;
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: 0 8px 32px 0 var(--shadow-color);
    position: relative;
    width: 90%;
    max-width: 400px;
}
#close-modal-btn {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: #888;
}
.hidden {
    opacity: 0;
    pointer-events: none;
}

#contact-modal-backdrop:not(.hidden) {
    opacity: 1;
    pointer-events: auto;
}
.captcha-container, .contact-info { text-align: center; }
.captcha-code {
    background: #eee;
    padding: 1rem;
    font-size: 2rem;
    letter-spacing: 0.5rem;
    border-radius: 2px;
    margin: 1rem 0;
    font-family: monospace;
}
.captcha-container input {
    width: 100%;
    padding: 12px;
    font-size: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 2px;
    text-align: center;
    margin-bottom: 1rem;
}
.captcha-error {
    color: red;
    font-size: 0.9rem;
    min-height: 1.2rem;
}
.contact-info a {
    margin: 0 0.5rem;
}
.contact-info img { width: 32px; }

/* --- Responsive Design --- */
@media (max-width: 768px) {
    #site-header {
        padding: 1rem;
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    #site-logo-container {
        flex: none;
    }
    
    #page-title-container {
        padding: 0 1rem 1rem 1rem;
    }
    
    #page-title-container h1 {
        font-size: 2rem;
    }
    
    #page-container { 
        padding: 1.5rem; 
        margin: 0 1rem 1rem 1rem;
        width: calc(100% - 2rem);
    }
    
    .about-layout { 
        flex-direction: column; 
    }
    
    .homepage-nav {
        flex-wrap: wrap;
        gap: 1rem;
        padding: 1rem 0 0 0;
    }
    
    #site-navigation {
        flex-wrap: wrap;
        gap: 1rem;
    }
    
    #site-navigation a.nav-logo img {
        width: 72px;
        height: 72px;
    }
    
    #site-navigation img {
        width: 60px;
        height: 60px;
    }

    /* Portfolio dropdown mobile fixes */
    .nav-portfolio-wrapper {
        position: relative;
    }

    /* Mobile dropdown backdrop - shown on mobile */
    .portfolio-dropdown-backdrop {
        display: block;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        z-index: 1999;
        transition: opacity 0.3s ease, visibility 0.3s ease;
    }

    .portfolio-dropdown-backdrop.active {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }

    .portfolio-dropdown {
        position: fixed;
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        transform: translateY(100%);
        width: 100%;
        max-width: 100%;
        min-width: auto;
        border-radius: 0;
        border-top-left-radius: 12px;
        border-top-right-radius: 12px;
        margin: 0;
        z-index: 2000;
        transition: transform 0.3s ease, opacity 0.3s ease, visibility 0.3s ease;
        max-height: 80vh;
        overflow-y: auto;
    }

    .portfolio-dropdown.active {
        transform: translateY(0);
    }

    .about-actions,
    .about-social {
        justify-content: center;
    }

    /* On mobile, use fixed pseudo-element for background image instead of background-attachment */
    body {
        background-image: none; /* Remove background from body on mobile */
    }

    /* Show the fixed background image container on mobile */
    body::after {
        display: block;
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        z-index: -2;
    }

    /* Keep overlay fixed on mobile */
    body::before {
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        z-index: -1;
    }
}

#image-zoom-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.25s ease, visibility 0s linear 0.25s;
    z-index: 1200;
}

#image-zoom-overlay.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition: opacity 0.25s ease;
}

.image-zoom-content {
    position: relative;
    width: min(92vw, 1280px);
    height: min(92vh, 92vh);
    background: rgba(20, 20, 20, 0.65);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-zoom-content img {
    max-width: none;
    max-height: none;
    user-select: none;
    pointer-events: auto;
    transition: transform 0s;
}

#image-zoom-overlay.active .image-zoom-content img {
    cursor: grab;
}

.image-zoom-content img.grabbing {
    cursor: grabbing;
}

.close-zoom-btn {
    position: absolute;
    top: 14px;
    right: 14px;
    background: rgba(0, 0, 0, 0.55);
    color: white;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, transform 0.2s ease;
}

body.image-zoom-open,
body.portfolio-dropdown-open {
    overflow: hidden;
}

@media (hover: hover) and (pointer: fine) {
    #site-navigation a:hover {
        transform: scale(1.1);
        opacity: 0.8;
    }

    .homepage-nav a:hover {
        transform: scale(1.1);
        opacity: 0.8;
    }

    .nav-portfolio-btn:hover img {
        transform: scale(1.1);
        opacity: 0.8;
    }

    .site-logo img:hover {
        transform: scale(1.05);
    }

    .portal-item:hover:not(.portal-item--coming-soon) {
        transform: translateY(-5px);
        box-shadow: 0 12px 24px var(--shadow-color);
    }

    .portal-item:hover:not(.portal-item--coming-soon)::before {
        filter: blur(1px);
    }

    .portal-item:hover:not(.portal-item--coming-soon)::after {
        opacity: 1;
    }

    .tag-button:hover {
        border-color: var(--primary-color);
    }

    .keyword-chip:hover {
        border-color: var(--primary-color);
        background: rgba(189, 0, 47, 0.1);
        background: color-mix(in srgb, var(--primary-color) 15%, transparent);
    }

    .soundcloud-embed-caption a:hover {
        text-decoration: underline;
    }

    .masonry-item:hover {
        transform: translateY(-2px);
        box-shadow: 0 8px 16px var(--shadow-color);
    }

    .masonry-item:hover img {
        opacity: 0.9;
        filter: blur(1px);
    }

    .masonry-item:hover .artwork-overlay {
        opacity: 1;
    }

    .news-card:hover {
        transform: translateY(-5px);
        box-shadow: 0 12px 24px var(--shadow-color);
    }

    .social-link:hover {
        transform: translateY(-2px);
        opacity: 0.9;
    }

    .keyword-tag:hover {
        background: var(--primary-color);
        border-color: var(--primary-color);
        color: white;
        cursor: pointer;
    }

    .btn:hover {
        background-color: #d9003d;
        transform: scale(1.05);
        color: white;
        text-decoration: none;
    }
    .btn.share-btn:hover {
        background-position: 100% 50%;
        box-shadow: 0 16px 32px rgba(189, 0, 47, 0.35);
    }
    .btn.btn-secondary:hover {
        background-color: #5a6268;
    }
}