﻿.page-food .container {
  width: 90%;
  margin: 0 auto;
  box-sizing: border-box;
}

.page-food .post {
  max-width: 1100px;
  margin: 28px auto;
}

.page-food .post .post-body {
  margin: 0;
  padding: 0 18px;
  line-height: 1.6;
}

.post-gallery {
  width: 100%;
  max-width: var(--content-max-w);
  margin: 18px auto 22px auto;
  padding: 0 var(--content-gutter);
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  grid-template-rows: repeat(2, minmax(140px, 1fr));
  grid-template-areas: "main side1" "main side2";
  gap: 16px;
  align-items: start;
  min-height: 420px;
  box-sizing: border-box;
}

.post-gallery.two-photo {
  grid-template-columns: 1fr 1fr;
  grid-template-rows: auto;
  grid-template-areas: "side3 side4";
  gap: 12px;
  align-items: center;
  min-height: 0;
  margin: 12px auto 8px auto;
  padding: 0 var(--content-gutter);
}

/* Header gallery: remove extra space below images and tighten captions */
.post-header-gallery {
  margin-bottom: 0; /* remove extra gap under header images */
  padding-bottom: 0;
}
.post-header-gallery .post-caption {
  padding-top: 8px;
  padding-bottom: 4px; /* reduce bottom padding so gallery sits tighter */
}

/* Ensure header/gallery captions are transparent */
.page-food .post-header-gallery figcaption.post-caption,
.page-food .post-gallery figcaption.post-caption,
.post-header-gallery figcaption.post-caption {
  background: transparent !important;
  box-shadow: none !important;
}

/* Remove box-shadows from gallery figures/photos/captions in blog scope */
.post-gallery .post-figure,
.post-gallery .post-figure .post-photo,
.post-gallery .post-figure > figcaption.post-caption {
  box-shadow: none !important;
  -webkit-box-shadow: none !important;
}

/* Ensure captions in posts don't get a white/cream background from other rules */
.page-food figcaption.post-caption,
.page-food .post-caption,
.post-header-gallery figcaption.post-caption {
  background: transparent !important;
}

/* If a header gallery precedes the content, tighten the post top margin
   so the first paragraph sits closer to the images */
.post-header-gallery + .content .post {
  margin-top: 8px; /* default post margin reduced from 28px to 8px */
}
@media (max-width: 700px) {
  .post-header-gallery + .content .post {
    margin-top: 6px;
  }
}

.post-body .post-gallery {
  padding: 0;
  margin-left: 0;
  margin-right: 0;
}

.post-body .post-gallery.two-photo {
  margin: 12px 0 8px 0;
}

.post-body .post-gallery.three-photo {
  margin: 18px 0 22px 0;
}

.post-gallery.two-photo .post-figure {
  height: auto;
}

.post-gallery.two-photo .post-photo {
  aspect-ratio: 4 / 3;
  height: auto;
  width: 100%;
}

.post-gallery.two-photo .photo-side4 .post-photo {
  object-position: center 95%;
}

.post-gallery .photo-main {
  grid-area: main;
}
.post-gallery .photo-side1 {
  grid-area: side1;
}
.post-gallery .photo-side2 {
  grid-area: side2;
}

.post-gallery .post-photo {
  width: 100%;
  height: auto;
  object-fit: cover;
  object-position: center center;
  display: block;
  border-radius: 8px;
  box-shadow: 0 8px 22px rgba(15, 23, 36, 0.06);
  border: 1px solid rgba(15, 20, 40, 0.03);
  cursor: zoom-in;
  transition: transform 0.18s ease;
  flex: 1 1 auto;
}

.post-gallery .post-figure {
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: visible;
  margin: 0;
}

.post-gallery .photo-main .post-photo {
  aspect-ratio: 16 / 10;
  height: auto;
}
.post-gallery .photo-side1 .post-photo,
.post-gallery .photo-side2 .post-photo {
  aspect-ratio: 4 / 3;
  height: auto;
}

@media (max-width: 900px) {
  .post-gallery {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto;
    grid-template-areas: "main main" "side1 side2";
  }
  .post-gallery .photo-main .post-photo {
    max-height: none;
  }
}

@media (max-width: 700px) {
  .post-gallery {
    display: block;
    width: calc(100% - 32px);
    margin-left: 16px;
    margin-right: 16px;
  }
  .post-gallery .post-photo {
    margin-bottom: 12px;
    height: auto;
    width: 100%;
  }
  .page-food .container {
    width: calc(100% - 32px);
    margin: 0 16px;
  }
}

.lightbox-overlay img {
  max-width: 92vw;
  max-height: 92vh;
  object-fit: contain;
}

:root {
  --sp-left: 9%;
  --sp-max: 980px;
}

.page-hero-title {
  padding-left: 0;
  padding-right: 0;
}
.page-hero-inner {
  max-width: var(--content-max-w);
  margin: 0 auto;
  padding: 0 var(--content-gutter);
  text-align: left;
}
.page-hero-inner h1 {
  margin-left: 0;
  padding-left: 0;
  max-width: var(--sp-max);
  white-space: normal;
  overflow: visible;
  line-height: 1.05;
}

.page-hero-date {
  margin: 8px 0 4px 0;
  color: #6a6f78;
  font-size: 15px; /* match page subtitle */
  font-weight: 400;
  letter-spacing: 0.4px;
  padding-top: 8px;
  max-width: var(--content-max-w);
  border-top: none;
}

/* Underline beneath the date that matches the post gallery/content width */
.page-hero-date::after {
  content: "";
  display: block;
  width: 100%;
  height: 2px;
  background: var(--color-accent);
  margin-top: 12px;
  border-radius: 2px;
}

@media (max-width: 900px) {
  .page-hero-inner h1 {
    white-space: normal;
  }
}

@media (max-width: 700px) {
  .page-hero-date {
    font-size: 13px;
  }
}

.post .post-body {
  max-width: var(--content-max-w);
  margin: 0 auto;
  padding: 0 var(--content-gutter);
  text-align: left;
}

.post-meta,
.post-gallery {
  max-width: var(--content-max-w);
  margin: 0 auto;
  padding: 0 var(--content-gutter);
}

.post-meta {
  text-align: left;
  margin-bottom: 16px;
  color: #6a6f78;
}

.post h1 {
  font-size: clamp(28px, 3.6vw, 44px);
  margin-top: 0.4em;
  margin-bottom: 0.6em;
  color: var(--color-text);
  letter-spacing: 0.6px;
}
@media (min-width: 1200px) {
  .post h2 {
    white-space: nowrap;
    overflow-wrap: normal;
  }
}

.post-body {
  font-size: 18px;
  line-height: 1.6;
  color: var(--color-text);
  margin-bottom: 34px;
}

.post-body ul,
.post-body ol {
  padding-left: 3rem;
  margin-left: 0;
}
.post-body li {
  margin-bottom: 0.6rem;
}

.inset-photo.inset-left ~ ul,
.inset-photo.inset-left ~ ol,
.post-body h2 + ul,
.post-body h2 + ol {
  clear: left;
  margin-top: 12px;
}

.post-gallery .post-figure {
  box-shadow: 0 8px 22px rgba(15, 23, 36, 0.06);
}

.inset-photo {
  float: right;
  width: clamp(220px, 38%, 40%);
  margin: 0 0 28px 22px;
  display: block;
  shape-outside: inset(0);
}
.inset-photo.small {
  width: clamp(160px, 30%, 30%);
}
.inset-photo.inset-left {
  float: left;
  margin: 0 28px 28px 0;
}
.inset-photo img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 8px;
  object-fit: cover;
}

.post-body::after {
  content: "";
  display: block;
  clear: both;
}

@media (max-width: 900px) {
  .inset-photo {
    width: 48%;
    margin: 0 0 14px 0;
    float: none;
  }
  .inset-photo.inset-left {
    margin: 0 0 14px 0;
  }
}
@media (max-width: 700px) {
  .inset-photo {
    width: 100%;
    margin: 0 0 16px 0;
  }
}

.post-body h2 + p + ul,
.post-body h2 + p + ol {
  clear: left;
  margin-top: 12px;
}

.spaced-heading {
  margin-top: 2.2rem;
}

.back-link {
  display: inline-block;
  background: var(--color-ochre-dark);
  color: var(--color-buttercream);
  padding: 8px 14px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  margin-top: 6px;
}
.back-link:hover {
  background: var(--color-accent-2);
}

.page-food .post {
  background: transparent !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  padding: 0 !important;
}

/* Recipe box styles (moved from inline post styles) */
.recipe-box {
  border: 1px solid rgba(20, 26, 40, 0.06);
  padding: 22px 20px;
  border-radius: 12px;
  background: linear-gradient(180deg, #ffffff, #fbfbfb);
  margin: 20px 0 34px 0;
  box-shadow: 0 8px 24px rgba(15, 20, 30, 0.05);
}
.recipe-box h3 {
  margin: 0 0 18px 0;
  font-size: 1.2rem;
  color: var(--color-text);
}
.recipe-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 14px;
  color: #374151;
  align-items: center;
}
.servings-control {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}
.serv-btn {
  background: var(--color-accent);
  color: #fff;
  border: 0;
  padding: 4px 6px;
  border-radius: 6px;
  cursor: pointer;
  min-width: 28px;
  min-height: 28px;
  font-size: 0.9rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 8px rgba(15, 20, 30, 0.06);
  transition:
    transform 0.12s ease,
    filter 0.12s ease;
}
.serv-btn:hover {
  filter: brightness(0.95);
  transform: translateY(-1px);
}
.serv-btn:active {
  transform: translateY(1px);
}
.serv-btn:focus {
  outline: 3px solid rgba(59, 130, 246, 0.18);
  outline-offset: 3px;
}
#servings-input {
  width: 48px;
  padding: 6px;
  border: 1px solid #e6eef8;
  border-radius: 6px;
  text-align: center;
  font-size: 0.95rem;
}
.recipe-columns {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}
.recipe-col {
  flex: 1;
  min-width: 220px;
}
.ingredient-qty {
  font-weight: 700;
  color: var(--color-accent);
}
.recipe-instructions ol {
  margin-left: 1.2rem;
}
.recipe-nutrition ul {
  margin-left: 1.2rem;
}
@media (max-width: 640px) {
  .recipe-columns {
    flex-direction: column;
  }
  .recipe-meta {
    font-size: 0.95rem;
  }
  .serv-btn {
    min-width: 40px;
    min-height: 40px;
  }
  #servings-input {
    width: 56px;
  }
}

/* hide native number input spinners */
.recipe-box input[type="number"]::-webkit-outer-spin-button,
.recipe-box input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.recipe-box input[type="number"] {
  -moz-appearance: textfield;
}

@media (max-width: 640px) {
  .servings-control {
    margin-left: 0;
    margin-top: 8px;
  }
}

/* small accessibility/visual tweaks */
.recipe-box .post-caption {
  font-size: 0.95rem;
  color: #6b7280;
}
