/* MyManga — mangaup.ir reference theme (light + dark) */

:root,
[data-theme="dark"] {
    --main-yellow: #ffc700;
    --main-dark: #111111;
    --main-darker: #0e0e0f;
    --main-light-dark: #1b1b1b;
    --main-dark-border: #2a2a2a;
    --main-text-dark: #888888;
    --main-text-mid-light: #e5e5e5;
    --main-blue: #489dec;
    --bg: var(--main-darker);
    --bg-alt: var(--main-dark);
    --surface: var(--main-light-dark);
    --surface-elevated: #222222;
    --text: var(--main-text-mid-light);
    --text-muted: var(--main-text-dark);
    --border: var(--main-dark-border);
    --primary: var(--main-yellow);
    --primary-hover: #e6b300;
    --primary-soft: rgba(255, 199, 0, 0.12);
    --accent: var(--main-blue);
    --header-bg: rgba(14, 14, 15, 0.95);
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
    --slide-shadow: linear-gradient(90deg, rgba(14, 14, 15, 0.95) 0%, transparent 60%);
    --on-primary: #111111;
}

[data-theme="light"] {
    --bg: #f5f5f7;
    --bg-alt: #ebebef;
    --surface: #ffffff;
    --surface-elevated: #ffffff;
    --text: #1a1a1a;
    --text-muted: #666666;
    --border: #e0e0e5;
    --primary: #d4a000;
    --primary-hover: #b88900;
    --primary-soft: rgba(212, 160, 0, 0.12);
    --accent: #2b7fd4;
    --header-bg: rgba(255, 255, 255, 0.95);
    --shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    --slide-shadow: linear-gradient(90deg, rgba(255, 255, 255, 0.95) 0%, transparent 60%);
    --on-primary: #111111;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: "Vazirmatn", Tahoma, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    max-width: 100%;
    display: block;
}

button {
    font-family: inherit;
}

.container {
    width: min(1200px, 94vw);
    margin-inline: auto;
}

.ltr-input {
    direction: ltr;
    text-align: left;
    unicode-bidi: isolate;
}

input[type="email"],
input[type="password"],
input[type="url"],
input[type="search"] {
    direction: ltr;
    text-align: left;
    unicode-bidi: isolate;
}

.app-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.content-body {
    flex: 1;
}

/* Header */
.site-header {
    position: sticky;
    top: 0;
    z-index: 200;
    background: var(--header-bg);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
}

.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.75rem 0;
    min-height: 64px;
}

.navbar-right,
.navbar-left {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.navbar-center {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.logo-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text);
}

.logo-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--primary);
    color: var(--on-primary);
    font-weight: 800;
}

.nav-link,
.dropdown-trigger,
.filter-trigger {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.5rem 0.75rem;
    border: none;
    background: none;
    color: var(--text-muted);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    border-radius: 8px;
    transition: color 0.2s, background 0.2s;
}

.nav-link:hover,
.dropdown-trigger:hover,
.filter-trigger:hover {
    color: var(--primary);
}

.nav-item {
    position: relative;
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    inset-inline-start: 0;
    min-width: 160px;
    background: var(--surface-elevated);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0.35rem;
    box-shadow: var(--shadow);
    z-index: 300;
}

.dropdown-menu.is-open {
    display: flex;
    flex-direction: column;
}

.dropdown-menu a {
    padding: 0.55rem 0.85rem;
    border-radius: 8px;
    color: var(--text);
    font-size: 0.9rem;
}

.dropdown-menu a:hover {
    background: var(--primary-soft);
    color: var(--primary);
}

.global-search {
    display: flex;
    align-items: center;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 0.2rem 0.2rem 0.2rem 0.75rem;
    gap: 0.25rem;
}

.global-search input {
    border: none;
    background: transparent;
    color: var(--text);
    font-family: inherit;
    font-size: 0.875rem;
    width: min(180px, 28vw);
    outline: none;
}

.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: none;
    background: transparent;
    color: var(--text);
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.icon-btn:hover {
    background: var(--primary-soft);
    color: var(--primary);
}

.icon-border {
    border: 1px solid var(--border);
}

[data-theme="light"] .theme-icon-dark { display: none; }
[data-theme="dark"] .theme-icon-light { display: none; }

.mobile-only { display: none; }
.desktop-only { display: inline-flex; }

/* Offcanvas */
.offcanvas {
    position: fixed;
    inset: 0;
    z-index: 500;
    pointer-events: none;
}

.offcanvas.is-open {
    pointer-events: auto;
}

.offcanvas-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    opacity: 0;
    transition: opacity 0.25s;
}

.offcanvas.is-open .offcanvas-backdrop {
    opacity: 1;
}

.offcanvas-panel {
    position: absolute;
    top: 0;
    inset-inline-end: 0;
    width: min(320px, 88vw);
    height: 100%;
    background: var(--surface);
    border-inline-start: 1px solid var(--border);
    transform: translateX(100%);
    transition: transform 0.25s;
    overflow-y: auto;
    padding: 1.25rem;
}

[dir="rtl"] .offcanvas-panel {
    transform: translateX(-100%);
}

.offcanvas.is-open .offcanvas-panel {
    transform: translateX(0);
}

[dir="rtl"].offcanvas.is-open .offcanvas-panel,
[dir="rtl"] .offcanvas.is-open .offcanvas-panel {
    transform: translateX(0);
}

.offcanvas-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.menu-separator {
    height: 1px;
    background: var(--border);
    margin: 1rem 0;
}

.offcanvas-nav {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.offcanvas-nav > a,
.offcanvas-sub summary {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    border-radius: 10px;
    color: var(--text);
    cursor: pointer;
}

.offcanvas-nav > a:hover,
.offcanvas-sub summary:hover {
    background: var(--primary-soft);
}

.offcanvas-sub {
    border-radius: 10px;
}

.offcanvas-sub summary {
    list-style: none;
}

.offcanvas-sub summary::-webkit-details-marker {
    display: none;
}

.offcanvas-sub-links {
    display: flex;
    flex-direction: column;
    padding-inline-start: 2.5rem;
    gap: 0.15rem;
}

.offcanvas-sub-links a {
    padding: 0.45rem 0.75rem;
    color: var(--text-muted);
    font-size: 0.9rem;
    border-radius: 8px;
}

.offcanvas-sub-links a:hover {
    color: var(--primary);
    background: var(--primary-soft);
}

/* Hero slideshow */
.top-slider {
    margin-bottom: 2rem;
}

.slideshow {
    position: relative;
    overflow: hidden;
}

.slideshow-track {
    position: relative;
    min-height: clamp(220px, 36vw, 400px);
}

.slideshow-slide {
    display: none;
    animation: fadeIn 0.4s ease;
}

.slideshow-slide.is-active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.box-data {
    position: relative;
    min-height: clamp(220px, 36vw, 400px);
    overflow: hidden;
    border-radius: 0;
}

.slide-image-wrap {
    position: absolute;
    inset: 0;
}

.image-slideshow {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
}

.item-shadow {
    position: absolute;
    inset: 0;
    background: var(--slide-shadow);
    pointer-events: none;
}

.item-info-container {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    padding: clamp(1rem, 4vw, 3rem);
    pointer-events: none;
}

.item-info {
    max-width: min(520px, 90%);
    pointer-events: auto;
}

.slide-title {
    font-size: clamp(1.25rem, 3vw, 2rem);
    font-weight: 700;
    margin-bottom: 0.75rem;
    color: var(--text);
}

.genres {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    list-style: none;
    padding: 0;
    margin: 0 0 0.75rem;
}

.genres li {
    background: var(--primary-soft);
    color: var(--primary);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
}

.description {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 1rem;
    line-height: 1.7;
}

.slide-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
}

.links-item {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.55rem 1rem;
    border-radius: 10px;
    font-size: 0.875rem;
    font-weight: 600;
    transition: transform 0.2s, opacity 0.2s;
}

.links-item:hover {
    transform: translateY(-1px);
}

.show-post {
    background: var(--primary);
    color: var(--on-primary);
}

.add-to-bookmark {
    background: var(--surface-elevated);
    border: 1px solid var(--border);
    color: var(--text);
}

.slideshow-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid var(--border);
    color: var(--text);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.slideshow-prev { inset-inline-start: 1rem; }
.slideshow-next { inset-inline-end: 1rem; }

.slideshow-pagination {
    position: absolute;
    bottom: 1rem;
    inset-inline-start: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 0.4rem;
    z-index: 10;
}

.slideshow-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    border: none;
    background: var(--text-muted);
    cursor: pointer;
    padding: 0;
}

.slideshow-dot.is-active {
    background: var(--primary);
    width: 24px;
    border-radius: 4px;
}

/* Genre slider */
.genres-slider {
    position: relative;
    margin-bottom: 3rem;
}

.genre-track {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding: 0.5rem 0 1rem;
    scrollbar-width: none;
}

.genre-track::-webkit-scrollbar {
    display: none;
}

.genre-item {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    scroll-snap-align: start;
    min-width: 72px;
    color: var(--text-muted);
    transition: color 0.2s;
}

.genre-item:hover {
    color: var(--primary);
}

.genre-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--surface);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--primary);
}

.genre-nav {
    position: absolute;
    top: 50%;
    inset-inline-start: -12px;
    transform: translateY(-50%);
    z-index: 5;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    cursor: pointer;
    color: var(--text);
}

/* Index tab section */
.box-index-tab,
.latest-updates {
    padding: 0 0 3rem;
}

.index-tab-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

.index-title {
    flex: 1;
    font-size: clamp(1.1rem, 2.5vw, 1.5rem);
    font-weight: 700;
}

.index-title .first-part {
    color: var(--text-muted);
    font-weight: 500;
}

.btn-more {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: var(--primary);
    font-weight: 600;
    font-size: 0.9rem;
}

.filter {
    position: relative;
}

/* Horizontal series loop cards */
.box-loop-last-section {
    overflow: hidden;
}

.slider-horizontal {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    padding-bottom: 1rem;
    scroll-snap-type: x mandatory;
    list-style: none;
    margin: 0;
    padding-inline-start: 0;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}

.post-type-loop {
    position: relative;
    flex: 0 0 180px;
    scroll-snap-align: start;
}

.loop-panel {
    display: block;
    position: relative;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
    color: var(--text);
}

.loop-panel:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow);
}

.post-type-loop.show-box-back .loop-panel {
    opacity: 0;
    pointer-events: none;
}

.img-view {
    position: relative;
    aspect-ratio: 223 / 320;
    overflow: hidden;
}

.post-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card-top {
    position: absolute;
    top: 0.5rem;
    inset-inline: 0.5rem;
}

.status-box {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: rgba(0, 0, 0, 0.65);
    color: #fff;
    font-size: 0.7rem;
    padding: 0.25rem 0.5rem;
    border-radius: 999px;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #22c55e;
}

.card-bottom {
    padding: 0.75rem;
}

.card-bottom h2 {
    margin: 0 0 0.5rem;
    font-size: 0.9rem;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.box-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.35rem;
    font-size: 0.75rem;
}

.price-tag {
    color: #22c55e;
    font-weight: 600;
}

.last-file {
    color: var(--text-muted);
    direction: ltr;
    unicode-bidi: isolate;
}

.rating {
    display: flex;
    align-items: baseline;
    gap: 0.1rem;
    color: var(--primary);
    font-weight: 700;
    direction: ltr;
    unicode-bidi: isolate;
}

.rating span:first-child {
    font-size: 0.65rem;
    color: var(--text-muted);
}

.show-box-back-button,
.hide-box-back-button {
    position: absolute;
    z-index: 5;
    background: var(--surface-elevated);
    border: 1px solid var(--border);
    border-radius: 8px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text);
}

.show-box-back-button {
    top: 0.5rem;
    inset-inline-start: 0.5rem;
}

.hide-box-back-button {
    display: none;
    top: 50%;
    inset-inline-start: -16px;
    transform: translateY(-50%);
}

.post-type-loop.show-box-back .hide-box-back-button {
    display: flex;
}

.box-back {
    display: none;
    position: absolute;
    inset: 0;
    background: var(--surface-elevated);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 1rem;
    flex-direction: column;
    justify-content: space-between;
}

.post-type-loop.show-box-back .box-back {
    display: flex;
}

.box-back-dic {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.7;
    overflow-y: auto;
}

.box-back-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.post-type-label {
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.2rem 0.55rem;
    border-radius: 6px;
    background: var(--primary-soft);
    color: var(--primary);
}

.hit-count {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Latest updates */
.update-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1rem;
    list-style: none;
    padding: 0;
    margin: 0;
}

.update-card {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.85rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    transition: border-color 0.2s;
    color: var(--text);
}

.update-card:hover {
    border-color: var(--primary);
}

.update-card img {
    width: 48px;
    height: 64px;
    object-fit: cover;
    border-radius: 8px;
    flex-shrink: 0;
}

.update-card-body {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    min-width: 0;
}

.update-card-body strong {
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.update-card-body span {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Catalog page */
.page-section {
    padding: 2rem 0 3rem;
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.page-header h1 {
    margin: 0;
    font-size: 1.5rem;
}

.filter-bar {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

.filter-bar input,
.filter-bar select {
    padding: 0.6rem 0.85rem;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
    color: var(--text);
    font-family: inherit;
}

.filter-bar input[type="search"] {
    direction: ltr;
    text-align: left;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.55rem 1.1rem;
    border-radius: 10px;
    border: none;
    font-family: inherit;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background: var(--primary);
    color: var(--on-primary);
}

.btn-primary:hover {
    background: var(--primary-hover);
}

.btn-ghost {
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-ghost.active,
.btn-ghost:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.catalog-loop {
    overflow: hidden;
}

/* Series detail */
.series-detail {
    padding: 2rem 0 3rem;
}

.detail-hero {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

.detail-cover img {
    width: 100%;
    border-radius: 14px;
    box-shadow: var(--shadow);
}

.detail-info h1 {
    margin: 0.5rem 0;
    font-size: clamp(1.25rem, 3vw, 2rem);
}

.detail-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.badge {
    display: inline-block;
    background: var(--primary-soft);
    color: var(--primary);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.65rem;
    border-radius: 999px;
}

.badge-status {
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
}

.detail-meta {
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.detail-summary {
    color: var(--text-muted);
    line-height: 1.8;
}

.detail-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    margin-top: 1.25rem;
}

.chapter-list-section h2 {
    margin: 0 0 1rem;
    font-size: 1.2rem;
}

.chapter-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.chapter-item {
    display: grid;
    grid-template-columns: 48px 1fr auto;
    align-items: center;
    gap: 1rem;
    padding: 0.85rem 1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text);
    transition: border-color 0.2s;
}

.chapter-item:hover {
    border-color: var(--primary);
}

.chapter-num {
    font-weight: 700;
    color: var(--primary);
    direction: ltr;
    unicode-bidi: isolate;
}

.chapter-date {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Reader */
.reader-section {
    padding-bottom: 2rem;
}

.reader-toolbar {
    position: sticky;
    top: 64px;
    z-index: 100;
    background: var(--header-bg);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    padding: 0.75rem 0;
}

.reader-toolbar-inner {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.reader-title {
    font-weight: 600;
    flex: 1;
    text-align: center;
    font-size: 0.95rem;
}

.reader-controls {
    display: flex;
    gap: 0.35rem;
}

.reader-pages {
    padding: 1.5rem 0;
    max-width: 800px;
    margin-inline: auto;
}

.reader-page {
    margin: 0 auto 0.5rem;
}

.reader-page img {
    width: 100%;
    border-radius: 4px;
}

.reader-nav {
    padding: 1.5rem 0 3rem;
    border-top: 1px solid var(--border);
}

.reader-nav-inner {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
}

.pagination {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.page-link {
    padding: 0.45rem 0.85rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    background: var(--surface);
}

.page-link.active {
    background: var(--primary);
    color: var(--on-primary);
    border-color: var(--primary);
}

.empty-state {
    text-align: center;
    color: var(--text-muted);
    padding: 2rem;
}

/* Footer */
.site-footer {
    background: var(--surface);
    border-top: 1px solid var(--border);
    padding: 2rem 0;
    margin-top: auto;
}

.footer-grid {
    display: grid;
    gap: 1rem;
}

.footer-desc {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin: 0.5rem 0 0;
}

.footer-links {
    display: flex;
    gap: 1.25rem;
    flex-wrap: wrap;
}

.footer-links a {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.footer-links a:hover {
    color: var(--primary);
}

.footer-bottom {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem 1rem;
    border-top: 1px solid var(--border);
    padding-top: 1rem;
    margin-top: 0.5rem;
    grid-column: 1 / -1;
}

.copyright {
    color: var(--text-muted);
    font-size: 0.8rem;
    margin: 0;
}

.footer-version {
    color: var(--text-muted);
    font-size: 0.75rem;
    margin: 0;
    font-variant-numeric: tabular-nums;
}

/* Responsive */
@media (max-width: 960px) {
    .mobile-only { display: inline-flex; }
    .desktop-only { display: none !important; }

    .global-search input {
        width: min(120px, 22vw);
    }

    .item-info-container {
        align-items: flex-end;
        padding-bottom: 2.5rem;
    }

    .description {
        display: none;
    }

    .genres {
        display: none;
    }

    .detail-hero {
        grid-template-columns: 1fr;
    }

    .detail-cover {
        max-width: 200px;
        margin: 0 auto;
    }
}

@media (max-width: 640px) {
    .slideshow-nav {
        display: none;
    }

    .add-to-bookmark span {
        display: none;
    }

    .post-type-loop {
        flex: 0 0 150px;
    }
}

/* Auth pages */
.auth-section {
    display: flex;
    justify-content: center;
}

.auth-card {
    max-width: 420px;
    width: 100%;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 2rem;
}

.auth-card h1 {
    margin: 0 0 1.5rem;
    font-size: 1.35rem;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.35rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.65rem 0.85rem;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--bg);
    color: var(--text);
    font-family: inherit;
}

.ltr-input {
    direction: ltr;
    text-align: left;
}

.btn-block {
    width: 100%;
    margin-top: 0.5rem;
}

.auth-switch {
    text-align: center;
    margin-top: 1.25rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.auth-switch a {
    color: var(--primary);
    font-weight: 600;
}

.alert {
    padding: 0.75rem 1rem;
    border-radius: 10px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.alert-error {
    background: rgba(239, 68, 68, 0.12);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.25);
}

.alert-success {
    background: rgba(34, 197, 94, 0.12);
    color: #22c55e;
    border: 1px solid rgba(34, 197, 94, 0.25);
}

.inline-form {
    display: inline;
}

.inline-form button.links-item {
    cursor: pointer;
    border: none;
    font-family: inherit;
}

.add-to-bookmark.is-active {
    background: var(--primary-soft);
    color: var(--primary);
}

/* Blog */
.blog-grid {
    display: grid;
    gap: 1.25rem;
}

.blog-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 1.25rem 1.5rem;
}

.blog-card h2 {
    margin: 0 0 0.5rem;
    font-size: 1.1rem;
}

.blog-card h2 a {
    color: var(--text);
}

.blog-card h2 a:hover {
    color: var(--primary);
}

.blog-excerpt {
    color: var(--text-muted);
    margin: 0 0 0.5rem;
    line-height: 1.7;
}

.blog-date {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.blog-article {
    max-width: 720px;
}

.back-link {
    display: inline-block;
    margin-bottom: 1rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.blog-content {
    line-height: 1.9;
    margin-top: 1.5rem;
}

/* Genre page */
.genre-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 1rem;
}

.genre-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.65rem;
    padding: 1.25rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    color: var(--text);
    transition: border-color 0.2s;
}

.genre-card:hover {
    border-color: var(--primary);
}

/* Rules / static */
.static-content {
    max-width: 720px;
    line-height: 1.9;
}

.static-content h2 {
    margin: 1.5rem 0 0.75rem;
    font-size: 1.1rem;
}

.static-content ul {
    padding-right: 1.25rem;
}

.mono {
    direction: ltr;
    unicode-bidi: isolate;
    font-family: ui-monospace, monospace;
}

/* User panel */
.user-email {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

.bookmark-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 1rem;
}

.bookmark-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    color: var(--text);
}

.bookmark-card img {
    width: 100%;
    aspect-ratio: 2/3;
    object-fit: cover;
}

.bookmark-card-body {
    padding: 0.65rem;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.bookmark-card-body span {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.latest-updates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

/* Comments & rating */
.comments-section {
    margin-top: 2.5rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
}

.comments-section h2 {
    margin: 0 0 1rem;
    font-size: 1.2rem;
}

.comment-form textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
    color: var(--text);
    font-family: inherit;
    resize: vertical;
    margin-bottom: 0.75rem;
}

.comment-list {
    list-style: none;
    padding: 0;
    margin: 1.5rem 0 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.comment-item {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1rem;
}

.comment-meta {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.comment-login-hint {
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.rating-form {
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px dashed var(--border);
}

.rating-form label {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.rating-input {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    margin-top: 0.5rem;
    flex-wrap: wrap;
}

.star-label {
    cursor: pointer;
}

.star-label input {
    position: absolute;
    opacity: 0;
}

.star-label span {
    display: inline-flex;
    width: 2rem;
    height: 2rem;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.85rem;
    transition: all 0.15s;
}

.star-label input:checked + span,
.star-label:hover span {
    background: var(--primary);
    color: var(--on-primary);
    border-color: var(--primary);
}

.btn-sm {
    padding: 0.35rem 0.75rem;
    font-size: 0.85rem;
}

.error-page h1 {
    margin-bottom: 0.5rem;
}

.error-id {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin: 1rem 0;
}
