/* Blood Moon Games - Unified Theme CSS */
/* Red/Black/Gray Color Scheme */

:root {
    /* Blood Moon Horror Palette (Coolors) */
    /* Core Reds */
    --blood-red: #D00000;      /* Primary brand red */
    --dark-red: #9D0208;       /* Deeper red for gradients */
    --light-red: #E85D04;      /* Warmer red/orange highlight */

    /* Background / Neutrals */
    --pure-black: #000000;     /* Keep deep black as base */
    --brand-navy: #03071E;     /* Very dark blue for subtle depth */
    --dark-gray: #1a1a1a;      /* Minimal use */
    --medium-gray: #404040;
    --light-gray: #6b7280;

    /* Text Colors */
    --white: #ffffff;
    --light-text: #e5e7eb;
    --muted-text: #9ca3af;

    /* Accent Oranges (glow/highlights) */
    --accent-orange-600: #DC2F02;
    --accent-orange-500: #E85D04;
    --accent-orange-400: #F48C06;
    --accent-orange-300: #FAA307;
    --accent-orange-200: #FFBA08;

    /* Legacy aliases for compatibility */
    --accent-red: var(--accent-orange-500);
    --hover-red: #6A040F;      /* Dark maroon hover */
    --success-green: #10b981;
    --warning-orange: var(--accent-orange-400);
    /* Layout */
    --header-height: 80px;
}

/* Base Styles */
body {
    background: var(--pure-black) !important; /* remove site-wide bg image; hero handles page banner */
    color: var(--white) !important;
    font-family: 'Lato', sans-serif;
}

/* Page-wide dim overlay for readability */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background: radial-gradient(ellipse at center, rgba(3,7,30,0.35) 0%, rgba(0,0,0,0.65) 60%, rgba(0,0,0,0.85) 100%),
                repeating-linear-gradient(to bottom, rgba(255,255,255,0.03) 0px, rgba(255,255,255,0.03) 1px, rgba(0,0,0,0) 1px, rgba(0,0,0,0) 3px);
    pointer-events: none;
    z-index: -1;
}

/* Atmospheric Fog Overlay (subtle, animated) */
body::after {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9000; /* below lightbox (10000) */
    opacity: 0.05;
    mix-blend-mode: screen;
    background-image:
        radial-gradient(1000px 600px at 20% 15%, rgba(255,255,255,0.04), transparent 60%),
        radial-gradient(900px 500px at 80% 85%, rgba(255,255,255,0.03), transparent 60%),
        radial-gradient(700px 700px at 50% 60%, rgba(255,255,255,0.035), transparent 60%);
    background-repeat: no-repeat;
    background-size: 140% 140%, 130% 130%, 150% 150%;
    will-change: transform, background-position;
    animation: fogDrift 60s ease-in-out infinite alternate;
}

/* Edge vignette overlays to fill empty sides on wide screens */
#page-wrapper::before,
#page-wrapper::after {
    content: '';
    position: fixed;
    top: 0;
    bottom: 0;
    width: 72px;
    pointer-events: none;
    z-index: 8500;
}
#page-wrapper::before {
    left: 0;
    background: linear-gradient(90deg, rgba(3,7,30,0.85) 0%, rgba(157,2,8,0.28) 45%, rgba(0,0,0,0) 100%);
}
#page-wrapper::after {
    right: 0;
    background: linear-gradient(270deg, rgba(3,7,30,0.85) 0%, rgba(157,2,8,0.28) 45%, rgba(0,0,0,0) 100%);
}

@media (max-width: 980px) {
    #page-wrapper::before, #page-wrapper::after { width: 36px; opacity: 0.7; }
}
@media (max-width: 640px) {
    #page-wrapper::before, #page-wrapper::after { display: none; }
}

@keyframes fogDrift {
    0%   { transform: translate3d(0, 0, 0) scale(1); background-position: 0 0, 0 0, 0 0; }
    50%  { transform: translate3d(-1.5%, 1.2%, 0) scale(1.02); background-position: -2% 1%, 1% -1%, -1% 2%; }
    100% { transform: translate3d(1.2%, -1.2%, 0) scale(1.04); background-position: 2% -1%, -1% 1%, 1% -2%; }
}

@media (max-width: 768px) {
    body::after { opacity: 0.035; }
}

/* Header Styling */
#header {
    background: linear-gradient(180deg, var(--brand-navy) 0%, rgba(0, 0, 0, 0.95) 100%) !important;
    box-shadow: 0 4px 20px rgba(220, 38, 38, 0.2);
    transition: all 0.3s ease;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 10000;
    height: var(--header-height);
    display: flex;
    align-items: center;
}

#header.alt {
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0.6) 100%) !important;
    backdrop-filter: blur(15px);
}
/* Prevent content from being hidden by fixed header */
#page-wrapper {
    padding-top: var(--header-height);
}

/* Navigation */
#nav ul li a {
    color: var(--white) !important;
    transition: all 0.3s ease;
}

/* Center navigation items */
#nav ul {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1em;
}

#nav ul li a:hover,
#nav ul li.current a {
    color: var(--blood-red) !important;
    background: rgba(220, 38, 38, 0.1);
    border-radius: 4px;
}

/* Buttons - Unified Red Theme */
.button,
input[type="button"],
input[type="submit"],
button {
    background: var(--blood-red) !important;
    border-color: var(--blood-red) !important;
    color: var(--white) !important;
    transition: all 0.3s ease;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 1px;
}

.button:hover,
input[type="button"]:hover,
input[type="submit"]:hover,
button:hover {
    background: var(--hover-red) !important;
    border-color: var(--hover-red) !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(220, 38, 38, 0.4);
}

.button.primary {
    background: var(--blood-red) !important;
    border-color: var(--blood-red) !important;
    color: var(--white) !important;
}

.button.primary:hover {
    background: var(--hover-red) !important;
    border-color: var(--hover-red) !important;
}
/* Pressed state */
.button:active,
input[type="button"]:active,
input[type="submit"]:active,
button:active {
    transform: translateY(0);
    filter: brightness(1.05);
}

/* Responsive button sizing and wrapping */
.button,
input[type="button"],
input[type="submit"],
button {
    line-height: 1.25 !important;
    min-width: 0 !important;
    width: auto;
    height: auto;
    padding: 0.9em 1.2em !important;
    white-space: normal !important;
    overflow-wrap: anywhere !important;
    word-break: normal !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--blood-red) !important;
    box-sizing: border-box !important;
}

/* Ensure list buttons don’t crop and can fill width when needed */
ul.buttons .button,
ul.actions .button { max-width: 100%; }

@media (max-width: 768px) {
    ul.buttons .button,
    ul.actions .button { width: 100% !important; }
}

/* Banner Section */
#banner {
    background: var(--pure-black) !important;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 80vh;
}

#banner::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('../../images/screenshots/20250901133718_1.jpg') center/cover;
    opacity: 0.4;
    z-index: 0;
    filter: blur(1px);
}

#banner::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(220, 38, 38, 0.1) 0%, rgba(0, 0, 0, 0.7) 100%);
    z-index: 1;
}

#banner .inner {
    background: rgba(0, 0, 0, 0.6) !important;
    border-radius: 15px;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(220, 38, 38, 0.3);
    position: relative;
    z-index: 2;
    border: 1px solid rgba(220, 38, 38, 0.2);
    margin: 0 auto;
    padding: 2.5em 2em;
}

/* Main Content */
#main {
    background: transparent !important;
    position: relative;
}

/* Wrapper Sections - Flowing Transitions */
.wrapper.style1 {
    background: rgba(0,0,0,0.35) !important; /* lighter to reveal hero/background */
    box-shadow: 0 4px 20px rgba(220, 38, 38, 0.1);
    position: relative;
    overflow: hidden;
}
.wrapper.style1::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at top, rgba(208,0,0,0.05) 0%, transparent 55%),
                radial-gradient(ellipse at bottom, rgba(3,7,30,0.06) 0%, transparent 60%);
    pointer-events: none;
}

.wrapper.style1::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, var(--blood-red) 50%, transparent 100%);
    opacity: 0.6;
}

.wrapper.style2 {
    background: linear-gradient(135deg, rgba(208,0,0,0.20) 0%, rgba(157,2,8,0.20) 50%, rgba(208,0,0,0.20) 100%) !important;
    color: var(--white) !important;
    box-shadow: 0 8px 32px rgba(220, 38, 38, 0.18);
    position: relative;
}

.wrapper.style2::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at center, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    pointer-events: none;
}

.wrapper.style3 {
    background: rgba(0,0,0,0.30) !important;
    color: var(--white) !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}

.wrapper.style4 {
    background: rgba(0,0,0,0.35) !important;
    color: var(--white) !important;
    border-radius: 15px;
    box-shadow: 0 8px 32px rgba(220, 38, 38, 0.18);
    border: 1px solid rgba(220, 38, 38, 0.12);
}

/* Icons */
.icon.solid.featured {
    color: var(--blood-red) !important;
    text-shadow: 0 0 10px rgba(220, 38, 38, 0.5);
}

.icon.solid.featured:before {
    font-size: 3em;
}

/* Enhanced Headers with Better Spacing */
h1, h2, h3, h4, h5, h6 {
    color: var(--white) !important;
    text-shadow: 0 3px 8px rgba(0, 0, 0, 0.7), 0 1px 3px rgba(208, 0, 0, 0.3);
    position: relative;
    margin-bottom: 1.5em;
    margin-top: 1.5em;
    line-height: 1.4;
    font-weight: 600;
}

h1 {
    margin-bottom: 1em;
    margin-top: 0.5em;
    padding: 0.5em 0;
}

h2 {
    position: relative;
    padding-bottom: 0.8em;
    margin-bottom: 1.5em;
    margin-top: 2em;
}

h3 {
    margin-bottom: 1.2em;
    margin-top: 1.8em;
}

h4 {
    margin-bottom: 1em;
    margin-top: 1.5em;
}

/* Paragraph spacing */
p {
    margin-bottom: 1.2em;
    line-height: 1.9;
    padding: 0.25em 0;
    color: var(--light-text);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
    font-weight: 400;
}

/* Enhanced List spacing with internal padding */
ul, ol {
    margin-bottom: 2em;
    padding-left: 3em;
    padding-right: 2em;
    padding-top: 1em;
    padding-bottom: 1em;
}

li {
    margin-bottom: 1.2em;
    line-height: 1.8;
    padding-left: 1em;
    padding-right: 1em;
    padding-top: 0.5em;
    padding-bottom: 0.5em;
    position: relative;
}

/* List item bleeding effect */
li::before {
    content: '';
    position: absolute;
    left: -0.5em;
    right: -0.5em;
    top: -0.2em;
    bottom: -0.2em;
    background: rgba(220, 38, 38, 0.05);
    border-radius: 8px;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s ease;
}

li:hover::before {
    opacity: 1;
}

/* Nested list spacing */
ul ul, ol ol, ul ol, ol ul {
    margin-top: 1em;
    margin-bottom: 1em;
    padding-left: 2em;
}

/* List markers bleeding effect */
ul li::marker, ol li::marker {
    color: transparent;
}

h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 2px;
    background: linear-gradient(90deg, transparent 0%, var(--blood-red) 50%, transparent 100%);
    border-radius: 1px;
}

/* Links */
a {
    color: var(--blood-red) !important;
    transition: color 0.2s ease, text-shadow 0.2s ease, box-shadow 0.2s ease;
}

a:hover {
    color: var(--accent-orange-400) !important;
    text-shadow: 0 0 6px rgba(244, 140, 6, 0.5);
}

/* Focus rings for accessibility */
a:focus,
button:focus,
.button:focus,
input:focus,
select:focus,
textarea:focus {
    outline: 2px solid var(--accent-orange-400);
    outline-offset: 2px;
    box-shadow: 0 0 0 3px rgba(220, 47, 2, 0.35);
}

/* Visually hidden utility (for sr-only labels) */
.sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* Form Elements */
input[type="text"],
input[type="email"],
input[type="password"],
textarea,
select {
    background: var(--dark-gray) !important;
    border: 2px solid var(--medium-gray) !important;
    color: var(--white) !important;
    border-radius: 5px;
    transition: all 0.3s ease;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
textarea:focus,
select:focus {
    border-color: var(--blood-red) !important;
    box-shadow: 0 0 10px rgba(220, 38, 38, 0.3);
    outline: none;
}

/* Footer with Enhanced Spacing */
#footer {
    background: linear-gradient(180deg, var(--brand-navy) 0%, var(--pure-black) 100%) !important;
    color: var(--light-text) !important;
    position: relative;
    overflow: hidden;
    padding: 3em 2em;
    margin: 2em 1em 0 1em;
    text-align: center;
}

#footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, var(--blood-red) 50%, transparent 100%);
    opacity: 0.6;
}

#footer .icons {
    margin: 2em 0;
    padding: 1em 0;
    display: flex;
    gap: 1em;
    justify-content: center;
    align-items: center;
}

#footer .icons a {
    color: var(--blood-red) !important;
    transition: all 0.3s ease;
    margin: 0 1em;
    padding: 1em;
    font-size: 1.5em;
    display: inline-block;
    border-radius: 50%;
    background: rgba(220, 38, 38, 0.1);
    width: 3em;
    height: 3em;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

#footer .icons a:hover {
    color: var(--light-red) !important;
    transform: translateY(-3px) scale(1.1);
    background: rgba(220, 38, 38, 0.2);
    box-shadow: 0 8px 20px rgba(220, 38, 38, 0.3);
}

/* Font Awesome Icon Fixes (v6) */
.fa, .fas, .far, .fab, .fa-solid, .fa-regular, .fa-brands {
    font-style: normal !important;
    font-variant: normal !important;
    text-rendering: auto !important;
    -webkit-font-smoothing: antialiased !important;
    -moz-osx-font-smoothing: grayscale !important;
}

/* Families */
.fa, .fas, .far, .fa-solid, .fa-regular {
    font-family: "Font Awesome 6 Free" !important;
}
.fab, .fa-brands {
    font-family: "Font Awesome 6 Brands" !important;
}

/* Weights */
.fa-solid, .fas { font-weight: 900 !important; }
.fa-regular, .far { font-weight: 400 !important; }

/* Icon display fixes for template .icon helper */
.icon {
    font-weight: 900 !important;
}
.icon:before {
    font-weight: 900 !important;
}

/* Breadcrumb Navigation */
nav[aria-label="Breadcrumb"] {
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.9) 0%, rgba(26, 26, 26, 0.8) 100%) !important;
    backdrop-filter: blur(10px);
    position: relative;
}
nav[aria-label="Breadcrumb"] .container { max-width: 1200px; margin: 0 auto; }

nav[aria-label="Breadcrumb"]::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, var(--blood-red) 50%, transparent 100%);
    opacity: 0.4;
}

nav[aria-label="Breadcrumb"] a {
    color: var(--blood-red) !important;
}

nav[aria-label="Breadcrumb"] a:hover {
    color: var(--light-red) !important;
}

/* Discord Section */
#community-discord {
    background: var(--pure-black) !important;
    border-radius: 15px;
    box-shadow: 0 8px 32px rgba(220, 38, 38, 0.2);
    position: relative;
    overflow: hidden;
}
#community-discord .row {
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    justify-content: space-between;
    align-items: center;
}
#community-discord header,
#community-discord p {
    text-align: left !important;
}

#community-discord::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at center, rgba(220, 38, 38, 0.1) 0%, transparent 70%);
    pointer-events: none;
}

/* CTA Section */
#cta {
    background: var(--pure-black) !important;
    position: relative;
    overflow: hidden;
}

#cta::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('../../images/screenshots/20250901133355_1.jpg') center/cover;
    opacity: 0.3;
    z-index: 0;
    filter: blur(1px);
}

#cta::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(220, 38, 38, 0.1) 0%, rgba(0, 0, 0, 0.7) 100%);
    z-index: 1;
}

#cta > * {
    position: relative;
    z-index: 2;
}

/* Special Effects */
.special.container {
    position: relative;
}

.special.container::before {
    content: '';
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background: linear-gradient(90deg, transparent 0%, var(--blood-red) 50%, transparent 100%);
    border-radius: 2px;
    box-shadow: 0 0 10px rgba(220, 38, 38, 0.5);
}

/* Smooth Section Transitions */
section {
    transition: all 0.3s ease;
    position: relative;
}

section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, rgba(220, 38, 38, 0.2) 50%, transparent 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

section:hover::before {
    opacity: 1;
}

/* Title flicker for horror ambience (subtle) */
@keyframes titleFlicker {
    0%, 100% { text-shadow: 0 3px 8px rgba(0,0,0,0.7), 0 1px 3px rgba(208,0,0,0.3); opacity: 1; }
    48% { opacity: 0.98; }
    50% { text-shadow: 0 2px 6px rgba(0,0,0,0.6), 0 0 6px rgba(208,0,0,0.35); opacity: 0.94; }
    52% { opacity: 0.99; }
}
.page-hero__title, header.major h2, header.special h2 { animation: titleFlicker 6s infinite steps(60) alternate; }

/* Image Styling */
img {
    border-radius: 10px;
    transition: transform 0.3s ease-in-out, opacity 0.3s ease-in-out, box-shadow 0.3s ease-in-out;
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.5), 0 2px 8px rgba(208, 0, 0, 0.2);
    transform: translate3d(0,0,0);
}
/* Center screenshots */
.screenshot {
    display: block;
    margin: 0 auto;
    max-width: 100%;
    height: auto;
}

/* Carousel card image sizing: keep consistent visible area */
.gallery-item .screenshot {
    width: 100%;
    height: 220px;
    object-fit: cover;
}
@media (max-width: 480px) {
    .gallery-item .screenshot { height: 160px; }
}

/* Lively but subtle hover only in carousel (disabled in lightbox) */
.gallery-wrapper .gallery-item .screenshot:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 8px 24px rgba(0,0,0,0.45), 0 3px 10px rgba(208,0,0,0.22);
    opacity: 0.98;
}

.lightbox.open img:hover { transform: none; box-shadow: 0 20px 60px rgba(0,0,0,0.6); opacity: 0.85; }

img:hover {
    transform: translateY(-3px) scale(1.04);
    box-shadow: 0 10px 35px rgba(0, 0, 0, 0.6), 0 4px 12px rgba(208, 0, 0, 0.3);
    opacity: 0.95;
}

/* Gallery: layout and controls */
.gallery-wrapper {
    position: relative;
    overflow: hidden;
}

.gallery-container {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    /* Reintroduce soft edge masks without adding padding that causes offsets */
    -webkit-mask-image: linear-gradient(to right, transparent 0, black 48px, black calc(100% - 48px), transparent 100%);
            mask-image: linear-gradient(to right, transparent 0, black 48px, black calc(100% - 48px), transparent 100%);
}

.gallery-container::-webkit-scrollbar { display: none; }

.gallery-item {
    flex: 0 0 auto;
    /* Consistent card width to match autoscroll step and avoid double-image slot */
    min-width: clamp(280px, 26vw, 360px);
    scroll-snap-align: center;
}

.gallery-prev, .gallery-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(3, 7, 30, 0.35);
    color: #fff;
    border: 1px solid rgba(208, 0, 0, 0.25);
    padding: 0.55em 0.8em;
    cursor: pointer;
    z-index: 3;
    border-radius: 9999px;
    box-shadow: 0 6px 18px rgba(0,0,0,0.28), 0 0 0 1px rgba(220,47,2,0.12) inset;
    opacity: 0.95;
    transition: background 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.gallery-prev { left: 24px; }
.gallery-next { right: 24px; }

.gallery-prev:hover, .gallery-next:hover { background: rgba(208,0,0,0.6); border-color: rgba(248,140,6,0.35); }

/* Show arrows on hover or focus (desktop) */
.gallery-wrapper:hover .gallery-prev,
.gallery-wrapper:hover .gallery-next,
.gallery-wrapper:focus-within .gallery-prev,
.gallery-wrapper:focus-within .gallery-next { opacity: 1; }

/* Disable clicks during drag */
.gallery-wrapper.is-dragging .gallery-prev,
.gallery-wrapper.is-dragging .gallery-next { pointer-events: none; }

/* Always show arrows on touch devices */
@media (hover: none) {
    .gallery-prev, .gallery-next { opacity: 0.75; }
}

.gallery-prev:active, .gallery-next:active {
    transform: translateY(calc(-50% + 1px)) scale(0.98);
}

/* Shared Lightbox */
.lightbox {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.88);
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    transition: opacity 450ms ease;
}

.lightbox.open { display: flex; opacity: 1; }

.lightbox img {
    max-width: 92vw;
    max-height: 88vh;
    border-radius: 10px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.6);
    transform: translateY(6px) scale(0.985);
    opacity: 0.85;
    transition: transform 600ms ease, opacity 600ms ease;
}

.lightbox .lightbox-close, .lightbox .lightbox-prev, .lightbox .lightbox-next {
    position: absolute;
    background: rgba(3,7,30,0.7);
    color: #fff;
    border: 1px solid rgba(208,0,0,0.4);
    padding: 0.6em 0.8em;
    border-radius: 9999px;
    cursor: pointer;
}
.lightbox .lightbox-close {
    font-size: 1.1rem;
    padding: 0.7em;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.35), 0 0 0 1px rgba(220,47,2,0.2) inset;
}
.lightbox .lightbox-close:hover {
    background: rgba(208,0,0,0.75);
}

.lightbox .lightbox-close { top: 16px; right: 16px; }
.lightbox .lightbox-prev { left: 24px; top: 50%; transform: translateY(-50%); }
.lightbox .lightbox-next { right: 24px; top: 50%; transform: translateY(-50%); }

/* Desktop: slightly smaller UI scale */
@media (min-width: 1024px) {
    body { font-size: 0.85rem; }
    h1 { font-size: 2.0rem; }
    h2 { font-size: 1.6rem; }
    h3 { font-size: 1.25rem; }
    .wrapper { padding: 2.2em 2em; }
    .container { padding: 1.3em 1em; }
}

/* Logo Styling */
#header img {
    border-radius: 0;
    box-shadow: none;
    transition: all 0.3s ease;
}

#header img:hover {
    transform: scale(1.05);
    filter: drop-shadow(0 0 10px rgba(220, 38, 38, 0.5));
}

/* Enhanced Padding and Margins for Better Readability */
.wrapper {
    transition: all 0.3s ease;
    margin: 2em 1em;
    padding: 4em 3em;
}

.wrapper + .wrapper {
    margin-top: 1em;
}

/* Container spacing improvements */
.container {
    padding: 2em 1.5em;
    margin: 1em 0.5em;
}

/* Body spacing */
body {
    padding: 1em;
    margin: 0;
    line-height: 1.8;
}

/* Global centering helpers */
header.major,
header.special,
.special.container,
#main,
#cta,
#banner .inner {
    text-align: center;
}

/* Hero watermark logo */
#banner .inner::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url('../images/bmg-no-stroke-white.png') center/40% no-repeat;
    opacity: 0.04;
    pointer-events: none;
}

.container {
    margin-left: auto;
    margin-right: auto;
}

.row {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    justify-content: space-between;
    gap: 1.25em;
}

/* Spread items across sections */
.wrapper .row,
.container > .row,
.row.gtr-50 {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    justify-content: space-between;
}

/* Center button groups */
.buttons,
.actions {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.75em;
    list-style: none;
    padding-left: 0;
}

.buttons li,
.actions li {
    float: none;
}

/* Equalize feature/related cards */
.row.gtr-50 > [class*="col-"] > section {
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    text-align: center;
}
.row.gtr-50 { max-width: 1200px; margin-left: auto; margin-right: auto; }

/* Spread gtr-50 rows horizontally using responsive grid */
.row.gtr-50 {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)) !important;
    gap: 1.6rem !important;
    align-items: start !important;
}
@media (max-width: 420px) {
    .row.gtr-50 { grid-template-columns: 1fr !important; }
}

/* Page hero should sit below fixed header and not be overlapped */
.page-hero {
    margin-top: calc(var(--header-height) * -1);
    padding-top: calc(var(--header-height) + 2rem);
}

/* Main content spacing */
#main {
    padding: 2.2em 0;
    margin: 0 0.6em;
}

/* Section spacing */
section {
    padding: 1.6em 0.9em;
    margin: 0.8em 0;
}

/* Remove hard borders from all elements */
* {
    border: none !important;
}

/* Soft, bleeding borders with smear effects */
.wrapper, section, .container {
    box-shadow: 
        0 12px 50px rgba(3, 7, 30, 0.35),
        0 6px 20px rgba(208, 0, 0, 0.18),
        0 3px 12px rgba(0, 0, 0, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.08),
        0 0 0 1px rgba(220, 47, 2, 0.2);
    backdrop-filter: blur(18px);
    border-radius: 16px;
    position: relative;
    overflow: hidden;
}

/* Bleeding border effect */
.wrapper::before, section::before, .container::before {
    content: '';
    position: absolute;
    top: -3px;
    left: -3px;
    right: -3px;
    bottom: -3px;
    background: linear-gradient(45deg, 
        rgba(220, 47, 2, 0.15) 0%, 
        rgba(3, 7, 30, 0.12) 25%, 
        rgba(208, 0, 0, 0.08) 50%, 
        rgba(3, 7, 30, 0.12) 75%, 
        rgba(220, 47, 2, 0.15) 100%);
    border-radius: 20px;
    z-index: -1;
    filter: blur(4px);
    opacity: 0.7;
}

/* Soft borders for specific elements */
.wrapper.style1 {
    box-shadow: 
        0 8px 32px rgba(220, 38, 38, 0.1),
        0 2px 8px rgba(0, 0, 0, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.wrapper.style2 {
    box-shadow: 
        0 12px 40px rgba(220, 38, 38, 0.16),
        0 4px 12px rgba(0, 0, 0, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.wrapper.style3 {
    box-shadow: 
        0 6px 24px rgba(0, 0, 0, 0.18),
        0 2px 6px rgba(0, 0, 0, 0.10),
        inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.wrapper.style4 {
    box-shadow: 
        0 10px 36px rgba(220, 38, 38, 0.14),
        0 3px 10px rgba(0, 0, 0, 0.10),
        inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

/* Smooth gradient transitions between sections */
#main > * {
    position: relative;
    z-index: 1;
}

#main > *::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent 0%, rgba(220, 38, 38, 0.1) 50%, transparent 100%);
    z-index: 0;
}

/* Enhanced Blur Effects */
.wrapper, section, .container {
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
}

.wrapper.style2 {
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

/* Soft glow effects */
.wrapper:hover {
    box-shadow: 
        0 8px 40px rgba(220, 38, 38, 0.2),
        0 4px 16px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Enhanced mobile responsiveness */
@media (max-width: 1200px) {
    .wrapper {
        margin: 0 1em;
        border-radius: 8px;
    }
    
    .wrapper.style2 {
        backdrop-filter: blur(15px);
        -webkit-backdrop-filter: blur(15px);
    }
}

@media (max-width: 768px) {
    .button {
        width: 100%;
        margin: 0.5em 0;
        padding: 1em 2em;
        font-size: 1.1em;
    }
    
    #nav ul {
        flex-direction: column;
        gap: 0.5em;
        padding: 1em;
    }
    
    .wrapper {
        padding: 2em 1em !important;
        margin: 0 0.5em;
        border-radius: 8px;
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
    }
    
    /* Mobile-optimized shadows */
    .wrapper, section, .container {
        box-shadow: 
            0 4px 16px rgba(0, 0, 0, 0.1),
            0 1px 3px rgba(0, 0, 0, 0.08),
            inset 0 1px 0 rgba(255, 255, 255, 0.03);
    }
    
    /* Mobile image optimization */
    img {
        max-width: 100%;
        height: auto;
        border-radius: 6px;
    }
    
    /* Mobile header adjustments */
    #header {
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
    }
    
    /* Mobile banner adjustments */
    #banner {
        padding: 2em 1em;
    }
    
    #banner .inner {
        border-radius: 12px;
        backdrop-filter: blur(15px);
        -webkit-backdrop-filter: blur(15px);
    }
}

@media (max-width: 480px) {
    .wrapper {
        padding: 1.5em 0.8em !important;
        margin: 0 0.3em;
        border-radius: 6px;
    }
    
    .button {
        padding: 0.8em 1.5em;
        font-size: 1em;
    }
    
    /* Ultra-mobile shadows */
    .wrapper, section, .container {
        box-shadow: 
            0 2px 12px rgba(0, 0, 0, 0.08),
            0 1px 2px rgba(0, 0, 0, 0.06),
            inset 0 1px 0 rgba(255, 255, 255, 0.02);
    }
    
    /* Mobile text adjustments */
    h1 { font-size: 2em; }
    h2 { font-size: 1.5em; }
    h3 { font-size: 1.3em; }
    
    /* Mobile navigation */
    #nav ul {
        padding: 0.5em;
        gap: 0.3em;
    }
    
    #nav ul li a {
        padding: 0.8em 1em;
        font-size: 0.9em;
    }
}

/* Loading Animation */
@keyframes bloodPulse {
    0% { box-shadow: 0 0 5px var(--blood-red); }
    50% { box-shadow: 0 0 20px var(--blood-red), 0 0 30px var(--blood-red); }
    100% { box-shadow: 0 0 5px var(--blood-red); }
}

.button.primary {
    animation: bloodPulse 2s infinite;
}

/* Contact: larger primary button */
body.contact .button.primary {
    font-size: 1.2rem !important;
    padding: 0.8em 1.6em !important;
    line-height: 1.1 !important;
    min-width: 0 !important;
    width: 100% !important;
}
@media (max-width: 768px) {
    body.contact .button.primary { font-size: 1.25rem !important; padding: 0.85em 1.4em !important; }
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--dark-gray);
}

::-webkit-scrollbar-thumb {
    background: var(--blood-red);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--hover-red);
}

/* Center section titles */
section header h2,
section header h3 {
    text-align: center !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

/* Justify card/body text inside horizontally spread boxes */
.grid > [class*="col-"] > section p,
.row.gtr-50 > [class*="col-"] > section p {
    text-align: justify !important;
    text-justify: inter-word !important;
}

/* Discord section: center title, justify paragraph */
#community-discord h2 { text-align: center !important; }
#community-discord p { text-align: justify !important; }

/* Discord layout alignment: center on mobile, symmetric on desktop */
#community-discord header, #community-discord p { text-align: inherit !important; }
#community-discord .row { margin-left: auto !important; margin-right: auto !important; justify-items: center !important; align-items: center !important; }
#community-discord .col-8, #community-discord .col-4 { display: flex !important; flex-direction: column !important; justify-content: center !important; }
#community-discord .col-8 *, #community-discord .col-4 * { text-align: inherit !important; }

/* Mobile/tablet: center both */
@media (max-width: 979px) {
    #community-discord .col-8, #community-discord .col-4 { align-items: center !important; text-align: center !important; }
    #community-discord .discord-card { align-self: center !important; justify-content: center !important; }
}

/* Desktop: left column left, right column right */
@media (min-width: 980px) {
    #community-discord .col-8 { align-items: flex-start !important; text-align: left !important; }
    #community-discord .col-4 { align-items: flex-end !important; text-align: right !important; }
    #community-discord .col-4 .discord-card { justify-content: flex-end !important; }
}

/* Contact page: quick navigation buttons layout */
body.contact header.special > div {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)) !important;
    grid-auto-flow: dense !important;
    gap: 0.6em !important;
    justify-items: stretch !important;
    align-items: stretch !important;
    max-width: 900px !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

body.contact header.special a.button {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    min-height: 44px !important;
    padding: 0.85em 1.2em !important;
    line-height: 1.15 !important;
    white-space: normal !important;
    overflow: visible !important;
    text-align: center !important;
}

@media (max-width: 768px) {
    body.contact header.special > div {
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)) !important;
    }
}

/* Contact: Newsletter layout (desktop) */
body.contact form.newsletter .row {
    display: grid !important;
    grid-template-columns: 1fr minmax(200px, max-content) !important;
    align-items: center !important;
    gap: 0.6em !important;
}
body.contact form.newsletter input[type="email"] {
    height: 44px !important;
    line-height: 1.2 !important;
}
body.contact form.newsletter .button.primary {
    height: 44px !important;
    padding: 0 1.4em !important;
    line-height: 1.1 !important;
    min-width: 200px !important;
    white-space: normal !important;
    overflow-wrap: anywhere !important;
}

@media (max-width: 768px) {
    body.contact form.newsletter .row { grid-template-columns: 1fr !important; }
    body.contact form.newsletter .button.primary { width: 100% !important; }
}

/* Force 3-up layout for .grid.grid-3 on desktop */
.grid.grid-3 {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 1.6rem !important;
    align-items: start !important;
}
@media (max-width: 980px) {
    .grid.grid-3 { grid-template-columns: repeat(2, 1fr) !important; }
}
@media (max-width: 540px) {
    .grid.grid-3 { grid-template-columns: 1fr !important; }
}

/* Desktop refinements */
@media (min-width: 981px) {
    /* Contact quick-nav buttons smaller on desktop */
    body.contact header.special a.button {
        font-size: 0.95em !important;
        padding: 0.6em 1em !important;
        min-height: 40px !important;
    }
    /* Newsletter email field larger on desktop */
    body.contact form.newsletter input[type="email"] {
        height: 50px !important;
        font-size: 1.05em !important;
        padding: 0 0.9em !important;
    }
    body.contact form.newsletter .button.primary {
        height: 50px !important;
    }
}

/* Equalize cards in 3-up grids (e.g., Related Links) */
.grid.grid-3 {
    align-items: stretch !important;
}
.grid.grid-3 > [class*="col-"] {
    height: 100% !important;
}
.grid.grid-3 > [class*="col-"] > section {
    height: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between !important;
}

/* Center content inside grid cards */
.grid.grid-3 > [class*="col-"] > section {
    text-align: center !important;
}
.grid.grid-3 > [class*="col-"] > section header,
.grid.grid-3 > [class*="col-"] > section p,
.grid.grid-3 > [class*="col-"] > section footer { text-align: center !important; }

/* Footer icons remain centered (already set) */

/* Center text within grid sections and equalize heights */
.grid > [class*="col-"] > section,
.row.grid > [class*="col-"] > section,
.row.gtr-50 > [class*="col-"] > section {
    text-align: center !important;
    height: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between !important;
}

.grid > [class*="col-"] > section header,
.grid > [class*="col-"] > section p,
.grid > [class*="col-"] > section footer,
.row.gtr-50 > [class*="col-"] > section header,
.row.gtr-50 > [class*="col-"] > section p,
.row.gtr-50 > [class*="col-"] > section footer { text-align: center !important; }
