/* DESIGN C6B — image/text balance. Page-scoped. Load before header-canonical. */

/* ——— O projektu: close portrait is editorial, not a 50% wall ——— */
.page-about .op-close {
  align-items: center;
  grid-template-columns: minmax(0, 1.52fr) minmax(0, 0.68fr);
  gap: clamp(24px, 3.5vw, 48px);
}
.page-about .op-close .op-close-portrait {
  width: min(100%, 268px);
  max-height: min(56vh, 400px);
  justify-self: end;
}
.page-about .op-close .op-close-portrait img {
  object-fit: contain;
  object-position: center top;
}

/* O projektu hero is a true overlay hero on desktop. On small screens H1 first. */
@media (max-width: 640px) {
  .page-about .op-hero {
    min-height: 0;
    height: auto;
    display: flex;
    flex-direction: column;
  }
  .page-about .op-hero-in {
    order: -1;
    padding: 22px 16px 10px;
  }
  .page-about .op-hero > img {
    order: 2;
    position: relative;
    inset: auto;
    width: 100%;
    height: min(68svh, 420px);
    max-height: min(72svh, 440px);
    object-fit: cover;
    object-position: 72% 28%;
  }
}

/* ——— Homepage gastro: keep landscape, copy first on small screens ——— */
.page-home #gastro .b2b-in {
  align-items: center;
  grid-template-columns: minmax(0, 0.96fr) minmax(0, 1.14fr);
}
.page-home #gastro .b2b-img {
  aspect-ratio: 3 / 2;
  max-height: min(48vh, 400px);
  overflow: hidden;
}
.page-home #gastro .b2b-img .ph,
.page-home #gastro .b2b-img .rimg,
.page-home #gastro .b2b-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 42%;
}
@media (max-width: 860px) {
  .page-home #gastro .b2b-in {
    grid-template-columns: 1fr;
  }
  .page-home #gastro .b2b-c { order: 1; }
  .page-home #gastro .b2b-img {
    order: 2 !important;
    max-width: none;
    max-height: min(46svh, 340px);
  }
}

/* ——— Homepage founder: smaller editorial portrait ——— */
.page-home #pribeh .about-in {
  align-items: center;
  grid-template-columns: minmax(0, 0.62fr) minmax(0, 1.38fr);
}
.page-home #pribeh .about-img {
  aspect-ratio: 3 / 4;
  width: min(100%, 320px);
  max-height: min(56vh, 440px);
  justify-self: center;
  overflow: hidden;
}
.page-home #pribeh .about-img .ph,
.page-home #pribeh .about-img .rimg,
.page-home #pribeh .about-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 16%;
}
@media (max-width: 820px) {
  .page-home #pribeh .about-in {
    grid-template-columns: 1fr !important;
  }
  .page-home #pribeh .about-c { order: 1; }
  .page-home #pribeh .about-img {
    order: 2;
    width: min(72%, 280px);
    max-height: min(68svh, 400px);
    margin-inline: auto;
  }
}

/* ——— Winery hero: keep Tenuta 3/2 + PHOTO P1 object-position; shrink other portraits ——— */
.page-winery .wy-hero {
  align-items: center;
}
.page-winery:not([data-winery="tenuta-la-pergola"]) .wy-hero {
  grid-template-columns: minmax(220px, 0.72fr) minmax(0, 1.28fr);
}
.page-winery:not([data-winery="tenuta-la-pergola"]) .wy-hero-photo {
  max-height: min(56vh, 400px);
  width: 100%;
}
.page-winery[data-winery="tenuta-la-pergola"] .wy-hero {
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr);
}

/* Visit portraits: editorial, not a half-page column */
.page-winery .wy-visit-split {
  align-items: center;
  grid-template-columns: minmax(0, 1.42fr) minmax(180px, 0.58fr);
  gap: clamp(22px, 3.2vw, 40px);
}
.page-winery .wy-visit-portrait {
  max-height: min(58vh, 420px);
  width: min(100%, 280px);
  margin-left: auto;
}
@media (max-width: 1099px) {
  .page-winery .wy-visit-portrait {
    max-height: min(70svh, 420px) !important;
    margin-left: 0;
    margin-inline: auto;
  }
}

/* Cellar / vineyard story photo already 4/3 — keep landscape cap */
.page-winery[data-winery="borgogno"] .wy-story-photo,
.page-winery[data-winery="borgogno"] .wy-story-photo img {
  max-height: min(48vh, 380px);
  aspect-ratio: 3 / 2;
  object-fit: cover;
}

/* ——— B2B page: copy stays first; visual is supporting, not a tall 4/5 wall ——— */
.vde-b2b .hero-in {
  align-items: center;
}
.vde-b2b .hero-visual {
  aspect-ratio: 4 / 5;
  max-height: min(50vh, 440px);
  align-self: center;
}
.vde-b2b .hero-visual img {
  object-fit: cover;
  object-position: 50% 38%;
}
@media (max-width: 1024px) {
  .vde-b2b .hero-visual {
    order: 2 !important;
    max-height: min(46svh, 340px);
    aspect-ratio: 3 / 2;
    max-width: min(560px, 100%);
  }
  .vde-b2b .hero-copy { order: 1; }
  .vde-b2b .auth-img { order: 2 !important; }
}

/* Unused .club-ed styles still live in la-cantina.html — keep them from becoming 4/5 walls if reused */
.page-prive .club-ed {
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 0.72fr);
  align-items: center;
}
.page-prive .club-ed-img:not(.wide) {
  aspect-ratio: 3 / 4;
  max-height: min(56vh, 400px);
  width: min(100%, 300px);
}
.page-prive .club-ed-img.wide {
  max-height: min(46vh, 360px);
}
