:root {
    --ml-bg: #0a0f1e;
    --ml-bg-elevated: #111827;
    --ml-card: #111111;
    --ml-card-border: #333333;
    --ml-card-inner: #1b1b1b;
    --ml-text: #f5f5f5;
    --ml-text-muted: #c8c8c8;
    --ml-gold: #f5c542;
    --ml-gold-hover: #ffd95f;
    --ml-green: #38e678;
    --ml-red: #ff5b5b;
    --ml-radius: 16px;
    --ml-radius-sm: 10px;
    --ml-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
    --ml-font: "Outfit", Arial, sans-serif;
    --ml-container: 1100px;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: var(--ml-font);
    font-size: 16px;
    line-height: 1.6;
    color: var(--ml-text);
    background: var(--ml-bg);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

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

a:hover {
    color: var(--ml-gold-hover);
}

.screen-reader-text {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.ml-site {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.ml-page-shell {
    flex: 1;
}

.ml-container {
    width: min(100% - 24px, var(--ml-container));
    margin-inline: auto;
}

/* Header */
.ml-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(10, 15, 30, 0.92);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.ml-header-inner {
    width: min(100% - 24px, var(--ml-container));
    margin-inline: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 0;
}

.ml-brand-text {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--ml-gold);
    letter-spacing: 0.02em;
}

.custom-logo-link img {
    max-height: 56px;
    width: auto;
}

.ml-nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: transparent;
    border: 0;
    cursor: pointer;
    padding: 8px;
}

.ml-nav-toggle-bar {
    width: 24px;
    height: 2px;
    background: var(--ml-gold);
    border-radius: 2px;
}

.ml-nav-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 18px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.ml-nav-list a {
    color: var(--ml-text);
    font-weight: 600;
    font-size: 0.95rem;
}

.ml-nav-list a:hover,
.ml-nav-list .current-menu-item > a {
    color: var(--ml-gold);
}

/* Hero */
.ml-hero {
    position: relative;
    min-height: clamp(320px, 55vh, 520px);
    display: grid;
    place-items: center;
    overflow: hidden;
}

.ml-hero-bg {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        180deg,
        rgba(0, 0, 0, 0.55) 0%,
        rgba(0, 0, 0, 0.75) 50%,
        rgba(0, 0, 0, 0.9) 100%
    );
}

.ml-hero-overlay {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 50% 20%, rgba(245, 197, 66, 0.08), transparent 55%);
}

.ml-hero-inner {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 48px 0 36px;
}

.ml-hero-logo {
    width: min(280px, 70vw);
    margin: 0 auto 16px;
    filter: drop-shadow(0 8px 24px rgba(0, 0, 0, 0.5));
}

.ml-hero-title {
    margin: 0 0 12px;
    font-size: clamp(2rem, 6vw, 3.2rem);
    font-weight: 800;
    color: var(--ml-gold);
    letter-spacing: 0.04em;
}

.ml-hero-tagline {
    margin: 0;
    font-size: clamp(1rem, 2.5vw, 1.25rem);
    color: var(--ml-text-muted);
    max-width: 640px;
    margin-inline: auto;
}

/* Sections */
.ml-section {
    padding: 36px 0;
}

.ml-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 20px;
}

.ml-section-head h2,
.ml-section-title-center {
    margin: 0;
    font-size: clamp(1.4rem, 3vw, 1.9rem);
    color: #fff;
}

.ml-section-title-center {
    text-align: center;
    margin-bottom: 24px;
}

.ml-link-gold {
    color: var(--ml-gold);
    font-weight: 700;
}

/* Nav tiles (homepage) */
.ml-nav-tiles {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.ml-nav-tiles-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.ml-nav-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 120px;
    padding: 18px 12px;
    border-radius: var(--ml-radius);
    background: var(--ml-card);
    border: 1px solid var(--ml-card-border);
    box-shadow: var(--ml-shadow);
    color: var(--ml-text);
    text-align: center;
    transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.ml-nav-tile:hover {
    transform: translateY(-3px);
    border-color: var(--ml-gold);
    color: #fff;
}

.ml-nav-tile-icon {
    font-size: 1.8rem;
    line-height: 1;
}

.ml-nav-tile-title {
    font-weight: 700;
    font-size: 0.98rem;
}

/* Event cards */
.ml-event-grid,
.ml-post-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 18px;
}

.ml-event-card,
.ml-post-card {
    background: var(--ml-card);
    border: 1px solid var(--ml-card-border);
    border-radius: var(--ml-radius);
    overflow: hidden;
    box-shadow: var(--ml-shadow);
}

.ml-event-card-link {
    display: block;
    color: inherit;
}

.ml-event-card-link:hover {
    color: inherit;
}

.ml-event-card-media img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
}

.ml-event-card-placeholder {
    aspect-ratio: 1;
    display: grid;
    place-items: center;
    font-size: 3rem;
    background: var(--ml-card-inner);
}

.ml-event-card-body,
.ml-post-body {
    padding: 16px;
}

.ml-event-card-title,
.ml-post-title {
    margin: 0 0 8px;
    font-size: 1.1rem;
    color: #fff;
}

.ml-event-card-title a,
.ml-post-title a {
    color: inherit;
}

.ml-event-card-excerpt,
.ml-post-excerpt {
    margin: 0 0 10px;
    color: var(--ml-text-muted);
    font-size: 0.92rem;
}

.ml-post-thumb img {
    width: 100%;
    aspect-ratio: 16/10;
    object-fit: cover;
}

.ml-post-meta {
    margin: 0 0 10px;
    font-size: 0.85rem;
    color: var(--ml-text-muted);
}

/* Collaborators */
.ml-collab-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
}

.ml-collab-card {
    display: grid;
    place-items: center;
    min-height: 96px;
    padding: 18px;
    border-radius: var(--ml-radius-sm);
    background: var(--ml-card-inner);
    border: 1px solid var(--ml-card-border);
    color: var(--ml-text);
    text-align: center;
    font-weight: 600;
}

.ml-collab-card:hover {
    border-color: var(--ml-gold);
    color: #fff;
}

/* Content pages */
.ml-content {
    padding: 28px 0 48px;
}

.ml-content-card {
    background: var(--ml-card);
    border: 1px solid var(--ml-card-border);
    border-radius: var(--ml-radius);
    padding: clamp(18px, 4vw, 32px);
    box-shadow: var(--ml-shadow);
}

.ml-page-title {
    margin: 0 0 16px;
    font-size: clamp(1.6rem, 4vw, 2.2rem);
    color: #fff;
}

.entry-content {
    color: var(--ml-text);
}

.entry-content h2,
.entry-content h3 {
    color: #fff;
}

.entry-content p,
.entry-content li {
    color: var(--ml-text-muted);
}

.ml-single-featured {
    margin-bottom: 18px;
    border-radius: var(--ml-radius-sm);
    overflow: hidden;
}

.ml-btn,
.ml-btn-primary,
button.ml-btn-primary,
input[type="submit"] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 20px;
    border: 0;
    border-radius: var(--ml-radius-sm);
    background: var(--ml-gold);
    color: #111;
    font-weight: 700;
    cursor: pointer;
}

.ml-btn-primary:hover,
button.ml-btn-primary:hover,
input[type="submit"]:hover {
    background: var(--ml-gold-hover);
    color: #111;
}

.ml-empty,
.ml-empty-state p {
    color: var(--ml-text-muted);
}

.ml-404 {
    text-align: center;
}

/* Footer */
.ml-footer {
    margin-top: auto;
    padding: 32px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(0, 0, 0, 0.35);
}

.ml-footer-inner {
    display: grid;
    gap: 18px;
}

.ml-footer-brand strong {
    color: var(--ml-gold);
    font-size: 1.1rem;
}

.ml-footer-brand p,
.ml-footer-copy {
    margin: 8px 0 0;
    color: var(--ml-text-muted);
    font-size: 0.9rem;
}

.ml-footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 18px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.ml-footer-links a {
    color: var(--ml-text-muted);
}

/* Marlat Core plugin harmonization */
.marlat-scanner-wrap,
.marlat-contributor-wrap,
.marlat-transactions-box,
.marlat-qr-card,
.marlat-dashboard-stats {
    color: var(--ml-text);
}

.marlat-main-button,
.marlat-scanner-button,
.marlat-load-more-btn,
.marlat-points-button {
    background: var(--ml-gold) !important;
    color: #111 !important;
    border-radius: var(--ml-radius-sm) !important;
    font-weight: 700 !important;
}

.marlat-box,
.marlat-event-card,
.marlat-transaction-card,
.marlat-qr-card,
.marlat-stat-card {
    background: var(--ml-card) !important;
    border: 1px solid var(--ml-card-border) !important;
    border-radius: var(--ml-radius) !important;
}

.marlat-stat-number {
    color: var(--ml-gold) !important;
    font-size: 1.8rem !important;
    font-weight: 800 !important;
}

.marlat-dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 14px;
    margin: 16px 0;
}

.marlat-stat-card {
    padding: 16px !important;
    text-align: center;
}

.marlat-scanner-button-wrap {
    margin: 16px 0;
}

.marlat-scanner-button {
    display: inline-flex;
    padding: 14px 22px !important;
    text-decoration: none !important;
}

/* Pagination */
.navigation.pagination {
    margin-top: 24px;
}

.nav-links {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    border-radius: 8px;
    background: var(--ml-card-inner);
    border: 1px solid var(--ml-card-border);
    color: var(--ml-text);
}

.page-numbers.current,
.page-numbers:hover {
    background: var(--ml-gold);
    color: #111;
    border-color: var(--ml-gold);
}

/* Responsive */
@media (max-width: 900px) {
    .ml-nav-tiles,
    .ml-nav-tiles-3 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    .ml-nav-toggle {
        display: flex;
    }

    .ml-nav {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: rgba(10, 15, 30, 0.98);
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
        display: none;
    }

    .ml-nav.is-open {
        display: block;
    }

    .ml-nav-list {
        flex-direction: column;
        padding: 16px;
    }

    .ml-hero-bg {
        background: linear-gradient(
            180deg,
            rgba(0, 0, 0, 0.55) 0%,
            rgba(0, 0, 0, 0.75) 50%,
            rgba(0, 0, 0, 0.20) 100%
        );
    }
}

@media (max-width: 520px) {
    .ml-nav-tiles,
    .ml-nav-tiles-3 {
        grid-template-columns: 1fr;
    }

    .ml-nav-tile {
        min-height: 88px;
        flex-direction: row;
        justify-content: flex-start;
        text-align: left;
    }
}