/* ── CSS Custom Properties ────────────────────────────────────────────────── */
:root {
  --bg-primary:    #1a1a1a;
  --bg-secondary:  #242424;
  --bg-header:     #0d0d0d;
  --bg-card:       #2a2a2a;
  --bg-admin:      #1e1e2e;
  --text-primary:  #f0f0f0;
  --text-muted:    #999;
  --text-dim:      #ccc;
  --accent:        #c0392b;
  --accent-hover:  #e74c3c;
  --accent-dark:   #922b21;
  --border:        #333;
  --border-light:  #444;
  --success:       #27ae60;
  --warning:       #f39c12;
  --error:         #e74c3c;
  --radius:        4px;
  --shadow:        0 2px 8px rgba(0,0,0,.5);
  --transition:    0.2s ease;
  --font-main:     -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono:     'Courier New', monospace;
  --max-width:     1280px;
  --header-h:      60px;
}

/* ── Reset ───────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: var(--font-main);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }
ul { list-style: none; }
button { cursor: pointer; font-family: inherit; }

/* ── Accessibility ───────────────────────────────────────────────────────── */
.skip-link {
  position: absolute; top: -100%; left: 0;
  background: var(--accent); color: #fff;
  padding: .5rem 1rem; z-index: 9999;
  transition: top var(--transition);
}
.skip-link:focus { top: 0; }
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ── Header ──────────────────────────────────────────────────────────────── */
.site-header {
  background: var(--bg-header);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 100;
}
.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  min-height: var(--header-h);
  flex-wrap: wrap;
}
.site-logo img { height: 40px; width: auto; }
.site-name-text {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
}

/* Nav */
#main-nav { flex: 1; overflow-x: auto; }
#main-nav ul {
  display: flex;
  gap: 0;
  white-space: nowrap;
}
#main-nav a {
  display: block;
  padding: .5rem .75rem;
  color: var(--text-dim);
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  transition: color var(--transition), background var(--transition);
}
#main-nav a:hover,
#main-nav a[aria-current="page"] {
  color: var(--text-primary);
  background: rgba(255,255,255,.06);
}
.nav-upload { color: var(--accent) !important; }

/* Mobile menu toggle */
.menu-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border-light);
  color: var(--text-primary);
  padding: .4rem .8rem;
  border-radius: var(--radius);
  font-size: .85rem;
  margin-left: auto;
}

/* ── Main Content ────────────────────────────────────────────────────────── */
#main-content { min-height: calc(100vh - var(--header-h) - 200px); }
.art-section, .category-section, .artist-section,
.artists-section, .categories-section, .static-page, .not-found {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2rem 1rem;
}
.section-heading {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 1.5rem;
  border-bottom: 2px solid var(--accent);
  padding-bottom: .5rem;
}

/* ── Art Grid ────────────────────────────────────────────────────────────── */
.art-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}
.art-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  transition: transform var(--transition), border-color var(--transition);
}
.art-card:hover { transform: translateY(-2px); border-color: var(--border-light); }
.art-card-link { display: block; }
.art-card-figure {
  margin: 0;
  aspect-ratio: 4/3;
  overflow: hidden;
  background: var(--bg-secondary);
}
.art-card-figure img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .3s ease;
}
.art-card:hover .art-card-figure img { transform: scale(1.03); }
.art-card-placeholder { width: 100%; height: 100%; background: var(--bg-secondary); }
.art-card-meta { padding: .75rem; }
.art-card-date { font-size: .75rem; color: var(--text-muted); display: block; margin-bottom: .3rem; }
.art-card-title { font-size: .9rem; line-height: 1.3; }
.art-card-title a { color: var(--text-primary); }
.art-card-title a:hover { color: var(--accent); }

/* ── Pagination ──────────────────────────────────────────────────────────── */
.pagination {
  display: flex; flex-wrap: wrap; gap: .4rem;
  justify-content: center; align-items: center;
  padding: 1.5rem 0;
}
.pagination-item, .pagination-prev, .pagination-next {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 2rem; height: 2rem; padding: 0 .6rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: .85rem;
  color: var(--text-dim);
  transition: background var(--transition), border-color var(--transition);
}
.pagination-item:hover, .pagination-prev:hover, .pagination-next:hover {
  background: var(--bg-card); border-color: var(--border-light); color: var(--text-primary);
}
.pagination-current {
  background: var(--accent); border-color: var(--accent); color: #fff;
}

/* ── Single Post ─────────────────────────────────────────────────────────── */
.single-post {
  max-width: 900px; margin: 0 auto; padding: 2rem 1rem;
}
.post-title { font-size: 1.6rem; margin-bottom: 1rem; line-height: 1.3; }
.post-artist {
  display: flex; flex-wrap: wrap; align-items: center; gap: .5rem;
  font-size: .9rem; color: var(--text-muted); margin-bottom: 1rem;
}
.artist-link { color: var(--accent); font-weight: 600; }
.artist-socials { display: flex; flex-wrap: wrap; gap: .4rem; }
.social-link {
  font-size: .75rem; padding: .2rem .5rem;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); color: var(--text-muted);
  transition: color var(--transition), border-color var(--transition);
}
.social-link:hover { color: var(--text-primary); border-color: var(--border-light); }
.post-figure { margin-bottom: 1.5rem; }
.post-image {
  max-width: 100%; cursor: zoom-in;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

/* Rating widget */
.rating-widget { margin: 1.5rem 0; }
.rating-label { font-size: .85rem; color: var(--text-muted); margin-bottom: .5rem; }
.rating-stars { display: flex; gap: .3rem; margin-bottom: .3rem; }
.star-btn {
  background: var(--bg-card); border: 1px solid var(--border);
  color: var(--text-muted); width: 2rem; height: 2rem;
  border-radius: var(--radius); font-size: .9rem;
  transition: background var(--transition), color var(--transition);
}
.star-btn.active, .star-btn:hover { background: var(--warning); color: #fff; border-color: var(--warning); }
.rating-labels { display: flex; justify-content: space-between; font-size: .7rem; color: var(--text-muted); width: 10rem; }

/* Post nav */
.post-nav {
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: .5rem;
  padding: 1rem 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
  margin: 1.5rem 0;
}
.post-nav a { font-size: .85rem; color: var(--accent); }
.post-meta { font-size: .82rem; color: var(--text-muted); margin-bottom: 1.5rem; }
.post-meta time { display: block; margin-bottom: .3rem; }
.cat-link {
  display: inline-block; padding: .15rem .5rem;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); font-size: .78rem; color: var(--text-muted);
  margin: .15rem;
}
.cat-link:hover { border-color: var(--accent); color: var(--accent); }

/* Comments */
.comments-section { margin-top: 2rem; }
.comments-heading { font-size: 1.1rem; margin-bottom: 1rem; padding-bottom: .5rem; border-bottom: 1px solid var(--border); }
.comments-list { display: flex; flex-direction: column; gap: 1rem; margin-bottom: 1.5rem; }
.comment { background: var(--bg-card); padding: 1rem; border-radius: var(--radius); border: 1px solid var(--border); }
.comment-author { color: var(--accent); font-size: .9rem; }
.comment-date { font-size: .75rem; color: var(--text-muted); display: block; margin: .2rem 0 .5rem; }
.comment-content { font-size: .9rem; line-height: 1.6; }

/* Comment form */
.comment-form { display: flex; flex-direction: column; gap: 1rem; max-width: 600px; }
.form-group { display: flex; flex-direction: column; gap: .3rem; }
.form-group label { font-size: .85rem; color: var(--text-muted); }
.form-group input, .form-group textarea {
  background: var(--bg-secondary); border: 1px solid var(--border);
  color: var(--text-primary); padding: .6rem .8rem;
  border-radius: var(--radius); font-family: inherit; font-size: .9rem;
  transition: border-color var(--transition);
}
.form-group input:focus, .form-group textarea:focus { border-color: var(--accent); outline: none; }
.form-group textarea { resize: vertical; min-height: 100px; }
.form-message {
  padding: .75rem 1rem; border-radius: var(--radius); font-size: .9rem; margin-bottom: .5rem;
}
.form-message.success { background: rgba(39,174,96,.15); border: 1px solid var(--success); color: var(--success); }
.form-message.error   { background: rgba(231,76,60,.15);  border: 1px solid var(--error);   color: var(--error); }

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: .6rem 1.2rem; border-radius: var(--radius); font-size: .9rem;
  font-weight: 600; border: none; transition: background var(--transition), opacity var(--transition);
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); color: #fff; }
.btn-secondary { background: var(--bg-card); color: var(--text-dim); border: 1px solid var(--border); }
.btn-secondary:hover { border-color: var(--border-light); color: var(--text-primary); }

/* ── Breadcrumb ──────────────────────────────────────────────────────────── */
.breadcrumb { margin-bottom: 1rem; }
.breadcrumb ol { display: flex; flex-wrap: wrap; gap: .3rem; align-items: center; font-size: .82rem; }
.breadcrumb li { color: var(--text-muted); }
.breadcrumb li + li::before { content: '›'; margin-right: .3rem; }
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--accent); }

/* ── Artist Pages ────────────────────────────────────────────────────────── */
.artist-profile { margin-bottom: 2rem; }
.artist-name { font-size: 1.6rem; margin-bottom: .5rem; }
.artist-bio { color: var(--text-muted); margin-bottom: 1rem; max-width: 700px; }
.artist-socials-full { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: .75rem; }
.social-btn {
  padding: .35rem .8rem; border-radius: var(--radius); font-size: .8rem;
  border: 1px solid var(--border); background: var(--bg-card); color: var(--text-muted);
  transition: border-color var(--transition), color var(--transition);
}
.social-btn:hover { border-color: var(--accent); color: var(--accent); }
.artist-post-count { font-size: .85rem; color: var(--text-muted); }

/* Artists list */
.artists-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem; margin-top: 1rem;
}
.artist-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: .75rem;
  display: flex; flex-direction: column; gap: .3rem;
  transition: border-color var(--transition);
}
.artist-card:hover { border-color: var(--border-light); }
.artist-card-name { color: var(--text-primary); font-weight: 600; font-size: .9rem; }
.artist-card-count { font-size: .75rem; color: var(--text-muted); }
.artist-card-socials { display: flex; gap: .3rem; flex-wrap: wrap; margin-top: .3rem; }

/* ── Categories ──────────────────────────────────────────────────────────── */
.categories-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1rem; }
.category-card {
  display: flex; flex-direction: column; gap: .3rem;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1rem;
  color: var(--text-primary); font-weight: 600;
  transition: border-color var(--transition), background var(--transition);
}
.category-card:hover { border-color: var(--accent); background: rgba(192,57,43,.08); color: var(--text-primary); }
.category-count { font-size: .78rem; color: var(--text-muted); font-weight: 400; }

/* ── Static Page ─────────────────────────────────────────────────────────── */
.page-title { font-size: 1.6rem; margin-bottom: 1.5rem; padding-bottom: .5rem; border-bottom: 2px solid var(--accent); }
.page-content { max-width: 800px; line-height: 1.8; color: var(--text-dim); }
.page-content h2 { font-size: 1.2rem; margin: 1.5rem 0 .5rem; color: var(--text-primary); }
.page-content p { margin-bottom: 1rem; }
.page-content a { color: var(--accent); }

/* ── Section Description ─────────────────────────────────────────────────── */
.section-description { color: var(--text-muted); margin-bottom: 1.5rem; font-size: .9rem; }

/* ── Footer ──────────────────────────────────────────────────────────────── */
.site-footer {
  background: var(--bg-header); border-top: 1px solid var(--border);
  margin-top: 3rem; padding: 2rem 1rem;
}
.footer-inner {
  max-width: var(--max-width); margin: 0 auto;
  display: flex; flex-direction: column; align-items: center;
  gap: .75rem; text-align: center;
}
.footer-site-name { font-size: 1.1rem; font-weight: 700; color: var(--text-primary); }
.footer-tagline { font-size: .85rem; color: var(--text-muted); }
.footer-nav { display: flex; flex-wrap: wrap; gap: 1rem; justify-content: center; }
.footer-nav a { font-size: .82rem; color: var(--text-muted); }
.footer-nav a:hover { color: var(--accent); }
.footer-copyright { font-size: .78rem; color: var(--text-muted); }

/* ── Cookie Banner ───────────────────────────────────────────────────────── */
.cookie-banner[hidden] { display: none !important; }
.cookie-banner {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: #111; border-top: 1px solid var(--border);
  padding: 1rem; display: flex; flex-wrap: wrap;
  align-items: center; justify-content: center; gap: 1rem;
  z-index: 200; font-size: .85rem; color: var(--text-muted);
}
.cookie-banner p { margin: 0; max-width: 700px; }
.cookie-banner a { color: var(--accent); }

/* ── Lightbox ────────────────────────────────────────────────────────────── */
.lightbox {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.92);
  display: flex; align-items: center; justify-content: center;
  z-index: 500;
}
.lightbox[hidden] { display: none; }
.lightbox-close {
  position: absolute; top: 1rem; right: 1.5rem;
  background: none; border: none; color: #fff;
  font-size: 2rem; line-height: 1;
}
#lightbox-img { max-width: 95vw; max-height: 95vh; object-fit: contain; }

/* ── Age Gate ────────────────────────────────────────────────────────────── */
.age-gate-page { background: #111; }
.age-gate-overlay {
  min-height: 100vh; display: flex;
  align-items: center; justify-content: center;
  padding: 2rem 1rem;
}
.age-gate-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 8px; padding: 2.5rem 2rem;
  max-width: 480px; width: 100%; text-align: center;
}
.age-gate-logo {
  display: flex; align-items: center; justify-content: center;
  gap: .75rem; margin-bottom: 1.5rem;
}
.age-gate-logo img { height: 40px; width: auto; }
.age-gate-site-name { font-size: 1.2rem; font-weight: 700; color: var(--text-primary); }
.age-gate-heading { font-size: 1.4rem; margin-bottom: .5rem; }
.age-gate-divider { border: none; border-top: 1px solid var(--border); margin: 1rem 0; }
.age-gate-subheading { font-size: .9rem; color: var(--text-muted); margin-bottom: 1rem; }
.age-gate-badge {
  display: inline-block;
  background: var(--accent); color: #fff;
  font-size: .7rem; font-weight: 700; letter-spacing: .08em;
  padding: .25rem .75rem; border-radius: 2rem;
  margin-bottom: 1rem;
}
.age-gate-sub { font-size: 1rem; margin-bottom: .75rem; }
.age-gate-body { font-size: .85rem; color: var(--text-muted); margin-bottom: .75rem; }
.age-gate-confirm { font-size: .8rem; color: var(--text-muted); margin-bottom: 1.5rem; }
.age-gate-form { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; margin-bottom: 1rem; }
.btn-decline {
  background: transparent; border: 1px solid var(--border);
  color: var(--text-muted); padding: .6rem 1.4rem;
  border-radius: var(--radius); font-size: .9rem; font-weight: 600;
  transition: border-color var(--transition), color var(--transition);
}
.btn-decline:hover { border-color: var(--border-light); color: var(--text-primary); }
.btn-accept {
  background: var(--accent); color: #fff;
  border: none; padding: .6rem 1.8rem;
  border-radius: var(--radius); font-size: .9rem; font-weight: 700;
  transition: background var(--transition);
}
.btn-accept:hover { background: var(--accent-hover); }
.age-gate-privacy { font-size: .78rem; }
.age-gate-privacy a { color: var(--text-muted); }
.age-gate-privacy a:hover { color: var(--accent); }

/* ── 404 ─────────────────────────────────────────────────────────────────── */
.not-found { text-align: center; padding: 4rem 1rem; }
.not-found h1 { font-size: 2rem; margin-bottom: 1rem; }
.not-found p { color: var(--text-muted); margin-bottom: 1.5rem; }
.not-found-cats { margin-top: 3rem; text-align: left; }
.not-found-cats h2 { font-size: 1.1rem; margin-bottom: 1rem; }

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .menu-toggle { display: block; }
  #main-nav {
    display: none; width: 100%;
    border-top: 1px solid var(--border);
  }
  #main-nav.open { display: block; }
  #main-nav ul { flex-direction: column; }
  #main-nav a { padding: .75rem 1rem; border-bottom: 1px solid var(--border); }
  .art-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 1rem; }
  .post-title { font-size: 1.2rem; }
  .age-gate-card { padding: 1.5rem 1rem; }
}

@media (min-width: 1024px) {
  .art-grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
}

/* ── Print ───────────────────────────────────────────────────────────────── */
@media print {
  .site-header, .site-footer, .cookie-banner, .lightbox,
  .rating-widget, .comment-form-wrap, .post-nav { display: none; }
  body { background: #fff; color: #000; }
  a { color: #000; text-decoration: underline; }
}
