/* =============================================================================
   Alabama Signature Homes — services/house_plans
   =============================================================================

   The house-plans service page, app/views/services/house_plans.html.php: a
   third-party iframe with a skeleton behind it while it loads.

   ORDER MATTERS in this file. .plans-skeleton__rail is declared twice, and the
   second declaration (width: 300px) overrides the first (min-width: 200px).
   Same layer, same specificity, so source order is the only thing deciding it —
   the two halves were adjacent blocks in main.css and must stay in this order.

   Same house rules as main.css — no nesting, flat selectors, media queries
   inside the layer that owns them. Everything is wrapped in @layer: an
   unlayered rule would outrank even the utilities layer.
   ========================================================================== */

@layer pages {
  /* ----- house plans embed ----- */

  .plans-frame {
    position: relative;
    height: calc(100dvh - 150px);
  }

  .plans-frame iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
  }

  .plans-skeleton {
    position: absolute;
    inset: 0;
    padding: var(--space-md);
    z-index: var(--z-behind);
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-xs);
  }

  @media (min-width: 768px) {
    .plans-skeleton {
      grid-template-columns: auto 1fr;
    }
  }

  .plans-skeleton__rail {
    display: grid;
    gap: var(--space-xs);
    grid-auto-rows: 2rem;
    min-width: 200px;
  }

  .plans-skeleton__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-xs);
    grid-auto-rows: 200px;
  }

  /* Verbatim from the old page, keyframe renamed: @keyframes names are global
     now that Astro's component scoping is gone. */
  .placeholder-bg {
    background-image: linear-gradient(
      90deg,
      rgba(0, 0, 0, 0) 0%,
      rgba(255, 255, 255, 0.5) 50%,
      rgba(0, 0, 0, 0) 100%
    );
    background-size: 200px 1500px;
    background-repeat: no-repeat;
    background-color: hsl(0 0% 90%);
    animation: plans-skeleton-slide 1.25s infinite ease-in-out;
    border-radius: 1rem;
  }

  @keyframes plans-skeleton-slide {
    0% { background-position: -200% 50%; }
    100% { background-position: 200% 50%; }
  }

  /* ----- second half -----
     Everything below was a separate block in main.css and must stay below: the
     .plans-skeleton__rail here overrides the one above. */

  .plans-section {
    position: relative;
    isolation: isolate;
    background-color: var(--clr-white);
    overflow: hidden;
  }

  .plans-skeleton__rail {
    height: 100%;
    width: 300px;
  }

  .plans-skeleton__grid > .placeholder-bg {
    min-height: 300px;
  }
}
