/* WallpaperDJ modern dark theme
   Loaded after style.css so legacy Smarty modules keep their existing behavior. */
:root {
    color-scheme: dark;
    --page-bg: #0b0c0f;
    --surface: #12151a;
    --surface-raised: #191e25;
    --surface-hover: #222a34;
    --border: #29313b;
    --text: #edf1f5;
    --muted: #9aa5b1;
    --accent: #55c5d5;
    --accent-strong: #8be0e8;
    --content-width: 1380px;
    --radius: 12px;
}

*, *::before, *::after { box-sizing: border-box; }
html { min-width: 320px; background: var(--page-bg); scroll-behavior: smooth; }
body {
    min-width: 320px;
    margin: 0;
    background: var(--page-bg);
    color: var(--text);
    font: 15px/1.6 Arial, Helvetica, sans-serif;
    -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; }
a, a:link, a:visited { color: var(--accent); text-decoration: none; transition: color .18s ease, border-color .18s ease, background-color .18s ease; }
a:hover, a:focus-visible { color: var(--accent-strong); }

#body { width: min(100% - 36px, var(--content-width)); margin: 0 auto; position: relative; }
.top-header, .bottom-footer, .container, .container_right { width: 100%; background: none; }
.top-header, .bottom-footer { display: none; }
.container_inside { width: 100%; margin: 0; padding: 24px 0 30px; background: transparent !important; }
.container_right_ie, #ie_background { display: none !important; }
.content_background {
    display: grid;
    grid-template-columns: 178px minmax(0, 1fr) 300px;
    align-items: start;
    gap: 24px;
    float: none;
    width: 100%;
    background: transparent;
}
.content { float: none; width: auto !important; min-width: 0; padding: 0; background: transparent !important; }
.content-text { float: none; width: auto !important; max-width: 100%; }
.left-panel, .right-panel {
    float: none;
    width: auto;
    min-width: 0;
    padding: 0;
    background: transparent !important;
    border: 0;
    border-radius: 0;
}
.left-panel { position: relative; }
.content_background > .reset, .content_background > br.reset { display: none; }

/* Header and text-based logo */
.site-header { width: 100%; padding: 8px 0 22px; }
.header-main { min-height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 13px; min-width: 0; color: var(--text) !important; }
.brand-mark { width: 42px; height: 42px; display: inline-flex; align-items: center; justify-content: center; gap: 3px; padding: 8px; flex: 0 0 42px; border: 1px solid rgba(85,197,213,.38); border-radius: 12px; background: linear-gradient(145deg, #1c3941, #17212a); }
.brand-mark i { display: block; width: 3px; border-radius: 4px; background: var(--accent); }
.brand-mark i:nth-child(1) { height: 9px; }
.brand-mark i:nth-child(2) { height: 17px; }
.brand-mark i:nth-child(3) { height: 23px; }
.brand-mark i:nth-child(4) { height: 14px; }
.brand-mark i:nth-child(5) { height: 8px; }
.brand-copy { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name { color: #fff; font-size: clamp(23px, 3vw, 31px); font-weight: 800; letter-spacing: .075em; text-transform: uppercase; }
.brand-tagline { margin-top: 5px; color: var(--muted); font-size: 10px; letter-spacing: .16em; text-transform: uppercase; }
.primary-nav { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 5px; }
.primary-nav a { display: inline-flex; align-items: center; min-height: 38px; padding: 8px 12px; border: 1px solid transparent; border-radius: 8px; color: #c6ced7; font-size: 13px; font-weight: 700; }
.primary-nav a:hover, .primary-nav a:focus-visible { color: #fff; background: var(--surface-raised); border-color: var(--border); }

/* Direct advertising: retain existing creatives and destinations. */
.ad-slot { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; overflow: hidden; }
.ad-label { display: block; color: #737e8b; font-size: 9px; font-weight: 700; line-height: 1.2; letter-spacing: .16em; text-align: center; text-transform: uppercase; }
.top-menu-ads { float: none; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; width: 100%; max-width: 100%; min-height: 112px; margin: 16px 0 0; padding: 9px 12px; border: 1px solid var(--border); border-radius: var(--radius); background: #101319; }
.top-menu-ads a { display: block; width: min(100%, 728px); line-height: 0; text-align: center; }
.top-menu-ads img { display: block; width: 100%; max-width: 728px; height: auto; max-height: 90px; margin: 0 auto; object-fit: contain; }
.ad-rectangle { width: 100%; max-width: 300px; min-height: 270px; margin: 0 auto 22px; padding: 9px; border: 1px solid var(--border); border-radius: var(--radius); background: #101319; }
.ad-rectangle img { display: block; width: 100%; max-width: 300px; height: auto; }

/* Side modules */
.left-panel, .right-panel { color: var(--muted); font-size: 13px; }
.left-panel .side-panel, .right-panel .side-panel, .left-panel .modules, .right-panel .modules,
.left-panel .block295px, .right-panel .block295px, .left-panel .block590px, .right-panel .block590px {
    width: 100%; max-width: 100%; margin: 0 0 18px; padding: 14px; float: none;
    border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface);
}
.left-panel h1, .left-panel h2, .right-panel h1, .right-panel h2,
.left-panel .side-header, .right-panel .side-header { float: none; width: auto; height: auto; margin: 0 0 10px; padding: 0; color: var(--text); background: none; font-size: 13px; font-weight: 800; line-height: 1.4; }
.left-panel ul, .right-panel ul { margin: 0; padding: 0; }
.left-panel li, .right-panel li { margin: 0; padding: 5px 0; border-bottom: 1px solid rgba(255,255,255,.055); }
.left-panel li:last-child, .right-panel li:last-child { border-bottom: 0; }
.left-panel a, .right-panel a { color: #b9c4ce !important; }
.left-panel a:hover, .right-panel a:hover { color: var(--accent-strong) !important; }

/* Page headings and homepage intro */
.home-intro { margin: 0 0 24px; padding: 4px 0 18px; border-bottom: 1px solid var(--border); }
.eyebrow { margin: 0 0 5px; color: var(--accent); font-size: 10px; font-weight: 800; letter-spacing: .17em; text-transform: uppercase; }
.home-intro h1 { float: none; margin: 0 0 7px; color: #fff; font-size: clamp(23px, 3vw, 32px); font-weight: 800; line-height: 1.2; }
.home-intro > p:last-child { max-width: 680px; margin: 0; color: var(--muted); font-size: 14px; }
.content h1 { float: none; width: auto !important; margin: 0 0 16px; color: #f4f7fa; font-size: clamp(21px, 2.4vw, 27px); line-height: 1.25; }
.content h2 { float: none; width: auto !important; margin: 22px 0 14px; color: #f0f4f7; font-size: 19px; line-height: 1.3; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 15px; margin: 0 0 14px; padding-bottom: 11px; border-bottom: 1px solid var(--border); }
.section-heading h2 { margin: 0; color: #f4f7fa; font-size: 19px; }
.section-heading .eyebrow { margin-bottom: 3px; }
.gallery-section { margin-bottom: 28px; }
.rss-back { float: right; margin: 3px 0 0 10px; }

/* Gallery cards */
ul.wallpapers { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; float: none; width: 100%; margin: 0; padding: 0; }
ul.wallpapers > li.wall { display: flex; flex-direction: column; float: none; width: auto !important; height: auto !important; min-width: 0; margin: 0 !important; padding: 8px; overflow: hidden; border: 1px solid var(--border); border-radius: 11px; background: var(--surface); transition: transform .18s ease, border-color .18s ease, background .18s ease; }
ul.wallpapers > li.wall:hover { transform: translateY(-2px); border-color: rgba(85,197,213,.5); background: var(--surface-raised); }
ul.wallpapers > li.wall > .item_title { order: 2; float: none; width: 100%; min-height: 40px; padding: 9px 2px 1px; }
ul.wallpapers > li.wall > .item_title a { display: block; float: none; overflow: hidden; color: #e7edf2; font-size: 13px; font-weight: 700; line-height: 1.4; text-overflow: ellipsis; }
ul.wallpapers > li.wall > .item_title a:hover { color: var(--accent-strong); }
ul.wallpapers > li.wall > .thumb { order: 1; float: none; width: 100%; margin: 0; }
ul.wallpapers > li.wall > .thumb a { display: block; float: none; position: relative; margin: 0; padding: 0; overflow: hidden; border: 0; border-radius: 7px; background: #080a0d; }
ul.wallpapers > li.wall > .thumb a:hover { border: 0; }
ul.wallpapers .thumb_img { display: block; width: 100% !important; height: auto !important; aspect-ratio: 4 / 3; object-fit: cover; transition: transform .28s ease; }
ul.wallpapers > li.wall:hover .thumb_img { transform: scale(1.035); }
ul.wallpapers .mini-tags { right: 7px; bottom: 7px; }
.categoryList > li.wall { min-height: 0; }
.categoryList > li.wall > a:first-child { order: 2; display: block; padding: 8px 2px 0; color: #e7edf2; font-weight: 700; }
.categoryList > li.wall .thumb { order: 1; width: 100%; }
.categoryList > li.wall .thumb img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; }

/* Pagination, forms, content blocks */
.pagination { display: flex; flex-wrap: wrap; justify-content: center; gap: 5px; width: 100%; margin: 24px auto 8px; padding: 0; color: var(--muted); }
.pagination a, .pagination span.disabled, .pagination span.selected { display: inline-flex; align-items: center; justify-content: center; min-width: 34px; min-height: 34px; margin: 0; padding: 5px 10px; border: 1px solid var(--border); border-radius: 7px; background: var(--surface); color: #c5ced7; }
.pagination a:hover, .pagination span.selected { border-color: var(--accent); background: #183039; color: #fff; }
.pagination span.disabled { color: #697480; }
.input-text, .input-textarea, .input-text-short, .input-other, input, select, textarea { max-width: 100%; border: 1px solid var(--border); border-radius: 7px; background: #0f1318; color: var(--text); }
.input-text, .input-textarea, .input-text-short, .input-other { padding: 9px 10px; }
.input-text:focus, .input-textarea:focus, input:focus, select:focus, textarea:focus { outline: 2px solid rgba(85,197,213,.25); border-color: var(--accent); }
.button, a.button { display: inline-flex; align-items: center; justify-content: center; min-height: 36px; padding: 7px 13px; border: 1px solid var(--border); border-radius: 7px; background: var(--surface-hover); color: var(--text); cursor: pointer; }
.button:hover, a.button:hover { border-color: var(--accent); background: #183039; color: #fff; }
fieldset, .block295px, .block590px, .modules { border-color: var(--border); border-radius: var(--radius); background: var(--surface); }
.description, .content-text { color: #c2cbd4; }
.wallpaper-resolutions { float: none; width: 100%; margin: 12px 0 20px; padding: 0 0 16px; border-color: var(--border); }
.wallpaper-resolutions a { display: inline-block; margin: 4px 5px 4px 0; padding: 5px 9px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); }
.wallpaper-resolutions a:hover { background: #183039; color: #fff; }
.wallpaper-2ads-separator { float: none; width: 100%; border-color: var(--border); }

/* Wallpaper detail page */
.padding-row { max-width: 100%; }
.single_mwall { float: left; max-width: 100%; margin: 0 18px 16px 0; }
.single_wall { max-width: 100%; padding: 0; margin: 0; border: 0; }
.wallpaper-thumb { float: none; display: block; width: min(100%, 360px); padding: 5px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.wallpaper-thumb img { display: block; width: 100% !important; height: auto !important; border-radius: 6px; }
.wallpaper-separator { display: none; }
.wallpaper-ads-right { float: right; width: 300px; max-width: 100%; height: auto; margin: 0 0 20px 20px; }
.tagcloud { color: var(--muted); }
.tagcloud a { display: inline-block; margin: 3px; padding: 5px 9px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); }

/* Footer */
.site-footer { margin-top: 34px; padding: 22px 0 10px; border-top: 1px solid var(--border); color: var(--muted); }
.footer-disclaimer { display: inline-block; margin-bottom: 12px; color: #dce4eb !important; font-size: 12px; font-weight: 700; }
.main_foot { float: none; display: block; width: 100%; height: auto; margin: 0; padding: 10px 0; background: none; color: #78838f; font-size: 11px; line-height: 1.9; }
.main_foot span { padding: 0 4px; color: #46515d; }
#footer { padding: 12px 0 0; color: #78838f; text-align: left; }

/* Legacy compatibility and utility classes */
.reset { clear: both; }
.wallinfo { border-color: var(--border); color: var(--muted); }
.comments li { border-color: var(--border); border-radius: 8px; background: var(--surface); }
.row_odd, .listStyle li:nth-child(even), .listStyle li:nth-child(odd) { background: transparent; }
#notifyBox { border-color: var(--border); background: var(--surface-raised); color: var(--text); }

@media (max-width: 1120px) {
    #body { width: min(100% - 28px, var(--content-width)); }
    .content_background { grid-template-columns: 160px minmax(0, 1fr); gap: 20px; }
    .right-panel { grid-column: 2; display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 14px; }
    .right-panel .side-panel, .right-panel .modules { margin-bottom: 0; }
    ul.wallpapers { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
    .primary-nav { gap: 0; }
    .primary-nav a { padding-right: 9px; padding-left: 9px; }
}
@media (max-width: 760px) {
    #body { width: min(100% - 24px, var(--content-width)); }
    .container_inside { padding-top: 14px; }
    .header-main { align-items: flex-start; flex-direction: column; gap: 13px; }
    .brand-name { font-size: 25px; }
    .primary-nav { width: 100%; justify-content: flex-start; gap: 5px; }
    .primary-nav a { min-height: 34px; padding: 6px 9px; font-size: 12px; }
    .top-menu-ads { min-height: 0; margin-top: 12px; padding: 7px; }
    .content_background { display: flex; flex-direction: column; gap: 18px; }
    .content { order: 1; width: 100% !important; }
    .right-panel { order: 2; display: block; width: 100%; }
    .left-panel { order: 3; width: 100%; }
    .right-panel .side-panel, .left-panel .side-panel { margin-bottom: 12px; }
    ul.wallpapers { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    ul.wallpapers > li.wall { padding: 6px; }
    ul.wallpapers > li.wall > .item_title { min-height: 36px; padding-top: 7px; }
    ul.wallpapers > li.wall > .item_title a { font-size: 12px; }
    .home-intro { margin-bottom: 18px; }
    .home-intro > p:last-child { font-size: 13px; }
    .wallpaper-ads-right { float: none; margin: 15px auto 20px; }
    .single_mwall { float: none; margin: 0 auto 16px; }
    .wallpaper-thumb { margin: 0 auto; }
    .section-heading h2 { font-size: 17px; }
}
@media (max-width: 420px) {
    #body { width: calc(100% - 18px); }
    .brand-mark { width: 38px; height: 38px; flex-basis: 38px; }
    .brand-name { font-size: 22px; }
    .brand-tagline { font-size: 9px; letter-spacing: .12em; }
    .primary-nav a { padding: 5px 7px; font-size: 11px; }
    ul.wallpapers { gap: 8px; }
    ul.wallpapers > li.wall { padding: 5px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

/* The old left/right panel templates begin with a standalone line break. */
.content_background > br { display: none; }
/* Keep moderation controls available to administrators without affecting card layout. */
ul.wallpapers > li.wall > div[style*="float:right"] { order: 3; float: none !important; align-self: flex-end; }

/* Sidebar refinement – v2
   Append after the existing sidebar rules in modern.css. */
.left-panel,
.right-panel {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
    color: var(--muted);
}

/* Treat each existing Smarty sidebar module as a consistent dark card. */
.left-panel .side-panel,
.right-panel .side-panel,
.left-panel .modules,
.right-panel .modules,
.left-panel .block295px,
.right-panel .block295px,
.left-panel .block590px,
.right-panel .block590px,
.left-panel .categories,
.right-panel .categories,
.left-panel .resolutions,
.right-panel .resolutions,
.left-panel .partners,
.right-panel .partners,
.left-panel .sponsors,
.right-panel .sponsors,
.left-panel .login,
.right-panel .login {
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    margin: 0;
    padding: 15px;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: linear-gradient(155deg, #171c23 0%, #11151b 100%);
    box-shadow: 0 8px 22px rgba(0, 0, 0, .14);
}

/* Old image-based sidebar headings become clean text headings. */
.left-panel .side-header,
.right-panel .side-header,
.left-panel [class^="side-header"],
.right-panel [class^="side-header"],
.left-panel .block295px h1,
.right-panel .block295px h1,
.left-panel .block590px h1,
.right-panel .block590px h1 {
    display: flex;
    align-items: center;
    float: none;
    width: auto;
    min-height: 0;
    height: auto;
    margin: 0 0 11px;
    padding: 0 0 10px;
    border: 0;
    border-bottom: 1px solid rgba(139, 224, 232, .18);
    background: none !important;
    color: #eef4f8;
    font-size: 12px;
    font-weight: 800;
    line-height: 1.35;
    letter-spacing: .11em;
    text-transform: uppercase;
}

.left-panel ul,
.right-panel ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.left-panel li,
.right-panel li,
.left-panel .categories ul li,
.right-panel .categories ul li {
    display: block;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
}

.left-panel li + li,
.right-panel li + li {
    border-top: 1px solid rgba(255, 255, 255, .055);
}

.left-panel li a,
.right-panel li a,
.left-panel .categories a,
.right-panel .categories a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-height: 32px;
    padding: 6px 2px;
    color: #b8c3ce !important;
    font-size: 12px;
    line-height: 1.4;
    text-decoration: none;
    transition: color .16s ease, padding .16s ease;
}

.left-panel li a:hover,
.right-panel li a:hover,
.left-panel .categories a:hover,
.right-panel .categories a:hover {
    padding-left: 6px;
    color: var(--accent-strong) !important;
}

.left-panel .categories a.selected,
.right-panel .categories a.selected {
    color: var(--accent-strong) !important;
    font-weight: 700;
}

/* Resolution links should read as compact filter chips, not a text list. */
.left-panel .wallpaper-resolutions,
.right-panel .wallpaper-resolutions,
.left-panel .resolutions-list,
.right-panel .resolutions-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    width: 100%;
    margin: 0;
    padding: 0;
    border: 0;
}

.left-panel .wallpaper-resolutions a,
.right-panel .wallpaper-resolutions a,
.left-panel .resolutions-list a,
.right-panel .resolutions-list a {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    margin: 0;
    padding: 4px 8px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: #0e1319;
    color: #aebbc7 !important;
    font-size: 11px;
}

.left-panel .wallpaper-resolutions a:hover,
.right-panel .wallpaper-resolutions a:hover,
.left-panel .resolutions-list a:hover,
.right-panel .resolutions-list a:hover {
    border-color: var(--accent);
    background: #183039;
    color: #fff !important;
}

/* Sidebar search and login controls. */
.left-panel .search_bg,
.right-panel .search_bg {
    box-sizing: border-box;
    width: 100%;
    height: auto;
    margin: 0;
    padding: 0;
    background: none;
}

.left-panel input,
.right-panel input,
.left-panel select,
.right-panel select {
    box-sizing: border-box;
    max-width: 100%;
}

.left-panel .input-text,
.right-panel .input-text,
.left-panel input[type="text"],
.right-panel input[type="text"],
.left-panel input[type="password"],
.right-panel input[type="password"] {
    width: 100%;
    min-height: 35px;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 7px;
    background: #0c1015;
    color: var(--text);
    font-size: 12px;
}

.left-panel input[type="submit"],
.right-panel input[type="submit"],
.left-panel .button,
.right-panel .button {
    min-height: 34px;
    padding: 6px 11px;
    border: 1px solid rgba(85, 197, 213, .35);
    border-radius: 7px;
    background: #183039;
    color: #eafcff;
    cursor: pointer;
}

.left-panel input[type="submit"]:hover,
.right-panel input[type="submit"]:hover,
.left-panel .button:hover,
.right-panel .button:hover {
    border-color: var(--accent);
    background: #21434c;
}

/* Avoid inherited legacy floats and fixed widths inside the narrow columns. */
.left-panel h1,
.left-panel h2,
.left-panel h3,
.left-panel h4,
.right-panel h1,
.right-panel h2,
.right-panel h3,
.right-panel h4 {
    float: none;
    max-width: 100%;
}

.left-panel img,
.right-panel img,
.left-panel iframe,
.right-panel iframe {
    max-width: 100%;
}

@media (max-width: 1120px) {
    .right-panel {
        align-items: stretch;
        gap: 12px;
    }
}

@media (max-width: 760px) {
    .left-panel,
    .right-panel {
        gap: 10px;
        width: 100%;
    }

    .left-panel .side-panel,
    .right-panel .side-panel,
    .left-panel .modules,
    .right-panel .modules,
    .left-panel .block295px,
    .right-panel .block295px,
    .left-panel .block590px,
    .right-panel .block590px,
    .left-panel .categories,
    .right-panel .categories,
    .left-panel .resolutions,
    .right-panel .resolutions,
    .left-panel .partners,
    .right-panel .partners,
    .left-panel .sponsors,
    .right-panel .sponsors,
    .left-panel .login,
    .right-panel .login {
        margin-bottom: 0;
        padding: 13px;
    }
}

/* Right sidebar categories: increase link readability. */
.right-panel .categories li a,
.right-panel .categories > a,
.right-panel li a {
    font-size: 16px;
}

/* Sidebar typography and category count alignment - November 2026 */
.left-panel {
    font-size: 14px;
}

.left-panel li a,
.left-panel .categories a,
.left-panel .resolutions a,
.left-panel .wallpaper-resolutions a,
.left-panel .resolutions-list a {
    font-size: 14px;
}

.left-panel .side-header,
.left-panel [class^="side-header"],
.left-panel .block295px h1,
.left-panel .block590px h1 {
    font-size: 14px;
}

.left-panel input,
.left-panel select,
.left-panel textarea {
    font-size: 14px;
}

/* Category module: keep the category label and item count on one line. */
.right-panel .categories li a,
.right-panel .categories a,
.right-panel .categories li,
.right-panel li a {
    white-space: nowrap;
}

.right-panel .categories li a,
.right-panel .categories a {
    display: block;
    overflow: visible;
    text-overflow: clip;
    font-size: 16px;
    line-height: 1.5;
}
