/*
Theme Name: NewDesign Base
Theme URI: https://trzpro.com
Author: trzpro
Author URI: https://trzpro.com
Description: Lightweight base templates for trzpro pages.
Version: 0.1.0
Text Domain: newdesign
*/

:root {
  --bg: #12120d;
  --surface: #1d1d14;
  --surface-2: #26261b;
  --text: #ecebdc;
  --muted: #a9aa94;
  --accent: #cedd6d;
  --border: #333326;
}
[data-theme="light"] {
  --bg: #f5f6f0;
  --surface: #ffffff;
  --surface-2: #f0f2e9;
  --text: #1d2415;
  --muted: #5d6750;
  --accent: #7b9d2f;
  --border: #d8ddcc;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: Inter, Arial, sans-serif;
  line-height: 1.45;
}
a { color: var(--accent); text-decoration: none; }

.nd-wrap { width: min(1220px, 94%); margin: 0 auto; }
.nd-header {
  position: sticky;
  top: 0;
  z-index: 999;
  background: rgba(18, 18, 13, 0.95);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(6px);
}
.nd-header-inner {
  height: 60px;
  display: flex;
  gap: 12px;
  align-items: center;
}
.nd-logo { height: 30px; width: auto; display: block; }
.nd-nav-link {
  padding: 6px 10px;
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--text);
  font-size: 13px;
}
.nd-theme-toggle {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
  height: 32px;
  padding: 0 10px;
  cursor: pointer;
}
.nd-search { margin-left: auto; display: flex; gap: 8px; width: min(320px, 100%); }
.nd-search input[type="search"] {
  flex: 1 1 auto;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  padding: 0 10px;
}
.nd-search button {
  border: 0;
  border-radius: 10px;
  background: var(--accent);
  color: #121212;
  font-weight: 700;
  padding: 0 12px;
}

.nd-grid { display: grid; grid-template-columns: 1fr 320px; gap: 22px; align-items: start; }
.nd-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 14px; }
.nd-title { margin: 0 0 10px; font-size: 28px; }
.nd-muted { color: var(--muted); font-size: 14px; }
.nd-specs { display:grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap:10px; }
.nd-spec { background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 10px; }
.nd-spec strong { display:block; color: var(--accent); font-size: 12px; margin-bottom: 3px; text-transform: uppercase; }
.nd-spec span { color: var(--text); font-size: 13px; }

.nd-actions { display: flex; gap: 10px; margin-top: 14px; }
.nd-btn {
  border: 0; border-radius: 10px; padding: 10px 16px; font-weight: 800;
  background: var(--accent); color: #131313; cursor: pointer;
}
.nd-btn.is-icon { width: 42px; height: 42px; padding: 0; display: grid; place-items: center; }

.nd-gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}
.nd-gallery-btn { border:0; padding:0; background:transparent; cursor:pointer; }
.nd-gallery-grid img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  border-radius: 8px;
  display: block;
}

.nd-lightbox { position: fixed; inset: 0; z-index: 10002; opacity: 0; pointer-events: none; transition: opacity .2s ease; }
.nd-lightbox.is-open { opacity: 1; pointer-events: auto; }
.nd-lightbox-bg { position:absolute; inset:0; background: rgba(0,0,0,.82); }
.nd-lightbox-content { position:absolute; inset:0; display:flex; align-items:center; justify-content:center; padding:20px 60px; }
.nd-lightbox-content img { max-width:min(92vw,1280px); max-height:86vh; border-radius: 8px; }
.nd-lightbox-close { position:absolute; top:8px; right:14px; border:0; background:transparent; color:#fff; font-size:34px; cursor:pointer; }
.nd-lightbox-nav { position:absolute; top:50%; transform:translateY(-50%); border:0; border-radius:50%; width:46px; height:46px; background:rgba(255,255,255,.18); color:#fff; font-size:24px; cursor:pointer; }
.nd-lightbox-nav.prev { left:12px; }
.nd-lightbox-nav.next { right:12px; }
.nd-tags a { display:inline-block; margin: 0 8px 8px 0; padding:4px 9px; border-radius:999px; background:#2a2a1f; border:1px solid var(--border); font-size:12px; color:var(--text); }

.nd-sidebar-item { position: relative; margin-bottom: 10px; }
.nd-sidebar-item img { width: 100%; border-radius: 8px; display: block; }
.nd-sidebar-meta {
  position: absolute; left: 0; right: 0; top: 0;
  padding: 8px; background: rgba(0,0,0,.72); border-radius: 8px 8px 0 0;
}

.nd-popular-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.nd-popular-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}
.nd-popular-thumb img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
}
.nd-popular-body { padding: 8px; }
.nd-popular-body h3 {
  margin: 0;
  font-size: 13px;
  line-height: 1.2;
}
.nd-popular-body h3 a { color: var(--text); }
.nd-single-aside { position: relative; }
.nd-version {
  display: inline-block; margin-top: 6px; font-size: 11px;
  background: #2a4e34; color: #d9e7cb; border-radius: 999px; padding: 2px 7px;
}

.nd-single-hero {
  position: relative;
  min-height: 320px;
  border-radius: 12px;
  overflow: hidden;
  background: var(--surface-2);
  margin-bottom: 14px;
}
.nd-single-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--single-hero, none) center/cover no-repeat;
  opacity: 0.45;
}
.nd-single-hero-fade {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(18,18,13,.95) 8%, rgba(18,18,13,.25) 60%);
}
.nd-single-hero-content {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  padding: 18px;
}

.nd-comments .comment-list li {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 10px;
}
.nd-comments-title { margin: 0 0 12px; font-size: 24px; }
.nd-comment-list { list-style: none; margin: 0; padding: 0; }
.nd-comment-list > li { margin: 0 0 12px; }
.nd-comment-list .comment-body {
  background: #202016;
  border: 1px solid #3a3a2b;
  border-radius: 12px;
  padding: 14px;
}
.nd-comment-list .comment-author {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}
.nd-comment-list .comment-meta a { color: var(--muted); font-size: 13px; }
.nd-comment-list .reply a {
  display: inline-block;
  margin-top: 6px;
  background: #2d2d20;
  border: 1px solid #3f3f2f;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  color: var(--text);
}
.nd-comment-nav {
  margin-top: 10px;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.nd-comment-nav .page-numbers {
  display: inline-flex;
  min-width: 32px;
  height: 32px;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: #222217;
  border: 1px solid #3b3b2c;
  color: var(--text);
  padding: 0 8px;
}
.nd-comment-nav .page-numbers.current {
  background: var(--accent);
  color: #111;
  border-color: transparent;
}
.nd-comment-form-wrap {
  margin-top: 16px;
  border-top: 1px solid #303023;
  padding-top: 14px;
}
.nd-comments input, .nd-comments textarea {
  width: 100%;
  background: #15150f;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
}
.nd-comments .comment-form p { margin-bottom: 10px; }
.nd-comments .comment-form input[type="submit"] { width: auto; background: var(--accent); color: #121212; border: 0; font-weight: 700; }

.nd-download-box { width: min(860px, 94%); margin: 30px auto; }
.nd-download-stack { display: grid; gap: 12px; }
.nd-download-popup {
  position: fixed; inset: 0; z-index: 10000; opacity: 0; pointer-events: none; transition: opacity .2s ease;
}
.nd-download-popup.is-open { opacity: 1; pointer-events: auto; }
.nd-download-popup-bg { position: absolute; inset: 0; background: rgba(0,0,0,.72); }
.nd-download-popup-card {
  position: relative; margin: 10vh auto 0; width: min(560px, 92%);
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 16px;
}
.nd-download-media img { width: 100%; height: auto; border-radius: 10px; display: block; }
.nd-download-ad {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
  background: #181811;
}
.nd-download-btn { justify-content: center; font-size: 15px; padding: 12px 16px; }
.nd-install-guide ol { margin: 0; padding-left: 18px; }
.nd-install-guide li { margin-bottom: 6px; color: var(--text); }

/* ===== Hero ===== */
.nd-hero {
  position: relative;
  min-height: 340px;
  display: flex;
  align-items: flex-end;
  padding: 32px min(60px, 5%);
  overflow: hidden;
  background: var(--bg);
  margin-bottom: 18px;
  border-radius: 16px;
}
.nd-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--hero-bg, none) center/cover no-repeat;
  opacity: .35;
}
.nd-hero-fade {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, var(--bg) 0%, transparent 55%),
              linear-gradient(to right, var(--bg) 0%, transparent 60%);
}
.nd-hero-content { position: relative; z-index: 2; max-width: 520px; }
.nd-hero-sub { color: var(--muted); font-size: 14px; margin: 0 0 6px; }
.nd-hero-title { font-size: 34px; margin: 0 0 12px; line-height: 1.15; }
.nd-hero-actions { display: flex; gap: 10px; align-items: center; }
.nd-hero-car {
  position: absolute;
  right: -40px;
  bottom: 0;
  max-height: 300px;
  z-index: 1;
  opacity: .92;
  filter: drop-shadow(0 8px 26px rgba(0,0,0,.6));
}
.nd-btn-dl { display: inline-flex; align-items: center; gap: 6px; }

/* ===== Home grid ===== */
.nd-home-grid { display: grid; grid-template-columns: 1fr 320px; gap: 22px; }
.nd-home-main { display: grid; gap: 18px; align-content: start; }
.nd-home-aside { display: grid; gap: 14px; align-content: start; }
.nd-section h2 { margin: 0 0 12px; font-size: 20px; }
.nd-pagination-wrap { margin-top: 14px; }
.nd-pagination-wrap .nav-links { display: flex; gap: 8px; flex-wrap: wrap; }
.nd-pagination-wrap .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  border-radius: 10px;
  border: 1px solid #3b3b2c;
  background: #222217;
  color: var(--text);
}
.nd-pagination-wrap .page-numbers.current {
  background: var(--accent);
  color: #111;
  border-color: transparent;
  font-weight: 700;
}

/* ===== Mod card ===== */
.nd-mod-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
}
.nd-mod-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  transition: transform .15s ease, border-color .15s ease;
}
.nd-mod-card:hover { transform: translateY(-2px); border-color: #4e4e38; }
.nd-mod-thumb img { width: 100%; height: 140px; object-fit: cover; display: block; }
.nd-mod-body { padding: 10px; }
.nd-mod-body h3 { margin: 0 0 6px; font-size: 15px; line-height: 1.2; }
.nd-mod-body h3 a { color: var(--text); }
.nd-mod-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 8px;
}
.nd-mod-pill {
  height: 26px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  border: 1px solid var(--border);
  white-space: nowrap;
}
.nd-mod-size {
  background: #232319;
  color: var(--muted);
}
.nd-mod-ver {
  background: #2a4e34;
  color: #d9e7cb;
  border-color: transparent;
}
.nd-btn-sm { font-size: 12px; padding: 6px 12px; border-radius: 8px; display: inline-flex; align-items: center; gap: 4px; }
.nd-install-btn {
  width: 100%;
  justify-content: center;
  height: 34px;
  font-size: 14px;
  font-weight: 800;
}
.nd-ad-card {
  display: flex;
  align-items: stretch;
  align-self: start;
  height: auto;
  min-height: 0;
}
.nd-ad-card-inner {
  width: 100%;
  aspect-ratio: auto;
  min-height: 226px;
  border: 1px dashed #4b4b36;
  border-radius: 10px;
  background: #1f1f15;
  padding: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  position: relative;
  overflow: hidden;
}
.nd-ad-card-label {
  position: static;
  font-size: 11px;
  color: var(--muted);
  margin: 0 0 8px;
  text-transform: uppercase;
  letter-spacing: .04em;
  align-self: flex-start;
}
.nd-ad-slot-wrap {
  position: static;
  display: grid;
  place-items: center;
  width: 100%;
  min-height: 0;
  aspect-ratio: 1 / 1;
}
.nd-ad-card-adslot {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  max-width: 200px !important;
  max-height: 200px !important;
}

/* ===== Filters ===== */
.nd-filters { display: grid; gap: 10px; }
.nd-filters select {
  width: 100%;
  height: 36px;
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 0 10px;
}

/* ===== Tags ===== */
.nd-tag-cloud { display: flex; flex-wrap: wrap; gap: 8px; }
.nd-tag {
  display: inline-block;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-size: 12px;
  color: var(--accent);
}

/* ===== Stats ===== */
.nd-stats { display: grid; gap: 8px; }
.nd-stat { display: flex; justify-content: space-between; }
.nd-stat strong { color: var(--accent); font-size: 22px; }
.nd-stat span { color: var(--muted); font-size: 13px; align-self: center; }

.nd-brands-groups { display: grid; gap: 14px; }
.nd-brand-group { margin: 0; }
.nd-brand-group-title { margin: 0 0 10px; color: var(--accent); font-size: 22px; }
.nd-brand-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.nd-brand-item {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
  color: var(--text);
  transition: transform .15s ease, border-color .15s ease;
}
.nd-brand-item:hover { transform: translateY(-1px); border-color: #4a4a36; }
.nd-brand-img { display: grid; place-items: center; height: 100px; margin-bottom: 8px; }
.nd-brand-img img { max-width: 100%; max-height: 100px; width: auto; height: auto; border-radius: 8px; }
.nd-brand-item h3 { margin: 0; font-size: 14px; text-align: center; }
.nd-brand-fallback {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #2f2f22;
  font-weight: 800;
  color: var(--accent);
}

.nd-modders-table-wrap {
  overflow-x: auto;
  margin-top: 10px;
}
.nd-modders-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 560px;
}
.nd-modders-table th,
.nd-modders-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
}
.nd-modders-table th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.nd-modders-table tbody tr:hover {
  background: var(--surface-2);
}

@media (max-width: 980px) {
  .nd-grid { grid-template-columns: 1fr; }
  .nd-home-grid { grid-template-columns: 1fr; }
  .nd-specs { grid-template-columns: 1fr; }
  .nd-lightbox-content { padding: 20px 10px; }
  .nd-hero { min-height: 260px; padding: 20px; }
  .nd-hero-car { max-height: 180px; right: -20px; }
  .nd-hero-title { font-size: 24px; }
  .nd-popular-grid { grid-template-columns: 1fr; }
  .nd-single-hero { min-height: 240px; }
}
/* UI updates */
.nd-btn { display: inline-flex; align-items: center; gap: 8px; }
.nd-btn-icon { width: 15px; height: 15px; display: inline-block; }
.nd-btn.is-icon { width: 42px; height: 42px; justify-content: center; }
.nd-btn.is-icon .nd-btn-icon { width: 18px; height: 18px; }

.nd-hero-desc { color: var(--muted); margin: 0; max-width: 460px; }
.nd-hero { transition: opacity .45s ease; }
.nd-hero.is-fading { opacity: .75; }

.nd-download-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}
.nd-download-media img { width: 100%; height: auto; border-radius: 10px; display: block; }

.nd-gallery-grid { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.nd-gallery-grid img { height: 140px; object-fit: cover; }

@media (max-width: 980px) {
  .nd-download-grid { grid-template-columns: 1fr; }
}
