/* Financial Essentials Recipe Box v1.0.2
   Scoped entirely to Recipe Box elements. The website supplies fonts and
   accent/text colors through Astra or Elementor settings; only paper, texture,
   and fine dividing rules use their own neutral vintage colors. */
.fe-rb,
.fe-rb-single {
  --fe-rb-ink: var(--ast-global-color-2, var(--e-global-color-text, currentColor));
  --fe-rb-accent: var(--ast-global-color-0, var(--e-global-color-primary, currentColor));
  --fe-rb-paper: #faf6eb;
  --fe-rb-paper-dark: #f0e8d7;
  --fe-rb-rule: #ddd0b9;
  --fe-rb-paper-ink: var(--ast-global-color-3, var(--e-global-color-text, currentColor));
  box-sizing: border-box;
  width: 100%;
  font-family: inherit;
  line-height: 1.55;
  color: var(--fe-rb-ink);
}
.fe-rb *, .fe-rb *::before, .fe-rb *::after,
.fe-rb-single *, .fe-rb-single *::before, .fe-rb-single *::after {
  box-sizing: border-box;
}

/* The full Recipe Box shortcode: hero text and photo never overlap. */
.fe-rb { max-width: 1280px; margin: 0 auto; padding: 0 0 32px; }
.fe-rb-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr);
  min-height: 290px;
  background: var(--fe-rb-paper);
  border: 1px solid var(--fe-rb-rule);
  overflow: hidden;
  box-shadow: 0 7px 22px rgb(45 37 28 / 8%);
}
.fe-rb-hero-copy {
  align-self: center;
  min-width: 0;
  max-width: 610px;
  padding: clamp(26px, 4.5vw, 64px);
  background: var(--fe-rb-paper);
}
.fe-rb .fe-rb-title {
  margin: 0 0 20px;
  font-size: clamp(2rem, 3.7vw, 3.5rem);
  line-height: 1.09;
  color: var(--fe-rb-ink);
}
.fe-rb-hero-copy p {
  margin: 0;
  max-width: 420px;
  color: var(--fe-rb-ink);
  font-size: clamp(.98rem, 1.25vw, 1.11rem);
  line-height: 1.7;
}
.fe-rb-hero-image {
  min-height: 245px;
  background: #e6dcc9 url('recipe-hero.webp') center right / cover no-repeat;
}

/* Photo-front vintage cards: no category labels, no fabricated placeholders. */
.fe-rb-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(18px, 2.4vw, 30px);
  margin: clamp(24px, 4vw, 43px) 0;
}
.fe-rb-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  position: relative;
  overflow: hidden;
  background-color: var(--fe-rb-paper);
  background-image: repeating-linear-gradient(0deg, transparent 0, transparent 30px, rgb(118 117 108 / 4%) 31px, transparent 32px);
  border: 1px solid var(--fe-rb-rule);
  box-shadow: 0 5px 15px rgb(32 25 19 / 9%);
  transition: transform .15s ease, box-shadow .15s ease;
}
.fe-rb-card::before {
  content: '';
  position: absolute;
  top: 9px; right: 0; left: 0;
  border-top: 1px solid var(--fe-rb-rule);
  pointer-events: none;
  z-index: 2;
}
.fe-rb-card:hover,
.fe-rb-card:focus-within {
  transform: translateY(-2px);
  box-shadow: 0 9px 20px rgb(32 25 19 / 13%);
}
.fe-rb-card-media {
  display: block;
  flex: none;
  overflow: hidden;
  margin: 18px 18px 0;
  padding: 6px;
  background: #fffdf8;
  border: 1px solid #ded4c4;
  aspect-ratio: 4 / 3;
  cursor: pointer;
}
.fe-rb-card-photo,
.fe-rb-photo-fallback {
  display: block;
  width: 100% !important;
  height: 100% !important;
  object-fit: cover;
  object-position: center center;
  border: 0;
}
.fe-rb-photo-fallback {
  background: radial-gradient(circle at 70% 40%, #e3cfaa 0 8%, transparent 8% 100%),
              repeating-linear-gradient(0deg, #f6f0e3 0 32px, #e4d9c4 33px 34px);
}
.fe-rb-card-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 23px clamp(18px, 2vw, 27px) 28px;
}
.fe-rb .fe-rb-card-title {
  margin: 0 0 12px;
  font-size: clamp(1.26rem, 1.8vw, 1.65rem);
  line-height: 1.25;
  color: var(--fe-rb-ink);
}
.fe-rb-card-title a,
.fe-rb-card-title a:hover {
  color: inherit;
  text-decoration: none;
}
.fe-rb-card-title a:focus-visible,
.fe-rb-link:focus-visible,
.fe-rb-back-link:focus-visible,
.fe-rb-print-button:focus-visible {
  outline: 2px solid var(--fe-rb-accent);
  outline-offset: 3px;
}
.fe-rb-card-description {
  flex: 1;
  margin: 0 0 21px;
  line-height: 1.6;
  color: var(--fe-rb-paper-ink);
}
.fe-rb .fe-rb-link {
  align-self: flex-start;
  display: inline-block;
  margin-top: auto;
  padding: 5px 0;
  font-weight: 700;
  text-underline-offset: 5px;
  color: var(--fe-rb-accent);
}
.fe-rb .fe-rb-link:hover { text-decoration-thickness: 2px; }

.fe-rb-closing {
  text-align: center;
  border-top: 1px solid var(--fe-rb-rule);
  padding: 22px 12px 8px;
}
.fe-rb-closing p { margin: 0; }
.fe-rb-empty {
  margin: 28px 0;
  padding: 36px 24px;
  text-align: center;
  border: 1px dashed var(--fe-rb-rule);
  background: var(--fe-rb-paper);
}
.fe-rb-empty h3 { margin: 0 0 10px; color: var(--fe-rb-ink); }
.fe-rb-empty p { margin: 5px 0; }
.fe-rb-admin-hint { font-size: .9rem; }

/* Individual recipe with a printable, old-fashioned index-card look. */
.fe-rb-single {
  max-width: 1120px;
  margin: clamp(20px, 4vw, 48px) auto;
  padding: 0 20px 36px;
}
.fe-rb-recipe-navigation {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin: 0 0 18px;
}
.fe-rb-single .fe-rb-back-link { color: var(--fe-rb-accent); text-decoration: underline; text-underline-offset: 4px; }
.fe-rb-single button.fe-rb-print-button {
  display: inline-block;
  padding: 10px 20px;
  border: 1px solid var(--fe-rb-accent);
  border-radius: 2px;
  background: transparent;
  color: var(--fe-rb-accent);
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  line-height: 1.25;
}
.fe-rb-single button.fe-rb-print-button:hover {
  background-color: var(--fe-rb-paper);
  color: var(--fe-rb-accent);
}
.fe-rb-sheet {
  width: 100%;
  padding: clamp(25px, 4vw, 48px);
  border: 1px solid var(--fe-rb-rule);
  background: var(--fe-rb-paper);
  box-shadow: 0 8px 24px rgb(38 30 21 / 10%);
}
.fe-rb-sheet-header {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr);
  gap: clamp(20px, 3vw, 40px);
  align-items: center;
  margin: 0 0 30px;
  padding-bottom: 28px;
  border-bottom: 2px solid var(--fe-rb-rule);
}
.fe-rb-sheet-label {
  margin: 0 0 13px;
  font-size: .8rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--fe-rb-paper-ink);
}
.fe-rb-single .fe-rb-sheet-title {
  margin: 0 0 14px;
  font-size: clamp(2.1rem, 4vw, 3.3rem);
  line-height: 1.1;
  color: var(--fe-rb-ink);
}
.fe-rb-sheet-description { font-size: 1.06rem; line-height: 1.65; margin: 0 0 20px; color: var(--fe-rb-paper-ink); }
.fe-rb-recipe-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 15px 27px;
  margin: 19px 0 0;
  padding: 17px 0 0;
  border-top: 1px solid var(--fe-rb-rule);
}
.fe-rb-recipe-facts > div { display: block; }
.fe-rb-recipe-facts dt { font-weight: 700; margin: 0 0 1px; }
.fe-rb-recipe-facts dd { margin: 0; color: var(--fe-rb-paper-ink); }
.fe-rb-sheet-figure {
  margin: 0;
  padding: 7px;
  background: #fffdf8;
  border: 1px solid var(--fe-rb-rule);
  aspect-ratio: 4 / 3;
  overflow: hidden;
}
.fe-rb-sheet-image { display: block; width: 100% !important; height: 100% !important; object-fit: cover; }
.fe-rb-sheet-body { display: grid; grid-template-columns: minmax(220px, .8fr) minmax(0, 1.4fr); gap: clamp(25px, 4vw, 54px); }
.fe-rb-sheet-body > section { min-width: 0; }
.fe-rb-single .fe-rb-sheet-body h2 {
  margin: 0 0 21px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--fe-rb-rule);
  font-size: clamp(1.35rem, 2vw, 1.65rem);
  line-height: 1.2;
  color: var(--fe-rb-ink);
}
.fe-rb-sheet-ingredients ul { list-style: none; margin: 0; padding: 0; }
.fe-rb-sheet-ingredients li { padding: 9px 0 9px 22px; border-bottom: 1px dashed var(--fe-rb-rule); position: relative; }
.fe-rb-sheet-ingredients li::before { content: '•'; position: absolute; left: 4px; font-size: 1.4rem; line-height: 1; color: var(--fe-rb-accent); }
.fe-rb-directions-content > :first-child { margin-top: 0; }
.fe-rb-directions-content ol, .fe-rb-directions-content ul { padding-left: 24px; }
.fe-rb-directions-content li { padding-left: 2px; margin-bottom: 13px; }
.fe-rb-directions-content p { margin: 0 0 15px; }
.fe-rb-sheet-credit { border-top: 1px solid var(--fe-rb-rule); margin: 34px 0 0; padding-top: 17px; font-style: italic; }

@media (max-width: 850px) {
  .fe-rb-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fe-rb-hero { grid-template-columns: minmax(0, 1fr) minmax(0, .65fr); }
  .fe-rb-sheet-header { grid-template-columns: minmax(0, 1fr) minmax(0, .75fr); }
}
@media (max-width: 630px) {
  .fe-rb { padding-bottom: 24px; }
  .fe-rb-hero { grid-template-columns: 1fr; }
  .fe-rb-hero-copy { padding: 28px 24px; }
  .fe-rb-hero-image { min-height: 170px; background-position: center center; }
  .fe-rb-grid { grid-template-columns: 1fr; gap: 19px; margin: 23px 0; }
  .fe-rb-card-media { aspect-ratio: 16 / 10; }
  .fe-rb-card-body { padding: 20px 22px 24px; }
  .fe-rb-single { padding: 0 13px 28px; }
  .fe-rb-sheet { padding: 24px 20px; }
  .fe-rb-sheet-header, .fe-rb-sheet-body { grid-template-columns: 1fr; }
  .fe-rb-sheet-header { margin-bottom: 24px; }
  .fe-rb-recipe-navigation { flex-direction: row; }
}
@media (prefers-reduced-motion: reduce) {
  .fe-rb-card { transition: none; }
  .fe-rb-card:hover, .fe-rb-card:focus-within { transform: none; }
}
/* Print-only brand is absent from the screen reader's visual layout and
   becomes the first line of the printed recipe. */
.fe-rb-single .fe-rb-print-brand { display: none; }

/* Printing individual recipes only: remove Astra's non-recipe UI from layout.
   Unlike visibility:hidden + absolute positioning, display:none on the
   surrounding UI and normal-flow recipe content cannot create a trailing blank
   printed page solely from the hidden header/footer taking up space. */
@media print {
  @page { margin: .5in; }

  body.single-fe_recipe {
    margin: 0 !important;
    padding: 0 !important;
    min-height: 0 !important;
    height: auto !important;
    overflow: visible !important;
    background: #fff !important;
    color: #111 !important;
  }
  /* Astra's site chrome, admin bar, and recipe-only on-screen navigation. */
  body.single-fe_recipe #masthead,
  body.single-fe_recipe #colophon,
  body.single-fe_recipe #wpadminbar,
  body.single-fe_recipe .site-header,
  body.single-fe_recipe .site-footer,
  body.single-fe_recipe .fe-rb-recipe-navigation,
  body.single-fe_recipe #ast-scroll-top {
    display: none !important;
  }

  /* Remove theme page-height constraints and default container spacing without
     changing anything outside the print view of the recipe post type. */
  body.single-fe_recipe #page,
  body.single-fe_recipe #content,
  body.single-fe_recipe .site-content,
  body.single-fe_recipe .ast-container,
  body.single-fe_recipe main.fe-rb-single {
    display: block !important;
    float: none !important;
    position: static !important;
    width: 100% !important;
    max-width: none !important;
    min-height: 0 !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
  }

  body.single-fe_recipe .fe-rb-sheet {
    display: block !important;
    position: static !important;
    top: auto !important;
    left: auto !important;
    width: 100% !important;
    max-width: none !important;
    min-height: 0 !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    box-shadow: none !important;
    background: white !important;
    color: #111 !important;
    overflow: visible !important;
    break-before: auto;
    break-after: auto;
    break-inside: auto;
  }

  body.single-fe_recipe .fe-rb-print-brand {
    display: block !important;
    margin: 0 0 14px !important;
    padding: 0 0 8px !important;
    border-bottom: 1px solid #777;
    color: #111 !important;
    font: 700 10pt/1.3 Arial, Helvetica, sans-serif !important;
    letter-spacing: .07em;
    text-align: center;
    break-after: avoid;
  }
  body.single-fe_recipe .fe-rb-sheet-label { display: none !important; }
  body.single-fe_recipe .fe-rb-sheet-title,
  body.single-fe_recipe .fe-rb-sheet-body h2 { color: #111 !important; }
  body.single-fe_recipe .fe-rb-sheet-description,
  body.single-fe_recipe .fe-rb-recipe-facts dd { color: #333 !important; }
  body.single-fe_recipe .fe-rb-sheet-ingredients li::before { color: #111 !important; }
  body.single-fe_recipe .fe-rb-sheet-header {
    gap: 18px;
    padding-bottom: 12px;
    margin-bottom: 16px;
    break-inside: avoid;
  }
  body.single-fe_recipe .fe-rb-sheet-figure { max-height: 145px; }
  body.single-fe_recipe .fe-rb-sheet-figure img { max-height: 145px; }
  body.single-fe_recipe .fe-rb-recipe-facts { gap: 9px 17px; }
  body.single-fe_recipe .fe-rb-sheet-body { gap: 22px; }
  body.single-fe_recipe .fe-rb-sheet-ingredients li,
  body.single-fe_recipe .fe-rb-directions-content li { break-inside: avoid; }
  body.single-fe_recipe .fe-rb-sheet-credit { break-inside: avoid; }
}

/* Grid-only shortcode: Elementor controls the page heading, image, and closing section.
   All selectors stay under the plugin's root class; no global theme changes. */
.fe-rb.fe-rb-grid-only { max-width: none; padding: 0; }
.fe-rb.fe-rb-grid-only .fe-rb-grid { margin: 0; }
.fe-rb.fe-rb-grid-only .fe-rb-empty { margin: 0; }

/* ========================================================================
   V1.0.5 print layout refinements -- ONLY the fe_recipe content type.
   Printed logo and disclosure are real HTML, not browser-optional backgrounds.
   ======================================================================== */

/* Center the Print Recipe action above the recipe; keep backlink on the left. */
body.single-fe_recipe .fe-rb-recipe-navigation {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 14px;
  align-items: center;
}
body.single-fe_recipe .fe-rb-recipe-navigation .fe-rb-back-link {
  grid-column: 1;
  grid-row: 1;
  justify-self: start;
}
body.single-fe_recipe .fe-rb-recipe-navigation button.fe-rb-print-button {
  grid-column: 2;
  grid-row: 1;
  justify-self: center;
  display: inline-block;
  padding: 12px 19px;
  background: var(--ast-global-color-0, var(--e-global-color-accent, #1d6f7a));
  border: 1px solid var(--ast-global-color-0, var(--e-global-color-accent, #1d6f7a));
  border-radius: 0;
  color: #fff;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: .04em;
  text-transform: uppercase;
  box-shadow: none;
}
body.single-fe_recipe .fe-rb-recipe-navigation button.fe-rb-print-button:hover,
body.single-fe_recipe .fe-rb-recipe-navigation button.fe-rb-print-button:focus-visible {
  background: transparent;
  color: var(--ast-global-color-0, var(--e-global-color-accent, #1d6f7a));
}
@media (max-width: 630px) {
  body.single-fe_recipe .fe-rb-recipe-navigation { grid-template-columns: 1fr; }
  body.single-fe_recipe .fe-rb-recipe-navigation .fe-rb-back-link {
    grid-column: 1; grid-row: 1; justify-self: center;
  }
  body.single-fe_recipe .fe-rb-recipe-navigation button.fe-rb-print-button {
    grid-column: 1; grid-row: 2; justify-self: center;
  }
}

/* On SCREEN only, show the entire uploaded recipe picture and its browned edges.
   Previously the forced 4:3 figure and object-fit:cover cropped left/right sides.
   This does not affect the recipe collection cards or the compact print photo. */
@media screen {
  body.single-fe_recipe .fe-rb-sheet-figure {
    width: 100%;
    height: auto;
    max-height: none;
    aspect-ratio: auto;
    overflow: visible;
  }
  body.single-fe_recipe .fe-rb-sheet-figure img.fe-rb-sheet-image {
    display: block;
    width: 100% !important;
    height: auto !important;
    max-width: 100% !important;
    max-height: none !important;
    object-fit: contain !important;
    object-position: center center;
  }
}

/* These items never show on the browser version of the recipe. */
body.single-fe_recipe .fe-rb-print-disclosure,
body.single-fe_recipe .fe-rb-print-logo { display: none; }

@media print {
  @page { size: letter; margin: .5in; }

  /* Align the disclosure near the physical foot of Letter-sized recipes that
     fit on one sheet; longer recipes grow naturally and may print on 2+ pages. */
  body.single-fe_recipe #fe-rb-printable-recipe.fe-rb-sheet {
    display: flex !important;
    flex-direction: column !important;
    min-height: 9.72in !important;
    height: auto !important;
    box-sizing: border-box !important;
    padding: 0 !important;
    overflow: visible !important;
  }

  /* Hide any old CSS-generated assets to prevent a duplicate logo/disclosure. */
  /* Outrank older WordPress Customizer CSS which added a logo and
     disclosure via ::before/::after; prevents duplicates when updated. */
  html body.single-fe_recipe #fe-rb-printable-recipe.fe-rb-sheet .fe-rb-print-brand::before,
  html body.single-fe_recipe #fe-rb-printable-recipe.fe-rb-sheet::after {
    content: none !important;
    display: none !important;
  }

  body.single-fe_recipe #fe-rb-printable-recipe .fe-rb-print-brand {
    display: block !important;
    flex: none !important;
    margin: 0 0 .11in !important;
    padding: 0 0 .07in !important;
    border-bottom: 1px solid #777;
    text-align: center;
  }
  body.single-fe_recipe #fe-rb-printable-recipe .fe-rb-print-brand .fe-rb-print-logo {
    display: block !important;
    width: .5in !important;
    height: .5in !important;
    max-width: .5in !important;
    max-height: .5in !important;
    object-fit: contain !important;
    margin: 0 auto .055in !important;
    page-break-inside: avoid;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }
  body.single-fe_recipe #fe-rb-printable-recipe .fe-rb-print-brand span {
    display: block;
    font: 700 9.5pt/1.25 Arial, Helvetica, sans-serif !important;
    color: #111;
    letter-spacing: .06em;
  }

  /* Keep the photograph beside the title, whole and unframed. */
  body.single-fe_recipe #fe-rb-printable-recipe .fe-rb-sheet-header {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) 1.85in !important;
    gap: .18in !important;
    align-items: start !important;
    margin: 0 0 .11in !important;
    padding: 0 0 .08in !important;
  }
  body.single-fe_recipe #fe-rb-printable-recipe .fe-rb-sheet-figure {
    width: 1.85in !important;
    max-height: none !important;
    height: auto !important;
    aspect-ratio: auto !important;
    justify-self: end !important;
    margin: 0 !important;
    padding: 0 !important;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    overflow: visible !important;
  }
  body.single-fe_recipe #fe-rb-printable-recipe .fe-rb-sheet-figure img.fe-rb-sheet-image {
    display: block !important;
    width: auto !important;
    height: auto !important;
    max-width: 100% !important;
    max-height: 1.25in !important;
    object-fit: contain !important;
    margin: 0 auto !important;
  }
  body.single-fe_recipe #fe-rb-printable-recipe .fe-rb-sheet-description {
    font-size: 9pt !important;
    line-height: 1.32 !important;
    margin: 0 0 .08in !important;
  }
  body.single-fe_recipe #fe-rb-printable-recipe .fe-rb-sheet-title {
    margin-bottom: .08in !important;
    line-height: 1.12 !important;
  }
  body.single-fe_recipe #fe-rb-printable-recipe .fe-rb-recipe-facts {
    gap: .06in .16in !important;
    margin-top: .08in !important;
    padding-top: .06in !important;
  }

  /* Use a real, printable footer; leave room for content above it. */
  body.single-fe_recipe #fe-rb-printable-recipe .fe-rb-print-disclosure {
    display: block !important;
    flex: none !important;
    margin: auto 0 0 !important;
    padding: .08in 0 0 !important;
    color: #929292 !important;
    border-top: 1px solid #e5e5e5;
    font: 7pt/1.3 Arial, Helvetica, sans-serif !important;
    font-style: normal !important;
    text-align: left !important;
    letter-spacing: normal !important;
    break-inside: avoid;
  }
}
