/* CSS Variables are now dynamically injected via base.html.twig based on template configuration */
:root {
  --text-dark: #333333;
}
body {
  background-color: var(--masala-white);
  color: var(--text-dark);
}

h1, h2, h3, h4, h5, h6 {
  color: var(--leaf-green);
}

a {
  color: var(--leaf-green);
}

/* Recipe Sync Plugin Color Overrides */
.rs-recipe {
  /* Let the plugin handle its own layout, just inject theme colors where applicable */
  --rs-primary: var(--leaf-green);
  --rs-bg-color: var(--masala-white);
}

.rs-recipe .rs-controls button {
  border-color: var(--leaf-green);
  color: var(--leaf-green);
}

.rs-recipe .rs-controls button:hover,
.rs-recipe .rs-controls button.rs-unit-btn--active {
  background-color: var(--leaf-green);
  color: var(--masala-white);
}

.rs-recipe .rs-nutr-pill {
  border-color: var(--leaf-green);
  color: var(--leaf-green);
}

/* Header Layout: Centered Logo & Menu */
header#header .navbar {
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 1.5rem;
  padding: 1.5rem 0;
  position: relative;
}

header#header .navbar-section.logo {
  flex: 0 0 auto;
}

header#header .navbar-section.desktop-menu {
  flex: 0 0 auto;
  width: 100%;
  display: flex;
  justify-content: center;
  position: relative;
}

header#header .navbar-section.actions {
  position: absolute;
  right: 1.5rem;
  top: 50%;
  transform: translateY(-50%);
}

/* Logo Sizing */
.navbar-brand img,
.navbar-brand svg {
  height: 120px;
  width: auto;
  display: block;
}

@media (max-width: 840px) {
  header#header .navbar {
    flex-direction: row;
    justify-content: space-between;
    padding: 1rem 0;
  }
  header#header .navbar-section.desktop-menu {
    display: none;
  }
  header#header .navbar-section.actions {
    position: static;
    transform: none;
  }
  header#header .navbar-brand img,
  header#header .navbar-brand svg {
    height: 50px;
  }
}

.overlay .mobile-logo .navbar-brand img,
.overlay .mobile-logo .navbar-brand svg {
  height: 120px;
  width: auto;
  display: block;
}

/* Mega Menu Styles */
.navigation li.has-mega-menu {
  position: static !important; /* Allow mega menu to span full width of navbar container */
}

.navigation li.has-mega-menu > a {
  position: relative;
}

.navigation li.has-mega-menu > a::before {
  content: '';
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  height: 25px;
  background: transparent;
  pointer-events: auto;
}

.mega-menu-container {
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  background-color: var(--masala-white);
  box-shadow: 0 10px 30px rgba(0,0,0,0.1);
  padding: 2rem;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  z-index: 1000;
  border-top: 2px solid var(--leaf-green);
  transition: opacity 0.15s ease, visibility 0.15s ease;
}

.navigation li.has-mega-menu:hover > .mega-menu-container,
.navigation li.has-mega-menu:focus-within > .mega-menu-container,
.mega-menu-container:hover {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
}

.mega-menu-grid {
  display: grid;
  grid-template-columns: repeat(var(--megamenu-cols, 4), 1fr);
  gap: 1.5rem;
  max-width: 1200px;
  margin: 0 auto;
}

.mega-menu-item {
  text-decoration: none !important;
  color: var(--text-dark) !important;
  text-align: center;
  display: block;
}

.mega-menu-thumb {
  aspect-ratio: 3/2;
  overflow: hidden;
  border-radius: 8px;
  margin-bottom: 0.75rem;
  background-color: #eee;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.mega-menu-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.mega-menu-item:hover .mega-menu-thumb img {
  transform: scale(1.05);
}

.mega-menu-item:hover .mega-menu-title {
  color: var(--leaf-green);
}

.mega-menu-title {
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1.3;
  transition: color 0.2s;
}

.mega-menu-placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #f5f5f5, #e0e0e0);
}

/* Shortcode Layout & Grid Classes */
.flex-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.flex-row.about-intro-section {
  align-items: center;
}

.flex-row.recipe-grid-3,
.recipe-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.flex-row.recipe-grid-2,
.recipe-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

.flex-row.recipe-grid-4,
.recipe-grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
}

@media (max-width: 960px) {
  .flex-row.recipe-grid-3,
  .recipe-grid-3,
  .flex-row.recipe-grid-4,
  .recipe-grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .flex-row.recipe-grid-3,
  .recipe-grid-3,
  .flex-row.recipe-grid-2,
  .recipe-grid-2,
  .flex-row.recipe-grid-4,
  .recipe-grid-4 {
    grid-template-columns: 1fr;
  }
}

.box {
  flex: 1;
  min-width: 280px;
}

/* Card styling for dynamic recipe & blog cards */
.recipe-card {
  background: var(--masala-white);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.recipe-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.card-image,
.recipe-card-img-link {
  display: block;
  aspect-ratio: 16/10;
  overflow: hidden;
}

.card-image img,
.recipe-card-img-link img,
.recipe-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.card:hover .card-image img,
.recipe-card:hover .recipe-card-img-link img,
.recipe-card:hover .recipe-card-img {
  transform: scale(1.04);
}

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

.card-title,
.recipe-card-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-top: 0;
  margin-bottom: 0.5rem;
  line-height: 1.35;
  text-align: center;
}

.card-title :is(h1, h2, h3, h4, h5, h6),
.recipe-card-title :is(h1, h2, h3, h4, h5, h6) {
  text-align: center;
  margin: 0;
}

.card-title a,
.recipe-card-title a {
  color: var(--q2-text-strong);
  text-decoration: none;
  transition: color 0.2s ease;
}

.card-title a:hover,
.recipe-card-title a:hover {
  color: var(--leaf-green);
}

.recipe-card-summary {
  font-size: 0.88rem;
  color: var(--q2-text-muted);
  margin-bottom: 1rem;
  flex: 1;
  line-height: 1.45;
}

.recipe-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: auto;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.recipe-card-time {
  font-size: 0.8rem;
  color: var(--q2-text-muted);
  font-weight: 600;
}

.recipe-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.card-tag {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  background-color: color-mix(in oklab, var(--leaf-green) 12%, transparent);
  color: var(--leaf-green);
}

.card-tag.category-tag {
  background-color: var(--leaf-green);
  color: var(--masala-white);
}

/* Recipe Plugin Layout Overrides */
.rs-recipe .rs-ingredients,
.rs-recipe .rs-ingredients-container,
.rs-ingredients {
  position: static !important;
  float: none !important;
}

.rs-recipe .rs-servings,
.rs-recipe .rs-recipe-servings,
.rs-recipe .rs-meta {
  padding: 1.5rem !important;
}

/* Tabbed Mega Menu */
.mega-menu-tabbed {
  max-width: 1200px;
  margin: 0 auto;
}
.mega-menu-tabs-wrapper {
  display: flex;
  gap: 2rem;
}
.mega-menu-sidebar {
  flex: 0 0 250px;
  border-right: 1px solid #eee;
  padding-right: 1rem;
}
.mega-menu-tab {
  padding: 0.5rem 1rem;
  margin-bottom: 0.5rem;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
}
.mega-menu-tab a {
  text-decoration: none;
  color: var(--text-dark);
  display: block;
  font-weight: 600;
}
.mega-menu-tab:hover,
.mega-menu-tab.active {
  background-color: var(--leaf-green);
}
.mega-menu-tab:hover a,
.mega-menu-tab.active a {
  color: var(--masala-white);
}

.mega-menu-content {
  flex: 1;
}
.mega-menu-pane {
  display: none;
}
.mega-menu-pane.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Mega Menu Tags Overlay */
.mega-menu-thumb {
  position: relative;
}
.mega-menu-tag {
  position: absolute;
  top: 10px;
  left: 10px;
  background-color: var(--leaf-green);
  color: var(--masala-white);
  padding: 0.3rem 0.6rem;
  font-size: 0.7rem;
  font-weight: bold;
  border-radius: 2px;
  z-index: 10;
  text-transform: uppercase;
  transition: all 0.3s ease;
}
.mega-menu-item:hover .mega-menu-tag {
  background-color: var(--masala-white);
  color: var(--leaf-green);
}

/* Recipes Page Sub-Sections */
.recipe-subsection-title {
  text-align: center;
  font-size: 1.8rem;
  color: var(--leaf-green);
  margin-top: 3rem;
  margin-bottom: 1.5rem;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.btn-primary {
  background-color: var(--leaf-green);
  color: var(--masala-white) !important;
  border: 2px solid var(--leaf-green);
  padding: 0.6rem 1.5rem;
  text-transform: uppercase;
  font-weight: bold;
  font-size: 0.9rem;
  border-radius: 4px;
  transition: all 0.3s;
  text-decoration: none;
  display: inline-block;
}
.btn-primary:hover {
  background-color: var(--masala-white);
  color: var(--leaf-green) !important;
}

/* Hide recipe jump button in blog list summaries */
.card-body .rs-jump-btn {
  display: none !important;
}

/* Overlap Hero Layout for Recipes */
.overlap-hero {
  position: relative;
  margin-top: -150px;
  background: var(--masala-white);
  padding: 3rem;
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.08);
  z-index: 10;
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
}
@media (max-width: 768px) {
  .overlap-hero {
    margin-top: -40px;
    padding: 1.5rem;
  }
}

/* Style Jump to Recipe Button */
a.rs-jump-btn,
.rs-recipe a.rs-jump-btn {
  background-color: var(--leaf-green, #1E3F20) !important;
  color: var(--masala-white, #FCF8F2) !important;
  border: 2px solid var(--leaf-green, #1E3F20) !important;
  padding: 0.8rem 2rem !important;
  text-transform: uppercase !important;
  font-weight: bold !important;
  font-size: 0.95rem !important;
  border-radius: 4px !important;
  transition: all 0.3s !important;
  text-decoration: none !important;
  display: flex !important;
  width: max-content !important;
  align-items: center;
  justify-content: center;
  margin: 1.5rem auto 2.5rem auto !important;
}
a.rs-jump-btn:hover,
.rs-recipe a.rs-jump-btn:hover {
  background-color: var(--masala-white, #FCF8F2) !important;
  color: var(--leaf-green, #1E3F20) !important;
}

/* Smooth Scrolling */
html {
  scroll-behavior: smooth;
}

/* Fix specificity conflicts between dropmenu navigation and mega menu elements */
.dropmenu .mega-menu-container a {
  display: block !important;
  background: transparent !important;
  color: inherit !important;
  padding: 0 !important;
  margin: 0 !important;
  border-radius: 0 !important;
  white-space: normal !important;
  transition: none !important;
}

.dropmenu .mega-menu-container a:hover {
  background: transparent !important;
  color: var(--masala-white, #FCF8F2) !important;
}

/* Tab link styles inside mega menu */
.mega-menu-tab a {
  display: block !important;
  font-weight: 600;
  text-decoration: none;
  width: 100%;
  height: 100%;
}

.mega-menu-tab:hover a,
.mega-menu-tab.active a {
  color: var(--masala-white) !important;
}

/* Grid item card styles inside mega menu */
.mega-menu-item {
  display: block !important;
  text-align: center;
  text-decoration: none !important;
}

.mega-menu-item:hover .mega-menu-title {
  color: var(--leaf-green) !important;
}

.mega-menu-thumb {
  display: block !important;
  width: 100%;
  position: relative;
}

.mega-menu-thumb img {
  display: block !important;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Style navigation chevron icons */
.navigation a i.fa-chevron-down {
  margin-left: 0.35rem;
  font-size: 0.75rem;
  vertical-align: middle;
  transition: transform 0.25s ease;
  display: inline-block !important;
}

.navigation li.has-children:hover > a i.fa-chevron-down {
  transform: rotate(180deg);
}

/* Suppress CSS pseudo-caret in theme.css since Font Awesome chevron icon is rendered */
.dropmenu li.has-children > a::after {
  content: none !important;
}

/* Navigation Hover & Active Highlights using Primary Color */
.dropmenu a:hover,
.navigation a:hover,
.dropmenu li:hover > a,
.navigation li:hover > a {
  color: var(--leaf-green) !important;
}

.dropmenu a.active,
.navigation a.active {
  color: var(--leaf-green) !important;
  background: transparent !important;
  font-weight: 600;
}

.overlay .overlay-menu a:hover,
.overlay .overlay-menu a.active {
  color: var(--leaf-green) !important;
}

/* Breadcrumbs Bar Styles */
.breadcrumbs-nav {
  margin-bottom: 1.25rem;
  font-size: 0.88rem;
}
.breadcrumbs {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
}
.breadcrumbs .crumb-item {
  display: inline-flex;
  align-items: center;
  color: var(--q2-text-muted, #666);
}
.breadcrumbs .crumb-item a {
  color: var(--leaf-green, #1E3F20);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s ease;
}
.breadcrumbs .crumb-item a:hover {
  text-decoration: underline;
}
.breadcrumbs .crumb-item.active {
  color: var(--text-dark, #333);
  font-weight: 600;
}
.breadcrumbs .crumb-separator {
  margin-left: 0.4rem;
  color: #aaa;
  font-weight: 300;
}

/* SEM Social Share Component */
.social-share-container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin: 1.5rem auto;
  padding: 0.75rem 1.25rem;
  background-color: color-mix(in oklab, var(--leaf-green) 5%, transparent);
  border: 1px solid color-mix(in oklab, var(--leaf-green) 15%, transparent);
  border-radius: 30px;
  width: fit-content;
  max-width: 100%;
}
.social-share-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--leaf-green, #1E3F20);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.social-share-buttons {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.9rem;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none !important;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  background: var(--masala-white, #FCF8F2);
  line-height: 1;
}
.share-btn.share-pinterest {
  color: #BD081C;
  border-color: rgba(189, 8, 28, 0.25);
}
.share-btn.share-pinterest:hover {
  background-color: #BD081C;
  color: #ffffff;
}
.share-btn.share-facebook {
  color: #1877F2;
  border-color: rgba(24, 119, 242, 0.25);
}
.share-btn.share-facebook:hover {
  background-color: #1877F2;
  color: #ffffff;
}
.share-btn.share-copy {
  color: var(--leaf-green, #1E3F20);
  border-color: color-mix(in oklab, var(--leaf-green) 30%, transparent);
}
.share-btn.share-copy:hover,
.share-btn.share-copy.copied {
  background-color: var(--leaf-green, #1E3F20);
  color: var(--masala-white, #FCF8F2);
}

/* Mobile Navigation: Hide dropdown chevron icons in mobile menu overlay */
.overlay-menu .navigation a i.fa-chevron-down {
  display: none !important;
}

/* Hero Section Mobile Sizing */
@media (max-width: 768px) {
  #default-hero,
  #blog-hero,
  .hero {
    min-height: 240px;
    padding-block: 4rem 2rem;
  }
}

