/*
Theme Name: Magic Caviar
Theme URI: https://magiccaviar.com
Author: Ryan Mitchell
Description: A premium editorial theme for online income guides.
Version: 1.0.0
Text Domain: magiccaviar
*/

/* === DESIGN TOKENS === */
:root {
  --mc-charcoal: #1c1c28;
  --mc-dark: #2a2a3a;
  --mc-gold: #c9a227;
  --mc-gold-light: #e8d48b;
  --mc-gold-dim: #a68522;
  --mc-cream: #faf8f4;
  --mc-warm-white: #f5f3ef;
  --mc-text: #3a3a42;
  --mc-text-light: #6b6b78;
  --mc-border: #e2e0dc;
  --mc-border-dark: #d1cfc9;
  --mc-success: #2e7d4f;
  --mc-info: #2563a8;
  --mc-warn: #b45309;
  --mc-radius: 6px;
  --mc-radius-lg: 10px;
  --mc-space: 8px;
  --mc-max-width: 1200px;
  --mc-content-width: 740px;
  --mc-font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --mc-font-display: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --mc-font-mono: 'JetBrains Mono', 'Fira Code', monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --mc-cream: #1c1c28;
    --mc-warm-white: #24243a;
    --mc-text: #e0ddd8;
    --mc-text-light: #a0a0b0;
    --mc-border: #3a3a4e;
    --mc-border-dark: #4a4a5e;
    --mc-charcoal: #faf8f4;
    --mc-dark: #f5f3ef;
  }
}

/* === RESET & BASE === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: 100%;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: var(--mc-font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--mc-text);
  background: var(--mc-cream);
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: var(--mc-gold);
  color: #fff;
}

/* === TYPOGRAPHY === */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--mc-font-display);
  font-weight: 700;
  line-height: 1.25;
  color: var(--mc-charcoal);
}

h1 { font-size: 2.25rem; letter-spacing: -0.02em; }
h2 { font-size: 1.625rem; margin-top: 2.5rem; margin-bottom: 0.75rem; }
h3 { font-size: 1.25rem; margin-top: 2rem; margin-bottom: 0.5rem; }
h4 { font-size: 1.0625rem; font-weight: 600; margin-top: 1.5rem; margin-bottom: 0.5rem; }

p { margin-bottom: 1.25rem; max-width: 72ch; }

a {
  color: var(--mc-gold-dim);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
  transition: color 0.15s ease;
}
a:hover { color: var(--mc-gold); }
a:focus-visible {
  outline: 2px solid var(--mc-gold);
  outline-offset: 2px;
  border-radius: 2px;
}

strong { font-weight: 600; }
em { font-style: italic; }

ul, ol { margin: 0 0 1.25rem 1.5rem; }
li { margin-bottom: 0.4rem; }
li::marker { color: var(--mc-gold); }

blockquote {
  border-left: 3px solid var(--mc-gold);
  padding: 1rem 1.5rem;
  margin: 1.5rem 0;
  background: var(--mc-warm-white);
  border-radius: 0 var(--mc-radius) var(--mc-radius) 0;
  font-style: italic;
  color: var(--mc-text-light);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
  border-radius: var(--mc-radius);
}

figure {
  margin: 2rem 0;
}
figcaption {
  font-size: 0.875rem;
  color: var(--mc-text-light);
  margin-top: 0.5rem;
  text-align: center;
}

/* === LAYOUT === */
.mc-wrap {
  max-width: var(--mc-max-width);
  margin: 0 auto;
  padding: 0 calc(var(--mc-space) * 3);
}

.mc-content-wrap {
  max-width: var(--mc-content-width);
  margin: 0 auto;
}

.mc-skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 9999;
  background: var(--mc-gold);
  color: #fff;
  padding: 0.75rem 1.5rem;
  font-weight: 600;
  border-radius: 0 0 var(--mc-radius) 0;
}
.mc-skip-link:focus { left: 0; }

/* === HEADER === */
.mc-header {
  background: var(--mc-charcoal);
  padding: calc(var(--mc-space) * 2) 0;
  position: sticky;
  top: 0;
  z-index: 100;
}
.mc-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: var(--mc-max-width);
  margin: 0 auto;
  padding: 0 calc(var(--mc-space) * 3);
}
.mc-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
}
.mc-logo img {
  height: 36px;
  width: auto;
  border-radius: 0;
}
.mc-logo-text {
  font-family: var(--mc-font-display);
  font-size: 1.375rem;
  font-weight: 700;
  color: var(--mc-cream);
  letter-spacing: -0.01em;
}
.mc-logo-text span {
  color: var(--mc-gold);
}
.mc-nav { display: flex; align-items: center; gap: 0; }
.mc-nav a {
  color: var(--mc-cream);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.5rem 1rem;
  border-radius: var(--mc-radius);
  transition: background 0.15s ease, color 0.15s ease;
  opacity: 0.85;
}
.mc-nav a:hover { opacity: 1; background: rgba(255,255,255,0.08); }

.mc-mobile-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--mc-cream);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.5rem;
  min-width: 48px;
  min-height: 48px;
  align-items: center;
  justify-content: center;
}

@media (max-width: 768px) {
  .mc-mobile-toggle { display: flex; }
  .mc-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--mc-charcoal);
    flex-direction: column;
    padding: 1rem;
    border-top: 1px solid rgba(255,255,255,0.1);
  }
  .mc-nav.is-open { display: flex; }
  .mc-nav a { padding: 0.75rem 1rem; width: 100%; }
}

/* === HERO === */
.mc-hero {
  background: linear-gradient(135deg, var(--mc-charcoal) 0%, var(--mc-dark) 100%);
  padding: calc(var(--mc-space) * 8) 0 calc(var(--mc-space) * 6);
  text-align: center;
}
.mc-hero h1 {
  color: var(--mc-cream);
  font-size: 2.75rem;
  margin-bottom: 1rem;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}
.mc-hero .mc-hero-sub {
  color: var(--mc-gold-light);
  font-size: 1.125rem;
  max-width: 560px;
  margin: 0 auto 2rem;
  line-height: 1.6;
}
.mc-hero .mc-btn {
  font-size: 1rem;
}

@media (max-width: 768px) {
  .mc-hero h1 { font-size: 2rem; }
  .mc-hero { padding: calc(var(--mc-space) * 5) 0 calc(var(--mc-space) * 4); }
}

/* === ANSWER CAPSULE === */
.mc-answer-capsule {
  background: var(--mc-warm-white);
  border-left: 3px solid var(--mc-gold);
  padding: 1.25rem 1.5rem;
  margin: 1.5rem 0 2rem;
  border-radius: 0 var(--mc-radius) var(--mc-radius) 0;
  font-size: 1.0625rem;
  line-height: 1.6;
}
.mc-answer-capsule strong {
  color: var(--mc-charcoal);
}

/* === BUTTONS === */
.mc-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.75rem;
  border-radius: var(--mc-radius);
  font-weight: 600;
  font-size: 0.9375rem;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
  min-height: 48px;
}
.mc-btn:active { transform: scale(0.98); }
.mc-btn-primary {
  background: var(--mc-gold);
  color: #fff;
}
.mc-btn-primary:hover {
  background: var(--mc-gold-dim);
  color: #fff;
}
.mc-btn-outline {
  background: transparent;
  border: 2px solid var(--mc-gold);
  color: var(--mc-gold);
}
.mc-btn-outline:hover {
  background: var(--mc-gold);
  color: #fff;
}

/* === CARDS === */
.mc-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: calc(var(--mc-space) * 3);
  margin: 2rem 0;
}
.mc-card {
  background: #fff;
  border: 1px solid var(--mc-border);
  border-radius: var(--mc-radius-lg);
  overflow: hidden;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.mc-card:hover {
  border-color: var(--mc-gold);
  box-shadow: 0 4px 16px rgba(0,0,0,0.06);
}
.mc-card-img {
  aspect-ratio: 16/9;
  overflow: hidden;
}
.mc-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 0;
  transition: transform 0.3s ease;
}
.mc-card:hover .mc-card-img img { transform: scale(1.03); }

.mc-card-body {
  padding: 1.25rem 1.5rem;
}
.mc-card-body h3 {
  font-size: 1.125rem;
  margin: 0 0 0.5rem;
  line-height: 1.35;
}
.mc-card-body h3 a {
  color: var(--mc-charcoal);
  text-decoration: none;
}
.mc-card-body h3 a:hover { color: var(--mc-gold-dim); }
.mc-card-meta {
  font-size: 0.8125rem;
  color: var(--mc-text-light);
  margin-bottom: 0.5rem;
}
.mc-card-excerpt {
  font-size: 0.9375rem;
  color: var(--mc-text-light);
  line-height: 1.5;
}

/* === PILLAR CARDS === */
.mc-pillar-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: calc(var(--mc-space) * 3);
  margin: 2rem 0;
}
.mc-pillar-card {
  background: var(--mc-charcoal);
  border-radius: var(--mc-radius-lg);
  padding: 2rem;
  transition: transform 0.2s ease;
}
.mc-pillar-card:hover { transform: translateY(-2px); }
.mc-pillar-card h3 {
  color: var(--mc-cream);
  font-size: 1.25rem;
  margin-bottom: 0.75rem;
}
.mc-pillar-card p {
  color: rgba(250,248,244,0.7);
  font-size: 0.9375rem;
  margin-bottom: 1.25rem;
}
.mc-pillar-card a {
  color: var(--mc-gold-light);
  font-weight: 600;
  text-decoration: none;
  font-size: 0.9rem;
}
.mc-pillar-card a:hover { color: var(--mc-gold); }

/* === SECTION HEADINGS === */
.mc-section {
  padding: calc(var(--mc-space) * 6) 0;
}
.mc-section-alt {
  background: var(--mc-warm-white);
}
.mc-section-header {
  text-align: center;
  margin-bottom: calc(var(--mc-space) * 4);
}
.mc-section-header h2 {
  margin-top: 0;
  font-size: 1.875rem;
}
.mc-section-header p {
  color: var(--mc-text-light);
  max-width: 560px;
  margin: 0.75rem auto 0;
}
.mc-label {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--mc-gold);
  margin-bottom: 0.5rem;
}

/* === TABLES === */
.mc-table-wrap {
  overflow-x: auto;
  margin: 1.5rem 0;
  border-radius: var(--mc-radius);
  border: 1px solid var(--mc-border);
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
}
thead {
  background: var(--mc-charcoal);
  color: var(--mc-cream);
}
th {
  text-align: left;
  padding: 0.75rem 1rem;
  font-weight: 600;
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
td {
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--mc-border);
}
tbody tr:hover {
  background: var(--mc-warm-white);
}

/* === TOC === */
.mc-toc {
  background: var(--mc-warm-white);
  border: 1px solid var(--mc-border);
  border-radius: var(--mc-radius-lg);
  padding: 1.5rem 2rem;
  margin: 2rem 0;
}
.mc-toc-title {
  font-family: var(--mc-font-display);
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  color: var(--mc-charcoal);
}
.mc-toc ol {
  margin: 0;
  padding-left: 1.25rem;
}
.mc-toc li {
  margin-bottom: 0.35rem;
}
.mc-toc a {
  color: var(--mc-text);
  text-decoration: none;
  font-size: 0.9375rem;
}
.mc-toc a:hover { color: var(--mc-gold-dim); }

/* === FAQ === */
.mc-faq {
  margin: 2.5rem 0;
}
.mc-faq-item {
  border-bottom: 1px solid var(--mc-border);
}
.mc-faq-q {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 1.25rem 0;
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--mc-font-display);
  font-size: 1.0625rem;
  font-weight: 600;
  color: var(--mc-charcoal);
  text-align: left;
  min-height: 48px;
  gap: 1rem;
}
.mc-faq-q:focus-visible {
  outline: 2px solid var(--mc-gold);
  outline-offset: 2px;
}
.mc-faq-q::after {
  content: '+';
  font-size: 1.25rem;
  font-weight: 400;
  color: var(--mc-gold);
  flex-shrink: 0;
  transition: transform 0.2s ease;
}
.mc-faq-item.is-open .mc-faq-q::after {
  content: '-';
}
.mc-faq-a {
  display: none;
  padding: 0 0 1.25rem;
  color: var(--mc-text-light);
  line-height: 1.6;
}
.mc-faq-item.is-open .mc-faq-a { display: block; }

/* === AUTHOR BIO === */
.mc-author-card {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
  background: var(--mc-warm-white);
  border: 1px solid var(--mc-border);
  border-radius: var(--mc-radius-lg);
  padding: 1.75rem;
  margin: 2.5rem 0;
}
.mc-author-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.mc-author-info h4 {
  margin: 0 0 0.25rem;
  font-size: 1rem;
}
.mc-author-info .mc-author-role {
  font-size: 0.8125rem;
  color: var(--mc-gold-dim);
  font-weight: 600;
  margin-bottom: 0.5rem;
}
.mc-author-info p {
  font-size: 0.9375rem;
  color: var(--mc-text-light);
  margin-bottom: 0;
}

/* === BYLINE === */
.mc-byline {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.875rem;
  color: var(--mc-text-light);
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}
.mc-byline img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
}
.mc-byline a { color: var(--mc-charcoal); font-weight: 600; }
.mc-byline-sep { color: var(--mc-border-dark); }

/* === BREADCRUMBS === */
.mc-breadcrumbs {
  font-size: 0.8125rem;
  color: var(--mc-text-light);
  margin-bottom: 1rem;
  padding: 0.75rem 0;
}
.mc-breadcrumbs a {
  color: var(--mc-text-light);
  text-decoration: none;
}
.mc-breadcrumbs a:hover { color: var(--mc-gold-dim); }
.mc-breadcrumbs span { margin: 0 0.4rem; }

/* === SOURCES === */
.mc-sources {
  margin: 2.5rem 0;
  padding: 1.5rem;
  background: var(--mc-warm-white);
  border: 1px solid var(--mc-border);
  border-radius: var(--mc-radius-lg);
}
.mc-sources h3 {
  font-size: 1rem;
  margin: 0 0 0.75rem;
}
.mc-sources ol {
  margin: 0;
  padding-left: 1.25rem;
}
.mc-sources li {
  font-size: 0.875rem;
  color: var(--mc-text-light);
  margin-bottom: 0.35rem;
}
.mc-sources a { font-size: 0.875rem; }

/* === CTA CARD === */
.mc-cta-card {
  background: linear-gradient(135deg, var(--mc-charcoal), var(--mc-dark));
  border-radius: var(--mc-radius-lg);
  padding: 2.5rem;
  text-align: center;
  margin: 2.5rem 0;
}
.mc-cta-card h3 {
  color: var(--mc-cream);
  margin: 0 0 0.75rem;
  font-size: 1.375rem;
}
.mc-cta-card p {
  color: rgba(250,248,244,0.75);
  margin: 0 auto 1.5rem;
  max-width: 480px;
}

/* === INFO BOX === */
.mc-info-box {
  border-left: 3px solid var(--mc-info);
  background: #f0f4f8;
  padding: 1.25rem 1.5rem;
  margin: 1.5rem 0;
  border-radius: 0 var(--mc-radius) var(--mc-radius) 0;
}
.mc-info-box strong {
  display: block;
  margin-bottom: 0.35rem;
  color: var(--mc-info);
}
.mc-warn-box {
  border-left-color: var(--mc-warn);
  background: #fef7ed;
}
.mc-warn-box strong { color: var(--mc-warn); }

/* === RELATED POSTS === */
.mc-related {
  margin: 3rem 0 2rem;
}
.mc-related h3 {
  margin-bottom: 1.25rem;
}

/* === FOOTER === */
.mc-footer {
  background: var(--mc-charcoal);
  color: rgba(250,248,244,0.7);
  padding: calc(var(--mc-space) * 6) 0 calc(var(--mc-space) * 3);
}
.mc-footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: calc(var(--mc-space) * 4);
  margin-bottom: calc(var(--mc-space) * 4);
}
.mc-footer h4 {
  color: var(--mc-cream);
  font-family: var(--mc-font-display);
  font-size: 1rem;
  margin-bottom: 1rem;
}
.mc-footer a {
  color: rgba(250,248,244,0.65);
  text-decoration: none;
  font-size: 0.9rem;
}
.mc-footer a:hover { color: var(--mc-gold-light); }
.mc-footer ul { list-style: none; margin: 0; padding: 0; }
.mc-footer li { margin-bottom: 0.5rem; }
.mc-footer-bottom {
  border-top: 1px solid rgba(250,248,244,0.1);
  padding-top: calc(var(--mc-space) * 3);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.8125rem;
}
.mc-footer-disclaimer {
  font-size: 0.8125rem;
  color: rgba(250,248,244,0.5);
  max-width: 700px;
  line-height: 1.5;
  margin-top: calc(var(--mc-space) * 2);
}

/* === ARCHIVE === */
.mc-archive-header {
  background: var(--mc-charcoal);
  padding: calc(var(--mc-space) * 5) 0;
  text-align: center;
}
.mc-archive-header h1 { color: var(--mc-cream); margin-bottom: 0.5rem; }
.mc-archive-header p { color: rgba(250,248,244,0.7); max-width: 560px; margin: 0 auto; }

/* === SEARCH & 404 === */
.mc-search-form {
  display: flex;
  gap: 0.5rem;
  max-width: 480px;
  margin: 1.5rem auto;
}
.mc-search-form input[type="search"] {
  flex: 1;
  padding: 0.75rem 1rem;
  border: 1px solid var(--mc-border);
  border-radius: var(--mc-radius);
  font-size: 1rem;
  font-family: var(--mc-font-body);
  min-height: 48px;
}
.mc-search-form input:focus {
  outline: none;
  border-color: var(--mc-gold);
  box-shadow: 0 0 0 3px rgba(201,162,39,0.15);
}

/* === DISCLOSURE === */
.mc-disclosure {
  background: #fef7ed;
  border: 1px solid #f0d9a8;
  border-radius: var(--mc-radius);
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
  font-size: 0.875rem;
  color: var(--mc-warn);
  line-height: 1.5;
}

/* === SINGLE POST === */
.mc-single-header {
  padding: calc(var(--mc-space) * 4) 0 calc(var(--mc-space) * 2);
}
.mc-single-content {
  padding-bottom: calc(var(--mc-space) * 4);
}
.mc-post-category {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--mc-gold);
  text-decoration: none;
  margin-bottom: 0.5rem;
}
.mc-post-category:hover { color: var(--mc-gold-dim); }

/* === LAST REVIEWED === */
.mc-last-reviewed {
  font-size: 0.8125rem;
  color: var(--mc-text-light);
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--mc-border);
}

/* === UTILITIES === */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}

/* === AUTHOR PAGE === */
.mc-author-page {
  padding: calc(var(--mc-space) * 5) 0;
}
.mc-author-page-header {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
  margin-bottom: 3rem;
}
.mc-author-page-avatar {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 3px solid var(--mc-gold);
}
.mc-author-page-bio h1 { margin-bottom: 0.5rem; }
.mc-author-page-bio .mc-author-role {
  color: var(--mc-gold-dim);
  font-weight: 600;
  margin-bottom: 1rem;
}

@media (max-width: 640px) {
  .mc-author-page-header { flex-direction: column; align-items: center; text-align: center; }
  .mc-author-card { flex-direction: column; align-items: center; text-align: center; }
  h1 { font-size: 1.75rem; }
  .mc-footer-grid { grid-template-columns: 1fr; }
  .mc-footer-bottom { flex-direction: column; text-align: center; }
}

/* Fix WP nav menu */
.mc-nav { list-style: none; padding: 0; margin: 0; }
.mc-nav li { display: inline-flex; list-style: none; }
.mc-nav li::marker { content: none; }
.mc-nav .sub-menu { display: none; }
