/* assets/css/mrp-recipe-styles.css */
/* This file controls the new responsive design (v1.2) */

/* --- 1. Import Fonts --- */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;700&family=Outfit:wght@600;700;800&display=swap');

/* --- 2. Define Colors & Fonts --- */
:root {
  --mrp-accent: #FF6210;
  --mrp-heading: #1C0D0A;
  --mrp-body: #353535;
  --mrp-border-color: #e0e0e0;
  --mrp-bg-light: #f9f9f9;
  
  --mrp-font-heading: 'Outfit', sans-serif;
  --mrp-font-body: 'DM Sans', sans-serif;
}

/* --- 3. Main Recipe Wrapper --- */
.mrp-recipe {
  font-family: var(--mrp-font-body);
  color: var(--mrp-body);
  border: 1px solid var(--mrp-border-color);
  border-radius: 8px;
  overflow: hidden;
  margin: 20px 0;
  background: #fff;
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

/* --- 4. Header: Title & Actions --- */
.mrp-recipe__header {
  padding: 20px 25px;
  border-bottom: 1px solid var(--mrp-border-color);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
}
.mrp-recipe__title {
  margin: 0;
  font-family: var(--mrp-font-heading);
  font-size: 2rem;
  font-weight: 700;
  color: var(--mrp-heading);
}
.mrp-recipe__actions {
  display: flex;
  gap: 10px;
}

/* --- NEW BUTTON STYLES --- */
.mrp-recipe__action-btn {
  font-family: var(--mrp-font-body);
  background: var(--mrp-accent);
  border: 1px solid var(--mrp-accent);
  color: #000000;
  font-weight: 700;
  border-radius: 5px;
  padding: 8px 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.mrp-recipe__action-btn:hover {
  background: #e0560e; /* Darker accent */
  border-color: #e0560e;
  color: #000;
}
.mrp-save-status {
  font-style: italic;
  color: var(--mrp-body);
  margin-left: 5px;
}

/* --- 5. Recipe Body: 2-Col Layout --- */
.mrp-recipe__body {
  display: flex;
  flex-direction: row-reverse;
  flex-wrap: wrap;
}
.mrp-recipe__main-content {
  flex: 1; 
  min-width: 60%;
  padding: 25px;
}
.mrp-recipe__sidebar {
  flex-basis: 350px;
  padding: 25px;
  background: var(--mrp-bg-light);
  border-left: 1px solid var(--mrp-border-color);
}

/* --- 6. Media (Image/Video) --- */
.mrp-recipe__media {
  margin-bottom: 20px;
  position: relative;
  aspect-ratio: 16 / 9; 
  overflow: hidden;
  border-radius: 8px;
  background: #f0f0f0;
}
.mrp-recipe__media img,
.mrp-recipe__video-wrapper iframe,
.mrp-recipe__media-placeholder {
  width: 100%;
  height: 100%;
  object-fit: cover; 
  display: block;
}
.mrp-recipe__video-wrapper {
  height: 100%;
}
.mrp-recipe__media-placeholder {
  background-color: #eee;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #aaa;
  font-family: var(--mrp-font-body);
}
.mrp-recipe__media-placeholder:after {
  content: 'No Image';
  font-size: 1rem;
}

/* --- 7. Excerpt & Description --- */
.mrp-recipe__excerpt {
  font-size: 1.1rem;
  font-style: italic;
  color: var(--mrp-body);
  border-left: 3px solid var(--mrp-accent);
  padding-left: 15px;
  margin-bottom: 20px;
}
.mrp-recipe__description p {
  font-size: 1rem;
  line-height: 1.6;
  margin-bottom: 15px;
}
.mrp-recipe__description a {
  color: var(--mrp-accent);
}

/* --- 8. Ingredients & Instructions --- */
.mrp-recipe__ingredients h3,
.mrp-recipe__instructions h3 {
  font-family: var(--mrp-font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 15px;
  border-bottom: 2px solid var(--mrp-accent);
  padding-bottom: 5px;
  display: inline-block;
  color: var(--mrp-heading);
}
.mrp-recipe__ingredients ul,
.mrp-recipe__instructions ol {
  padding-left: 20px;
}
.mrp-recipe__ingredients li,
.mrp-recipe__instructions li {
  font-size: 1rem;
  line-height: 1.7;
  margin-bottom: 10px;
}
.mrp-recipe__instructions li {
  padding-left: 5px;
}

/* --- 9. Sidebar Meta Box --- */
.mrp-recipe__meta {
  background: #fff;
  border: 1px solid var(--mrp-border-color);
  border-radius: 8px;
  padding: 15px;
}
.mrp-recipe__meta-item {
  display: flex;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px dashed var(--mrp-border-color);
}
.mrp-recipe__meta-item:last-child {
  border-bottom: none;
}
.mrp-recipe__meta-label {
  font-weight: 600;
  color: var(--mrp-heading);
}
.mrp-recipe__meta-value {
  color: var(--mrp-body);
  font-weight: 500;
}

/* --- 10. Sidebar Nutrition Card --- */
.mrp-recipe__nutrition-card {
  background: #fff;
  border: 1px solid var(--mrp-border-color);
  border-radius: 8px;
  padding: 20px;
  margin-top: 20px;
}
.mrp-recipe__nutrition-card h3 {
  font-family: var(--mrp-font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  margin-top: 0;
  margin-bottom: 15px;
  text-align: center;
  color: var(--mrp-heading);
}
.mrp-recipe__nutrition-item {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px dashed var(--mrp-border-color);
}
.mrp-recipe__nutrition-item:last-child {
  border-bottom: none;
}

/* --- 11. Responsive Layout --- */
@media (max-width: 768px) {
  .mrp-recipe__body {
    flex-direction: column;
  }
  .mrp-recipe__sidebar {
    flex-basis: auto;
    width: 100%;
    border-left: none;
    border-top: 1px solid var(--mrp-border-color);
  }
  .mrp-recipe__main-content {
    min-width: 100%;
  }
  .mrp-recipe__header {
    flex-direction: column;
    align-items: flex-start;
  }
  .mrp-recipe__title {
    font-size: 1.8rem;
  }
}

/* --- 12. New Sections (Affiliate & Related) --- */
.mrp-affiliate-section,
.mrp-related-recipes-section {
  padding: 20px 0; /* Updated padding */
  margin: 20px 0;
  border-top: 1px solid var(--mrp-border-color);
  max-width: 1200px;
}
.mrp-affiliate-section h2,
.mrp-related-recipes-section h2 {
  font-family: var(--mrp-font-heading);
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--mrp-heading);
  margin-top: 0;
  margin-bottom: 20px;
}

/* --- 13. Archive Page Header & NEW Filter --- */
.mrp-archive-header {
  margin-bottom: 30px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--mrp-border-color);
}
.mrp-archive-header .page-title {
  font-family: var(--mrp-font-heading);
  font-size: 2.5rem;
  color: var(--mrp-heading);
}

.mrp-filter-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 30px;
}
.mrp-filter-link,
.mrp-filter-link--active {
  font-family: var(--mrp-font-body);
  font-weight: 600;
  text-decoration: none;
  padding: 8px 15px;
  border-radius: 20px;
  border: 1px solid var(--mrp-border-color);
  transition: all 0.2s ease;
}
.mrp-filter-link {
  background: #fff;
  color: var(--mrp-body);
}
.mrp-filter-link:hover {
  background: var(--mrp-bg-light);
  border-color: var(--mrp-accent);
  color: var(--mrp-heading);
}
.mrp-filter-link--active {
  background: var(--mrp-accent);
  color: #fff;
  border-color: var(--mrp-accent);
}

/* --- 14. NEW Archive Grid & Recipe Card --- */
.mrp-archive-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 25px;
}

.mrp-recipe-card {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  border: 1px solid var(--mrp-border-color);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  overflow: hidden;
  transition: all 0.2s ease-in-out;
}
.mrp-recipe-card:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  transform: translateY(-3px);
  border-color: var(--mrp-accent);
}

.mrp-recipe-card__image {
  aspect-ratio: 4 / 3;
  width: 100%;
  overflow: hidden;
  background: var(--mrp-bg-light);
  position: relative; /* For rating */
}
.mrp-recipe-card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.mrp-recipe-card__placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mrp-font-heading);
  font-size: 4rem;
  color: var(--mrp-border-color);
  background: #fafafa;
}

.mrp-recipe-card__rating {
  position: absolute;
  bottom: 10px;
  right: 10px;
  background: rgba(0,0,0,0.6);
  color: #fff;
  font-family: var(--mrp-font-body);
  font-weight: 600;
  font-size: 0.9rem;
  padding: 3px 8px;
  border-radius: 5px;
}

.mrp-recipe-card__content {
  padding: 20px;
  display: flex;
  flex-direction: column;
  flex-grow: 1; /* Makes cards in a row equal height */
}

.mrp-recipe-card__category {
  font-family: var(--mrp-font-body);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--mrp-accent);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.mrp-recipe-card__title {
  font-family: var(--mrp-font-heading);
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--mrp-heading);
  margin: 5px 0 10px;
}

.mrp-recipe-card__excerpt {
  font-family: var(--mrp-font-body);
  font-size: 0.9rem;
  color: var(--mrp-body);
  line-height: 1.5;
  margin: 0 0 15px;
  flex-grow: 1; /* Pushes meta to the bottom */
}

.mrp-recipe-card__meta {
  font-family: var(--mrp-font-body);
  font-size: 0.9rem;
  color: var(--mrp-body);
  border-top: 1px solid var(--mrp-border-color);
  padding-top: 10px;
}

/* --- 15. NEW Filter Form Styles (v2.0) --- */
.mrp-filter-form {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  align-items: center;
  margin-bottom: 30px;
  padding: 20px;
  background: var(--mrp-bg-light);
  border-radius: 8px;
}

.mrp-filter-form__group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-grow: 1;
}

.mrp-filter-form__label {
  font-family: var(--mrp-font-body);
  font-weight: 600;
  font-size: 1rem;
  color: var(--mrp-heading);
}

.mrp-filter-form__select-wrapper {
  position: relative;
  flex-grow: 1;
}

.mrp-filter-form__select {
  /* Remove default styling */
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  
  /* Our styles */
  width: 100%;
  padding: 12px 40px 12px 15px;
  font-family: var(--mrp-font-body);
  font-size: 1rem;
  color: var(--mrp-body);
  background-color: #fff;
  border: 1px solid var(--mrp-border-color);
  border-radius: 5px;
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.mrp-filter-form__select:hover {
  border-color: var(--mrp-accent);
}
.mrp-filter-form__select:focus {
  outline: none;
  border-color: var(--mrp-accent);
  box-shadow: 0 0 0 2px rgba(255, 98, 16, 0.3);
}

/* Custom Dropdown Arrow */
.mrp-filter-form__select-wrapper::after {
  content: '';
  position: absolute;
  top: 50%;
  right: 15px;
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 5px solid var(--mrp-body);
  transform: translateY(-50%);
  pointer-events: none;
}

.mrp-filter-form__actions {
  flex-basis: 100%; /* Make reset link take its own line */
  text-align: right;
  margin-top: -10px; /* Pull it closer */
}

.mrp-filter-form__reset {
  font-family: var(--mrp-font-body);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--mrp-accent);
  text-decoration: none;
  border-radius: 5px;
  padding: 5px 0;
  transition: all 0.2s ease;
}
.mrp-filter-form__reset:hover {
  text-decoration: underline;
}

/* Responsive adjustment for filter form */
@media (max-width: 768px) {
  .mrp-filter-form {
    flex-direction: column;
    align-items: stretch;
  }
  .mrp-filter-form__group {
    flex-direction: column;
    align-items: stretch;
  }
  .mrp-filter-form__label {
    text-align: left;
    margin-bottom: 5px;
  }
  .mrp-filter-form__actions {
    text-align: center;
    margin-top: 10px;
  }
}


/* --- 19. NEW: Sidebar Affiliate Widget Styles --- */

.mrp-recipe__affiliate-widget {
  background: #fff;
  border: 1px solid var(--mrp-border-color);
  border-radius: 8px;
  padding: 20px;
  margin-top: 20px;
  text-align: center;
}
.mrp-recipe__affiliate-title {
  font-family: var(--mrp-font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  margin-top: 0;
  margin-bottom: 15px;
  color: var(--mrp-heading);
}
.mrp-recipe__affiliate-widget a {
  display: block;
  text-decoration: none;
}
.mrp-recipe__affiliate-widget img {
  max-width: 100%;
  height: auto;
  margin-bottom: 15px;
  border-radius: 5px;
}
.mrp-recipe__affiliate-btn {
  font-family: var(--mrp-font-body);
  background: var(--mrp-accent);
  border: 1px solid var(--mrp-accent);
  color: #000;
  font-weight: 700;
  border-radius: 5px;
  padding: 10px 15px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-block; /* Not block */
}
.mrp-recipe__affiliate-btn:hover {
  background: #e0560e;
  border-color: #e0560e;
}

/* Styles for the MOVED affiliate section */
.mrp-sidebar-affiliate-section {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px dashed var(--mrp-border-color);
}
.mrp-sidebar-affiliate-section h2 {
  font-family: var(--mrp-font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--mrp-heading);
  margin-top: 0;
  margin-bottom: 20px;
  text-align: center;
}
/* Ensure any images/widgets in this section are constrained */
.mrp-sidebar-affiliate-section img,
.mrp-sidebar-affiliate-section iframe {
  max-width: 100%;
  height: auto;
  margin: 0 auto;
  display: block;
}
/* --- 20. NEW: Single Recipe Flow Styles --- */

.mrp-recipe__header-single {
  /* This is the H1 wrapper */
  /* We can re-use archive styles for consistency */
  text-align: center;
  margin-bottom: 20px;
}

.mrp-recipe__intro {
  font-family: var(--mrp-font-body);
  font-size: 1.15rem;
  line-height: 1.7;
  color: var(--mrp-body);
  max-width: 800px; /* Make intro text readable */
  text-align: justify;
}

.mrp-recipe__taxonomies {
  display: flex;
  flex-wrap: wrap;
  justify-content: right;
  gap: 10px;
  margin-bottom: 25px;
}

.mrp-recipe__tax-link {
  font-family: var(--mrp-font-body);
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--mrp-body);
  padding: 5px;
  text-decoration: none;
  transition: all 0.2s ease;
}
.mrp-recipe__tax-link:hover {
  color: var(--mrp-body);
  border-color: var(--mrp-accent);
}

/* Remove the top header from the main recipe card */
/*.mrp-recipe .mrp-recipe__header {*/
/*  display: none;*/
/*}*/

/* Add a bar for the action buttons */
.mrp-recipe__actions-bar {
  padding: 20px 25px;
  border-bottom: 1px solid var(--mrp-border-color);
  background: #fff;
}
.mrp-recipe__actions {
  justify-content: center; /* Center the buttons */
}


/* --- 21. NEW: E-E-A-T Section Styles --- */

/* Base container for Tips, Notes, FAQs, Author */
.mrp-extra-section {
  padding: 25px;
  margin-top: 30px;
  background: var(--mrp-bg-light);
  border: 1px solid var(--mrp-border-color);
  border-radius: 8px;
}

.mrp-extra-section h2 {
  font-family: var(--mrp-font-heading);
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--mrp-heading);
  margin-top: 0;
  margin-bottom: 20px;
}

.mrp-extra-section p,
.mrp-extra-section li {
  font-family: var(--mrp-font-body);
  font-size: 1rem;
  line-height: 1.7;
  color: var(--mrp-body);
}

/* FAQ Styles */
.mrp-faq-item {
  border-bottom: 1px dashed var(--mrp-border-color);
  padding: 15px 0;
}
.mrp-faq-item:first-of-type {
  padding-top: 0;
}
.mrp-faq-item:last-of-type {
  border-bottom: none;
  padding-bottom: 0;
}
.mrp-faq-question {
  font-family: var(--mrp-font-heading);
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--mrp-heading);
  margin: 0 0 10px 0;
}

/* Author Bio Styles */
.mrp-author-bio {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  padding: 10px !important;
  background: antiquewhite;
}
.mrp-author-bio__content{text-align: center}
.mrp-author-bio__avatar img {
  border-radius: 50%;
  border: 2px solid var(--mrp-border-color);
}
.mrp-author-bio__name {
  font-family: var(--mrp-font-heading);
  font-size: 1.3rem;
  margin: 0 0 5px 0;
}
.mrp-author-bio__description {
  font-size: 0.95rem !important;
  margin: 0;
  color: var(--mrp-text-light, #555);
  line-height: 1.4 !important;
  text-align: left !important;
}
/* --- 22. NEW: Single Page Layout Fix & Tags --- */

/* Style for the moved main content/story */
.mrp-recipe__main-story {
  font-family: var(--mrp-font-body);
  font-size: 1.1rem;
  line-height: 1.8;
  color: var(--mrp-body);
  margin-top: 30px;
}
/* Ensure Elementor content flows nicely */
.mrp-recipe__main-story p {
  margin-bottom: 1.5em;
}

/* Style for the new Tags section */
.mrp-recipe__tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-bottom: 25px;
  padding-top: 10px; /* Space from cat/cuisine */
}
.mrp-recipe__tags-label {
  font-family: var(--mrp-font-body);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--mrp-heading);
}
.mrp-recipe__tag-link {
  font-family: var(--mrp-font-body);
  font-size: 0.85rem;
  color: var(--mrp-body);
  background: #f0f0f0;
  border-radius: 4px;
  padding: 4px 10px;
  text-decoration: none;
  transition: all 0.2s ease;
}
.mrp-recipe__tag-link:hover {
  background: var(--mrp-accent);
  color: #fff;
}