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

:root {
  --bg: #0c0b08;
  --surface: #15140f;
  --border: #2b2820;
  --accent: #c8a84b;
  --accent2: #c95f3a;
  --text: #ede8dc;
  --muted: #8c8474;
  --card-bg: #1a1914;
  --radius: 4px;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  min-height: 100vh;
}

/* --- Header --- */
.site-header {
  border-bottom: 1px solid var(--border);
  padding: 0 1.5rem;
}

.site-header-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 58px;
}

.logo {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text);
  text-decoration: none;
}

.logo span { color: var(--accent); }

.site-nav { display: flex; gap: 1.5rem; }

.site-nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: color 0.15s;
}

.site-nav a:hover, .site-nav a.active { color: var(--text); }

/* --- Ad Slots --- */
.ad-banner  { max-width: 900px; margin: 1.2rem auto; text-align: center; overflow: hidden; }
.ad-footer  { max-width: 900px; margin: 0 auto 1.5rem; text-align: center; overflow: hidden; }
.ad-mid     { max-width: 900px; margin: 1.2rem auto; text-align: center; overflow: hidden; }
.ad-inline  { grid-column: 1 / -1; text-align: center; overflow: hidden; }
.ad-article { margin: 1.5rem 0; text-align: center; overflow: hidden; }
.ad-desktop { display: block; }
.ad-mobile  { display: none; }
@media (max-width: 740px) {
  .ad-desktop { display: none; }
  .ad-mobile  { display: block; }
}

/* --- Page Hero --- */
.page-hero {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.5rem 1.2rem 1.2rem;
  border-bottom: 1px solid var(--border);
}

.breadcrumb { font-size: 0.77rem; color: var(--muted); margin-bottom: 0.7rem; }
.breadcrumb a { color: var(--muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--accent); }

.page-hero h1 {
  font-family: 'Syne', sans-serif;
  font-size: 1.85rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: var(--text);
  margin-bottom: 0.35rem;
}

.page-hero p { color: var(--muted); font-size: 0.93rem; margin-bottom: 1rem; }

/* --- Search --- */
.search-wrap { max-width: 500px; }

.search-wrap input {
  width: 100%;
  padding: 0.62rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s;
}

.search-wrap input:focus { border-color: var(--accent); }
.search-wrap input::placeholder { color: var(--muted); }

/* --- Main / Status / Grid --- */
.main { max-width: 1100px; margin: 1.5rem auto; padding: 0 1.2rem; }

.status { color: var(--muted); font-size: 0.82rem; margin-bottom: 1rem; min-height: 1.2em; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 1rem;
}

/* --- Cards --- */
.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s, transform 0.15s;
}

.card:hover { border-color: var(--accent); transform: translateY(-2px); }

.card-thumb {
  width: 100%;
  aspect-ratio: 4/3;
  background: var(--surface);
  overflow: hidden;
  position: relative;
}

.card-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

.card-thumb .no-thumb {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  font-size: 2.5rem; color: var(--border);
}

.card-body { padding: 0.75rem; flex: 1; display: flex; flex-direction: column; gap: 0.3rem; }

.card-title {
  font-size: 0.88rem; font-weight: 600; line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

.card-meta { font-size: 0.74rem; color: var(--muted); }

.card-desc {
  font-size: 0.76rem; color: var(--muted); line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
  margin-top: auto; padding-top: 0.3rem;
}

/* --- Spinner --- */
.spinner { display: flex; justify-content: center; padding: 4rem; grid-column: 1/-1; }

.spinner::after {
  content: ''; width: 2rem; height: 2rem;
  border: 3px solid var(--border); border-top-color: var(--accent);
  border-radius: 50%; animation: spin 0.7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.empty { text-align: center; color: var(--muted); padding: 4rem; grid-column: 1/-1; }

/* --- Tags / Related --- */
.tag-list { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1.5rem; padding-top: 1.5rem; border-top: 1px solid var(--border); }

.tag-list a {
  padding: 0.28rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--muted);
  font-size: 0.78rem;
  text-decoration: none;
  transition: all 0.15s;
}

.tag-list a:hover { border-color: var(--accent); color: var(--accent); }

.tag-list-label { font-size: 0.75rem; color: var(--muted); align-self: center; margin-right: 0.25rem; letter-spacing: 0.05em; text-transform: uppercase; }

/* --- Article / Blog --- */
.article-wrap { max-width: 740px; margin: 2rem auto; padding: 0 1.2rem; }

.article-header { margin-bottom: 1.5rem; padding-bottom: 1rem; border-bottom: 1px solid var(--border); }

.category-tag { font-size: 0.7rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); font-weight: 700; margin-bottom: 0.4rem; }

.article-header h1 {
  font-family: 'Syne', sans-serif;
  font-size: 1.85rem; font-weight: 800; line-height: 1.2;
  color: var(--text); margin-bottom: 0.45rem;
}

.article-header .meta { font-size: 0.78rem; color: var(--muted); }

.article-body p { font-size: 0.97rem; line-height: 1.75; color: var(--text); margin-bottom: 1rem; }

.article-body h2 {
  font-family: 'Syne', sans-serif;
  font-size: 1.15rem; font-weight: 700; color: var(--text);
  margin: 1.75rem 0 0.5rem;
  padding-bottom: 0.3rem; border-bottom: 1px solid var(--border);
}

.article-body ul { padding-left: 1.2rem; margin-bottom: 1rem; }
.article-body ul li { font-size: 0.95rem; line-height: 1.7; color: var(--text); margin-bottom: 0.3rem; }

.article-body a { color: var(--accent); text-decoration: none; }
.article-body a:hover { text-decoration: underline; }
.article-body strong { color: var(--text); }

/* --- Blog Listing --- */
.blog-listing { max-width: 740px; margin: 2rem auto; padding: 0 1.2rem; }

.blog-listing h1 { font-family: 'Syne', sans-serif; font-size: 1.85rem; font-weight: 800; margin-bottom: 0.3rem; }
.blog-listing .subtitle { color: var(--muted); margin-bottom: 1.5rem; font-size: 0.93rem; }

.blog-card {
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1rem 1.2rem; margin-bottom: 0.7rem;
  background: var(--card-bg); text-decoration: none; display: block;
  transition: border-color 0.15s;
}

.blog-card:hover { border-color: var(--accent); }
.blog-card .post-tag { font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--accent); font-weight: 700; margin-bottom: 0.3rem; }
.blog-card h2 { font-size: 1.05rem; font-weight: 700; color: var(--text); margin-bottom: 0.25rem; }
.blog-card p { font-size: 0.83rem; color: var(--muted); line-height: 1.5; }

/* --- Footer --- */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem; text-align: center;
  color: var(--muted); font-size: 0.79rem; margin-top: 2rem;
}

.site-footer a { color: var(--accent2); text-decoration: none; }

.footer-links { display: flex; justify-content: center; flex-wrap: wrap; gap: 1rem; margin-bottom: 0.75rem; }
.footer-links a { color: var(--muted); text-decoration: none; font-size: 0.79rem; transition: color 0.15s; }
.footer-links a:hover { color: var(--text); }

/* --- Genre sub-nav --- */
.genre-nav { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1.2rem; }

.genre-nav a {
  padding: 0.3rem 0.8rem;
  border-bottom: 2px solid transparent;
  color: var(--muted); font-size: 0.82rem;
  text-decoration: none; letter-spacing: 0.04em;
  transition: all 0.15s;
}

.genre-nav a:hover, .genre-nav a.active { color: var(--accent); border-bottom-color: var(--accent); }

/* --- Responsive --- */
@media (max-width: 600px) {
  .logo { font-size: 1rem; }
  .page-hero h1 { font-size: 1.45rem; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(155px, 1fr)); }
  .article-header h1 { font-size: 1.45rem; }
}

@media (max-width: 520px) {
  .site-header { padding: 0 1rem; }
  .site-header-inner { height: auto; flex-direction: column; align-items: flex-start; padding: 0.55rem 0; gap: 0.35rem; }
  .site-nav { gap: 1rem; flex-wrap: wrap; padding-bottom: 0.25rem; }
}
