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

    /* Color scheme */

    --textcolor: #996666;
    --bgcolor: #0d0d0d;
    --highlight: #b15053;
    --3rdcolor: #d7797c;
}

@media (prefers-color-scheme: dark) {
    * {
        --textcolor: #996666;
        --bgcolor: #0d0d0d;
        --highlight: #b15053;
    }
}

body {
    font-size: 18px;
    font-family: arial, system-ui, sans-serif;
    letter-spacing: 3%;
    line-height: 1.5;
    color: var(--textcolor);
    background: var(--bgcolor);
    position: relative;
    max-width: 64em; /* remove this for a full-width layout */
    margin: 0 auto; /* centers the layout */
}

/* ------- Badge a la Dexter Sinister ------- */

.badgeContainer,
#badge-container {
    position: fixed;
    top: 50%;
    left: 50%;
    width: 180px;
    height: 180px;
    margin: -90px 0 0 -90px;
    z-index: 1;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

#badge-link {
    display: block;
    width: 100%;
    height: 100%;
    text-decoration: none;
    border: none;
}

#badge-link:hover {
    border-bottom: none; /* Override link hover styles */
}

#badge {
    position: absolute;
    vertical-align: top;
    width: 100%;
    height: 100%;
    object-fit: contain; /* Ensures proper scaling */
}

/* Hide badge on specific pages */
#about:target ~ #badge-container,
main:has(#about:target) ~ #badge-container,
body:has(#about:target) #badge-container {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

/* Fallback for browsers without :has() support */
@supports not selector(:has(*)) {
    /* Badge will remain visible in older browsers */
}

/*-- Badge over --*/



/* ------- Sections ------- */

section {
    padding: calc(6em + 5vw) 5vw 8vw 5vw;
    /* ! Everything below is needed ! */
    display: none;
    position: absolute;
    top: 0;
    min-height: 100vh;
    width: 100%;
    background: var(--bgcolor);
    z-index: 1; /* Below badge */
}

section:target {
    /* Show section */
    display: block;
}

section#home {
    /* Show #home by default */
    display: block;
}

/* ------- Header ------- */

header {
    padding: 5vw 5vw 0 5vw;
    display: flex;
    flex-wrap: wrap;
    position: absolute;
    width: 100%;
    z-index: 3; /* Above sections and badge */
}

header h1 {
    font-size: 1em;
    flex: 1; /* pushes nav to the right */
    white-space: nowrap;
    padding: 0 5vw 0.5em 0;
}

nav a:not(:last-of-type) {
    margin-right: 1.5vw;
}

/* Active navigation highlighting - CSS only */
body:has(#about:target) header nav a[href="#about"],
body:has(#news:target) header nav a[href="#news"],
body:has(#photos:target) header nav a[href="#photos"],
body:has(#iletisim:target) header nav a[href="#iletisim"],
body:has(#surprise:target) header nav a[href="#surprise"],
body:has(#EN:target) header nav a[href="#EN"] {
    border-bottom: 1px solid var(--highlight);
}

/* Home is active when no other section is targeted */
body:not(:has(section:target)) header nav a[href="#home"] {
    border-bottom: 1px solid var(--highlight);
}

/* Fallback for browsers without :has() support */
@supports not selector(:has(*)) {
    /* Navigation will work normally without active highlighting in older browsers */
}

/* ------- General ------- */

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

a:hover {
    border-bottom: 1px solid;
}

section h1 {
    font-size: 1.6em;
    margin: 0 0 1em 0;
    color: var(--highlight);
}

i {
    color: var(--3rdcolor);
}

h2,
h3,
h4 {
    font-size: 1.2em;
    font-weight: 600;
    margin: 1.6em 0 0.6em 0;
}

h2 {
    font-size: 1.4em;
    color: #c9a6a6; /* Lighter version of text color instead of white */
}

h3 {
    color: var(--3rdcolor); /* Text color, bold weight */
    font-weight: 600;
}

.kunye {
    color: var(--highlight);
}

.sicrama {
    margin: 0 0 1em 0;
}

/* Event metadata styling */
.event-date,
.event-venue {
    font-size: 1em;
    font-weight: 400;
    margin: 0.3em 0;
    color: var(--highlight);
    opacity: 0.9;
}

/* Time elements in event metadata should look like regular h3 */
.event-date time {
    font-size: 1em;
    font-weight: 400;
    margin: 0;
    color: inherit;
    opacity: 1;
}

p,
ul,
ol,
article {
    max-width: 60ch; /* Limit line-length to 60 characters */
    margin-bottom: 1.5em;
}

ul {
    list-style-type: disc;
}

ul li::marker {
    content: "\2022   ";
}

li {
    margin-bottom: 0.2em;
}

ul,
ol {
    padding-left: 2ch;
}

b,
strong {
    font-weight: 600;
}

hr {
    height: 2px;
    border: 0;
    background: currentColor;
    opacity: 0.1;
    margin: 3em 0;
}

abbr {
    text-decoration: none;
}

abbr[title]:hover {
    opacity: 0.7;
    cursor: help;
}

blockquote {
    padding-left: 2ch;
    opacity: 0.7;
    margin-bottom: 0.6em;
    position: relative;
}

blockquote:before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.3em;
    bottom: 0.3em;
    background: currentColor;
    width: 1px;
    opacity: 0.2;
}

img,
svg,
video,
audio {
    display: block;
    max-width: 100%;
    height: auto;
    fill: currentColor;
}

code,
textarea {
    font-family:
        ui-monospace,
        SF Mono,
        Menlo,
        Monaco,
        Andale Mono,
        monospace;
    font-size: 1em;
    opacity: 0.7;
}

a code {
    opacity: 1;
}

pre,
textarea {
    /* for code samples */
    font-size: 0.9em;
    color: inherit;
    line-height: inherit;
    padding: 0.6em 0.9em;
    margin: 0.8em 0 1em 0;
    position: relative;
    display: block;
    width: 100%;
    white-space: pre;
    border: 0;
    border-radius: 4px;
    background: rgba(255, 255, 100, 0.075);
    box-shadow:
        inset 1px 1px 0 rgba(0, 0, 0, 0.2),
        inset -1px -1px 0 rgba(0, 0, 0, 0.04);
}

/* Inline footnotes */

label {
    cursor: pointer;
    vertical-align: super;
    line-height: 1;
    font-size: 0.75em;
    padding-left: 0.1em;
}

label:hover {
    color: var(--highlight);
}

label + input,
label + input + small {
    display: none;
}

input:checked + small {
    display: inline;
}

/* ------- Form Elements (Updated) ------- */

input,
textarea,
input[type="submit"],
input[type="button"],
button {
    /* Use site colors */
    border-color: var(--textcolor);
    background-color: var(--bgcolor);
    color: var(--textcolor);

    /* Updated styling */
    font-size: 18px; /* Match paragraph text */
    font-family: arial, system-ui, sans-serif; /* Match body font */
    letter-spacing: 5%; /* Match body letter spacing */
    line-height: 1.5; /* Match body line height */
    border: 1px solid;
    padding: 7px 10px; /* Updated from 5px to 7px */

    /* Rounded corners - cross-browser compatible */
    border-radius: 7px;
    -webkit-border-radius: 7px; /* Safari/Chrome */
    -moz-border-radius: 7px; /* Firefox */

    /* Remove browser-specific styling */
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;

    /* Ensure box model consistency */
    box-sizing: border-box;
}

/* Focus state for better accessibility */
input:focus,
textarea:focus,
button:focus {
    outline: 1px solid var(--highlight);
    outline-offset: 1px;
}

/* Submit button hover state */
input[type="submit"]:hover,
button:hover {
    background-color: var(--highlight);
    color: var(--bgcolor);
    border-color: var(--highlight);
}

/* ------- Expandable Text (Pure CSS) ------- */

#admin a {
    text-decoration: underline;
}

.gorultu-expandable {
    display: inline;
}

.gorultu-expandable .expand-trigger {
    display: none;
}

.gorultu-expandable .expand-label {
    color: var(--textcolor);
    cursor: pointer;
    font-weight: 500;
    transition: color 0.2s ease;
    border: none; /* Override general link styles */

    /* Override general label styles */
    vertical-align: baseline !important; /* Not superscript */
    line-height: 1.5 !important; /* Match body line height */
    font-size: 1em !important; /* Match body font size */
    padding-left: 0 !important; /* Remove label padding */
}

.gorultu-expandable .expand-label:hover {
    color: var(--highlight);
    text-decoration: none;
    border-bottom: none !important; /* No underlines for expandable text */
}

.gorultu-expandable .expanded-text {
    display: none;
    color: var(--textcolor); /* Same as body text color */
    font-weight: normal;
}

.gorultu-expandable .expand-trigger:checked ~ .expanded-text {
    display: inline;
    animation: gorultu-fadeIn 0.3s ease-in;
}

.gorultu-expandable .expand-trigger:checked ~ .expand-label {
    text-decoration: none;
    opacity: 0.7;
    color: var(--highlight);
}

@keyframes gorultu-fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Optional: Add a subtle indicator when expanded */
.gorultu-expandable .expand-trigger:checked ~ .expand-label::after {
    content: " →";
    font-size: 0.8em;
    opacity: 0.6;
}

/* Ensure expandable labels don't get external link arrows */
.gorultu-expandable .expand-label:after {
    content: none !important;
}

/* Figures */

figure {
    margin: 2em 0 1.5em 0;
}

figure figcaption {
    margin: 0.8em 0 0 0;
    font-size: 0.85em;
    opacity: 0.7;
}

figure img.float {
    float: right;
    width: 40%;
    padding: 0 0 10px 30px;
}
/* Responsive video embeds */

figure.video {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 */
    height: 0;
    overflow: hidden;
}

figure.video iframe,
figure.video object,
figure.video embed {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
    visibility: hidden; /* so loading="lazy" should work? */
}

section:target iframe {
    visibility: visible;
}

/* External links */

a[href*="//"]:after
{
    font-weight: 300;
    font-size: 0.85em;
    content: "\2197"; /* top right arrow: ↗ */
    color: var(--highlight);
    opacity: 0.75;
}

a[href*="//"]:hover:after
{
    color: var(--highlight);
    opacity: 1;
}

a[href*="//"]:hover
{
    border-bottom: 1px solid; /* No underlines on external links - they have arrows */
}

/* File links */

a:before {
    font-size: 0.7em;
    margin-right: 0.4em;
}

/* Add more filetypes here if you want */

a[href$=".pdf"]:before {
    content: "PDF";
}
a[href$=".txt"]:before {
    content: "TXT";
}
a[href$=".mp3"]:before {
    content: "MP3";
}
a[href$=".zip"]:before {
    content: "ZIP";
}
a[href$=".rar"]:before {
    content: "RAR";
}
a[href$=".jpeg"]:before,
a[href$=".jpg"]:before,
a[href$=".gif"]:before,
a[href$=".png"]:before {
    content: "IMG";
}

/* ------- News ------- */

article + article {
    margin-top: 4.5em;
}

article h2 {
    font-weight: 700;
    margin: 0 0 1em 0;
}

article time {
    margin-left: 0.6em;
    font-size: 0.8em;
    font-weight: 400;
    opacity: 0.7;
}

/* ------- Images Grid ------- */

.grid {
    display: grid;
    grid-gap: 5vmin;
    grid-template-columns: repeat(
        auto-fill,
        minmax(150px, 1fr)
    ); /* 150px = minimum image size */
    grid-auto-flow: dense;
    padding: 2em 0;
}

.grid a {
    position: relative;
    border: 0;
}

.grid a:hover {
    transform: scale(0.975);
    border-bottom: none; /* No underlines on image grid items */
}

/* For a square ratio */
.grid a:before {
    content: "";
    display: block;
    padding-top: 100%;
}

.grid a img {
    position: absolute;
    top: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* ------- Slideshow ------- */

.slides {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 100vh;
    overflow-y: scroll;
    scroll-snap-type: y mandatory;
}

.slides figure {
    height: 100vh;
    padding: 0 5vw;
    margin: 0;
    display: grid;
    place-items: center;
    align-content: center;
    scroll-snap-align: center;
}

.slides figure img {
    max-height: 88vh; /* Adjust if needed */
}

.slides figure.cover {
    padding: 0;
}

.slides figure.cover p.lefty {
    color: #b48989;
    padding: 0 50px 0 50px;
}

.slides figure.cover img {
    max-height: none;
    position: absolute;
    z-index: -1;
    width: 100vw;
    height: 100vh;
    object-fit: cover;
}

/* ------- Film Carousel (Pure CSS) ------- */

.film-carousel {
    position: relative;
    width: 80%;
    max-width: 800px;
    margin: 1em 0;
    background: var(--bgcolor);
}

/* Hide radio buttons */
.film-carousel input[type="radio"] {
    display: none;
}

/* Container for images */
.film-carousel .carousel-images {
    position: relative;
    width: 100%;
    overflow: hidden;
}

/* Individual carousel items */
.film-carousel .carousel-item {
    display: none;
    width: 100%;
}

.film-carousel .carousel-item img {
    width: 100%;
    height: auto;
    display: block;
}

/* Show the selected image */
.film-carousel
    input[type="radio"]:nth-of-type(1):checked
    ~ .carousel-images
    .carousel-item:nth-child(1),
.film-carousel
    input[type="radio"]:nth-of-type(2):checked
    ~ .carousel-images
    .carousel-item:nth-child(2),
.film-carousel
    input[type="radio"]:nth-of-type(3):checked
    ~ .carousel-images
    .carousel-item:nth-child(3) {
    display: block;
}

/* Navigation dots */
.film-carousel .carousel-nav {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 2;
}

.film-carousel .carousel-nav label {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--textcolor);
    opacity: 0.4;
    cursor: pointer;
    transition: opacity 0.3s ease;

    /* Override general label styles */
    vertical-align: baseline !important;
    line-height: 1 !important;
    font-size: 0 !important;
    padding: 0 !important;
}

.film-carousel .carousel-nav label:hover {
    opacity: 0.7;
    color: inherit; /* Prevent color change on hover */
}

/* Active dot */
.film-carousel
    input[type="radio"]:nth-of-type(1):checked
    ~ .carousel-nav
    label:nth-of-type(1),
.film-carousel
    input[type="radio"]:nth-of-type(2):checked
    ~ .carousel-nav
    label:nth-of-type(2),
.film-carousel
    input[type="radio"]:nth-of-type(3):checked
    ~ .carousel-nav
    label:nth-of-type(3) {
    opacity: 1;
    background: var(--highlight);
}

/* Image counter */
.film-carousel .carousel-counter {
    position: absolute;
    bottom: 15px;
    right: 15px;
    background: rgba(0, 0, 0, 0.7);
    color: var(--textcolor);
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 0.65em; /* Much smaller as requested */
    z-index: 2;
    opacity: 0.7;
}

/* Hide all counter spans by default */
.film-carousel .carousel-counter span {
    display: none;
}

/* Show the appropriate counter based on selected image */
.film-carousel
    input[type="radio"]:nth-of-type(1):checked
    ~ .carousel-counter
    .counter-1,
.film-carousel
    input[type="radio"]:nth-of-type(2):checked
    ~ .carousel-counter
    .counter-2,
.film-carousel
    input[type="radio"]:nth-of-type(3):checked
    ~ .carousel-counter
    .counter-3 {
    display: inline;
}

/* Ensure carousel images maintain aspect ratio */
.film-carousel .carousel-item a {
    display: block;
    border-bottom: none;
}

.film-carousel .carousel-item a:hover {
    border-bottom: none;
    transform: scale(1.02);
    transition: transform 0.3s ease;
}

/* ------- Enhanced Lightbox with Captions ------- */

.lightbox {
    display: none;
    color: var(--textcolor);
}

.lightbox:target {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: var(--bgcolor);
    border: 0;
    z-index: 999; /* High z-index to be on top */
    padding: 3em 2em; /* Add padding to ensure content fits */
}

.lightbox img {
    max-width: 85vw;
    max-height: 75vh; /* Limit height to leave room for caption */
    width: auto;
    height: auto;
    object-fit: contain;
    z-index: 1000;
}

/* Caption styling */
.lightbox .lightbox-caption {
    display: none; /* Hidden by default */
    position: absolute;
    bottom: 2em;
    padding: 0 2vw;
    text-align: center;
    font-size: 0.9em;
    color: var(--textcolor);
    opacity: 0.8;
    max-width: 60ch;
    z-index: 1000;
}

/* Show caption when lightbox is active */
.lightbox:target .lightbox-caption {
    display: block;
    animation: gorultu-fadeIn 0.5s ease-in;
}

/* Navigation areas for lightbox */
.lightbox .nav-prev,
.lightbox .nav-next {
    position: absolute;
    top: 0;
    width: 40%;
    height: 100%;
    z-index: 1002;
    cursor: pointer;
    border: none;
}

.lightbox .nav-prev {
    left: 0;
}

.lightbox .nav-next {
    right: 0;
}

/* Remove underlines from navigation links */
.lightbox .nav-prev:hover,
.lightbox .nav-next:hover {
    border-bottom: none;
}

/* Navigation dots on hover */
.lightbox .nav-prev:hover::after,
.lightbox .nav-next:hover::after {
    content: "";
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 12px;
    height: 12px;
    background: var(--highlight);
    border-radius: 50%;
    opacity: 0.8;
    animation: pulse 1s infinite;
}

.lightbox .nav-prev:hover::after {
    left: 100px;
}

.lightbox .nav-next:hover::after {
    right: 100px;
}

@keyframes pulse {
    0%,
    100% {
        opacity: 0.8;
    }
    50% {
        opacity: 0.4;
    }
}

/* Loading indicator - red flickering dot */
.lightbox:target:before {
    content: "";
    height: 40px;
    width: 40px;
    background: var(--highlight);
    border-radius: 50%;
    display: block;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 998;
    animation: flicker 0.8s infinite;
    pointer-events: none;
}

@keyframes flicker {
    0%,
    100% {
        opacity: 0.2;
    }
    50% {
        opacity: 0.6;
    }
}

/* Close button */
.lightbox .close-x {
    position: fixed;
    font-size: 2em;
    font-weight: 200;
    line-height: 0;
    top: 0.75em;
    right: 0.5em;
    z-index: 1003;
    cursor: pointer;
    color: var(--textcolor);
    opacity: 0.7;
    text-decoration: none;
    border: none;
}

.lightbox .close-x:hover {
    opacity: 1;
    color: var(--highlight);
    border-bottom: none;
}

/* ------- Smaller screens ------- */

@media only screen and (max-width: 680px) {
    body {
        font-size: 16px;
    }

    /* Update form elements for smaller screens */
    input,
    textarea,
    input[type="submit"],
    input[type="button"],
    button {
        font-size: 16px; /* Prevent zoom on mobile */
    }

    /* Scale badge for mobile - 150% larger */
    #badge-container {
        width: 120px; /* Increased from 80px (150% larger) */
        height: 120px; /* Increased from 80px (150% larger) */
        margin: -60px 0 0 -60px; /* Adjusted for smaller size */
    }

    figure img.float {
        width: 100%;
        float: center;
        padding: 0 5% 10% 5%;
    }

    /* Lightbox adjustments for mobile */
    .lightbox img {
        width: 95%; /* Use more space on mobile */
        max-width: 95vw;
    }

    .lightbox .lightbox-caption {
        font-size: 0.85em;
        padding: 0 3vw;
    }

    /* Film carousel adjustments for mobile */
    .film-carousel {
        width: 100%;
    }

    .film-carousel .carousel-counter {
        font-size: 0.75em;
        padding: 3px 8px;
        bottom: 10px;
        right: 10px;
    }

    .film-carousel .carousel-nav {
        bottom: 10px;
    }
}

@media only screen and (max-width: 540px) {
    nav {
        width: 100%;
    } /* Fix for older webkit versions */

    /* Further scale badge for very small screens - 150% larger */
    #badge-container {
        width: 90px; /* Increased from 60px (150% larger) */
        height: 90px; /* Increased from 60px (150% larger) */
        margin: -45px 0 0 -45px;
    }

    /* Lightbox adjustments for very small screens */
    .lightbox img {
        width: 100%; /* Full width on very small screens */
        max-width: 100vw;
    }
}

/* ------- Print ------- */

@media print {
    nav,
    .lightbox:target:after {
        display: none;
    }

    article,
    figure,
    img {
        page-break-inside: avoid;
        break-inside: avoid;
    }

    /* Inline footnotes */

    label + input + small {
        display: inline;
    }
    label + input + small:before {
        content: "[";
    }
    label + input + small:after {
        content: "]";
    }

    /* Slides */

    .slides,
    .slides figure {
        position: relative;
        height: auto;
        padding: 0;
    }

    .slides figure img,
    .slides figure.cover img {
        max-height: auto;
        position: relative;
        z-index: 1;
        width: auto;
        height: 100vh;
        object-fit: contain;
    }
}