/* ===== LPSH Design System ===== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --bg: #0b0b14;
    --bg-elevated: #12121f;
    --bg-card: #161625;
    --bg-card-hover: #1c1c30;
    --bg-input: #0f0f1a;
    --text: #e8e8f0;
    --text-muted: #8b8ba3;
    --accent: #ff3d5a;
    --accent2: #ff6b81;
    --accent-glow: rgba(255, 61, 90, 0.35);
    --border: #26263a;
    --border-light: #32324a;
    --green: #2ed573;
    --blue: #5b5fff;
    --gold: #ffa502;
    --purple: #a55eea;
    --radius: 14px;
    --radius-sm: 10px;
    --shadow: 0 8px 32px rgba(0,0,0,0.4);
    --font: 'Outfit', system-ui, sans-serif;
    --mono: 'JetBrains Mono', monospace;
}

html { scroll-behavior: smooth; }

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.65;
    background-image:
        radial-gradient(ellipse 80% 50% at 50% -20%, rgba(255,61,90,0.12), transparent),
        radial-gradient(ellipse 60% 40% at 100% 0%, rgba(91,95,255,0.08), transparent);
}

.container { max-width: 1180px; margin: 0 auto; padding: 0 20px; }
a { color: var(--accent2); text-decoration: none; transition: color .2s; }
a:hover { color: #fff; }
img { max-width: 100%; height: auto; display: block; }

/* ===== HEADER ===== */
.site-header {
    background: rgba(11, 11, 20, 0.85);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    gap: 16px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #fff;
    white-space: nowrap;
    flex-shrink: 0;
}

.logo-img {
    height: 36px;
    width: auto;
    object-fit: contain;
}

.logo-text-fallback {
    font-size: 1.55rem;
    font-weight: 800;
    letter-spacing: 2px;
    background: linear-gradient(135deg, #fff 0%, var(--accent2) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: none;
}

.logo-tagline {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 500;
    border-left: 1px solid var(--border);
    padding-left: 10px;
    display: none;
}

@media (min-width: 900px) {
    .logo-tagline { display: inline; }
}

.main-nav {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    flex: 1;
    justify-content: center;
}

.nav-link {
    color: var(--text-muted);
    padding: 8px 14px;
    border-radius: 999px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.25s;
}

.nav-link:hover {
    background: var(--accent);
    color: #fff;
    box-shadow: 0 4px 16px var(--accent-glow);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px 18px;
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.25s;
    border: none;
    font-family: var(--font);
    line-height: 1.2;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent), #e63950);
    color: #fff;
    box-shadow: 0 4px 14px var(--accent-glow);
}
.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px var(--accent-glow);
    color: #fff;
}

.btn-outline {
    background: transparent;
    color: #fff;
    border: 1px solid var(--border-light);
}
.btn-outline:hover {
    border-color: var(--accent);
    color: var(--accent2);
    background: rgba(255,61,90,0.08);
}

.btn-sm { padding: 5px 12px; font-size: 0.75rem; }
.btn-danger { background: #dc3545; color: #fff; }
.btn-danger:hover { background: #c82333; color: #fff; }
.btn-warning { background: var(--gold); color: #111; }
.btn-green { background: var(--green); color: #111; }
.btn-block { width: 100%; }

.user-dropdown { position: relative; }

.btn-user {
    background: var(--bg-card);
    color: #fff;
    border: 1px solid var(--border);
    padding: 6px 14px 6px 6px;
    border-radius: 999px;
    cursor: pointer;
    font-family: var(--font);
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
}

.user-avatar-sm {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--purple));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
}

.badge-admin {
    background: linear-gradient(135deg, var(--accent), var(--gold));
    color: #fff;
    padding: 2px 8px;
    border-radius: 8px;
    font-size: 0.6rem;
    font-weight: 800;
    letter-spacing: 0.5px;
}

.dropdown-menu {
    display: none;
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    min-width: 200px;
    box-shadow: var(--shadow);
    overflow: hidden;
    z-index: 1100;
}

.dropdown-menu.show { display: block; animation: fadeDown .2s ease; }

@keyframes fadeDown {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}

.dropdown-menu a {
    display: block;
    padding: 12px 16px;
    color: var(--text);
    font-size: 0.9rem;
    border-bottom: 1px solid var(--border);
}
.dropdown-menu a:last-child { border-bottom: none; }
.dropdown-menu a:hover { background: var(--bg-card-hover); color: var(--accent2); }

.mobile-menu-toggle {
    display: none;
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: #fff;
    font-size: 1.25rem;
    padding: 8px 12px;
    border-radius: 10px;
    cursor: pointer;
}

/* ===== HEADER ADS ===== */
.header-ad-space {
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border);
    padding: 12px 0;
}

.ad-slider {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    justify-content: center;
    scrollbar-width: thin;
}

.ad-item img.ad-gif {
    max-height: 90px;
    width: auto;
    border-radius: 10px;
    border: 1px solid var(--border);
    object-fit: contain;
}

/* ===== MAIN ===== */
.main-content {
    padding: 32px 0 60px;
    min-height: calc(100vh - 280px);
}

/* Hero */
.hero {
    text-align: center;
    padding: 28px 20px 36px;
    margin-bottom: 8px;
}

.hero h1 {
    font-size: clamp(1.8rem, 4vw, 2.6rem);
    font-weight: 800;
    letter-spacing: -0.5px;
    margin-bottom: 10px;
    background: linear-gradient(135deg, #fff 30%, var(--accent2));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero p {
    color: var(--text-muted);
    font-size: 1.05rem;
    max-width: 520px;
    margin: 0 auto;
}

/* Search */
.search-bar {
    display: flex;
    gap: 10px;
    margin-bottom: 22px;
    max-width: 640px;
    margin-left: auto;
    margin-right: auto;
}

.search-bar input {
    flex: 1;
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: #fff;
    padding: 12px 18px;
    border-radius: 999px;
    font-family: var(--font);
    font-size: 0.95rem;
    outline: none;
    transition: border .2s, box-shadow .2s;
}

.search-bar input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.search-bar input::placeholder { color: var(--text-muted); }

/* Hashtags */
.hashtags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.hashtag {
    display: inline-block;
    background: rgba(255,61,90,0.1);
    color: var(--accent2);
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 500;
    border: 1px solid rgba(255,61,90,0.2);
    transition: all .2s;
}

.hashtag:hover {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

/* Posts grid */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 22px;
}

.post-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: transform .25s, box-shadow .25s, border-color .25s;
    display: flex;
    flex-direction: column;
}

.post-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow);
    border-color: var(--border-light);
}

.post-card-image {
    width: 100%;
    height: 180px;
    object-fit: cover;
    background: var(--bg-elevated);
}

.post-card-image-placeholder {
    width: 100%;
    height: 180px;
    background: linear-gradient(135deg, #1a1a2e 0%, #2a1a28 50%, #1a2035 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    font-weight: 800;
    letter-spacing: 3px;
    color: rgba(255,255,255,0.15);
}

.post-card-body {
    padding: 18px;
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 10px;
}

.post-card-title {
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1.35;
}

.post-card-title a { color: #fff; }
.post-card-title a:hover { color: var(--accent2); }

.post-card-excerpt {
    color: var(--text-muted);
    font-size: 0.9rem;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 0.78rem;
    color: var(--text-muted);
    padding-top: 8px;
    border-top: 1px solid var(--border);
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 36px;
    flex-wrap: wrap;
}

.pagination a {
    min-width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text);
    font-weight: 600;
    font-size: 0.9rem;
}

.pagination a:hover,
.pagination a.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

/* ===== SINGLE POST ===== */
.post-single {
    max-width: 820px;
    margin: 0 auto;
}

.post-single-header {
    margin-bottom: 28px;
}

.post-single-header h1 {
    font-size: clamp(1.6rem, 3.5vw, 2.2rem);
    font-weight: 800;
    line-height: 1.25;
    margin-bottom: 14px;
    letter-spacing: -0.3px;
}

.post-meta-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    align-items: center;
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 20px;
}

.post-cover {
    width: 100%;
    max-height: 420px;
    object-fit: cover;
    border-radius: var(--radius);
    margin-bottom: 28px;
    border: 1px solid var(--border);
}

.post-body {
    font-size: 1.05rem;
    line-height: 1.8;
    color: #d4d4e0;
}

.post-body h2, .post-body h3 {
    color: #fff;
    margin: 1.4em 0 0.6em;
    font-weight: 700;
}

.post-body p { margin-bottom: 1em; }
.post-body ul, .post-body ol { margin: 0 0 1em 1.4em; }
.post-body li { margin-bottom: 0.35em; }
.post-body img {
    border-radius: var(--radius-sm);
    margin: 1.2em 0;
    border: 1px solid var(--border);
}
.post-body a { color: var(--accent2); text-decoration: underline; }
.post-body blockquote {
    border-left: 3px solid var(--accent);
    padding: 12px 18px;
    margin: 1.2em 0;
    background: var(--bg-card);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    color: var(--text-muted);
}
.post-body code {
    font-family: var(--mono);
    background: var(--bg-card);
    padding: 2px 7px;
    border-radius: 5px;
    font-size: 0.88em;
}
.post-body pre {
    background: var(--bg-card);
    padding: 16px;
    border-radius: var(--radius-sm);
    overflow-x: auto;
    border: 1px solid var(--border);
    margin: 1em 0;
}
.post-body pre code { background: none; padding: 0; }

.post-actions {
    display: flex;
    gap: 10px;
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
    flex-wrap: wrap;
}

.author-card {
    display: flex;
    gap: 16px;
    align-items: center;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    margin-top: 32px;
}

.author-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--purple));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    font-weight: 800;
    flex-shrink: 0;
}

/* ===== FORMS / AUTH ===== */
.auth-wrap {
    max-width: 420px;
    margin: 40px auto;
}

.auth-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 36px 28px;
    box-shadow: var(--shadow);
}

.auth-card h1 {
    font-size: 1.6rem;
    font-weight: 800;
    text-align: center;
    margin-bottom: 6px;
}

.auth-card .auth-sub {
    text-align: center;
    color: var(--text-muted);
    margin-bottom: 28px;
    font-size: 0.95rem;
}

.auth-brand {
    text-align: center;
    margin-bottom: 20px;
}

.auth-brand img {
    height: 40px;
    margin: 0 auto 8px;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    font-size: 0.88rem;
    color: #ccc;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border);
    color: #fff;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-size: 0.95rem;
    outline: none;
    transition: border .2s, box-shadow .2s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-group small {
    display: block;
    margin-top: 5px;
    color: var(--text-muted);
    font-size: 0.8rem;
}

.form-group textarea { resize: vertical; min-height: 100px; }

.alert {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 18px;
    font-size: 0.9rem;
    font-weight: 500;
}

.alert-success {
    background: rgba(46,213,115,0.12);
    border: 1px solid rgba(46,213,115,0.35);
    color: var(--green);
}

.alert-error {
    background: rgba(255,61,90,0.12);
    border: 1px solid rgba(255,61,90,0.35);
    color: var(--accent2);
}

.alert-info {
    background: rgba(91,95,255,0.12);
    border: 1px solid rgba(91,95,255,0.35);
    color: #8b8fff;
}

/* Editor page */
.editor-page {
    max-width: 900px;
    margin: 0 auto;
}

.editor-page h1 {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 20px;
}

.ck-editor-wrap {
    background: #fff;
    border-radius: var(--radius-sm);
    overflow: hidden;
    margin-bottom: 16px;
}

.ck-editor__editable {
    min-height: 320px !important;
    color: #222 !important;
}

.cover-preview {
    max-width: 100%;
    max-height: 200px;
    border-radius: var(--radius-sm);
    margin-top: 10px;
    border: 1px solid var(--border);
}

/* Profile */
.profile-header {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px;
    display: flex;
    gap: 20px;
    align-items: center;
    margin-bottom: 28px;
    flex-wrap: wrap;
}

.profile-avatar-lg {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--purple));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 800;
}

.profile-stats {
    display: flex;
    gap: 24px;
    margin-top: 8px;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* ===== ADMIN ===== */
.admin-layout {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 24px;
    align-items: start;
}

.admin-sidebar {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px 12px;
    position: sticky;
    top: 80px;
}

.admin-sidebar h3 {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    padding: 0 12px 12px;
}

.admin-sidebar a {
    display: block;
    padding: 11px 14px;
    color: var(--text-muted);
    border-radius: 10px;
    font-weight: 500;
    font-size: 0.92rem;
    margin-bottom: 2px;
}

.admin-sidebar a:hover,
.admin-sidebar a.active {
    background: rgba(255,61,90,0.12);
    color: var(--accent2);
}

.admin-main {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px;
    min-height: 400px;
}

.admin-main h2 {
    font-size: 1.35rem;
    font-weight: 800;
    margin-bottom: 20px;
}

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

.stat-card {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 18px;
    text-align: center;
}

.stat-card .stat-num {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--accent2);
    line-height: 1.2;
}

.stat-card .stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.table-wrapper {
    overflow-x: auto;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

th, td {
    padding: 12px 14px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

th {
    background: var(--bg-elevated);
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(255,255,255,0.02); }

.btn-group {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    align-items: center;
}

.inline-form { display: inline; }

.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
}

.badge-published { background: rgba(46,213,115,0.15); color: var(--green); }
.badge-draft { background: rgba(255,165,2,0.15); color: var(--gold); }
.badge-admin-role { background: rgba(255,61,90,0.15); color: var(--accent2); }
.badge-user-role { background: rgba(91,95,255,0.15); color: #8b8fff; }

/* Empty state */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-state h3 {
    font-size: 1.2rem;
    margin-bottom: 8px;
    color: #aaa;
}

/* ===== FOOTER ===== */
.site-footer {
    background: var(--bg-elevated);
    border-top: 1px solid var(--border);
    padding: 48px 0 24px;
    margin-top: auto;
}

.footer-content {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 32px;
    margin-bottom: 32px;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #fff;
    margin-bottom: 12px;
}

.footer-logo img { height: 28px; width: auto; }
.footer-logo strong {
    font-size: 1.2rem;
    letter-spacing: 2px;
}

.footer-brand p {
    color: var(--text-muted);
    font-size: 0.9rem;
    max-width: 320px;
}

.footer-links h4 {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #fff;
    margin-bottom: 12px;
}

.footer-links a {
    display: block;
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 8px;
}

.footer-links a:hover { color: var(--accent2); }

.footer-bottom {
    border-top: 1px solid var(--border);
    padding-top: 20px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
    .mobile-menu-toggle { display: block; }
    .main-nav {
        display: none;
        position: absolute;
        left: 0;
        right: 0;
        top: 100%;
        background: var(--bg-elevated);
        border-bottom: 1px solid var(--border);
        flex-direction: column;
        padding: 12px 20px 16px;
        gap: 4px;
    }
    .main-nav.open { display: flex; }
    .site-header { position: sticky; }
    .header-inner { position: relative; flex-wrap: wrap; }
    .hide-mobile { display: none !important; }
    .admin-layout { grid-template-columns: 1fr; }
    .admin-sidebar { position: static; display: flex; flex-wrap: wrap; gap: 4px; padding: 12px; }
    .admin-sidebar h3 { width: 100%; }
    .admin-sidebar a { padding: 8px 12px; font-size: 0.85rem; }
    .footer-content { grid-template-columns: 1fr; gap: 24px; }
    .posts-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
    .auth-card { padding: 28px 18px; }
    .header-actions .btn-outline { display: none; }
    .admin-main { padding: 18px 14px; }
}

/* Utility */
.text-muted { color: var(--text-muted); }
.text-center { text-align: center; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mb-2 { margin-bottom: 16px; }
.flex-between { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; }

/* ===== i18n / Thai font ===== */
body, body.lang-th {
    font-family: 'Noto Sans Thai', 'Outfit', system-ui, sans-serif;
}
body.lang-en {
    font-family: 'Outfit', 'Noto Sans Thai', system-ui, sans-serif;
}

.lang-switch {
    display: inline-flex;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 999px;
    overflow: hidden;
    margin-right: 4px;
}
.lang-btn {
    padding: 6px 10px;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    text-decoration: none;
}
.lang-btn.active {
    background: var(--accent);
    color: #fff;
}
.lang-btn:hover { color: #fff; }

.hero-badge {
    display: inline-block;
    background: rgba(255,61,90,0.15);
    color: var(--accent2);
    border: 1px solid rgba(255,61,90,0.35);
    padding: 4px 14px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    margin-bottom: 14px;
}

/* Category cards like game hub */
.cat-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
    margin: 8px 0 28px;
}
@media (max-width: 800px) {
    .cat-grid { grid-template-columns: repeat(2, 1fr); }
}
.cat-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 18px 10px;
    background: linear-gradient(160deg, #1a1a2e 0%, #221428 100%);
    border: 1px solid var(--border);
    border-radius: 16px;
    color: #fff;
    text-decoration: none;
    transition: transform .2s, border-color .2s, box-shadow .2s;
    min-height: 100px;
}
.cat-card:hover {
    transform: translateY(-3px);
    border-color: var(--accent);
    box-shadow: 0 8px 24px var(--accent-glow);
    color: #fff;
}
.cat-emoji { font-size: 1.8rem; line-height: 1; }
.cat-label { font-weight: 700; font-size: 0.9rem; text-align: center; }

.section-title {
    font-size: 1.25rem;
    font-weight: 800;
    margin: 8px 0 18px;
    letter-spacing: -0.3px;
}
.filter-info {
    color: var(--text-muted);
    margin-bottom: 18px;
    font-size: 0.95rem;
}

/* Hub-style cards with big cover */
.posts-grid-hub {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
}
.hub-card .post-card-cover {
    display: block;
    position: relative;
    width: 100%;
    aspect-ratio: 16/10;
    overflow: hidden;
    background: var(--bg-elevated);
}
.hub-card .post-card-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .35s ease;
}
.hub-card:hover .post-card-cover img {
    transform: scale(1.05);
}
.post-card-cover-empty {
    width: 100%;
    height: 100%;
    min-height: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1a1a2e, #2a1530 50%, #152040);
    font-size: 2.8rem;
    font-weight: 800;
    color: rgba(255,255,255,0.18);
}
.cover-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(11,11,20,0.55), transparent 50%);
    pointer-events: none;
}
.read-more {
    display: inline-block;
    margin-top: 4px;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--accent2);
}
.read-more:hover { color: #fff; }

.narrow { max-width: 820px; }

.post-single {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 28px 28px 36px;
    margin-bottom: 32px;
}
.post-single-header h1 {
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 800;
    line-height: 1.3;
    margin: 12px 0 14px;
}
.post-cover {
    margin: 18px 0 24px;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid var(--border);
}
.post-cover img {
    width: 100%;
    max-height: 420px;
    object-fit: cover;
}
.post-content {
    font-size: 1.05rem;
    line-height: 1.85;
    color: #d8d8e8;
}
.post-content h2 {
    font-size: 1.25rem;
    margin: 28px 0 12px;
    color: #fff;
    font-weight: 800;
}
.post-content h3 {
    font-size: 1.05rem;
    margin: 20px 0 10px;
    color: #fff;
}
.post-content p { margin-bottom: 14px; }
.post-content ol, .post-content ul {
    margin: 12px 0 18px 1.4em;
}
.post-content li { margin-bottom: 8px; }
.post-content img {
    max-width: 100%;
    border-radius: 12px;
    margin: 12px 0;
}
.post-lead-img img {
    width: 100%;
    border-radius: 12px;
}
.related-section { margin-top: 12px; }

.profile-header {
    display: flex;
    gap: 20px;
    align-items: center;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 24px;
    margin-bottom: 28px;
}
.profile-avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--purple));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    font-weight: 800;
    flex-shrink: 0;
}

/* Active nav pill (first item style from reference) */
.main-nav .nav-link:first-child {
    background: var(--accent);
    color: #fff;
    box-shadow: 0 4px 16px var(--accent-glow);
}

@media (max-width: 900px) {
    .mobile-menu-toggle { display: inline-flex; }
    .main-nav {
        display: none;
        position: absolute;
        left: 0; right: 0;
        top: 100%;
        background: var(--bg-elevated);
        border-bottom: 1px solid var(--border);
        flex-direction: column;
        padding: 12px;
        z-index: 999;
    }
    .main-nav.open { display: flex; }
    .hide-mobile { display: none !important; }
    .logo-tagline { display: none !important; }
}

/* ===== Cover fields & form hints ===== */
.field-hint {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 6px;
    line-height: 1.45;
}
.sub-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 8px;
}
.cover-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-top: 10px;
}
@media (max-width: 720px) {
    .cover-fields { grid-template-columns: 1fr; }
}
.cover-box, .cover-fields > div {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 14px;
}
.cover-preview {
    margin: 10px 0;
}
.cover-preview img {
    max-height: 120px;
    border-radius: 10px;
    border: 1px solid var(--border);
}
.page-kicker {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--accent2);
    font-weight: 600;
    margin-bottom: 8px;
}
.admin-form-card {
    background: var(--bg-elevated);
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 22px;
    border: 1px solid var(--border);
}
.form-row-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}
@media (max-width: 720px) {
    .form-row-2 { grid-template-columns: 1fr; }
}
.logo-tagline:empty { display: none !important; }

/* ===== UI polish: SVG icons, spacing, admin topbar, editor ===== */
.cat-emoji { display: none; }
.cat-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: rgba(255, 61, 90, 0.1);
    border: 1px solid rgba(255, 107, 129, 0.25);
}
.cat-icon img {
    width: 36px;
    height: 36px;
    object-fit: contain;
    image-rendering: -webkit-optimize-contrast;
}
.cat-grid {
    gap: 16px;
    margin: 16px 0 36px;
}
.cat-card {
    gap: 12px;
    padding: 22px 14px;
    min-height: 120px;
}
.cat-label {
    letter-spacing: 0.2px;
}

/* Admin topbar + spaced buttons */
.admin-body { background: var(--bg); min-height: 100vh; }
.admin-wrap { max-width: 1280px; margin: 0 auto; padding: 0 20px 40px; }
.admin-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 0 18px;
    margin-bottom: 8px;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
}
.admin-logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: #fff;
    text-decoration: none;
    font-weight: 700;
}
.admin-logo-img {
    height: 28px;
    width: auto;
    object-fit: contain;
}
.admin-logo-text {
    font-size: 0.95rem;
    color: var(--text-muted);
    font-weight: 600;
    letter-spacing: 0.04em;
}
.admin-top-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.admin-top-btn {
    display: inline-flex !important;
    align-items: center;
    gap: 8px;
    padding: 8px 16px !important;
    font-size: 0.85rem !important;
    border-radius: 999px;
    min-height: 36px;
}
.admin-top-btn .btn-ico {
    flex-shrink: 0;
    opacity: 0.9;
}

/* Form / write content spacing */
.editor-wrap {
    max-width: 860px;
    margin: 0 auto 40px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px 28px 32px;
}
.editor-wrap h1 {
    margin-bottom: 22px;
    font-size: 1.55rem;
}
.editor-form .form-group {
    margin-bottom: 22px;
}
.editor-form .form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
}
.field-hint {
    display: block;
    margin: 6px 0 10px;
    font-size: 0.82rem;
    color: var(--text-muted);
    line-height: 1.45;
}
.menu-select,
.editor-form select {
    width: 100%;
    max-width: 420px;
}
.form-actions {
    gap: 14px !important;
    margin-top: 8px;
    padding-top: 8px;
}
.form-actions .btn {
    min-width: 110px;
    justify-content: center;
}
.btn-group {
    gap: 12px;
}
.cover-fields {
    gap: 16px;
}
.cover-box {
    padding: 14px;
}
.cover-preview {
    margin-bottom: 14px;
}
.cover-preview img {
    max-height: 160px;
    border-radius: 10px;
    border: 1px solid var(--border);
}

/* CKEditor dark-ish fit */
.cke_chrome {
    border-color: var(--border) !important;
    border-radius: 10px !important;
    overflow: hidden;
}
.cke_top {
    background: #1a1a2a !important;
    border-bottom-color: var(--border) !important;
}
.cke_bottom {
    background: #1a1a2a !important;
    border-top-color: var(--border) !important;
}

/* Header actions spacing (public) */
.header-actions {
    gap: 12px;
}
.header-actions .btn {
    white-space: nowrap;
}
.main-nav {
    gap: 6px;
}
.main-nav .nav-link {
    padding: 8px 12px;
}

/* ===== FIX v2: horizontal photo categories + home slider ===== */
.cat-grid {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
    align-items: stretch !important;
    gap: 18px !important;
    margin: 28px auto 40px !important;
    max-width: 980px;
    grid-template-columns: none !important;
}
.cat-card {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: flex-start !important;
    width: 150px;
    min-width: 140px;
    max-width: 160px;
    min-height: auto !important;
    padding: 0 0 14px !important;
    gap: 10px !important;
    background: linear-gradient(165deg, #1c1c30 0%, #24152a 100%) !important;
    border: 1px solid rgba(255,107,129,.28) !important;
    border-radius: 18px !important;
    overflow: hidden;
    text-decoration: none;
    color: #fff !important;
    box-shadow: 0 8px 24px rgba(0,0,0,.25);
    transition: transform .2s ease, border-color .2s, box-shadow .2s;
}
.cat-card:hover {
    transform: translateY(-4px);
    border-color: var(--accent) !important;
    box-shadow: 0 12px 28px var(--accent-glow);
    color: #fff !important;
}
.cat-icon { display: none !important; }
.cat-emoji { display: none !important; }
.cat-photo {
    display: block;
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: #12121c;
}
.cat-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .35s ease;
}
.cat-card:hover .cat-photo img {
    transform: scale(1.06);
}
.cat-label {
    font-weight: 700 !important;
    font-size: 0.92rem !important;
    text-align: center;
    padding: 0 10px;
    line-height: 1.25;
}
@media (max-width: 640px) {
    .cat-card {
        width: calc(50% - 12px);
        max-width: none;
        min-width: 0;
    }
}

/* Home hero slider — 3 background images only */
.home-slider {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    margin: 8px 0 8px;
    min-height: 380px;
    background: #0d0d16;
    border: 1px solid var(--border);
    box-shadow: 0 16px 40px rgba(0,0,0,.35);
}
.home-slider-track {
    position: relative;
    min-height: 380px;
}
.home-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    visibility: hidden;
    transition: opacity .55s ease, visibility .55s ease;
    display: block;
}
.home-slide.is-active {
    opacity: 1;
    visibility: visible;
    position: relative;
    min-height: 380px;
}
.home-slide-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    transform: scale(1.02);
}
.home-slide.is-active .home-slide-bg {
    animation: slideZoom 5.5s ease forwards;
}
@keyframes slideZoom {
    from { transform: scale(1.02); }
    to { transform: scale(1.08); }
}
.home-slider-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 5;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,.2);
    background: rgba(10,10,18,.55);
    color: #fff;
    font-size: 1.6rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(6px);
    transition: background .2s, border-color .2s;
}
.home-slider-nav:hover {
    background: rgba(255,61,90,.55);
    border-color: rgba(255,107,129,.7);
}
.home-slider-prev { left: 14px; }
.home-slider-next { right: 14px; }
.home-slider-dots {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 14px;
    z-index: 5;
    display: flex;
    justify-content: center;
    gap: 8px;
}
.home-slider-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    border: 0;
    padding: 0;
    background: rgba(255,255,255,.35);
    cursor: pointer;
}
.home-slider-dot.is-active {
    background: var(--accent);
    box-shadow: 0 0 0 3px rgba(255,61,90,.25);
    width: 22px;
    border-radius: 999px;
}
@media (max-width: 720px) {
    .home-slider, .home-slide.is-active, .home-slider-track { min-height: 240px; }
    .home-slider-nav { width: 36px; height: 36px; font-size: 1.35rem; }
}

.home-slider + .cat-grid { margin-top: 28px; }
