/* ============================================================
   Food Recipes Pro — Dark Mode
   Activates when html[data-frpro-theme="dark"]
   ============================================================ */

/* ── Variable overrides ────────────────────────────────── */
html[data-frpro-theme="dark"] {
  --fr-cream:        #15171a;
  --fr-warm:         #1c1f24;
  --fr-white:        #1f2227;
  --fr-ink:          #ebe6dc;
  --fr-ink-2:        #b8b3a8;
  --fr-ink-3:        #8a8578;
  --fr-border:       #2a2e35;
  --fr-border-soft:  #232730;
  --fr-accent-soft:  #3a2820;
  --fr-shadow-sm:    0 1px 4px rgba(0,0,0,.4);
  --fr-shadow:       0 4px 20px rgba(0,0,0,.5);
  --fr-shadow-lg:    0 12px 50px rgba(0,0,0,.6);
}

/* ── Page bits ─────────────────────────────────────────── */
html[data-frpro-theme="dark"] body {
  background: var(--fr-cream);
  color: var(--fr-ink);
}

/* Header — full block including masthead, meta bar, ticker */
html[data-frpro-theme="dark"] .fr-header {
  background: #15171a;
  border-bottom-color: var(--fr-border);
}
html[data-frpro-theme="dark"] .fr-masthead {
  background: #15171a;
  border-bottom-color: var(--fr-border);
}
html[data-frpro-theme="dark"] .fr-site-name,
html[data-frpro-theme="dark"] .fr-site-name a { color: var(--fr-ink); }
html[data-frpro-theme="dark"] .fr-tagline { color: var(--fr-ink-3); }

/* Meta bar (date + social icons row) */
html[data-frpro-theme="dark"] .fr-meta-bar {
  background: #15171a;
  border-bottom-color: var(--fr-border);
  color: var(--fr-ink-3);
}
html[data-frpro-theme="dark"] .fr-meta-bar a { color: var(--fr-ink-3); }
html[data-frpro-theme="dark"] .fr-meta-bar a:hover { color: var(--fr-ink); }
html[data-frpro-theme="dark"] .fr-masthead-date { color: var(--fr-ink-3); }
html[data-frpro-theme="dark"] .fr-social-icon { color: var(--fr-ink-3); }
html[data-frpro-theme="dark"] .fr-social-icon:hover { color: var(--fr-ink); }

/* News ticker */
html[data-frpro-theme="dark"] .fr-ticker-bar {
  background: #0d0e10;
  border-bottom-color: var(--fr-border);
  color: var(--fr-ink-2);
}
html[data-frpro-theme="dark"] .fr-ticker-label {
  background: var(--fr-accent, #c8522a);
  color: #fff;
}
html[data-frpro-theme="dark"] .fr-ticker-text { color: var(--fr-ink-2); }
html[data-frpro-theme="dark"] .fr-ticker-text a { color: var(--fr-ink-2); }
html[data-frpro-theme="dark"] .fr-ticker-text a:hover { color: var(--fr-ink); }

/* Flash sale bar */
html[data-frpro-theme="dark"] .fr-flash-bar {
  background: #1a0e00;
  border-bottom-color: #3a2200;
  color: #ffd54a;
}

/* Footer */
html[data-frpro-theme="dark"] .fr-footer {
  background: #0d0e10;
  border-top-color: var(--fr-border);
  color: var(--fr-ink-2);
}
html[data-frpro-theme="dark"] .fr-footer-widget-title,
html[data-frpro-theme="dark"] .fr-footer-brand-name { color: var(--fr-ink); }
html[data-frpro-theme="dark"] .fr-footer-brand-desc { color: var(--fr-ink-3); }
html[data-frpro-theme="dark"] .fr-footer-list li { border-bottom-color: var(--fr-border-soft); }
html[data-frpro-theme="dark"] .fr-footer-list a { color: var(--fr-ink-3); }
html[data-frpro-theme="dark"] .fr-footer-list a:hover { color: var(--fr-ink); }
html[data-frpro-theme="dark"] .fr-footer-social-icon {
  background: var(--fr-warm);
  color: var(--fr-ink-2);
  border-color: var(--fr-border);
}
html[data-frpro-theme="dark"] .fr-footer-social-icon:hover {
  background: var(--fr-accent, #c8522a);
  color: #fff;
  border-color: transparent;
}
html[data-frpro-theme="dark"] .fr-footer-divider { background: var(--fr-border); }

/* Footer bottom bar (copyright) */
html[data-frpro-theme="dark"] .fr-footer-bottom {
  background: #0a0b0d;
  border-top-color: var(--fr-border);
  color: var(--fr-ink-3);
}
html[data-frpro-theme="dark"] .fr-footer-bottom a { color: var(--fr-ink-3); }
html[data-frpro-theme="dark"] .fr-footer-bottom a:hover { color: var(--fr-ink); }

/* Nav — already dark, just refine */
html[data-frpro-theme="dark"] .fr-nav { background: #0d0e10; }

/* Cards */
html[data-frpro-theme="dark"] .fr-card { background: var(--fr-white); }
html[data-frpro-theme="dark"] .fr-card-title { color: var(--fr-ink); }
html[data-frpro-theme="dark"] .fr-card-excerpt { color: var(--fr-ink-2); }
html[data-frpro-theme="dark"] .fr-card-image { background: var(--fr-warm); }

/* Editorial hero */
html[data-frpro-theme="dark"] .fr-editorial-title { color: var(--fr-ink); }
html[data-frpro-theme="dark"] .fr-editorial-title a { color: inherit; }
html[data-frpro-theme="dark"] .fr-editorial-excerpt { color: var(--fr-ink-2); }
html[data-frpro-theme="dark"] .fr-editorial-cta { color: var(--fr-ink); border-color: var(--fr-ink); }
html[data-frpro-theme="dark"] .fr-editorial-issue { background: var(--fr-white); color: var(--fr-ink); }

/* Categories strip */
html[data-frpro-theme="dark"] .fr-categories-strip { border-color: var(--fr-border); }
html[data-frpro-theme="dark"] .fr-categories-strip::before,
html[data-frpro-theme="dark"] .fr-categories-strip::after { background: var(--fr-warm); border-color: var(--fr-border); }
html[data-frpro-theme="dark"] .fr-category-tile-img {
  background: var(--fr-warm);
  box-shadow: 0 0 0 1px var(--fr-border-soft), var(--fr-shadow-sm);
}
html[data-frpro-theme="dark"] .fr-category-tile-name { color: var(--fr-ink); }
html[data-frpro-theme="dark"] .fr-category-tile-img-fallback {
  background: linear-gradient(135deg, var(--fr-warm), var(--fr-accent-soft));
}

/* Section divider */
html[data-frpro-theme="dark"] .fr-section-divider-line { background: var(--fr-border); }
html[data-frpro-theme="dark"] .fr-section-divider-text { color: var(--fr-ink-2); }

/* Sidebar */
html[data-frpro-theme="dark"] .fr-sidebar .widget { background: var(--fr-white); }
html[data-frpro-theme="dark"] .fr-sidebar .widget-title { color: var(--fr-ink); }
html[data-frpro-theme="dark"] .fr-sidebar .widget ul li { border-bottom-color: var(--fr-border-soft); color: var(--fr-ink-2); }
html[data-frpro-theme="dark"] .fr-sidebar .widget ul li a { color: var(--fr-ink-2); }
html[data-frpro-theme="dark"] .fr-sidebar .search-field {
  background: var(--fr-warm);
  border-color: var(--fr-border);
  color: var(--fr-ink);
}

/* Single post */
html[data-frpro-theme="dark"] .fr-single { background: var(--fr-white); }
html[data-frpro-theme="dark"] .fr-single-header { border-bottom-color: var(--fr-border); }
html[data-frpro-theme="dark"] .fr-single-title { color: var(--fr-ink); }
html[data-frpro-theme="dark"] .fr-single-content { color: var(--fr-ink); }
html[data-frpro-theme="dark"] .fr-single-content h2,
html[data-frpro-theme="dark"] .fr-single-content h3,
html[data-frpro-theme="dark"] .fr-single-content h4 { color: var(--fr-ink); }
html[data-frpro-theme="dark"] .fr-single-content h2 { border-bottom-color: var(--fr-border); }
html[data-frpro-theme="dark"] .fr-single-content blockquote {
  background: var(--fr-warm);
  color: var(--fr-ink-2);
}
html[data-frpro-theme="dark"] .fr-single-content code { background: var(--fr-warm); color: #ff9670; }

/* Comments */
html[data-frpro-theme="dark"] .fr-comments-wrap { border-top-color: var(--fr-border); }
html[data-frpro-theme="dark"] .fr-comments-wrap .comment-body { background: var(--fr-warm); }
html[data-frpro-theme="dark"] .fr-comments-wrap .comment-author { color: var(--fr-ink); }
html[data-frpro-theme="dark"] .fr-comments-wrap .comment-form input,
html[data-frpro-theme="dark"] .fr-comments-wrap .comment-form textarea {
  background: var(--fr-warm);
  border-color: var(--fr-border);
  color: var(--fr-ink);
}

/* Tags */
html[data-frpro-theme="dark"] .fr-tag {
  background: var(--fr-warm);
  color: var(--fr-ink-2);
  border-color: var(--fr-border);
}

/* Pagination */
html[data-frpro-theme="dark"] .fr-pagination { border-top-color: var(--fr-border); }
html[data-frpro-theme="dark"] .fr-pagination a {
  background: var(--fr-white);
  border-color: var(--fr-border);
  color: var(--fr-ink);
}
html[data-frpro-theme="dark"] .fr-pagination a:hover {
  background: var(--fr-accent);
  border-color: var(--fr-accent);
  color: #fff;
}

/* Post nav */
html[data-frpro-theme="dark"] .fr-post-nav { background: var(--fr-border); }
html[data-frpro-theme="dark"] .fr-post-nav-prev,
html[data-frpro-theme="dark"] .fr-post-nav-next { background: var(--fr-white); }
html[data-frpro-theme="dark"] .fr-post-nav a:hover { background: var(--fr-warm); }
html[data-frpro-theme="dark"] .fr-nav-title { color: var(--fr-ink); }

/* Recipe Card Block */
html[data-frpro-theme="dark"] .frpro-recipe-card {
  --rc-cream: #1c1f24;
  --rc-warm: #15171a;
  --rc-ink: #ebe6dc;
  --rc-ink-2: #b8b3a8;
  --rc-ink-3: #8a8578;
  --rc-border: #2a2e35;
  --rc-border-soft: #232730;
  --rc-accent-soft: #3a2820;
}

/* Newsletter widget */
html[data-frpro-theme="dark"] .frpro-newsletter-widget .frpro-nl-card {
  background: linear-gradient(135deg, var(--fr-warm), var(--fr-accent-soft));
  border-color: var(--fr-border);
}
html[data-frpro-theme="dark"] .frpro-newsletter-widget .frpro-nl-title { color: var(--fr-ink); }
html[data-frpro-theme="dark"] .frpro-newsletter-widget .frpro-nl-intro { color: var(--fr-ink-2); }
html[data-frpro-theme="dark"] .frpro-newsletter-widget .frpro-nl-input {
  background: var(--fr-white);
  border-color: var(--fr-border);
  color: var(--fr-ink);
}

/* Body copy */
html[data-frpro-theme="dark"] h1,
html[data-frpro-theme="dark"] h2,
html[data-frpro-theme="dark"] h3,
html[data-frpro-theme="dark"] h4,
html[data-frpro-theme="dark"] h5,
html[data-frpro-theme="dark"] h6 { color: var(--fr-ink); }

/* Author banner */
html[data-frpro-theme="dark"] .fr-author-banner { background: var(--fr-white); }
html[data-frpro-theme="dark"] .fr-author-name { color: var(--fr-ink); }
html[data-frpro-theme="dark"] .fr-author-bio { color: var(--fr-ink-2); }

/* No posts */
html[data-frpro-theme="dark"] .fr-no-posts { background: var(--fr-white); }

/* List layout */
html[data-frpro-theme="dark"] .frpro-list-item { background: var(--fr-white); }
html[data-frpro-theme="dark"] .frpro-list-title { color: var(--fr-ink); }
html[data-frpro-theme="dark"] .frpro-list-excerpt { color: var(--fr-ink-2); }

/* Magazine layout */
html[data-frpro-theme="dark"] .frpro-mag-hero-title { color: var(--fr-ink); }
html[data-frpro-theme="dark"] .frpro-mag-hero-excerpt { color: var(--fr-ink-2); }

/* Smooth transition for theme switch */
html, body, .fr-card, .fr-single, .fr-sidebar .widget,
.frpro-list-item, .frpro-recipe-card,
.fr-tag, .fr-pagination a {
  transition: background-color .25s, color .25s, border-color .25s;
}

/* ── Dark mode toggle button ──────────────────────────── */
.frpro-dm-toggle {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--fr-ink);
  color: #fff;
  border: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(0,0,0,.18);
  z-index: 999;
  transition: transform .25s ease, background .25s ease;
  -webkit-tap-highlight-color: transparent;
}
.frpro-dm-toggle:hover {
  transform: scale(1.06) rotate(-12deg);
  background: var(--fr-accent);
}
.frpro-dm-toggle:focus-visible {
  outline: 2px solid var(--fr-accent);
  outline-offset: 3px;
}
.frpro-dm-toggle .frpro-dm-icon-light { display: none; }
.frpro-dm-toggle .frpro-dm-icon-dark  { display: block; }
html[data-frpro-theme="dark"] .frpro-dm-toggle .frpro-dm-icon-light { display: block; }
html[data-frpro-theme="dark"] .frpro-dm-toggle .frpro-dm-icon-dark  { display: none; }
html[data-frpro-theme="dark"] .frpro-dm-toggle {
  background: var(--fr-warm);
  color: #ffd54a;
  box-shadow: 0 4px 20px rgba(0,0,0,.5);
}
html[data-frpro-theme="dark"] .frpro-dm-toggle:hover {
  background: var(--fr-accent);
  color: #fff;
}

@media (max-width: 480px) {
  .frpro-dm-toggle {
    bottom: 18px;
    right: 18px;
    width: 44px;
    height: 44px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .frpro-dm-toggle:hover { transform: none; }
}

@media print {
  .frpro-dm-toggle { display: none !important; }
}
