/**
 * Compact-device copy placement for the three business stories.
 *
 * Desktop keeps the shared information cards. Tablets, unfolded foldables and
 * phones keep the photography and process motion dominant, so the copy becomes
 * an edge-aligned text overlay without a card surface. Each story owns its
 * compact-device position because its photographic focal point differs.
 */

@media (max-width: 920px) {
  :is(.gy-poultry-story__panel, .gy-solar-story__status, .gy-house-story__panel) {
    top: auto;
    right: auto;
    width: calc(100% - 150px);
    height: auto;
    min-height: 0;
    max-width: 440px;
    max-height: none;
    padding: 0;
    overflow: visible;
    color: #fff;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    translate: none;
    pointer-events: none;
  }

  :is(.gy-poultry-story__panel, .gy-solar-story__status, .gy-house-story__panel) h3 {
    margin: 7px 0 6px;
    font-size: clamp(23px, 3.4vw, 28px);
    line-height: 1.2;
    text-shadow: 0 2px 14px rgba(0, 0, 0, .86);
  }

  :is(.gy-poultry-story__panel, .gy-solar-story__status, .gy-house-story__panel) p {
    min-height: 0;
    color: rgba(255, 255, 255, .94);
    font-size: 13.5px;
    font-weight: 560;
    line-height: 1.58;
    text-shadow: 0 2px 12px rgba(0, 0, 0, .92);
  }

  .gy-poultry-story__panel > span,
  .gy-solar-story__status > span,
  .gy-solar-story__status > em,
  .gy-house-story__meta span {
    text-shadow: 0 2px 10px rgba(0, 0, 0, .92);
  }

  .gy-solar-story__status > em {
    margin-top: 4px;
    color: rgba(225, 244, 164, .94);
    font-size: 10px;
    line-height: 1.35;
  }

  :is(.gy-poultry-story__progress, .gy-solar-story__progress, .gy-house-story__progress) {
    position: relative;
    inset: auto;
    width: min(220px, 76%);
    height: 2px;
    margin-top: 11px;
    background: rgba(255, 255, 255, .3);
  }

  /* Poultry: keep the central equipment and hotspots clear. */
  .gy-poultry-story__panel {
    bottom: clamp(48px, 7vh, 70px);
    left: clamp(32px, 5vw, 52px);
  }

  /* Solar: use the sky at the top-left and leave the roof array unobstructed. */
  .gy-solar-story__status {
    top: clamp(58px, 8vh, 76px);
    bottom: auto;
    left: clamp(32px, 5vw, 52px);
  }

  .gy-solar-story__shade {
    background:
      radial-gradient(circle at var(--gy-solar-spot-x, 50%) var(--gy-solar-spot-y, 42%), rgba(185, 222, 95, .14), transparent 27%),
      linear-gradient(180deg, rgba(4, 12, 21, .72), rgba(4, 12, 21, .12) 38%, transparent 58%),
      linear-gradient(0deg, rgba(4, 12, 21, .34), transparent 34%);
  }

  /* Construction: copy sits in the existing lower photographic shade. */
  .gy-house-story__panel {
    bottom: clamp(48px, 7vh, 70px);
    left: clamp(32px, 5vw, 52px);
  }

  .gy-house-story__meta {
    gap: 10px;
    justify-content: flex-start;
  }

  /* Front-end editing controls occupy the lower edge only for signed-in admins. */
  body.logged-in .gy-poultry-story__panel,
  body.logged-in .gy-house-story__panel {
    top: auto;
    bottom: 122px;
  }

  body.logged-in .gy-solar-story__status {
    top: 82px;
    bottom: auto;
  }
}

@media (max-width: 640px) {
  :is(.gy-poultry-story__panel, .gy-solar-story__status, .gy-house-story__panel) {
    width: calc(100% - 78px);
    max-width: 310px;
  }

  :is(.gy-poultry-story__panel, .gy-solar-story__status, .gy-house-story__panel) h3 {
    font-size: clamp(20px, 5.7vw, 23px);
  }

  :is(.gy-poultry-story__panel, .gy-solar-story__status, .gy-house-story__panel) p {
    font-size: 12px;
  }

  .gy-solar-story__status > em {
    font-size: 9.5px;
  }

  :is(.gy-poultry-story__progress, .gy-solar-story__progress, .gy-house-story__progress) {
    width: min(180px, 76%);
  }

  .gy-poultry-story__panel {
    bottom: 38px;
    left: 22px;
  }

  .gy-solar-story__status {
    top: 46px;
    left: 22px;
  }

  .gy-house-story__panel {
    bottom: 42px;
    left: 22px;
  }

  body.logged-in .gy-poultry-story__panel,
  body.logged-in .gy-house-story__panel {
    bottom: 112px;
  }

  body.logged-in .gy-solar-story__status {
    top: 66px;
  }
}

@media (max-width: 370px) {
  :is(.gy-poultry-story__panel, .gy-solar-story__status, .gy-house-story__panel) {
    width: calc(100% - 68px);
  }

  :is(.gy-poultry-story__panel, .gy-solar-story__status, .gy-house-story__panel) p {
    font-size: 11.5px;
    line-height: 1.54;
  }
}
