/* =====================================================
   Baby Amma's Kitchen — Recipe Template CSS
   Fonts: Cormorant Garamond + DM Sans | Brand: #c0392b
   ===================================================== */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,400;0,600;0,700;1,400&family=DM+Sans:wght@300;400;500;600&display=swap');

/* ── RESET & TOKENS ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --brand:       #c0392b;
  --brand-dark:  #96281b;
  --brand-light: #fdf1f0;
  --brand-mid:   #e8d0ce;
  --text:        #1a1a1a;
  --text2:       #3a3a3a;
  --text3:       #888;
  --border:      #e8e8e8;
  --border2:     #f0f0f0;
  --white:       #fff;
  --bg:          #f6f5f3;
  --bg2:         #efefed;
  --card:        #fff;
  --display:     'Cormorant Garamond', Georgia, serif;
  --sans:        'DM Sans', sans-serif;
  --radius:      8px;
  --radius-lg:   14px;
  --shadow:      0 1px 4px rgba(0,0,0,.06), 0 4px 20px rgba(0,0,0,.07);
  --shadow-sm:   0 1px 3px rgba(0,0,0,.07);
}

/* ── BASE ── */
html   { scroll-behavior: smooth; }
body   { font-family: var(--sans); background: var(--bg); color: var(--text); line-height: 1.65; font-size: 15.5px; -webkit-font-smoothing: antialiased; }
img    { max-width: 100%; height: auto; display: block; }
a      { color: inherit; text-decoration: none; }
button { font-family: var(--sans); cursor: pointer; }

/* ── SVG FIX ──
   Elementor sets svg { width:100% } globally.
   We override every SVG inside .page with explicit sizes. */
.page svg {
  display: inline-block !important;
  vertical-align: middle;
  flex-shrink: 0;
  overflow: visible;
  width: 16px !important;
  height: 16px !important;
  max-width: none !important;
  max-height: none !important;
}
/* Per-context overrides */
.stat svg        { width: 20px !important; height: 20px !important; }
.af-icon svg     { width: 15px !important; height: 15px !important; }
.sb-header svg   { width: 13px !important; height: 13px !important; }
.mi svg          { width: 12px !important; height: 12px !important; }
.back-link svg   { width: 14px !important; height: 14px !important; }
.cat-name svg    { width: 11px !important; height: 11px !important; }
.search-btn svg  { width: 14px !important; height: 14px !important; }
.author-link svg { width: 13px !important; height: 13px !important; }
.rp-date svg     { width: 10px !important; height: 10px !important; }
.rc-meta svg     { width: 10px !important; height: 10px !important; }
.action-btn svg  { width: 14px !important; height: 14px !important; }
.sb-cta-btn svg  { width: 13px !important; height: 13px !important; }
.sb-cta-ico      { width: 26px !important; height: 26px !important; display: block !important; margin: 0 auto 10px !important; }

/* ── PAGE ── */
.page      { padding: 28px 0 60px; }
.container { max-width: 1120px; margin: 0 auto; padding: 0 24px; }

/* ── BACK LINK ── */
.back-link       { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text3); margin-bottom: 10px; transition: color .2s; }
.back-link:hover { color: var(--brand); }

/* ── BREADCRUMB ── */
.breadcrumb         { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; margin-bottom: 18px; font-size: 12.5px; color: var(--text3); }
.breadcrumb a       { color: var(--brand); font-weight: 500; }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb .sep    { color: var(--border); }

/* ── LAYOUT ── */
.layout    { display: grid; grid-template-columns: 1fr 292px; gap: 24px; align-items: start; }
.main-card { background: var(--card); border-radius: var(--radius-lg); box-shadow: var(--shadow); overflow: hidden; }

/* ── HERO IMAGE — full width fix ── */
.hero {
  position: relative;
  height: 400px;
  overflow: hidden;
  background: var(--bg2);
  width: 100% !important;
  max-width: 100% !important;
  display: block !important;
  margin: 0 !important;
  padding: 0 !important;
}
.hero img {
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  object-fit: cover !important;
  object-position: center !important;
  display: block !important;
  transition: transform .5s ease;
}
.hero:hover img { transform: scale(1.02); }

.cat-pill {
  position: absolute; top: 18px; left: 18px; z-index: 5;
  background: var(--brand); color: #fff;
  font-family: var(--sans); font-size: 11px; font-weight: 600;
  letter-spacing: .08em; text-transform: uppercase;
  padding: 4px 14px; border-radius: 100px;
}

/* ── POST HEADER ── */
.phead  { padding: 24px 30px 20px; border-bottom: 1px solid var(--border2); }
.pmeta  { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 12px; }
.mi     { display: flex; align-items: center; gap: 4px; font-size: 13px; color: var(--text3); }
.mi a   { color: var(--brand); }
.ptitle {
  font-family: var(--display);
  font-size: clamp(2rem, 3.5vw, 2.6rem);
  font-weight: 700; line-height: 1.15; margin-bottom: 12px;
}
.pexcerpt { font-size: 15.5px; color: var(--text2); line-height: 1.75; font-style: italic; }

/* ── STATS BAR ── */
.stats-bar       { display: grid; grid-template-columns: repeat(3,1fr); border-bottom: 1px solid var(--border2); }
.stat            { display: flex; flex-direction: column; align-items: center; padding: 16px 10px; gap: 5px; border-right: 1px solid var(--border2); text-align: center; }
.stat:last-child { border-right: none; }
.stat-lbl        { font-size: 10px; text-transform: uppercase; letter-spacing: .08em; color: var(--text3); font-weight: 600; }
.stat-val        { font-family: var(--display); font-size: 18px; font-weight: 600; color: var(--text); }

/* ── POST BODY ── */
.pbody { padding: 28px 30px; }

/* ── ACF FIELDS ── */
.acf-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; margin-bottom: 30px; }
.af       { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 13px 15px; display: flex; align-items: flex-start; gap: 10px; }
.af-icon  { width: 34px; height: 34px; flex-shrink: 0; background: var(--white); border: 1px solid var(--border); border-radius: 7px; display: flex; align-items: center; justify-content: center; color: var(--brand); }
.af-lbl   { font-size: 10px; text-transform: uppercase; letter-spacing: .07em; color: var(--text3); font-weight: 600; margin-bottom: 2px; }
.af-val   { font-size: 14px; font-weight: 600; color: var(--text); }

/* ── SECTION TITLE ── */
.sec-title { font-family: var(--display); font-size: 1.5rem; font-weight: 700; color: var(--text); margin-bottom: 18px; padding-bottom: 10px; border-bottom: 2px solid var(--border2); display: flex; align-items: center; gap: 9px; }
.sec-title::before { content: ''; display: block; width: 4px; height: 22px; background: var(--brand); border-radius: 0; flex-shrink: 0; }

/* ── GUTENBERG CONTENT ── */
.recipe-post-content { margin-bottom: 0; }

.recipe-post-content h2 {
  font-family: var(--display); font-size: 1.45rem; font-weight: 700; color: var(--text);
  margin: 28px 0 14px; padding-bottom: 10px; border-bottom: 2px solid var(--border2);
  display: flex; align-items: center; gap: 9px;
}
.recipe-post-content h2::before { content: ''; display: block; width: 4px; height: 20px; background: var(--brand); border-radius: 0; flex-shrink: 0; }

.recipe-post-content h3 {
  font-family: var(--sans); font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .09em; color: var(--brand);
  margin: 18px 0 10px; display: flex; align-items: center; gap: 8px;
}
.recipe-post-content h3::after { content: ''; flex: 1; height: 1px; background: var(--border); }

.recipe-post-content p             { font-size: 15px; line-height: 1.75; color: var(--text2); margin-bottom: 14px; }
.recipe-post-content p:last-child  { margin-bottom: 0; }
.recipe-post-content strong        { color: var(--text); font-weight: 600; }

.recipe-post-content ul            { list-style: none; margin-bottom: 20px; padding: 0; }
.recipe-post-content ul li         { display: flex; align-items: baseline; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border2); font-size: 14.5px; color: var(--text2); }
.recipe-post-content ul li:last-child { border-bottom: none; }
.recipe-post-content ul li::before { content: '—'; color: var(--brand); font-weight: 700; flex-shrink: 0; }

.recipe-post-content ol            { list-style: none; counter-reset: step-counter; margin-bottom: 20px; padding: 0; }
.recipe-post-content ol li         { counter-increment: step-counter; display: flex; align-items: flex-start; gap: 14px; padding: 10px 0; border-bottom: 1px solid var(--border2); font-size: 15px; line-height: 1.7; color: var(--text2); }
.recipe-post-content ol li:last-child { border-bottom: none; }
.recipe-post-content ol li::before {
  content: counter(step-counter);
  min-width: 28px; height: 28px; background: var(--brand); color: #fff;
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; flex-shrink: 0; margin-top: 2px;
  box-shadow: 0 2px 8px rgba(192,57,43,.25);
}

/* ── GALLERY FIX ──
   Targets all Gutenberg gallery markup variants.
   Key fix: set explicit height on the container, not just the img. */
.recipe-post-content .wp-block-gallery {
  display: grid !important;
  grid-template-columns: repeat(3, 1fr) !important;
  gap: 12px !important;
  margin: 24px 0 !important;
  padding: 0 !important;
  list-style: none !important;
  /* Reset WP flex layout */
  flex-wrap: unset !important;
  align-items: unset !important;
}
/* Every direct child = a grid cell */
.recipe-post-content .wp-block-gallery > *,
.recipe-post-content .wp-block-gallery .blocks-gallery-item,
.recipe-post-content .wp-block-gallery .wp-block-image {
  height: 200px !important;
  width: 100% !important;
  overflow: hidden !important;
  border-radius: var(--radius) !important;
  margin: 0 !important;
  padding: 0 !important;
  flex-grow: unset !important;
  flex-basis: unset !important;
}
/* Figure inside list item */
.recipe-post-content .wp-block-gallery .blocks-gallery-item figure {
  height: 100% !important;
  margin: 0 !important;
}
/* All gallery images */
.recipe-post-content .wp-block-gallery img {
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  max-height: none !important;
  object-fit: cover !important;
  object-position: center !important;
  display: block !important;
  transition: transform .35s ease;
}
.recipe-post-content .wp-block-gallery *:hover img { transform: scale(1.05); }
/* Hide captions */
.recipe-post-content .wp-block-gallery figcaption { display: none !important; }

/* ── IN-CONTENT CTA ── */
.content-cta         { background: var(--brand); border-radius: var(--radius-lg); padding: 22px 26px; display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 28px 0; overflow: hidden; position: relative; }
.content-cta::before { content: ''; position: absolute; right: -30px; top: -30px; width: 120px; height: 120px; background: rgba(255,255,255,.06); border-radius: 50%; }
.content-cta::after  { content: ''; position: absolute; right: 50px; bottom: -50px; width: 90px; height: 90px; background: rgba(255,255,255,.04); border-radius: 50%; }
.cta-text h3         { font-family: var(--display); font-size: 1.3rem; color: #fff; margin-bottom: 4px; }
.cta-text p          { font-size: 13px; color: rgba(255,255,255,.78); }
.cta-btn             { background: #fff; color: var(--brand); font-size: 13px; font-weight: 700; padding: 10px 20px; border-radius: 7px; border: none; white-space: nowrap; flex-shrink: 0; position: relative; z-index: 1; transition: all .2s; text-decoration: none; display: inline-block; }
.cta-btn:hover       { background: var(--brand-dark); color: #fff; }

/* ── TAGS ── */
.tags-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 28px; align-items: center; }
.tags-lbl { font-size: 11px; font-weight: 600; color: var(--text3); text-transform: uppercase; letter-spacing: .07em; }
.tag {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 100px; padding: 4px 13px;
  font-size: 13px; color: var(--text2); transition: all .18s;
  display: inline-block;
}
.tag:hover { background: var(--brand-light); border-color: var(--brand-mid); color: var(--brand); }

/* ── DIVIDER ── */
.divider { height: 1px; background: var(--border2); margin: 28px 0; }

/* ── AUTHOR BIO ── */
.author-bio  { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px 24px; display: flex; gap: 18px; align-items: center; }
.author-ava  { width: 64px; height: 64px; border-radius: 50%; background: var(--brand); color: #fff; display: flex; align-items: center; justify-content: center; font-family: var(--display); font-size: 1.6rem; font-weight: 700; flex-shrink: 0; }
.author-info { flex: 1; }
.author-name { font-family: var(--display); font-size: 1.25rem; font-weight: 700; margin-bottom: 2px; color: var(--text); }
.author-role { font-size: 10.5px; text-transform: uppercase; letter-spacing: .07em; color: var(--brand); font-weight: 600; margin-bottom: 8px; }
.author-desc { font-size: 13.5px; color: var(--text2); line-height: 1.7; }
.author-links { display: flex; gap: 6px; margin-top: 10px; }
.author-link  { width: 28px; height: 28px; background: var(--white); border: 1px solid var(--border); border-radius: 6px; display: flex; align-items: center; justify-content: center; color: var(--text3); transition: all .2s; }
.author-link:hover { background: var(--brand); color: #fff; border-color: var(--brand); }

/* ── ACTION BAR (Share / Print) ── */
.action-bar { display: flex; gap: 10px; margin-top: 20px; flex-wrap: wrap; }
.action-btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 18px; background: var(--bg);
  border: 1px solid var(--border); border-radius: 7px;
  font-family: var(--sans); font-size: 13px; font-weight: 500;
  color: var(--text2); cursor: pointer; transition: all .2s;
}
.action-btn:hover { background: var(--brand); color: #fff; border-color: var(--brand); }

/* ── RELATED POSTS ── */
.related-grid    { display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; }
.rc              { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; transition: transform .22s, box-shadow .22s; box-shadow: var(--shadow-sm); display: block; }
.rc:hover        { transform: translateY(-3px); box-shadow: var(--shadow); }
.rc-img          { height: 160px; overflow: hidden; background: var(--bg2); position: relative; }
.rc-img img      { position: absolute !important; top: 0 !important; left: 0 !important; width: 100% !important; height: 100% !important; max-width: none !important; object-fit: cover !important; object-position: center !important; display: block !important; transition: transform .35s; }
.rc:hover .rc-img img { transform: scale(1.06); }
.rc-body         { padding: 12px 14px; }
.rc-cat          { font-size: 10px; text-transform: uppercase; letter-spacing: .08em; color: var(--brand); font-weight: 700; margin-bottom: 4px; }
.rc-title        { font-family: var(--display); font-size: 15px; font-weight: 600; color: var(--text); line-height: 1.35; margin-bottom: 6px; }
.rc-meta         { font-size: 11.5px; color: var(--text3); display: flex; align-items: center; gap: 4px; }

/* ── SIDEBAR ──
   FIX: Removed max-height/overflow-y which was clipping
   search input and recent posts. Sticky works via
   position:sticky on the .sidebar div itself. The parent
   .layout grid already provides the needed height context.
   Adjust top = your UAE header height + 20px            */
.sidebar {
  position: -webkit-sticky;
  position: sticky;
  top: 100px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  /* Do NOT set max-height or overflow here —
     that clips content inside sidebar cards    */
  align-self: start;
}

.sb-card   { background: var(--card); border-radius: var(--radius-lg); box-shadow: var(--shadow); overflow: hidden; border: 1px solid var(--border); }
.sb-header { padding: 11px 16px; border-bottom: 1px solid var(--border2); display: flex; align-items: center; gap: 7px; }
.sb-header h3 { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .09em; color: var(--text); }
.sb-body   { padding: 14px 16px; display: block !important; visibility: visible !important; }

/* Search — force input visible, Hello Elementor sometimes hides input[type=search] */
.search-form  { display: flex !important; width: 100%; }
.search-input {
  flex: 1 !important;
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  padding: 8px 12px !important;
  border: 1px solid var(--border) !important;
  border-right: none !important;
  border-radius: 7px 0 0 7px !important;
  font-family: var(--sans) !important;
  font-size: 13px !important;
  color: var(--text) !important;
  background: var(--bg) !important;
  outline: none !important;
  height: auto !important;
  min-height: 38px !important;
  -webkit-appearance: none !important;
  appearance: none !important;
  box-shadow: none !important;
}
.search-input:focus { border-color: var(--brand) !important; }
.search-btn {
  padding: 8px 13px !important;
  background: var(--brand) !important;
  color: #fff !important;
  border: none !important;
  border-radius: 0 7px 7px 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  transition: background .2s;
  cursor: pointer !important;
  min-width: 40px !important;
  height: auto !important;
}
.search-btn:hover { background: var(--brand-dark) !important; }

/* Sidebar CTA */
.sb-cta    { background: var(--brand); border-radius: var(--radius-lg); padding: 20px 18px; text-align: center; box-shadow: var(--shadow); }
.sb-cta h3 { font-family: var(--display); font-size: 1.15rem; font-weight: 600; color: #fff; margin-bottom: 5px; line-height: 1.35; }
.sb-cta p  { font-size: 12.5px; color: rgba(255,255,255,.75); line-height: 1.6; margin-bottom: 14px; }
.sb-cta-btn { display: flex; align-items: center; justify-content: center; gap: 6px; background: #fff; color: var(--brand); font-family: var(--sans); font-size: 11.5px; font-weight: 600; padding: 10px 14px; border-radius: 6px; border: none; width: 100%; cursor: pointer; transition: all .2s; text-decoration: none; word-break: break-all; }
.sb-cta-btn:hover { background: var(--brand-dark); color: #fff; }

/* Categories */
.cat-list  { list-style: none; max-height: 360px; overflow-y: auto; padding-right: 4px; }
.cat-list::-webkit-scrollbar       { width: 4px; }
.cat-list::-webkit-scrollbar-track { background: var(--bg2); }
.cat-list::-webkit-scrollbar-thumb { background: var(--brand-mid); border-radius: 4px; }
.cat-item a           { display: flex; align-items: center; justify-content: space-between; padding: 8px 5px; font-size: 13px; color: var(--text2); border-bottom: 1px solid var(--border2); transition: all .18s; }
.cat-item:last-child a { border-bottom: none; }
.cat-item a:hover     { background: var(--brand-light); color: var(--brand); padding-left: 10px; }
.cat-item a:hover .cat-count { background: var(--brand); color: #fff; }
.cat-name  { display: flex; align-items: center; gap: 6px; }
.cat-count { font-size: 10.5px; font-weight: 700; background: var(--bg2); color: var(--text3); padding: 2px 8px; border-radius: 100px; transition: all .18s; }

/* Recent posts — force display, Hello Elementor may collapse these */
.recent-posts         { display: flex !important; flex-direction: column; }
.rp-item              { display: flex !important; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--border2); align-items: flex-start; transition: opacity .2s; }
.rp-item:last-child   { border-bottom: none; padding-bottom: 0; }
.rp-item:hover        { opacity: .8; }
.rp-img               { width: 52px !important; height: 52px !important; min-width: 52px; border-radius: 7px; overflow: hidden; flex-shrink: 0; background: var(--bg2); position: relative; }
.rp-img img           { position: absolute !important; top: 0 !important; left: 0 !important; width: 100% !important; height: 100% !important; max-width: none !important; object-fit: cover !important; display: block !important; }
.rp-cat               { font-size: 9.5px; text-transform: uppercase; letter-spacing: .07em; color: var(--brand); font-weight: 700; margin-bottom: 2px; display: block; }
.rp-title             { font-size: 12.5px; font-weight: 500; color: var(--text); line-height: 1.3; transition: color .2s; display: block; }
.rp-item:hover .rp-title { color: var(--brand); }
.rp-date              { font-size: 10.5px; color: var(--text3); margin-top: 3px; display: flex; align-items: center; gap: 3px; }

/* ── RESPONSIVE ── */
@media (max-width: 960px) {
  .layout       { grid-template-columns: 1fr; }
  .sidebar      { position: static !important; align-self: auto; }
  .related-grid { grid-template-columns: repeat(2,1fr); }
}
@media (max-width: 640px) {
  .page         { padding: 14px 0 40px; }
  .container    { padding: 0 14px; }
  .hero         { height: 230px; }
  .phead        { padding: 18px 16px 16px; }
  .pbody        { padding: 20px 16px; }
  .stats-bar    { grid-template-columns: repeat(3,1fr); }
  .acf-grid     { grid-template-columns: 1fr 1fr; }
  .related-grid { grid-template-columns: 1fr; }
  .author-bio   { flex-direction: column; text-align: center; }
  .author-links { justify-content: center; }
  .content-cta  { flex-direction: column; text-align: center; }
  .content-cta::before, .content-cta::after { display: none; }
  .recipe-post-content .wp-block-gallery {
    grid-template-columns: repeat(2,1fr) !important;
  }
  .recipe-post-content .wp-block-gallery > *,
  .recipe-post-content .wp-block-gallery .blocks-gallery-item,
  .recipe-post-content .wp-block-gallery .wp-block-image {
    height: 150px !important;
  }
}
@media print {
  .sidebar, .action-bar, .content-cta, .breadcrumb { display: none !important; }
  .layout    { grid-template-columns: 1fr; }
  .page      { background: #fff; padding: 0; }
  .main-card { box-shadow: none; border: none; }
}