/*
Theme Name:        NullMind's Lair
Theme URI:         https://nullmind.com
Author:            Carlos
Author URI:        https://nullmind.com
Description:       A minimal, dark, image-forward blog theme for archiving Instagram posts. Skull background, gold accents, clean typography. Built to work alongside Instagram auto-import plugins (e.g. Smash Balloon Instagram Feed, Instagram Feed Pro, Instagram Auto Post).
Version:           1.5.0
Requires at least: 6.0
Tested up to:      6.5
Requires PHP:      7.4
License:           GPL-2.0-or-later
License URI:       https://www.gnu.org/licenses/gpl-2.0.html
Text Domain:       nullmind-lair
Tags:              blog, dark, minimal, photography, custom-colors, custom-menu, custom-logo, featured-images, threaded-comments, translation-ready, two-columns
*/

/* ============ DESIGN TOKENS ============ */
:root {
  --bg:            #0a0f1c;
  --bg-elev:       #111a2e;
  --bg-card:       #131c30;
  --bg-card-hover: #182238;
  --border:        #1f2a44;
  --border-soft:   #18213a;
  --border-gold:   rgba(251, 191, 36, 0.35);
  --gold:          #fbbf24;
  --gold-soft:     #fde68a;
  --gold-dim:      #b08415;
  --text:          #f1f5f9;
  --text-muted:    #94a3b8;
  --text-dim:      #64748b;
  --radius:        14px;
  --radius-sm:     10px;
  --radius-pill:   999px;
  --shadow-soft:   0 1px 2px rgba(0,0,0,0.3), 0 8px 24px rgba(0,0,0,0.25);
  --maxw:          1180px;
}

/* ============ RESET / BASE ============ */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background-color: var(--bg);
  /* Drop a tiled skull image at /assets/images/skull-bg.png. SVG fallback below renders when the file is missing. */
  background-image:
    url('assets/images/skull-bg.png'),
    url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="64" height="64" viewBox="0 0 64 64"><g><path d="M32 8c-9 0-15 7-15 16v7c0 3 1 5 3 7l2 1v5c0 1 1 2 2 2h2v-3h2v3h2v-3h2v3h2v-3h2v3h2c1 0 2-1 2-2v-5l2-1c2-2 3-4 3-7v-7c0-9-6-16-15-16z" fill="%23141d33"/><ellipse cx="25" cy="24" rx="3.2" ry="4" fill="%230a0f1c"/><ellipse cx="39" cy="24" rx="3.2" ry="4" fill="%230a0f1c"/><path d="M32 31l-2 5h4z" fill="%230a0f1c"/></g></svg>');
  background-repeat: repeat, repeat;
  color: var(--text);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--gold); text-decoration: none; }
a:hover { color: var(--gold-soft); }
button { font-family: inherit; }

.screen-reader-text {
  border: 0; clip: rect(1px, 1px, 1px, 1px); clip-path: inset(50%);
  height: 1px; margin: -1px; overflow: hidden; padding: 0;
  position: absolute !important; width: 1px; word-wrap: normal !important;
}

/* ============ HEADER ============ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(10, 15, 28, 0.85);
  backdrop-filter: saturate(140%) blur(10px);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--border-soft);
}
.nav-wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  gap: 24px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: 'Space Grotesk', 'Inter', sans-serif;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
}
.brand:hover { color: var(--text); }
.brand-mark {
  width: 38px; height: 38px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-gold);
  overflow: hidden;
  background: linear-gradient(180deg, #1a253f, #0e1626);
  display: grid; place-items: center;
  flex-shrink: 0;
}
.brand-mark img { width: 100%; height: 100%; object-fit: cover; display: block; }
.brand-mark svg { width: 20px; height: 20px; color: var(--gold); }
.brand-name { font-size: 15px; }
.brand-name span { display: block; color: var(--text-muted); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; font-weight: 500; }

.nav-links {
  margin-left: auto;
  display: flex;
  gap: 4px;
  list-style: none;
  padding: 0;
  margin-right: 0;
  align-items: center;
}
.nav-links li { list-style: none; }
.nav-links a, .nav-links .menu-item a {
  padding: 8px 14px;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  transition: color .15s ease, background .15s ease;
}
.nav-links a:hover { color: var(--text); background: var(--bg-elev); }
.nav-links .current-menu-item > a,
.nav-links .current_page_item > a,
.nav-links a.active {
  color: var(--gold);
  background: rgba(251, 191, 36, 0.08);
}

.icon-btn {
  width: 38px; height: 38px;
  display: grid; place-items: center;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  cursor: pointer;
}
.icon-btn:hover { color: var(--gold); border-color: var(--border-gold); }
.icon-btn svg { width: 16px; height: 16px; }

/* Mobile nav toggle (shown only on small screens) */
.nav-toggle {
  display: none;
  margin-left: auto;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  width: 38px; height: 38px;
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.nav-toggle svg { width: 18px; height: 18px; }

@media (max-width: 880px) {
  .nav-toggle { display: grid; place-items: center; }
  .nav-links {
    display: none;
    position: absolute;
    top: 100%; left: 0; right: 0;
    flex-direction: column;
    gap: 0;
    background: var(--bg-elev);
    border-bottom: 1px solid var(--border-soft);
    padding: 12px 16px;
    margin: 0;
  }
  .nav-links.open { display: flex; }
  .nav-links a, .nav-links .menu-item a { display: block; padding: 12px 14px; }
}

/* ============ HERO ============ */
.hero {
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--border-soft);
}
.hero-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 80px 24px 64px;
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 44px;
  align-items: center;
}
@media (max-width: 720px) {
  .hero-inner { grid-template-columns: 1fr; gap: 28px; padding: 56px 24px 48px; }
}
.hero-avatar {
  width: 180px; height: 180px;
  border-radius: 50%;
  padding: 5px;
  border: 1px solid var(--border-gold);
  background: linear-gradient(180deg, #1a253f, #0e1626);
  box-shadow: 0 0 0 1px rgba(0,0,0,0.4), 0 18px 40px rgba(0,0,0,0.4);
  flex-shrink: 0;
  overflow: hidden;
  position: relative;
}
.hero-avatar::after {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(251,191,36,0.18), transparent 70%);
  z-index: -1;
}
.hero-avatar img {
  width: 100%; height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  background: #0d1426;
}
@media (max-width: 720px) {
  .hero-avatar { width: 140px; height: 140px; }
}
.eyebrow {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
  padding: 6px 12px;
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-pill);
  background: rgba(251, 191, 36, 0.04);
}
.hero h1 {
  font-family: 'Space Grotesk', 'Inter', sans-serif;
  font-size: clamp(32px, 4.6vw, 52px);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 20px 0 16px;
  max-width: 720px;
}
.hero p.lead {
  font-size: 17px;
  color: var(--text-muted);
  margin: 0;
  max-width: 580px;
}
.hero-meta {
  display: flex;
  gap: 24px;
  margin-top: 32px;
  color: var(--text-dim);
  font-size: 13px;
  flex-wrap: wrap;
}
.hero-meta span { display: inline-flex; align-items: center; gap: 6px; }
.dot { width: 4px; height: 4px; border-radius: 50%; background: var(--text-dim); }

/* ============ MAIN ============ */
main {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 56px 24px 96px;
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  margin-bottom: 28px;
  gap: 16px;
  flex-wrap: wrap;
}
.section-head h2 {
  font-family: 'Space Grotesk', 'Inter', sans-serif;
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0;
}
.section-head .sub {
  color: var(--text-muted);
  font-size: 14px;
  margin-top: 4px;
}
.filters {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.chip {
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--bg-elev);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all .15s ease;
  text-decoration: none;
}
.chip:hover { color: var(--text); border-color: var(--border-gold); }
.chip.active {
  color: var(--bg);
  background: var(--gold);
  border-color: var(--gold);
}

/* ============ FEATURED ============ */
.featured {
  margin-bottom: 56px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
}
@media (max-width: 800px) { .featured { grid-template-columns: 1fr; } }
.featured .img-wrap {
  aspect-ratio: 16 / 11;
  background: #0d1426;
  overflow: hidden;
}
.featured img { width: 100%; height: 100%; object-fit: cover; display: block; }
.featured .text {
  padding: 36px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 14px;
}
.featured h3 {
  font-family: 'Space Grotesk', 'Inter', sans-serif;
  font-size: 28px;
  font-weight: 600;
  line-height: 1.15;
  margin: 0;
  letter-spacing: -0.015em;
}
.featured h3 a { color: var(--text); }
.featured h3 a:hover { color: var(--gold); }
.featured p { color: var(--text-muted); margin: 0; font-size: 15px; }

/* ============ BUTTONS ============ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius-pill);
  background: var(--gold);
  color: #1a1305;
  border: 1px solid var(--gold);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s ease;
  align-self: flex-start;
  margin-top: 6px;
  text-decoration: none;
}
.btn:hover { background: var(--gold-soft); color: #1a1305; }
.btn-ghost {
  background: transparent;
  color: var(--gold);
  border: 1px solid var(--border-gold);
}
.btn-ghost:hover { background: rgba(251, 191, 36, 0.08); color: var(--gold-soft); }

/* ============ POST GRID ============ */
.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}
@media (max-width: 900px) { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .grid { grid-template-columns: 1fr; } }

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: all .2s ease;
  display: flex;
  flex-direction: column;
}
.card:hover {
  border-color: var(--border-gold);
  background: var(--bg-card-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-soft);
}
.card-media {
  aspect-ratio: 1 / 1;
  background: #0d1426;
  position: relative;
  overflow: hidden;
}
.card-media a { display: block; height: 100%; }
.card-media img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .4s ease;
}
.card:hover .card-media img { transform: scale(1.03); }
.card-media .ig-tag {
  position: absolute;
  top: 12px; right: 12px;
  width: 32px; height: 32px;
  display: grid; place-items: center;
  border-radius: var(--radius-sm);
  background: rgba(10, 15, 28, 0.7);
  backdrop-filter: blur(6px);
  border: 1px solid var(--border-gold);
  color: var(--gold);
}
.card-media .ig-tag svg { width: 16px; height: 16px; }

.card-body { padding: 18px 18px 20px; }
.card-cat {
  display: inline-block;
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--gold);
  margin-bottom: 8px;
  text-decoration: none;
}
.card-title {
  font-family: 'Inter', sans-serif;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.35;
  margin: 0 0 8px;
  letter-spacing: -0.005em;
}
.card-title a { color: var(--text); }
.card-title a:hover { color: var(--gold); }
.card-excerpt {
  font-size: 13.5px;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-meta {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border-soft);
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--text-dim);
  font-size: 12px;
}
.card-meta .heart {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.card-meta svg { width: 13px; height: 13px; }

/* ============ PAGINATION ============ */
.pagination, .nav-links.pagination {
  margin-top: 40px;
  display: flex;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
  position: static;
  background: transparent;
  padding: 0;
  border: none;
}
.pagination a, .pagination span,
.nav-links.pagination .page-numbers {
  min-width: 36px;
  height: 36px;
  padding: 0 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-elev);
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}
.pagination a:hover, .nav-links.pagination .page-numbers:hover {
  color: var(--text); border-color: var(--border-gold);
}
.pagination .current, .nav-links.pagination .page-numbers.current {
  background: var(--gold);
  color: #1a1305;
  border-color: var(--gold);
}

/* ============ SINGLE POST ============ */
.single-main {
  max-width: 820px;
  margin: 0 auto;
  padding: 56px 24px 96px;
}
.single-header { margin-bottom: 28px; }
.single-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.back-link {
  font-size: 13px;
  color: var(--text-muted);
}
.back-link:hover { color: var(--gold); }
.single-header h1 {
  font-family: 'Space Grotesk', 'Inter', sans-serif;
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.015em;
  margin: 0 0 12px;
  color: var(--text);
}
.single-info {
  display: flex;
  align-items: center;
  gap: 16px;
  color: var(--text-dim);
  font-size: 13px;
  flex-wrap: wrap;
}
.ig-link { color: var(--gold); }
.single-image {
  margin: 28px 0;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  background: #0d1426;
}
.single-image img { width: 100%; height: auto; display: block; }
.single-content {
  font-size: 17px;
  line-height: 1.7;
  color: var(--text);
}
.single-content p { margin: 0 0 1.2em; }
.single-content h2, .single-content h3 {
  font-family: 'Space Grotesk', 'Inter', sans-serif;
  margin: 1.6em 0 0.6em;
  letter-spacing: -0.01em;
}
.single-content h2 { font-size: 26px; }
.single-content h3 { font-size: 20px; }
.single-content blockquote {
  border-left: 3px solid var(--gold);
  margin: 1.4em 0;
  padding: 6px 0 6px 18px;
  color: var(--text-muted);
  font-style: italic;
}
.single-content code {
  background: var(--bg-elev);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.9em;
  border: 1px solid var(--border-soft);
}
.single-content img { border-radius: var(--radius-sm); margin: 18px 0; }
.single-content a { color: var(--gold); text-decoration: underline; text-decoration-color: rgba(251,191,36,0.4); }
.single-content a:hover { text-decoration-color: var(--gold); }

.single-footer {
  margin-top: 36px;
  padding-top: 24px;
  border-top: 1px solid var(--border-soft);
  color: var(--text-muted);
  font-size: 13px;
}
.single-footer .tags a {
  display: inline-block;
  margin-right: 8px;
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  font-size: 11.5px;
  color: var(--text-muted);
  text-decoration: none;
}
.single-footer .tags a:hover { color: var(--gold); border-color: var(--border-gold); }

.post-nav {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin-top: 40px;
  flex-wrap: wrap;
}
.post-nav a {
  flex: 1;
  min-width: 0;
  padding: 16px 18px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 13px;
  text-decoration: none;
  transition: all .15s ease;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.post-nav a:hover { border-color: var(--border-gold); color: var(--text); }
.post-nav .next { text-align: right; }

/* ============ COMMENTS ============ */
.comments-section {
  margin-top: 48px;
  padding-top: 32px;
  border-top: 1px solid var(--border-soft);
}
.comments-section h2, .comments-title {
  font-family: 'Space Grotesk', 'Inter', sans-serif;
  font-size: 20px;
  margin: 0 0 18px;
}
.comment-list { list-style: none; padding: 0; margin: 0 0 28px; }
.comment-list li { margin-bottom: 18px; padding: 16px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.comment-author { font-weight: 600; }
.comment-meta { font-size: 12px; color: var(--text-dim); margin-bottom: 8px; }
.comment-respond input[type="text"],
.comment-respond input[type="email"],
.comment-respond input[type="url"],
.comment-respond textarea {
  width: 100%;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 14px;
  margin-top: 4px;
}
.comment-respond label { display: block; font-size: 12px; color: var(--text-muted); margin-bottom: 12px; }
.comment-respond .submit, .submit { /* uses .btn styles when wrapped, but in case raw */
  background: var(--gold); color: #1a1305; border: 1px solid var(--gold);
  padding: 10px 18px; border-radius: var(--radius-pill); font-weight: 600; cursor: pointer;
}

/* ============ FOOTER ============ */
.site-footer {
  border-top: 1px solid var(--border-soft);
  padding: 48px 24px;
  margin-top: 48px;
}
.footer-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 18px;
  color: var(--text-dim);
  font-size: 13px;
}
.socials { display: flex; gap: 8px; }
.socials a {
  width: 36px; height: 36px;
  display: grid; place-items: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  color: var(--text-muted);
}
.socials a:hover { color: var(--gold); border-color: var(--border-gold); }
.socials svg { width: 14px; height: 14px; }

/* ============ NO RESULTS / 404 ============ */
.no-results, .error-404 {
  text-align: center;
  padding: 80px 24px;
  color: var(--text-muted);
}
.no-results h2, .error-404 h1 {
  font-family: 'Space Grotesk', 'Inter', sans-serif;
  color: var(--text);
  margin: 0 0 12px;
}

/* ============ INSTAGRAM PLUGIN OVERRIDES ============ */
/* Smash Balloon Instagram Feed compatibility — restyle the plugin's grid to match the theme cards */
#sb_instagram .sbi_item,
.sb_instagram_header,
#sb_instagram .sbi_photo {
  border-radius: var(--radius) !important;
}
#sb_instagram .sbi_item {
  border: 1px solid var(--border) !important;
  background: var(--bg-card) !important;
  overflow: hidden !important;
  transition: all .2s ease !important;
}
#sb_instagram .sbi_item:hover {
  border-color: var(--border-gold) !important;
  transform: translateY(-2px);
}
#sb_instagram_load .sbi_load_btn {
  background: var(--gold) !important;
  color: #1a1305 !important;
  border-radius: var(--radius-pill) !important;
  font-weight: 600 !important;
}
