/* Import theme variables and core structure */
@import url('core/structure.css');

/* ===== CUSTOM FOCUS STYLING ===== */
/* Remove default browser focus outline */
*:focus {
    outline: none;
}

/* Custom focus styling for all focusable elements */
*:focus-visible {
    outline: 2px solid var(--font-color-accent);
    outline-offset: 2px;
    box-shadow: 
        0 0 0 4px var(--font-color-accent-transparent, rgba(51, 136, 255, 0.2)),
        0 0 12px 2px var(--font-color-accent-transparent, rgba(51, 136, 255, 0.15));
    border-radius: 4px;
    transition: all 0.2s ease-in-out;
}

/* Enhanced focus for interactive elements */
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
a:focus-visible,
.ui-button:focus-visible {
    outline: 2px solid var(--font-color-accent);
    outline-offset: 3px;
    box-shadow: 
        0 0 0 5px var(--font-color-accent-transparent, rgba(51, 136, 255, 0.25)),
        0 0 16px 4px var(--font-color-accent-transparent, rgba(51, 136, 255, 0.2)),
        0 0 24px 8px var(--font-color-accent-transparent, rgba(51, 136, 255, 0.1));
    transform: scale(1.02);
}

/* Special focus for buttons with background */
button:focus-visible,
.ui-button:focus-visible,
input[type="submit"]:focus-visible,
input[type="button"]:focus-visible {
    box-shadow: 
        inset 0 0 0 2px var(--font-color-accent),
        0 0 0 3px var(--background-primary),
        0 0 0 5px var(--font-color-accent),
        0 0 16px 4px var(--font-color-accent-transparent, rgba(51, 136, 255, 0.3)),
        0 0 32px 8px var(--font-color-accent-transparent, rgba(51, 136, 255, 0.15));
}

/* Subtle focus for links within text */
a:focus-visible:not(.ui-button):not(.lang-link) {
    background-color: var(--font-color-accent-transparent, rgba(51, 136, 255, 0.1));
    box-shadow: 
        0 0 0 2px var(--font-color-accent-transparent, rgba(51, 136, 255, 0.3)),
        0 0 8px 2px var(--font-color-accent-transparent, rgba(51, 136, 255, 0.2));
    transform: none;
}

/* Focus for form inputs */
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
    border-color: var(--font-color-accent);
    background-color: var(--background-primary);
    box-shadow: 
        inset 0 0 0 1px var(--font-color-accent),
        0 0 0 3px var(--font-color-accent-transparent, rgba(51, 136, 255, 0.2)),
        0 0 12px 2px var(--font-color-accent-transparent, rgba(51, 136, 255, 0.15));
    transform: none;
}

/* Allow focus effects for all navigation types (keyboard, mouse, touch) */
/* Removed the :focus:not(:focus-visible) rule to enable mouse/touch focus */

/* Gallery-specific focus effects - always show for gallery navigation */
.gallery-container a:focus,
.thumb-div:focus,
a:focus:has(.thumb-div),
.content-card:focus {
    outline: 2px solid var(--font-color-accent);
    outline-offset: 3px;
    box-shadow: 
        0 0 0 4px var(--font-color-accent-transparent),
        0 0 12px 6px var(--font-color-accent-transparent),
        0 0 20px 10px rgba(51, 136, 255, 0.1);
    border-radius: 8px;
    transition: all 0.2s ease-in-out;
}

/* SVG Colours */
.svg-icon {
    color: var(--font-color-highlight);
    aspect-ratio: 1;
    height: 1.33em; /* don't set to 'lh' css unit! */
}
.home {
    color: var(--color-home);
}
.danger {
    color: var(--color-danger);
}
.admin,
.user {
    color: var(--color-neutral);
}
.exit, .check, .play {
    color: var(--color-ok);
}

/* Basic modal styles */
dialog.modal {
    position: fixed; /* Stay in place */
    z-index: 2; /* Sit on top */
    left: 0;
    top: 0;
    right: 0;
    overflow: auto; /* Enable scroll if needed */
    max-width: 92ch; 
    min-width: 46ch;
}
dialog.backend-modal {
    display: none; /* Hidden by default */
}
.modal-content {
    background-color: var(--background-primary);
    color: var(--font-color-text);
    margin: 15% auto; /* 15% from the top and centered */
    padding: 2rem;
    max-width: 120ch; /* Don't set this too low, but it could be more or less, depending on render context  */
    border: 0.2rem solid black;
    outline: 0.2rem solid var(--font-color-highlight);
}
dialog.modal:before { /* Purely decorative darker background for modal dialogs */
    content: '';
    position: absolute;
    z-index: -1;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background-color: var(--background-primary-transparent);
    border: 0.2rem solid var(--font-color-highlight);
}
.close,
.toggle-collapse { /* Close and Toggle Buttons (ROUND!) */
    display: grid;
    color: var(--font-color-highlight);
    float: right;
    background-color: var(--background-highlight);
    width: 1rem;
    height: 1rem;
    border-radius: 50%;
    border: 1px solid var(--font-color-highlight);
    text-align: center;
    align-content: center;
    padding: 0.1em;
    cursor: pointer;
}
iframe {
    min-height: calc(20lvh + 10vw);
    width: 100%;
}
video {
    max-width: 100%;;
}
.video-container {
    position: relative;
    overflow: clip;
}
.video-thumbnail {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    cursor: pointer;
    min-width: 100%;
}
.video-player {
    max-width: 100%;
}
.video-player[controls] {
    background-color: black;
}
.video-player.playing {
    display: block;
}
body {
   /* position: relative; */ /* resides in .content-grid */
   line-height: calc(sqrt(2));
   background: var(--background-primary);
   font-size: var(--font-size-body);
}
body, input, select, button  {
   margin-bottom: .4em;
}
.header {
   grid-column: main-start / main-end;
   grid-row: 1;
   display: inline-flex;
   margin-bottom: 2em;
}

/* Header decorative elements moved to theme files */


.claim {
    margin: 1rem 0 0 0;
}

button {
    cursor: pointer;
    display: inline-grid;
    grid-template-columns: auto auto;
    justify-content: space-around;
    margin: 0 0.15em;
}

button span:first-child {
    display: contents;
}
select, button {
   text-transform: uppercase;
}
form.login, form.create {
    margin-top: 1rem;
    display: grid;
    grid-template-columns: auto auto;
    max-width: fit-content;
    button.ui-button {
        margin-top: 1rem;
        margin-left: auto;
        margin-right: auto;
        grid-column: 2 / 3;
   }
}
form.login > label,
form.create > label {
   margin: auto .3rem auto auto;
}
form.login > input[type=submit], 
form.create > input[type=submit] {
   text-transform: uppercase;
   width: min-content;
   margin: 1rem 0.3rem auto auto;
}
email {
   display: inline-block;
   background-color: var(--background-highlight);
   padding: 1em 1em 1em 1em;
}
section.impressum {
   grid-column: content-start / content-end;
   background-color: var(--background-primary-transparent);
   margin-bottom: 1em;
   max-width: fit-content;
}
.flexrow > h2 {
    margin-top: 0;
    margin-bottom: 0;
}
address {
   margin-left: 2em;
   padding: 0 0 0 1em;
   grid-column: 1 / 3;
}
section {
   background-color: transparent;
   margin-bottom: 1em;
}
a {
   color: var(--font-color-highlight);
}
.oblique {
   font-style: oblique;
}
.capital-start-letter {
   list-style-type: none;
   /* width: 20lvw; */
}
.uppercase {
   text-transform: uppercase;
}
.capital-start-letter::first-letter {
   background-color: inherit;
   vertical-align: text-top;
   float: left;
   color: var(--font-color-highlight);
   initial-letter: 2 2; 
   font-family: 'azaret_mono';
   text-decoration: none;
   margin-right: -0.03em;
}
@-moz-document url-prefix() {
   .capital-start-letter::first-letter {
       font-size: 336%;
       margin-right: 0.06em;
   }
}
h1.icon {
    display: inline-block;
    width: min-content;
    font-size: 120%;
    z-index: 2;
    font-family: 'azaret_mono';
    font-style: oblique;
    letter-spacing: .2em;
    padding: 0;
    margin: -.8em 0 0 14%;
    text-transform: uppercase;
}
h1.icon > a > span::first-letter,
h1.icon > a > span > span > span { /* This was needed because there is no appropriate selector available */
    font-weight: 700;
    font-family: 'expletussans_regular';
    font-size: 130%;
    margin-right: 0;
}h1.icon > a > span > span {
    margin-left: 0.7rem;
}
h2, h3, h4 {
   z-index: 2;
}
h2 {
   font-size: calc(1em + 0.1vh);
   display: inline;
   margin-right: 1.5rem;
}
h2.galleryTitle {
    font-family: inherit;
}
.nowrap {
   display: inline-block;
   white-space: nowrap;
}
.text-at-bottom {
   position: absolute;
   bottom: 1lh;
   z-index: 2;
}
.text-at-bottom > li > a:hover {
   background-color: var(--font-color-highlight);
   color: var(--font-color-text);
}
.content-grid {     /********* GRID LAYOUT *********/
    position: relative;
   display: grid;
   grid-template-columns: [main-start] 10% [content-start] 1fr [content-end] 10% [main-end];
   grid-template-rows: auto 1fr auto;
   min-height: 100vh;
   padding-top: 1.8em;
}
img.mugshot {
    float: right;
    max-width: 10rem;
    aspect-ratio: 1 / 1;
    border-radius: 50%;
    margin: -1.8em 0 auto auto;
}
.intro-text {
    max-width: 70ch;
    margin-left: auto;
    margin-right: auto;
}

/* Specific class for main page content sections */
.page-content {
    grid-column: main-start / main-end;
    /* Allow natural document flow within content area */
}
.main {
   grid-column: main-start / main-end;
   grid-row: 2;
   max-width: 110rem;
   /* Use subgrid to inherit parent grid columns for content sections */
   display: grid;
   grid-template-columns: subgrid;
}
.cards {
    grid-column: main-start / main-end;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--gallery-gap);
    margin-left: auto; /* fix 'margin'/'gap' between sections (vertically) */
    margin-right: auto; /* fix 'margin'/'gap' between sections (vertically) */
    width: -moz-available;
    width: -webkit-fill-available;
} 
/******  GRID .content  *******/

.content { 
    grid-column: content-start / content-end;
    position: relative;
    z-index: 1; /* Ensure sections stack properly */
    padding: 1em;
    width: -moz-available;
    width: -webkit-fill-available;
    max-width: 93em;
    max-height: fit-content;
    margin-left: auto;
    margin-right: auto;
    align-items: stretch;
}
.tab-headers {
    display: flex;
    justify-content: left;
    max-width: fit-content;
    margin-bottom: 1em;
}
.tab-headers input[type="radio"] {
    display: none;
}

.tab-headers label {
    cursor: pointer;
    text-decoration: underline;
    /* UIButton-like styling */
    background-color: transparent; /* Inactive tabs now transparent */
    border: 0.1rem solid var(--font-color-highlight);
    border-radius: 0.22rem; /* All corners rounded */
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5em;
    color: var(--font-color-highlight);
    transition: all var(--growtime) ease;
    margin-right: .5rem;
    padding: 0.22rem .33rem;
    font-size: calc(1rem - 0.05vh);
}


.tab-headers label:hover {
    scale: var(--hoverscale);
    color: var(--font-color-highlight);
}

.tab-headers input[type="radio"]:checked + label {
    text-decoration-color: var(--color-neutral);
    color: var(--font-color-accent);
    background-color: var(--background-highlight); /* Active tabs now have visible background */
    border-color: var(--color-neutral);
}

/* Ensure that checked colored tabs don't lose their coloring */
.tab-headers input[type="radio"]:checked + label.colored-tab {
    /* Inherit the background and color from the colored-tab class set via JavaScript */
    border-color: var(--color-neutral);
    /* Don't override background-color or color here - let JavaScript handle it */
}

/* Special styling for colored tab headers (when they have background colors) */
.tab-headers label.colored-tab {
    color: var(--font-color-highlight);
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
    /* Enhanced box shadow for colored tabs */
    box-shadow: 1px 1px 5px var(--font-color-text), -1px -1px 5px var(--font-color-text), 1px -1px 5px var(--font-color-text), -1px 1px 5px var(--font-color-text) !important;
}

/* Ensure colored tabs maintain proper hover effects */
.tab-headers label.colored-tab:hover {
    scale: var(--hoverscale);
    /* Keep the enhanced box shadow on hover */
    box-shadow: 2px 2px 8px var(--font-color-text), -2px -2px 8px var(--font-color-text), 2px -2px 8px var(--font-color-text), -2px 2px 8px var(--font-color-text) !important;
}
.tab-content {
    width: -moz-available;
    width: -webkit-fill-available;
    display: none; /* initially hidden */
}

/* Show the first tab by default */
.tab-content[data-tab="tab-1"] {
    display: block;
}

/* Active tab content should be shown */
.tab-content.active {
    display: block !important;
}
.content-card {
    padding: var(--padding-cards);
    display: flex;
    flex-direction: column;
    height: 20em;
    /* Background gradients moved to theme files */
}
/* Content card alternating styles moved to theme files */

#topic1, 
#topic2, 
#topic3 {
    position: relative;
    overflow: hidden;
    min-height: 24em;
}
/* Topic background image styles moved to theme files */

#topic1 > 
#topic2 > ul,
#topic3 > ul {
    padding-left: 6%;
}
#topic1 > *:not(a.linkspace) {
    margin-left: calc(100% - var(--cards-image-ratio));
    padding-right: 2.5em;
}
#topic1 > h4::after {
    rotate: 180deg;
    z-index: -1;
    left: calc((100% + var(--cards-image-ratio)) * -1);
}
a.linkspace {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
}
div.content-card > h4 {
    display: block;
    font-family: var(--font-family-display), sans-serif;
    padding: 0em 1em 0.5em 1em;
    position: relative;
    letter-spacing: .15em;
}
div.content-card > h4 > a {
    color: inherit;
}
div.content-card > h4 > a {
    position: relative;
    display: block;
    text-decoration: inherit;
    z-index: 2;
    font-size: larger;
}
div.content-card > h4::after {
    content: '';
    position: absolute;
    z-index: -1;
    top:calc(100% - 0.7em);
    right: 0;
    bottom: 0.53em;
    left:0;
    background: var(--color-gradient-brand);
}
div.content-card > ul > li {
    padding: .4em .5em 0 0;
}
div.content-card > ul > li > a {
    position: relative;
    z-index: 3;
}
div.content-media {
    display: flex;
    flex-flow: column;
    max-width: 100%;
    padding: 0 0.1rem 0.1rem 0.1rem;
    background-color: var(--background-primary-transparent);
}
table {
    background-color: var(--background-table-transparent);
}
.admin-table {
    margin-bottom: 1.1em;
    width: 100%; 
    width: -moz-available;
    width: -webkit-fill-available;
    table-layout: fixed;
    font-family: monospace;
    padding-top: .6em;
}

.admin-table tr th:first-child,
.admin-table tr td:first-child {
    width: 13em; 
    line-break: anywhere;
}


td#col-controls > button.ui-button:hover,
td#col-controls > a.ui-button-container > button.ui-button:hover {
    background: var(--background-highlight);
}

/* Styling for share modal actions column */
td#col-controls > button.ui-button,
td#col-controls > a.ui-button-container > button.ui-button {
    display: inline-grid;
    grid-template-columns: auto auto;
    justify-content: space-around;
    align-items: center;
    gap: 0.3em;
    margin: 0.2em;
    padding: 0.3em 0.6em;
    color: var(--font-color-text);
    cursor: pointer;
    text-transform: uppercase;
    font-size: 0.8em;
    min-height: auto;
    border: initial;
    background: initial;
    font-family: var(--font-family-mono),monospace;
}

td#col-controls > button.ui-button:hover,
td#col-controls > a.ui-button-container > button.ui-button:hover {
    background: var(--background-highlight);
}
 th, td {
    border-bottom: 0.1rem solid var(--font-color-text);
}
th {
    text-align: left;
    vertical-align: bottom;
}
 tr:hover {
    background-color: var(--background-highlight);
}
 .opener {
    grid-row: content-start / content-end;
}
button,
select {
    min-width: 7rem;
}
button,
select, 
input {
    font-size: calc(1rem - 0.05vh);
    background-color: var(--background-highlight);
    border: 0.1rem solid var(--font-color-highlight);
    border-radius: 2rem;
    text-decoration: none;
    align-items: center;
}
button:hover,
input:hover,
.content-card:hover {
    scale: var(--hoverscale);
    color: var(--font-color-highlight);
}
.content-card:hover {
    scale: calc(0.33 * (var(--hoverscale) - 100%) + 100%);
}
input.filter-input {
    width: -moz-available;
    width: -webkit-fill-available;
    /* margin-bottom: 1.22em; */
}
input[type="checkbox"] {
    margin-top: .33em;
    /* Hide the default checkbox */
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    aspect-ratio: 1 / 1;
    width: 1em; /* Adjust size as needed */
    height: 1em; 
    margin-bottom: 0;
    border: 2px solid var(--font-color-highlight); /* Border color */
    border-radius: initial;
    cursor: pointer;
    position: relative; /* used for pseudo-element positioning */
}
input[type="checkbox"]:checked {
    border-color: var(--color-ok);
}
input[type="checkbox"]:checked::before {
    content: '\2713'; /* Unicode checkmark character */
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%); /* Center the checkmark */
    font-size: 16px; /* Adjust checkmark size */
    color: var(--color-ok); /* Checkmark color */ 
    text-shadow: 2px 2px 10px black, -2px -2px 10px black, -2px 2px 10px black, 2px -2px 10px black;
}
input[type="checkbox"]:focus {
    outline: 2px solid var(--font-color-accent); /* Example focus style */
}
label {
    margin-left: 1.4em;
    margin-right: 1em;
    font-size: 80%;
}
section.impressum > .readDisclaimer-button {
    float: right;
    min-height: 2.1lh;
    font-size: medium;
    padding-right: .6em;
}
input#userSearchInput, input#ownerSearchInput, select#roleFilter { /* user text input fields */
    margin-left: auto;
}
.flexrow { /* contains UI-Elements for table headers */
    display: inline-flex;
    flex-direction: row;
    align-items: unset;
    width: -moz-available;
    width: -webkit-fill-available;
    justify-content: space-between;
    padding: .1em 1em 0 1em;
    background-color: transparent;
}
.controls {
    display: inline-flex;
    align-items: center;
}
.controls p {
    text-align: right;
}
/* Style for the round sort button */
.sort-round-container {
    position: absolute;
    top: 0;
    right: 100%; /* Position to the left of navmenu */
    margin-top: 0;
    margin-right: 10px;
    z-index: 3;
}
.sort-round-container button {
    aspect-ratio: 1 / 1;
    height: 1.5rem;
    width: 1.5rem;
    padding: 0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: auto;
    visibility: hidden; /* Hidden by default, shown via specific CSS */
}

/* Sort button reverse state - rotate icon 180 degrees */
.sort-round-container button svg.reverse {
    transform: rotate(180deg);
    transition: transform 0.2s ease;
}

/* Ensure smooth transition for normal state too */
.sort-round-container button svg {
    transition: transform 0.2s ease;
}

/* Sort button spinning state while loading */
.sort-round-container button svg.spinning {
    animation: spin 1s linear infinite;
    /* Remove the transition during spinning to avoid conflicts */
    transition: none;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* navmenu stuff */
header > section.navmenu > a {
    display: contents; /* fixes navmenu spacing issues */
}
header > section.navmenu {
    position: absolute;
    top: -.5rem;
    right: 1.1rem;
    grid-row-start: 1;
    display: grid;
    grid-template-columns: auto auto auto auto auto auto; /* Allow up to 6 columns */
    z-index: 3;
}
header > section.navmenu_gallery,
header > section.navmenu_slideshow {  
    --gap-width: .3em;  
    display: grid;
    grid-template-columns: auto auto auto; /* 3 columns */
    grid-template-rows: auto auto; /* 2 rows */
    gap: var(--gap-width) calc(var(--gap-width) / 5);
    text-align: center;
}

/* CSS-only solution for right-to-left button ordering in second row */
header > section.navmenu_gallery,
header > section.navmenu_slideshow {
    /* Use explicit grid positioning instead of grid areas for testing */
    grid-template-areas: none;
}

/* Position navigation buttons in first row using explicit grid positioning */
header > section.navmenu_gallery button.prev,
header > section.navmenu_slideshow button.prev {
    grid-column: 1;
    grid-row: 1;
}

header > section.navmenu_gallery button.up,
header > section.navmenu_slideshow button.up {
    grid-column: 2;
    grid-row: 1;
}

header > section.navmenu_gallery button.next,
header > section.navmenu_slideshow button.next {
    grid-column: 3;
    grid-row: 1;
}

/* Position other buttons in second row from right to left */
/* Handle both standalone buttons and buttons wrapped in anchor elements */
header > section.navmenu_gallery button.exif,
header > section.navmenu_slideshow button.exif,
header > section.navmenu_gallery a.ui-button-container:has(button.exif),
header > section.navmenu_slideshow a.ui-button-container:has(button.exif) {
    grid-column: 3 !important; /* rightmost in second row */
    grid-row: 2 !important;
}

header > section.navmenu_gallery button.share,
header > section.navmenu_slideshow button.share,
header > section.navmenu_gallery a.ui-button-container:has(button.share),
header > section.navmenu_slideshow a.ui-button-container:has(button.share) {
    grid-column: 2 !important; /* middle in second row */
    grid-row: 2 !important;
}

header > section.navmenu_gallery button.download,
header > section.navmenu_slideshow button.download,
header > section.navmenu_gallery #fetch-link,
header > section.navmenu_slideshow #fetch-link,
header > section.navmenu_gallery a.ui-button-container:has(button.download),
header > section.navmenu_slideshow a.ui-button-container:has(button.download) {
    grid-column: 1 !important; /* leftmost in second row */
    grid-row: 2 !important;
}

/* Fallback for browsers that don't support :has() - target specific fetch-link */
header > section.navmenu_gallery a#fetch-link,
header > section.navmenu_slideshow a#fetch-link {
    grid-column: 1 !important; /* leftmost in second row */
    grid-row: 2 !important;
}

/* Additional fallback: target ui-button-container anchors that contain specific button types */
/* This works by targeting the container when it wraps download buttons */
header > section.navmenu_gallery a.ui-button-container[href*="download"],
header > section.navmenu_slideshow a.ui-button-container[href*="download"] {
    grid-column: 1 !important; /* leftmost in second row */
    grid-row: 2 !important;
}

span.usermessage {
    grid-column: 1 / 3;
    text-align: right;
    align-self: center;
    padding-right: .5rem;
 }
/* GALLERY - & SLIDESHOW STUFF */
.gallery-container {
    grid-column: main-start / main-end;
    grid-row: 2;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 1em; /* Consistent spacing between items */
    height: fit-content;
    padding-top: 1.4em;
    max-width: 100vw;
}
.gallery-container > a {
    z-index: 2; /* Above background text */
    text-decoration: none;
    display: inline-block;
    position: relative; /* Establish stacking context */
}
div#gallery-title {
    position: absolute;
    font-size: larger;
    top: 1em;
    margin-left: 1em;
    z-index: 2;
}
div.galleryTitle { /* titles in user home dir gallery */
    flex-basis: 100%; /* Full width */
    text-align: center;
}
div.galleryTitle:first-of-type {
    margin-top: -.9rem;  /* place above header line */
}
div.galleryTitle h2 {
    position: relative;
    padding: .8em;
}
/* Smooth scrolling for anchor links */
html {
    scroll-behavior: smooth;
    min-height: 100vh;
}
/* Shared content wrapper scroll offset */
#shared-content {
    scroll-margin-top: 6em; /* Offset for sticky headers when scrolling to anchor */
} 
/* Content wrappers - containers for sticky positioning with scroll anchoring */
.shared-content-wrapper, .regular-content-wrapper {
    position: relative;
    flex-basis: 100%; /* Full width */
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: flex-start;
    gap: 1em;
    margin-bottom: 2em;
    scroll-margin-top: 4em; /* Offset for sticky headers when scrolling to anchor */
}

/* Content headers - sticky containers that stay visible */
div.shared-content-header, div.regular-content-header {
    position: sticky;
    flex-basis: 100%; /* Full width */
    height: 0; /* No visual height */
    overflow: visible; /* Allow h3 elements to show outside bounds */
    z-index: 10; /* Above other content but below modals */
    pointer-events: none; /* Don't interfere with clicks, except for the links */
}

/* Shared content header sticks to top */
div.shared-content-header {
    top: 0;
}

/* Regular content header - always visible with fallback position */
div.regular-content-header {
    top: calc(100vh - 4em); /* Stick near bottom of viewport as fallback */
}

/* Common styles for both h3 elements */
div.shared-content-header h3, div.regular-content-header h3 {
    position: absolute;
    display: block;
    margin: 0;
    font-size: 2.2em;
    font-weight: 700;
    color: var(--font-color-accent);
    filter: brightness(0.5) saturate(0.5) opacity(0.8);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    white-space: nowrap;
    z-index: 10;
    transition: filter var(--growtime) ease;
}

/* Shared header - positioned left edge of viewport, rotated counter-clockwise */
div.shared-content-header h3 {
    left: 0; /* Position at left edge of viewport */
    transform: rotate(-90deg) translateX(-20%); /* Rotate and reposition for alignment with page header */
    transform-origin: left top;
    margin: 8em 0 0 0; /* Adjust margin to position header */
}

/* Regular header - positioned right edge of viewport, rotated clockwise */
div.regular-content-header h3 {
    right: 0; /* Position at right edge of viewport */
    transform: rotate(90deg) translateY(100%) translateX(20%); /* Rotate and reposition for alignment with regular content wrapper */
    transform-origin: right bottom; /* Change origin to bottom for better positioning */
    top: 0; /* Position relative to the sticky container */
}

/* Common styles for both header links */
div.shared-content-header h3 a, div.regular-content-header h3 a {
    color: inherit;
    text-decoration: none;
    cursor: pointer;
    display: block;
    pointer-events: auto; /* Enable clicks on the header */
    user-select: none; /* Prevent text selection */
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    transition: all var(--growtime) ease;
}

/* Common hover effect for both header links */
div.shared-content-header h3 a:hover, div.regular-content-header h3 a:hover {
    filter: none;
    color: var(--font-color-highlight);
    text-decoration: underline;
    transform: scale(1.05);
}



div.content-separator, 
header {
    --background-linewidth-multiplier: 1.25;
}
header {
    --background-transparent-gap: 51vw;
}
div.content-separator {
    min-height: calc(var(--titleline-btm) - var(--titleline-top));
    flex-basis: 100%;
    background: none;
    min-height: .1em;
    height: 2px; /* Give it a specific height so it's visible */
    margin: 2em 0; /* Add some vertical spacing */
}
.thumb-div {
    z-index: 1; /* Above background text but below other elements */
    position: relative;
    border: 1px solid black;
    outline: 1px solid white;
    margin: 2em;
    display: inline-block; /* Better for containing images */
}
.thumb-div > span,
.comment-container .floating-thumb > span {
    display: flex;
    align-items: center;
    text-align: right;
    justify-items: end;
    transition: all var(--growtime) ease-in-out;
    font-size: larger;
    color: var(--font-color-text);
    background-color: var(--background-highlight-transparent);
    position: absolute;
    top: auto;
    right: 0;
    bottom: 0;
    width: fit-content;
    padding: 0.2em;
    padding-left: 0.5em;
    z-index: 3;
    line-break: whitespace;
    .svg-icon {
        scale: 1.6;
        color: var(--color-home);
        margin-left: .3em;
        margin-right: .7em;
    }
}
.thumb-div:hover > span,
.thumb-div:focus > span {
    transform: scale(calc(var(--hoverscale) / 4 * 3));
}
.grow {
    transition: all var(--growtime) ease-in-out;
}
.grow:hover,
.grow:active,
.grow:focus-within {
    transform: scale(var(--hoverscale));
    z-index: 9; /* Ensure hovered items appear above others */
}
.thumb-div:hover > span,
.thumb-div:focus > span {
    transform: scale(calc(var(--hoverscale) / 4 * 3));
}
.grow {
    transition: all var(--growtime) ease-in-out;
}
.grow:hover,
.grow:active,
.grow:focus-within {
    transform: scale(var(--hoverscale));
}

/* Enhanced accessibility: Better focus indicators for all navigation types */
a:focus {
    outline: 2px solid var(--font-color-accent);
    outline-offset: 3px;
    box-shadow: 
        0 0 0 4px var(--font-color-accent-transparent),
        0 0 12px 6px var(--font-color-accent-transparent),
        0 0 20px 10px rgba(51, 136, 255, 0.1);
    border-radius: 3px;
    transition: all 0.2s ease-in-out;
}

/* Ensure focus is visible even with custom button styles */
button:focus, 
.ui-button:focus {
    outline: 2px solid var(--font-color-accent);
    outline-offset: 2px;
    box-shadow: 
        0 0 0 3px var(--font-color-accent-transparent),
        0 0 10px 4px var(--font-color-accent-transparent),
        0 0 16px 8px rgba(51, 136, 255, 0.08);
    transition: all 0.2s ease-in-out;
}
.ss-img-div {
    grid-column: main-start / main-end;
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    max-width: 100vw;
    text-align: center; /* align img center */
    align-content: center;
    min-height: 100vh;
} 
.ss-img-div > img {
    max-width: 92%;
    max-height: calc(100vh - (3.6 * var(--titleline-top))); /* max-height viewport heigth - 3* line height for header incl. margin for 'whitespace' / background at bottom*/
    object-fit: cover;
    /* object-position: center;
    margin-top: clamp(var(--titleline-top), 4lh, 5rem); */
    
}
.ss-img-div > img,
img#ss-img-zoom {
    border: 1px solid black;
    outline: 1px solid white;
    margin-bottom: 2.5em;
}
div#ss-img-zoom-div {
    display: none;
    z-index: 10;
    position: fixed;
    top: 0;
    right: 100%;
    bottom: 0;
    left: 0;
    background-color: #000000;
    width: 100%;
    padding-top: var(--titleline-top);
    text-align: center; /* center image */
    align-content: center;
    overflow: auto;
    .close {
        z-index: 3;
        position: fixed;
        top:1rem;
        right: 1rem;
        width: 1em;
        height: 1em;
    }
}
img#ss-img-zoom {
    object-fit: contain;
    max-width: 95%;
    transition: transform 0.3s ease-in-out; /* Smooth transition */
}
img#ss-img-zoom.zoomed {
    object-fit: unset; /* Remove object-fit for zooming */
}
/* fade-in-load: fade in on load. use for ss-images and thumb-divs in gallery */
/* spinny wheels stuff */
img.fade-in-load {
    opacity: .4;
    transition: opacity 0.5s ease-in-out;
    position: relative;
}

img.gallery-image {
    color: var(--font-color-text);
    max-width: 100%;
    min-width: 11rem;
    height: auto;
    object-fit: contain;
    display: block; /* Remove space below image */
}

/* Inline SVG document icons inherit color properly */
svg.gallery-image {
    color: var(--font-color-text);
    max-width: 100%;
    min-width: 11rem;
    height: auto;
    display: block; /* Remove space below image */
}

.thumb-div::before, .ss-img-div::before, .floating-thumb::before {
    content: '';
    display: var(--spinner-display, block); /* Default to 'block' */
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border: 6px ridge var(--background-primary-transparent);
    border-left-color: var(--font-color-highlight);
    border-left-style: solid;
    border-radius: 50%;
    width: 2.4em;
    height: 2.4em;
    animation: spin 1s linear infinite;
    z-index: 3;
    opacity: 1;
    transition: opacity 0.5s ease-in-out;
}

/* Spinner animation */
.spinner {
    animation: spin 1s linear infinite;
}

/* Enhanced spinner animation for download button */
.svg-icon.spinner {
    animation: spin 1s linear infinite;
}

/* Ensure spinner animations are visible and prominent */
@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* Make the spinner more visible */
.svg-icon.spinner {
    animation: spin 1s linear infinite !important;
    transform-origin: center !important;
    color: var(--font-color-accent) !important;
}

/* Enhanced button states with !important to override any conflicting styles */
button.ui-button.waiting {
    background-color: var(--background-highlight) !important;
    color: var(--font-color-accent) !important;
    cursor: wait !important;
    border-color: var(--font-color-accent) !important;
    box-shadow: 0 0 5px var(--font-color-accent) !important;
}

/* Make the download button's SVG icon rotate in waiting state instead of changing color */
.download button.ui-button.waiting svg,
button.ui-button.waiting svg {
    animation: spin 1s linear infinite !important;
    transform-origin: center !important;
}

/* Ensure button states have high specificity */
button.ui-button.waiting {
    background-color: var(--background-highlight) !important;
    color: var(--font-color-accent) !important;
    cursor: wait !important;
}

button.ui-button.ready {
    background-color: var(--color-ok) !important;
    color: var(--font-color-highlight) !important;
    cursor: pointer !important;
}

button.ui-button.failed {
    background-color: var(--color-danger) !important;
    color: var(--font-color-highlight) !important;
    cursor: not-allowed !important;
}

/* Style for download button in waiting state - rotate icon */
.navmenu .download button.ui-button.waiting .svg-icon {
    animation: spin 1s linear infinite !important;
    transform-origin: center !important;
}

button.up.sticky {
    transition: all 0.2s ease-in-out;
}

button.up.sticky:hover {
    transform: scale(1.1);
}

/* Add toggle-collapse button styles for directory tree */
.toggle-collapse {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 1px solid var(--font-color-highlight);
    border-radius: 50%;
    text-align: center;
    line-height: 14px;
    cursor: pointer;
    font-weight: bold;
    font-size: 14px;
    color: var(--font-color-text);
    margin-right: 5px;
    visibility: visible;
}

.toggle-collapse:empty::before {
    content: '+';
}

/* Directory rows with no subdirectories should have hidden toggle button */
tr:not([data-has-children='true']) .toggle-collapse {
    visibility: hidden;
}

/* Override the display grid that is causing the toggle buttons to not display correctly */
td .toggle-collapse {
    display: inline-block;
}

/* Style for the sticky up button */
#sticky-up-button {
    transition: all 0.2s ease-in-out;
}

#sticky-up-button:hover {
    transform: scale(1.1);
}

/* Add animation for smooth appearance */
#sticky-up-wrapper {
    transition: opacity 0.2s ease-in-out;
    opacity: 0;
}

#sticky-up-wrapper.visible {
    opacity: 1;
}

/* Markdown Comments Styling */
.thumb-div.has-comment {
    display: block;
    max-width: 100%;
    border: none;
    outline: none;
}

/* Floating thumbnail within comment text */
.comment-container .floating-thumb {
    float: right;
    margin: 0 1.2em 1.2em 0;
    max-width: 55%;
    position: relative;
    border: 1px solid black;
    outline: 1px solid white;
    transition: all var(--growtime) ease-in-out;
    z-index: 2;
}

.comment-container .floating-thumb:hover {
    transform: scale(var(--hoverscale));
    z-index: 9;
}



.comment-container .floating-thumb:hover > span {
    transform: scale(calc(var(--hoverscale) / 4 * 3));
}

/* Ensure comment container contains floating elements properly */
.comment-container::after {
    content: "";
    display: table;
    clear: both;
}

/* Improve text flow and spacing in comment containers */
.has-comment .comment-container {
    min-height: 200px; /* Ensure minimum height for better layout */
    padding: 1em;
}

.comment-container p {
    margin: 0.8em 0;
    max-width: none; /* Override global p max-width */
    padding: 0.5em; /* Add minimal padding for readability */
    border-radius: 0.3em; /* Subtle rounded corners */
}

.comment-container ul {
    margin: 0.8em 0;
    padding-left: 1.5em;
    border-radius: 0.3em; /* Subtle rounded corners */
    padding: 0.5em 0.5em 0.5em 2em; /* Adjust padding to account for list bullets */
}

.comment-container li {
    margin: 0.3em 0;
}

.comment-container blockquote {
    border-left: 3px solid var(--font-color-accent);
    padding-left: 1em;
    margin: 1em 0;
    font-style: italic;
    padding: 0.8em 1em;
    border-radius: 0.3em;
}

.comment-container hr {
    border: none;
    border-top: 1px solid var(--font-color-highlight);
    margin: 1.5em 0;
}

.comment-container a {
    display: inline-block; /* Allow padding to work */
    color: var(--font-color-text);
    text-decoration: none; /* Remove underline */
}
.comment-container > p > a {
    color: var(--font-color-highlight);
    text-decoration: underline;
}
.comment-container h1,
.comment-container h2,
.comment-container h3,
.comment-container h4,
.comment-container h5,
.comment-container h6 {
    margin: 0.5em 0 0.3em 0;
    font-weight: 600;
    line-height: 1.3;
    padding-bottom: 0.2em;
    font-family: var(--font-family-display), sans-serif;
}

.comment-container .md-image {
    max-width: 100%;
    height: auto;
    margin: 0.5em 0;
}

/* Slideshow Comment Overlay */
.slideshow-comment-overlay {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--background-primary-transparent);
    backdrop-filter: blur(10px);
    transform: translateY(100%);
    transition: transform 0.3s ease-out;
    z-index: 15;
    max-height: 70vh;
    overflow: visible; /* Allow dropdown to extend outside drawer */
    border-top: 2px solid var(--font-color-highlight);
    box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.5);
}

/* Content wrapper handles scrolling instead */
.slideshow-comment-overlay .comment-content {
    overflow-y: auto;
    max-height: 70vh;
}

/* Ensure language dropdown appears above drawer */
.slideshow-comment-overlay .footer-language-switcher .lang-dropdown-menu {
    z-index: 1001; /* Higher than standard dropdown z-index */
    position: fixed; /* Use fixed positioning to escape drawer bounds */
}

.slideshow-comment-overlay.visible {
    transform: translateY(0);
}

.slideshow-comment-overlay .comment-content {
    padding: 2em;
    line-height: 1.7;
}

/* Simple drawer section styling */
.slideshow-comment-overlay .comment-section h3 {
    margin: 0 0 1em 0;
    color: var(--font-color-highlight);
    font-size: 1.3em;
    border-bottom: 2px solid var(--font-color-accent);
    padding-bottom: 0.5em;
}

.slideshow-comment-overlay .section-divider {
    border: none;
    border-top: 1px solid var(--font-color-highlight);
    margin: 2em 0;
    opacity: 0.5;
}

/* Footer content in drawer uses exact same styles as regular footer */

.slideshow-comment-overlay .close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 16;
}

.close:hover {
    background: var(--font-color-highlight);
    color: var(--background-primary);
}

/* Comment Grabber - indicates hidden overlay */
.comment-grabber {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 5rem;
    height: .85rem;
    background: var(--font-color-accent);
    border-radius: 3px 3px 0 0;
    cursor: pointer;
    transition: all 0.1s ease;
    z-index: 16;
    opacity: 0.7;
}

.comment-grabber:hover {
    opacity: 1;
    height: 1rem;
    background: var(--font-color-highlight);
}

.comment-grabber.has-comment {
    background: var(--font-color-highlight);
    opacity: 1;
    animation: subtle-pulse 3s infinite;
}

.comment-grabber.has-footer-content {
    background: var(--font-color-accent);
    opacity: 0.8;
}

.comment-grabber.has-footer-content:hover {
    opacity: 1;
    background: var(--font-color-highlight);
}

.comment-grabber.has-minimal-content {
    background: var(--font-color-highlight);
    opacity: 0.6;
}

.comment-grabber.has-minimal-content:hover {
    opacity: 0.9;
    background: var(--font-color-highlight);
}

@keyframes subtle-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* Hide grabber when overlay is visible */
.slideshow-comment-overlay.visible + .comment-grabber {
    opacity: 0;
    pointer-events: none;
}

/* Directory comment item - displayed as first flex item in gallery */
.directory-comment-item {
    flex-basis: fit-content; 
    margin-bottom: 1em;
    padding: 0 18vw;
}

.directory-comment-content {
    padding: 1.5em;
}

.directory-comment-content .comment-title {
    margin: 0 0 1em 0;
    color: var(--font-color-highlight);
    font-size: 1.4em;
    border-bottom: 2px solid var(--font-color-accent);
    padding-bottom: 0.5em;
    text-align: center;
}

/* Ensure directory comment content inherits comment styling */
.directory-comment-content h1,
.directory-comment-content h2,
.directory-comment-content h3 {
    margin-top: 0;
    color: var(--font-color-highlight);
    font-family: var(--font-family-display), sans-serif;
}

.directory-comment-content h1 {
    font-size: 1.5em;
    border-bottom: 2px solid var(--font-color-accent);
    padding-bottom: 0.3em;
}

.directory-comment-content h2 {
    font-size: 1.3em;
    color: var(--font-color-accent);
}

.directory-comment-content h3 {
    font-size: 1.1em;
}

.directory-comment-content p {
    margin: 0.8em 0;
    line-height: 1.6;
    max-width: none;
}

.directory-comment-content ul {
    margin: 0.8em 0;
    padding-left: 1.5em;
}

.directory-comment-content li {
    margin: 0.3em 0;
}

.directory-comment-content blockquote {
    border-left: 3px solid var(--font-color-accent);
    padding-left: 1em;
    margin: 1em 0;
    font-style: italic;
    background: var(--background-primary-transparent);
    padding: 0.8em 1em;
    border-radius: 0.3em;
}

.directory-comment-content hr {
    border: none;
    border-top: 1px solid var(--font-color-highlight);
    margin: 1.5em 0;
}

.directory-comment-content a {
    color: var(--font-color-accent);
    text-decoration: underline;
}

.directory-comment-content a:hover {
    color: var(--font-color-highlight);
}

.directory-comment-content .md-image {
    max-width: 100%;
    height: auto;
    border-radius: 0.3em;
    margin: 0.5em 0;
}

/* EXIF Overlay Styles */
#exif-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--background-primary);
    color: var(--font-color-text);
    z-index: 1002; /* Higher than slideshow drawer language dropdown (z-index: 1001) */
    display: none; /* Hidden by default */
    overflow-y: auto;
}

#exif-overlay .exif-content {
    padding: 2em;
    max-width: 1200px;
    margin: 0 auto;
    column-count: 3; /* Two columns for better layout */
    column-gap: 2em;
    column-fill: balance; /* Balance content between columns */
}

#exif-overlay .exif-entry {
    break-inside: avoid; /* Keep each entry together, but allow column breaks between entries */
    margin-bottom: 1em;
    display: block;
    page-break-inside: avoid; /* Fallback for older browsers */
}

#exif-overlay .exif-key {
    font-weight: bold;
    margin-bottom: 0.25em;
    font-size: 0.9em;
}

#exif-overlay .exif-value {
    margin-bottom: 0.5em;
    padding-left: 1em;
    color: var(--font-color-text);
    word-wrap: break-word;
}
#exif-overlay .close {
    position: fixed;
    top: 1rem;
    right: 1rem;
    width: 2rem;
    height: 2rem;
    background: var(--background-highlight);
    border: 2px solid var(--font-color-highlight);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.2em;
    color: var(--font-color-highlight);
    z-index: 30;
}

#exif-overlay .close:hover {
    background: var(--font-color-highlight);
    color: var(--background-primary);
}

#exif-overlay.visible {
    display: block !important;
}

#exif-overlay h2 {
    color: var(--font-color-highlight);
    margin-bottom: 1em;
    text-align: center;
}

#exif-overlay div {
    max-width: 80ch;
    margin: 0 auto;
    line-height: 1.6;
}

#exif-overlay table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1em;
}

#exif-overlay th,
#exif-overlay td {
    padding: 0.5em;
    text-align: left;
    border-bottom: 1px solid var(--font-color-highlight);
}

#exif-overlay th {
    background-color: var(--background-highlight);
    color: var(--font-color-accent);
    font-weight: bold;
}

/* ===== MEDIA QUERIES ===== */
/* Media queries are placed at the end to ensure they override earlier styles */

@media screen and (max-width: 1920px) {
    h1.icon {
        margin-left: 1em;
    }
    header p.claim {
         display: none;
    }
    .ss-img-div {
        grid-column: main-start / main-end;
    }
    #exif-overlay .exif-content {
        column-count: 2;
        padding: 1.5em;
    }
    .directory-comment-item {
        flex-basis: 100%;
        padding: 0 10vw;
    }
}

@media screen and (pointer: coarse) {
    :root {
        --cards-image-ratio: 95%; /* in percent, please! */
    }
    header > section.navmenu {
        margin-top: 1rem;
    }
    .header {
        margin-bottom: 3rem;
    }
    /* Content card and topic styles moved to theme files */
    
    /* Adjust sticky header positioning for mobile */
    div.shared-content-header h3,
    div.regular-content-header h3 {
        top: 50%; /* Keep centered vertically */
        transform: rotate(-90deg) translateY(-50%); /* Shared header */
    }
    
    div.regular-content-header h3 {
        transform: rotate(90deg) translateY(-50%); /* Regular header */
    }
}

/* Thumbnail Worker Controls */
.worker-controls {
    display: flex;
    margin: 15px 0;
    padding: 15px;
    background-color: var(--background-light);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.worker-controls label {
    display: inline-block;
    font-weight: bold;
    margin-right: 10px;
    color: var(--font-color-text);
}

.worker-controls input[type="number"] {
    padding: 5px 8px;
    margin: 0 15px 0 5px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background-color: var(--background);
    color: var(--font-color);
    font-size: 14px;
    width: 70px;
}

.worker-controls .ui-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background-color: var(--background-highlight) !important;
}

#worker-output {
    margin-top: 15px;
    padding: 12px;
    background-color: var(--background-primary);
    border-radius: 4px;
    border: 1px solid var(--border-color);
    font-family: 'Courier New', Consolas, monospace;
    font-size: 12px;
    line-height: 1.4;
    white-space: pre-wrap;
    max-height: 300px;
    overflow-y: auto;
    color: var(--font-color-text);
}

#worker-output:empty {
    display: none !important;
}

#zip-worker-output {
    margin-top: 15px;
    padding: 12px;
    background-color: var(--background-primary);
    border-radius: 4px;
    border: 1px solid var(--border-color);
    font-family: 'Courier New', Consolas, monospace;
    font-size: 12px;
    line-height: 1.4;
    white-space: pre-wrap;
    max-height: 300px;
    overflow-y: auto;
    color: var(--font-color-text);
}

#zip-worker-output:empty {
    display: none !important;
}

/* Theme Selector Styles */
.theme-selector-container {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.theme-selector-container label {
    font-weight: 600;
    color: var(--font-color-text);
}

#theme-info {
    background-color: var(--background-highlight, #f5f5f5);
    border: 1px solid var(--border-color, #ddd);
    border-radius: 6px;
    padding: 15px;
}

#theme-info h4 {
    margin: 0 0 8px 0;
    color: var(--font-color-text);
    font-size: 16px;
}

#theme-info p {
    margin: 0 0 8px 0;
    color: var(--font-color-text);
    line-height: 1.4;
}

#theme-info small {
    color: var(--font-color-highlight, #666);
    font-size: 12px;
}

/* Site Footer Styles */
.site-footer {
    grid-column: main-start / main-end;
    grid-row: -1; /* Always last row */
    background-color: var(--background-primary-transparent);
    display: flex;
    align-items: end; /* Baseline align footer content to bottom */
    font-size: 80%;
    margin: 2em 0 0 0;
    padding: 0 0 1em 0;
    margin-bottom: -.5em; /* Offset bottom margin to align with page bottom */
}

.footer-content {
    margin: 0 auto;
    padding: 0 1rem;
    width: fit-content;
}

.footer-text {
    max-width: 63em;
    font-size: 80%;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    text-align: center;
    margin: 0;
    line-height: 1.4;
}

.owner-info {
    display: inline;
}

.location-info {
    font-weight: normal;
}

.footer-links {
    display: inline;
}

/* Footer button styling - using standard UIButton styles */
.footer-text .ui-button-container,
.footer-text .ui-button {
    display: inline-flex;
    vertical-align: baseline;
    margin: 0 0.25rem;
    font-size: 0.9em;
    line-height: inherit;
}

.footer-text .ui-button {
    padding: 0.125rem 0.375rem;
    min-height: auto;
    height: auto;
    font-size: inherit;
}

.footer-text .ui-button .svg-icon {
    width: 14px;
    height: 14px;
    margin-right: 0.25rem;
}

.footer-text .ui-button .button-label {
    font-size: inherit;
}

/* Footer Language Switcher */
.footer-language-section {
    margin-top: 0.5rem;
}

.footer-language-switcher {
    justify-content: center;
    gap: 0.3rem;
    margin: 0;
}

.footer-language-switcher .lang-link {
    font-size: 0.8em;
    padding: 0.2rem 0.4rem;
    min-width: auto;
    box-shadow: none;
    border: 1px solid var(--font-color-highlight);
    text-shadow: none;
}

.footer-language-switcher .lang-link:hover {
    transform: scale(1.05);
}

@media (max-width: 768px) {
    .footer-text {
        font-size: 0.9em;
        gap: 0.75rem;
    }
    
    .footer-text .ui-button {
        font-size: 0.85em;
        padding: 0.15rem 0.4rem;
    }
    
    .footer-language-switcher .lang-link {
        font-size: 0.75em;
        padding: 0.15rem 0.3rem;
    }
}

/* Impressum Contact Card Styles */
.impressum-contact-card {
    background-color: var(--background-highlight);
    border: 2px solid var(--font-color-highlight);
    border-radius: 0.5em;
    padding: 1.5em;
    margin: 1em 0 2em 0;
    max-width: fit-content;
}

.impressum-contact-card h4 {
    margin: 0 0 1em 0;
    color: var(--font-color-highlight);
    font-family: var(--font-family-display), sans-serif;
    font-size: 1.2em;
}

.impressum-contact-card address {
    margin: 0;
    padding: 0;
    font-style: normal;
    line-height: 1.6;
}

.impressum-contact-card address strong {
    color: var(--font-color-highlight);
    font-size: 1.1em;
}

.impressum-contact-card address a {
    color: var(--font-color-accent);
    text-decoration: none;
}

.impressum-contact-card address a:hover {
    text-decoration: underline;
}

/* Mobile responsive for EXIF overlay */
@media screen and (max-width: 768px) {
    #exif-overlay .exif-content {
        column-count: 1;
        padding: 1em;
        column-gap: 0;
    }
    
    #exif-overlay .close {
        top: 0.5rem;
        right: 0.5rem;
        width: 1.8rem;
        height: 1.8rem;
        font-size: 1rem;
    }
}
