/* ============================================
   NESTLY FUTURISTIC — Main Stylesheet
   ============================================ */

/* --- CSS Custom Properties (Dark default) --- */
:root,
[data-theme="dark"] {
  --nf-bg: #0B0F17;
  --nf-surface: #141A24;
  --nf-glass-bg: rgba(20,26,36,0.6);
  --nf-glass-border: 1px solid rgba(255,255,255,0.08);
  --nf-glass-blur: blur(14px);
  --nf-text: #E8ECF2;
  --nf-text-muted: #9AA6B2;
  --nf-accent-lime: #B6FF3C;
  --nf-accent-teal: #12D8B4;
  --nf-accent-warm: #FF8A3D;
  --nf-gradient: linear-gradient(135deg, #B6FF3C 0%, #12D8B4 100%);
  --nf-radius: 18px;
  --nf-radius-pill: 999px;
  --nf-shadow-card: 0 4px 24px rgba(0,0,0,0.3), 0 0 0 1px rgba(255,255,255,0.05);
  --nf-shadow-glow: 0 0 30px rgba(182,255,60,0.15), 0 0 60px rgba(18,216,180,0.08);
}

[data-theme="light"] {
  --nf-bg: #F7F9FC;
  --nf-surface: #FFFFFF;
  --nf-glass-bg: rgba(255,255,255,0.7);
  --nf-glass-border: 1px solid rgba(0,0,0,0.06);
  --nf-text: #1A1D23;
  --nf-text-muted: #6B7280;
  --nf-shadow-card: 0 4px 24px rgba(0,0,0,0.06), 0 0 0 1px rgba(0,0,0,0.04);
  --nf-shadow-glow: 0 0 30px rgba(182,255,60,0.08);
}

/* --- Global Resets & Base --- */
body.nestly-futuristic {
  background: var(--nf-bg) !important;
  color: var(--nf-text) !important;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  -webkit-font-smoothing: antialiased;
  transition: background 0.3s ease, color 0.3s ease;
}

/* --- Header: Sticky Glass --- */
.nestly-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--nf-glass-bg);
  backdrop-filter: var(--nf-glass-blur);
  -webkit-backdrop-filter: var(--nf-glass-blur);
  border-bottom: var(--nf-glass-border);
  padding: 0.75rem 1.5rem;
  transition: background 0.3s ease;
}

.nestly-header-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.nestly-logo {
  font-family: 'Sora', sans-serif;
  font-weight: 800;
  font-size: 1.5rem;
  background: var(--nf-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-decoration: none;
}

.nestly-nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.nestly-nav a {
  color: var(--nf-text-muted);
  text-decoration: none;
  padding: 0.5rem 1rem;
  border-radius: var(--nf-radius-pill);
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.2s ease;
}

.nestly-nav a:hover,
.nestly-nav a:focus-visible {
  color: var(--nf-text);
  background: var(--nf-glass-bg);
}

/* Mega-nav dropdown */
.nestly-dropdown {
  position: relative;
}

.nestly-dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 220px;
  background: var(--nf-surface);
  border: var(--nf-glass-border);
  border-radius: var(--nf-radius);
  box-shadow: var(--nf-shadow-card);
  padding: 0.5rem;
  z-index: 200;
}

.nestly-dropdown:hover .nestly-dropdown-menu,
.nestly-dropdown:focus-within .nestly-dropdown-menu {
  display: block;
}

.nestly-dropdown-menu a {
  display: block;
  padding: 0.6rem 1rem;
  border-radius: 12px;
  color: var(--nf-text);
  font-size: 0.85rem;
}

.nestly-dropdown-menu a:hover {
  background: var(--nf-glass-bg);
  color: var(--nf-accent-teal);
}

/* Theme toggle button */
.nestly-theme-toggle {
  background: var(--nf-glass-bg);
  border: var(--nf-glass-border);
  border-radius: var(--nf-radius-pill);
  padding: 0.5rem;
  cursor: pointer;
  color: var(--nf-text);
  font-size: 1.2rem;
  line-height: 1;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
}

.nestly-theme-toggle:hover {
  box-shadow: var(--nf-shadow-glow);
}

/* Search bar in header */
.nestly-search {
  position: relative;
}

.nestly-search input {
  background: var(--nf-glass-bg);
  border: var(--nf-glass-border);
  border-radius: var(--nf-radius-pill);
  padding: 0.5rem 1rem 0.5rem 2.5rem;
  color: var(--nf-text);
  font-size: 0.9rem;
  width: 200px;
  transition: width 0.3s ease, box-shadow 0.2s ease;
  outline: none;
}

.nestly-search input:focus {
  width: 280px;
  box-shadow: var(--nf-shadow-glow);
}

.nestly-search svg {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--nf-text-muted);
}

/* --- Hero Section --- */
.nestly-hero {
  position: relative;
  border-radius: var(--nf-radius);
  overflow: hidden;
  margin: 2rem auto;
  max-width: 1200px;
  min-height: 420px;
  display: flex;
  align-items: flex-end;
}

.nestly-hero img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.nestly-hero-overlay {
  position: relative;
  z-index: 2;
  padding: 3rem 2rem;
  background: linear-gradient(180deg, rgba(11,15,23,0) 0%, rgba(11,15,23,0.85) 60%, #0B0F17 100%);
  width: 100%;
}

.nestly-hero-title {
  font-family: 'Sora', sans-serif;
  font-size: clamp(1.75rem, 3vw, 2.75rem);
  font-weight: 800;
  color: #fff;
  margin-bottom: 1rem;
  line-height: 1.15;
}

.nestly-hero .nestly-btn {
  margin-top: 0.5rem;
}

/* --- Cards Grid --- */
.nestly-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
  max-width: 1200px;
  margin: 2rem auto;
  padding: 0 1rem;
}

.nestly-card {
  background: var(--nf-surface);
  border: var(--nf-glass-border);
  border-radius: var(--nf-radius);
  overflow: hidden;
  box-shadow: var(--nf-shadow-card);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
}

.nestly-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--nf-shadow-card), var(--nf-shadow-glow);
}

.nestly-card-image {
  aspect-ratio: 16/10;
  overflow: hidden;
  position: relative;
}

.nestly-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.nestly-card:hover .nestly-card-image img {
  transform: scale(1.05);
}

.nestly-card-body {
  padding: 1.25rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.nestly-card-title {
  font-family: 'Sora', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--nf-text);
  line-height: 1.3;
}

.nestly-card-meta {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: auto;
}

/* Time chips */
.nestly-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: var(--nf-glass-bg);
  border: var(--nf-glass-border);
  padding: 0.3rem 0.7rem;
  border-radius: var(--nf-radius-pill);
  font-size: 0.75rem;
  color: var(--nf-text-muted);
  font-weight: 500;
}

.nestly-chip svg {
  width: 14px;
  height: 14px;
}

/* Category tag */
.nestly-tag {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  background: var(--nf-gradient);
  color: #111;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.25rem 0.75rem;
  border-radius: var(--nf-radius-pill);
}

/* --- Buttons --- */
.nestly-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.75rem;
  border-radius: var(--nf-radius-pill);
  font-weight: 700;
  font-size: 1rem;
  text-decoration: none;
  transition: all 0.2s ease;
  cursor: pointer;
  border: none;
}

.nestly-btn-primary {
  background: var(--nf-gradient);
  color: #111;
}

.nestly-btn-primary:hover {
  box-shadow: var(--nf-shadow-glow);
  transform: translateY(-1px);
}

.nestly-btn-warm {
  background: linear-gradient(135deg, #FF8A3D, #FF6B1A);
  color: #111;
}

.nestly-btn-warm:hover {
  box-shadow: 0 0 24px rgba(255,138,61,0.3);
}

/* Amazon CTA button */
.nestly-amazon-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: linear-gradient(135deg, #FF8A3D, #FF6B1A);
  color: #111;
  font-weight: 700;
  padding: 0.85rem 2rem;
  border-radius: var(--nf-radius-pill);
  text-decoration: none;
  font-size: 1rem;
  transition: all 0.2s ease;
  border: none;
  cursor: pointer;
}

.nestly-amazon-btn:hover {
  box-shadow: 0 0 24px rgba(255,138,61,0.35);
  transform: translateY(-2px);
}

/* --- Single Recipe --- */
.nestly-recipe-card {
  background: var(--nf-surface);
  border: var(--nf-glass-border);
  border-radius: var(--nf-radius);
  padding: 2rem;
  margin: 2rem 0;
  box-shadow: var(--nf-shadow-card);
}

.nestly-recipe-card h2 {
  font-family: 'Sora', sans-serif;
  background: var(--nf-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 1.5rem;
}

.nestly-recipe-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.nestly-recipe-meta-item {
  text-align: center;
}

.nestly-recipe-meta-item .label {
  font-size: 0.75rem;
  color: var(--nf-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.nestly-recipe-meta-item .value {
  font-family: 'Sora', sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--nf-accent-teal);
}

/* Ingredient checklist */
.nestly-ingredients label {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0;
  cursor: pointer;
  color: var(--nf-text);
  transition: color 0.2s ease;
}

.nestly-ingredients label:has(input:checked) {
  color: var(--nf-text-muted);
  text-decoration: line-through;
}

.nestly-ingredients input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border: 2px solid var(--nf-text-muted);
  border-radius: 6px;
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.nestly-ingredients input[type="checkbox"]:checked {
  background: var(--nf-gradient);
  border-color: transparent;
}

.nestly-ingredients input[type="checkbox"]:checked::after {
  content: '✓';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: #111;
}

/* Numbered steps */
.nestly-steps ol {
  counter-reset: step;
  list-style: none;
  padding: 0;
}

.nestly-steps li {
  counter-increment: step;
  display: flex;
  gap: 1rem;
  padding: 1rem 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  align-items: flex-start;
}

.nestly-steps li::before {
  content: counter(step);
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  background: var(--nf-gradient);
  color: #111;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  font-family: 'Sora', sans-serif;
}

/* Cook Mode toggle */
.nestly-cook-mode {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.5rem;
  background: var(--nf-glass-bg);
  border: var(--nf-glass-border);
  border-radius: var(--nf-radius-pill);
  margin: 1.5rem 0;
  cursor: pointer;
}

.nestly-cook-mode-toggle {
  width: 48px;
  height: 26px;
  background: var(--nf-text-muted);
  border-radius: 13px;
  position: relative;
  transition: background 0.2s ease;
  flex-shrink: 0;
}

.nestly-cook-mode-toggle.active {
  background: var(--nf-accent-teal);
}

.nestly-cook-mode-toggle::after {
  content: '';
  position: absolute;
  width: 22px;
  height: 22px;
  background: #fff;
  border-radius: 50%;
  top: 2px;
  left: 2px;
  transition: transform 0.2s ease;
}

.nestly-cook-mode-toggle.active::after {
  transform: translateX(22px);
}

/* Allergen chips */
.nestly-allergens {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin: 1rem 0;
}

.nestly-allergen {
  background: rgba(255,138,61,0.12);
  color: var(--nf-accent-warm);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.3rem 0.75rem;
  border-radius: var(--nf-radius-pill);
  border: 1px solid rgba(255,138,61,0.2);
}

/* --- Single Guide --- */
.nestly-comparison-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  border-radius: var(--nf-radius);
  overflow: hidden;
  margin: 2rem 0;
  border: var(--nf-glass-border);
}

.nestly-comparison-table th {
  background: var(--nf-surface);
  color: var(--nf-text);
  font-family: 'Sora', sans-serif;
  font-weight: 600;
  padding: 1rem;
  text-align: left;
  border-bottom: 2px solid rgba(255,255,255,0.06);
}

.nestly-comparison-table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  color: var(--nf-text);
}

.nestly-comparison-table tr:last-child td {
  border-bottom: none;
}

/* Pros/Cons cards */
.nestly-proscons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin: 1.5rem 0;
}

.nestly-pros, .nestly-cons {
  padding: 1.25rem;
  border-radius: var(--nf-radius);
}

.nestly-pros {
  background: rgba(182,255,60,0.06);
  border: 1px solid rgba(182,255,60,0.15);
}

.nestly-cons {
  background: rgba(255,138,61,0.06);
  border: 1px solid rgba(255,138,61,0.15);
}

.nestly-pros h4 { color: var(--nf-accent-lime); }
.nestly-cons h4 { color: var(--nf-accent-warm); }

/* Quick Verdict box */
.nestly-verdict {
  background: var(--nf-surface);
  border: 2px solid var(--nf-accent-teal);
  border-radius: var(--nf-radius);
  padding: 1.5rem 2rem;
  margin: 2rem 0;
  position: relative;
}

.nestly-verdict::before {
  content: '⚡ Quick Verdict';
  position: absolute;
  top: -0.75rem;
  left: 1.5rem;
  background: var(--nf-accent-teal);
  color: #111;
  font-weight: 700;
  font-size: 0.75rem;
  padding: 0.2rem 0.75rem;
  border-radius: var(--nf-radius-pill);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Product card (affiliate) */
.nestly-product-card {
  display: flex;
  gap: 1.5rem;
  align-items: center;
  background: var(--nf-surface);
  border: var(--nf-glass-border);
  border-radius: var(--nf-radius);
  padding: 1.5rem;
  margin: 1.5rem 0;
  box-shadow: var(--nf-shadow-card);
}

.nestly-product-card img {
  width: 120px;
  height: 120px;
  object-fit: contain;
  border-radius: 12px;
  flex-shrink: 0;
}

.nestly-product-card .nestly-product-info {
  flex: 1;
}

.nestly-product-card .nestly-product-info h4 {
  margin: 0 0 0.5rem;
  color: var(--nf-text);
}

/* --- Sticky TOC --- */
.nestly-toc {
  position: sticky;
  top: 80px;
  background: var(--nf-surface);
  border: var(--nf-glass-border);
  border-radius: var(--nf-radius);
  padding: 1.25rem;
  margin-bottom: 2rem;
}

.nestly-toc-title {
  font-family: 'Sora', sans-serif;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--nf-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.75rem;
}

.nestly-toc a {
  display: block;
  padding: 0.4rem 0.75rem;
  color: var(--nf-text-muted);
  text-decoration: none;
  font-size: 0.85rem;
  border-radius: 8px;
  transition: all 0.2s ease;
  border-left: 2px solid transparent;
}

.nestly-toc a:hover,
.nestly-toc a.active {
  color: var(--nf-accent-teal);
  background: var(--nf-glass-bg);
  border-left-color: var(--nf-accent-teal);
}

/* --- Footer --- */
.nestly-footer {
  background: var(--nf-surface);
  border-top: var(--nf-glass-border);
  padding: 3rem 1.5rem 1.5rem;
  margin-top: 4rem;
}

.nestly-footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem;
}

.nestly-footer h4 {
  font-family: 'Sora', sans-serif;
  color: var(--nf-text);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.nestly-footer a {
  display: block;
  color: var(--nf-text-muted);
  text-decoration: none;
  padding: 0.3rem 0;
  font-size: 0.85rem;
  transition: color 0.2s ease;
}

.nestly-footer a:hover {
  color: var(--nf-accent-teal);
}

.nestly-footer-bottom {
  max-width: 1200px;
  margin: 2rem auto 0;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255,255,255,0.06);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.8rem;
  color: var(--nf-text-muted);
}

/* --- Disclosure banners --- */
.nestly-disclosure {
  font-size: 0.75rem;
  color: var(--nf-text-muted);
  padding: 1rem 1.5rem;
  margin: 2rem 0;
  border: var(--nf-glass-border);
  border-radius: var(--nf-radius);
  background: var(--nf-glass-bg);
}

/* --- Skeleton Loading --- */
.nestly-skeleton {
  background: linear-gradient(90deg, var(--nf-surface) 25%, rgba(255,255,255,0.06) 50%, var(--nf-surface) 75%);
  background-size: 200% 100%;
  animation: nestly-shimmer 1.5s ease-in-out infinite;
  border-radius: var(--nf-radius);
}

@keyframes nestly-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* --- Accessibility --- */
*:focus-visible {
  outline: 2px solid var(--nf-accent-teal);
  outline-offset: 2px;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* --- Mobile Responsive --- */
@media (max-width: 768px) {
  .nestly-header-inner {
    flex-wrap: wrap;
  }
  
  .nestly-nav {
    display: none;
    width: 100%;
    flex-direction: column;
    padding-top: 0.75rem;
  }
  
  .nestly-nav.open {
    display: flex;
  }

  .nestly-grid {
    grid-template-columns: 1fr;
  }

  .nestly-proscons {
    grid-template-columns: 1fr;
  }

  .nestly-product-card {
    flex-direction: column;
    text-align: center;
  }

  .nestly-hero {
    min-height: 320px;
    margin: 1rem;
  }

  .nestly-search input {
    width: 140px;
  }

  .nestly-search input:focus {
    width: 200px;
  }
}

/* --- Mobile nav hamburger --- */
.nestly-hamburger {
  display: none;
  background: none;
  border: none;
  color: var(--nf-text);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.5rem;
}

@media (max-width: 768px) {
  .nestly-hamburger {
    display: block;
  }
}

/* --- WP Block Overrides --- */
body.nestly-futuristic .wp-block-post-content {
  color: var(--nf-text);
}

body.nestly-futuristic .wp-block-post-content a {
  color: var(--nf-accent-teal);
}

body.nestly-futuristic .wp-block-post-content a:hover {
  color: var(--nf-accent-lime);
}

body.nestly-futuristic .wp-block-post-content h2,
body.nestly-futuristic .wp-block-post-content h3 {
  font-family: 'Sora', sans-serif;
  color: var(--nf-text);
}

body.nestly-futuristic .wp-block-image img {
  border-radius: var(--nf-radius);
}

/* Lazy image fade-in */
body.nestly-futuristic img[loading="lazy"] {
  opacity: 0;
  transition: opacity 0.4s ease;
}

body.nestly-futuristic img[loading="lazy"].loaded,
body.nestly-futuristic img[loading="lazy"][complete] {
  opacity: 1;
}
