/*
Theme Name: QuoteMeMaybe
Theme URI: https://quotememaybe.com
Author: Kyle Bamboo
Description: Custom quote-origin grid theme for QuoteMeMaybe.com — image-first card grid, dark aesthetic.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 7.4
License: Proprietary
Text Domain: quotememaybe
*/

/* ─── Custom Properties ──────────────────────────────────────────────────── */
:root {
  --bg:           #0a0a0a;
  --surface:      #161616;
  --surface-2:    #1f1f1f;
  --border:       #2a2a2a;
  --text:         #e8e8e8;
  --text-muted:   #888;
  --text-dim:     #4a4a4a;
  --accent:       #c8a84b;
  --accent-bg:    rgba(200, 168, 75, 0.12);
  --radius:       8px;
  --radius-sm:    4px;
  --gap:          16px;
  --header-h:     68px;
}

/* ─── Reset ──────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }

/* ─── Site Header ────────────────────────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 200;
  background: rgba(10, 10, 10, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  height: var(--header-h);
}
.site-header__inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 32px;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 28px;
}
.site-logo {
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -0.3px;
  color: var(--accent);
  white-space: nowrap;
  flex-shrink: 0;
  margin-right: 8px;
}
.site-logo:hover { color: var(--accent); opacity: 0.85; }

/* Primary nav */
.site-nav { display: flex; gap: 4px; }
.site-nav a {
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: color 0.15s, background 0.15s;
}
.site-nav a:hover,
.site-nav .current-menu-item > a,
.site-nav .current-menu-ancestor > a {
  color: var(--text);
  background: var(--surface-2);
}

/* Search */
.site-search { margin-left: auto; }
.search-form { display: flex; }
.search-field {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-right: none;
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
  padding: 6px 12px;
  color: var(--text);
  font-size: 0.82rem;
  width: 180px;
  outline: none;
  transition: border-color 0.15s, width 0.2s;
}
.search-field:focus { border-color: #444; width: 220px; }
.search-submit {
  background: var(--accent);
  border: none;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 6px 12px;
  color: #000;
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  transition: opacity 0.15s;
}
.search-submit:hover { opacity: 0.85; }

/* Mobile nav toggle */
.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  padding: 5px 9px;
  cursor: pointer;
  font-size: 1rem;
}

/* ─── Page Wrap ──────────────────────────────────────────────────────────── */
.page-wrap {
  max-width: 1440px;
  margin: 0 auto;
  padding: 28px 24px 60px;
}

/* ─── Archive / Search Header ────────────────────────────────────────────── */
.archive-header {
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}
.archive-header__label {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 6px;
}
.archive-header__title {
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.3px;
}
.archive-header__desc {
  margin-top: 6px;
  font-size: 0.875rem;
  color: var(--text-muted);
  max-width: 600px;
}

/* ─── Grid ───────────────────────────────────────────────────────────────── */
.qmm-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--gap);
}
@media (max-width: 1200px) { .qmm-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 820px)  { .qmm-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px)  { .qmm-grid { grid-template-columns: 1fr; } }

/* ─── Card ───────────────────────────────────────────────────────────────── */
.qmm-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}
.qmm-card:hover {
  border-color: #3a3a3a;
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}

/* Card image */
.qmm-card__img {
  aspect-ratio: 3 / 2;
  overflow: hidden;
  display: block;
  background: var(--surface-2);
}
.qmm-card__img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}
.qmm-card:hover .qmm-card__img img { transform: scale(1.04); }

/* Placeholder when no image */
.qmm-card__img--empty {
  aspect-ratio: 3 / 2;
  background: linear-gradient(135deg, var(--surface) 0%, var(--surface-2) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  color: var(--text-dim);
}

/* Card body */
.qmm-card__body {
  padding: 14px 15px 15px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.qmm-card__title {
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.qmm-card__title a:hover { color: var(--accent); }

/* Tag pills */
.qmm-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: auto;
  padding-top: 4px;
}
.qmm-card__tag {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  padding: 2px 7px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 3px;
  color: var(--text-muted);
  transition: color 0.15s, background 0.15s, border-color 0.15s;
}
.qmm-card__tag:hover {
  color: var(--accent);
  background: var(--accent-bg);
  border-color: rgba(200, 168, 75, 0.25);
}

/* Card footer */
.qmm-card__footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  font-size: 0.68rem;
  color: var(--text-dim);
  letter-spacing: 0.02em;
}

/* ─── Pagination ─────────────────────────────────────────────────────────── */
.qmm-pagination {
  margin-top: 40px;
  display: flex;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
}
.page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 0.82rem;
  color: var(--text-muted);
  transition: border-color 0.15s, color 0.15s;
}
.page-numbers.current {
  background: var(--accent);
  border-color: var(--accent);
  color: #000;
  font-weight: 700;
}
.page-numbers:not(.current):hover { border-color: #444; color: var(--text); }
.page-numbers.dots { background: none; border-color: transparent; }

/* ─── Single Post ────────────────────────────────────────────────────────── */
.single-wrap {
  max-width: 760px;
  margin: 0 auto;
  padding: 40px 24px 80px;
}
.single-hero {
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  border-radius: var(--radius);
  margin-bottom: 36px;
}
.single-header { margin-bottom: 28px; }
.single-cats {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}
.single-cat {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 3px 9px;
  background: var(--accent-bg);
  border: 1px solid rgba(200, 168, 75, 0.2);
  border-radius: 3px;
  color: var(--accent);
  transition: opacity 0.15s;
}
.single-cat:hover { opacity: 0.75; }
.single-title {
  font-size: 1.9rem;
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -0.4px;
  margin-bottom: 14px;
}
.single-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  font-size: 0.78rem;
  color: var(--text-muted);
  align-items: center;
}
.single-meta__sep { color: var(--text-dim); }

/* Article content */
.entry-content {
  font-size: 1rem;
  line-height: 1.8;
  color: var(--text);
}
.entry-content > * + * { margin-top: 1.1em; }
.entry-content h2 {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.2px;
  margin-top: 2.2em;
  margin-bottom: 0.5em;
  color: var(--text);
}
.entry-content h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-top: 1.8em;
  margin-bottom: 0.4em;
}
.entry-content p { margin-bottom: 0; }

/* Blockquote — the opening quote gets special treatment */
.entry-content blockquote,
.entry-content > p:first-child:has(> em),
.entry-content > p:first-of-type {
  /* styled below via .entry-content blockquote */
}
.entry-content blockquote {
  border-left: 3px solid var(--accent);
  padding: 14px 20px;
  margin: 1.6em 0;
  background: var(--surface);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 1.05rem;
  font-style: italic;
  line-height: 1.65;
}
/* The opening > "quote" paragraph pattern */
.entry-content p:first-child {
  border-left: 3px solid var(--accent);
  padding: 12px 18px;
  background: var(--surface);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 1.05rem;
  font-style: italic;
}
.entry-content a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: rgba(200,168,75,0.4);
  text-underline-offset: 2px;
}
.entry-content a:hover { text-decoration-color: var(--accent); }
.entry-content figure {
  margin: 2em 0;
  border-radius: var(--radius);
  overflow: hidden;
}
.entry-content figure img {
  width: 100%;
  border-radius: var(--radius);
}
.entry-content ul,
.entry-content ol {
  padding-left: 1.5em;
}
.entry-content li { margin-bottom: 0.4em; }
.entry-content li a { color: var(--accent); }

/* Affiliate products box */
.entry-content h2:last-of-type + ul,
.entry-content ul:last-of-type {
  /* handled by general ul styles */
}

/* Post navigation */
.post-nav {
  display: flex;
  gap: 12px;
  margin-top: 48px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
}
.post-nav__item {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  transition: border-color 0.15s;
  font-size: 0.8rem;
}
.post-nav__item:hover { border-color: #444; }
.post-nav__label { color: var(--text-dim); font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 5px; }
.post-nav__title { color: var(--text-muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.post-nav__item:hover .post-nav__title { color: var(--text); }

/* ─── 404 / No Results ───────────────────────────────────────────────────── */
.not-found {
  max-width: 500px;
  margin: 80px auto;
  text-align: center;
  padding: 0 24px;
}
.not-found__code {
  font-size: 6rem;
  font-weight: 800;
  color: var(--text-dim);
  line-height: 1;
}
.not-found__title { font-size: 1.4rem; font-weight: 700; margin: 12px 0 8px; }
.not-found__desc { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 24px; }
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--accent);
  color: #000;
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  transition: opacity 0.15s;
}
.btn:hover { opacity: 0.85; color: #000; }

/* ─── Site Footer ────────────────────────────────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding: 24px;
  text-align: center;
  font-size: 0.78rem;
  color: var(--text-dim);
}
.site-footer a { color: var(--text-muted); }
.site-footer a:hover { color: var(--accent); }

/* ─── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 820px) {
  .site-nav { display: none; }
  .site-nav.is-open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: var(--header-h);
    left: 0; right: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 12px 24px;
    gap: 4px;
  }
  .nav-toggle { display: flex; }
  .single-title { font-size: 1.5rem; }
  .post-nav { flex-direction: column; }
}
@media (max-width: 480px) {
  .page-wrap { padding: 20px 16px 48px; }
  .single-wrap { padding: 24px 16px 60px; }
  .single-title { font-size: 1.3rem; }
  .site-header__inner { padding: 0 16px; }
  .search-field { width: 130px; }
  .search-field:focus { width: 150px; }
}
