/* ================================================================
   MommyRecipe Extras — Custom Styles
   Matches existing mommyrecipe.com design language:
   warm, clean, family-friendly, mobile-first
   ================================================================ */

/* ---------------------------------------------------------------
   CSS VARIABLES — Edit here to match your exact theme colours
   --------------------------------------------------------------- */
:root {
  --mre-primary:       #E07A5F;   /* warm coral  */
  --mre-primary-dark:  #C4644A;   /* hover state */
  --mre-accent:        #F2CC8F;   /* warm amber  */
  --mre-light:         #FFF8F2;   /* cream bg    */
  --mre-text:          #3D2B1F;   /* dark warm   */
  --mre-text-muted:    #7A6558;
  --mre-white:         #FFFFFF;
  --mre-shadow:        0 4px 18px rgba(0,0,0,0.10);
  --mre-shadow-hover:  0 8px 28px rgba(0,0,0,0.16);
  --mre-radius:        14px;
  --mre-radius-sm:     8px;
  --mre-transition:    all 0.25s cubic-bezier(0.4,0,0.2,1);
  --mre-font:          inherit;   /* inherits Kadence theme font */
}

/* ================================================================
   1. READING PROGRESS BAR
   ================================================================ */
#mre-progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: rgba(224,122,95,0.15);
  z-index: 9999;
  pointer-events: none;
}

#mre-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--mre-primary), var(--mre-accent));
  border-radius: 0 2px 2px 0;
  transition: width 0.1s linear;
}

/* ================================================================
   2. FLOATING SOCIAL ICONS
   ================================================================ */
#mre-social-float {
  position: fixed;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  z-index: 9990;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px 0;
}

.mre-social-btn {
  display: flex;
  align-items: center;
  gap: 0;
  width: 44px;
  height: 44px;
  border-radius: 0 var(--mre-radius-sm) var(--mre-radius-sm) 0;
  text-decoration: none;
  overflow: hidden;
  transition: var(--mre-transition);
  box-shadow: var(--mre-shadow);
  position: relative;
}

.mre-social-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  height: 44px;
  color: #fff;
  flex-shrink: 0;
}

.mre-social-label {
  display: flex;
  align-items: center;
  height: 44px;
  padding: 0 10px 0 4px;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  width: 0;
  overflow: hidden;
  transition: width 0.28s ease, opacity 0.2s ease;
  opacity: 0;
  font-family: var(--mre-font);
}

.mre-social-btn:hover {
  width: auto;
  box-shadow: var(--mre-shadow-hover);
}

.mre-social-btn:hover .mre-social-label {
  width: 80px;
  opacity: 1;
}

/* Platform colours */
.mre-pinterest  { background: #E60023; }
.mre-pinterest:hover  { background: #cc001f; }

.mre-instagram  { background: linear-gradient(135deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888); }
.mre-instagram:hover  { filter: brightness(1.1); }

.mre-tiktok     { background: #010101; }
.mre-tiktok:hover     { background: #2c2c2c; }

.mre-facebook   { background: #1877F2; }
.mre-facebook:hover   { background: #1060c9; }

/* Mobile: hide labels, shrink icons slightly */
@media (max-width: 768px) {
  #mre-social-float {
    top: auto;
    bottom: 90px;   /* above scroll-to-top */
    transform: none;
    gap: 4px;
  }

  .mre-social-btn {
    width: 38px;
    height: 38px;
    border-radius: 0 6px 6px 0;
  }

  .mre-social-icon {
    min-width: 38px;
    height: 38px;
  }

  .mre-social-icon svg {
    width: 17px;
    height: 17px;
  }

  .mre-social-btn:hover .mre-social-label {
    display: none;
  }
}

/* ================================================================
   3. SCROLL TO TOP BUTTON
   ================================================================ */
#mre-scroll-top {
  position: fixed;
  bottom: 28px;
  right: 24px;
  z-index: 9990;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--mre-primary);
  color: var(--mre-white);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--mre-shadow);
  opacity: 0;
  transform: translateY(20px);
  pointer-events: none;
  transition: var(--mre-transition);
}

#mre-scroll-top.mre-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

#mre-scroll-top:hover {
  background: var(--mre-primary-dark);
  box-shadow: var(--mre-shadow-hover);
  transform: translateY(-3px);
}

#mre-scroll-top:focus-visible {
  outline: 3px solid var(--mre-accent);
  outline-offset: 3px;
}

@media (max-width: 768px) {
  #mre-scroll-top {
    bottom: 20px;
    right: 16px;
    width: 42px;
    height: 42px;
  }
}

/* ================================================================
   4. JUMP TO RECIPE / PRINT BUTTONS
   ================================================================ */
.mre-jump-wrap {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 16px 0 24px;
}

.mre-jump-btn,
.mre-print-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 20px;
  border-radius: 50px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: var(--mre-transition);
  cursor: pointer;
  font-family: var(--mre-font);
  line-height: 1;
}

.mre-jump-btn {
  background: var(--mre-primary);
  color: var(--mre-white);
  border: 2px solid var(--mre-primary);
}

.mre-jump-btn:hover {
  background: var(--mre-primary-dark);
  border-color: var(--mre-primary-dark);
  color: var(--mre-white);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(224,122,95,0.35);
  text-decoration: none;
}

.mre-print-btn {
  background: transparent;
  color: var(--mre-primary);
  border: 2px solid var(--mre-primary);
}

.mre-print-btn:hover {
  background: var(--mre-light);
  transform: translateY(-2px);
  text-decoration: none;
  color: var(--mre-primary-dark);
}

/* ================================================================
   5. PINTEREST SAVE BUTTON ON IMAGES
   ================================================================ */
.mre-img-wrap {
  position: relative;
  display: inline-block;
  width: 100%;
}

.mre-pin-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  background: #E60023;
  color: #fff;
  border: none;
  border-radius: 50px;
  padding: 7px 12px 7px 9px;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  opacity: 0;
  transform: scale(0.85);
  transition: var(--mre-transition);
  text-decoration: none;
  font-family: var(--mre-font);
  pointer-events: none;
  z-index: 10;
}

.mre-img-wrap:hover .mre-pin-btn,
.mre-img-wrap:focus-within .mre-pin-btn {
  opacity: 1;
  transform: scale(1);
  pointer-events: auto;
}

.mre-pin-btn:hover {
  background: #cc001f;
  transform: scale(1.05);
}

/* ================================================================
   6. CATEGORY CARDS GRID
   ================================================================ */
.mre-cat-section {
  margin: 40px 0;
}

.mre-cat-title {
  font-size: clamp(1.4rem, 3vw, 2rem);
  text-align: center;
  color: var(--mre-text);
  margin-bottom: 28px;
  font-weight: 700;
}

.mre-cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 18px;
}

.mre-cat-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 22px 20px;
  background: var(--card-bg, var(--mre-light));
  border: 2px solid var(--card-border, transparent);
  border-radius: var(--mre-radius);
  text-decoration: none;
  transition: var(--mre-transition);
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  color: var(--mre-text);
}

.mre-cat-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--mre-shadow-hover);
  text-decoration: none;
  color: var(--mre-text);
}

.mre-cat-emoji {
  font-size: 2.2rem;
  margin-bottom: 10px;
  line-height: 1;
  display: block;
}

.mre-cat-label {
  font-size: 1rem;
  font-weight: 700;
  color: var(--mre-text);
  margin-bottom: 6px;
  display: block;
  line-height: 1.3;
}

.mre-cat-desc {
  font-size: 0.85rem;
  color: var(--mre-text-muted);
  margin: 0;
  line-height: 1.5;
}

@media (max-width: 600px) {
  .mre-cat-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .mre-cat-card {
    padding: 16px 14px;
  }

  .mre-cat-emoji {
    font-size: 1.8rem;
  }

  .mre-cat-label {
    font-size: 0.9rem;
  }

  .mre-cat-desc {
    display: none; /* hides on mobile for clean 2-col grid */
  }
}

/* ================================================================
   7. RELATED POSTS
   ================================================================ */
.mre-related-posts {
  margin: 48px 0 24px;
  padding: 32px 24px;
  background: var(--mre-light);
  border-radius: var(--mre-radius);
  border-left: 4px solid var(--mre-primary);
}

.mre-related-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--mre-text);
  margin: 0 0 20px;
}

.mre-related-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.mre-related-card {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: var(--mre-text);
  border-radius: var(--mre-radius-sm);
  overflow: hidden;
  background: var(--mre-white);
  box-shadow: 0 2px 8px rgba(0,0,0,0.07);
  transition: var(--mre-transition);
}

.mre-related-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--mre-shadow-hover);
  text-decoration: none;
  color: var(--mre-text);
}

.mre-related-img {
  width: 100%;
  aspect-ratio: 16/10;
  overflow: hidden;
}

.mre-related-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.mre-related-card:hover .mre-related-img img {
  transform: scale(1.05);
}

.mre-related-info {
  padding: 12px 14px 14px;
}

.mre-related-cat {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--mre-primary);
  display: block;
  margin-bottom: 5px;
}

.mre-related-info strong {
  font-size: 0.9rem;
  line-height: 1.4;
  display: block;
}

@media (max-width: 640px) {
  .mre-related-grid {
    grid-template-columns: 1fr;
  }

  .mre-related-card {
    flex-direction: row;
  }

  .mre-related-img {
    width: 100px;
    min-width: 100px;
    aspect-ratio: auto;
  }
}

/* ================================================================
   8. PRINT STYLES
   ================================================================ */
@media print {
  #mre-social-float,
  #mre-scroll-top,
  #mre-progress-bar,
  .mre-jump-wrap,
  .mre-related-posts,
  .mre-pin-btn {
    display: none !important;
  }
}
