/* =====================================================================
   OSE · Image frame · styles/components/image-frame.css
   ---------------------------------------------------------------------
   A <figure> that crops a photo to a fixed ratio, shows a placeholder
   colour while it loads, and takes an optional caption. Component tokens
   only: --image-frame-*.

   Markup
     <figure class="image-frame [image-frame--wide|--square|--portrait] [image-frame--lg]">
       <div class="image-frame__media">
         <!-- PLACEHOLDER: replace with real photo -->
         <img src="/images/mockups/classroom.jpg" alt="…" width="1280" height="1600" loading="lazy" decoding="async">
         <span class="image-frame__tag">Ảnh minh hoạ</span>     brand mockups only
       </div>
       <figcaption class="image-frame__caption">…</figcaption>  optional
     </figure>

   No photo yet (e.g. the classroom before opening):
     <figure class="image-frame image-frame--empty">
       <div class="image-frame__media"><p class="image-frame__placeholder">Ảnh sẽ cập nhật</p></div>
     </figure>

   Ratios: photo 4:3 (default, also .image-frame--photo), --wide 16:9,
   --square 1:1, --portrait 4:5. Radius: card (default) or --lg (panel).
   Every mockup carries the "Ảnh minh hoạ" tag and the PLACEHOLDER
   comment (CLAUDE.md §6). Never put mockup people on the teachers page.
   Static, no interactive states. No JS.
   ===================================================================== */

@layer components {
  .image-frame {
    --_ratio: var(--image-frame-ratio);
    --_radius: var(--image-frame-radius);
    display: grid;
    align-content: start;
    gap: var(--image-frame-caption-gap);
    min-inline-size: 0;
  }

  .image-frame--photo {
    --_ratio: var(--image-frame-ratio);
  }

  .image-frame--wide {
    --_ratio: var(--image-frame-ratio-wide);
  }

  .image-frame--square {
    --_ratio: var(--image-frame-ratio-square);
  }

  .image-frame--portrait {
    --_ratio: var(--image-frame-ratio-portrait);
  }

  .image-frame--lg {
    --_radius: var(--image-frame-radius-lg);
  }

  .image-frame__media {
    position: relative;
    overflow: hidden;
    aspect-ratio: var(--_ratio);
    border: var(--image-frame-border-width) solid var(--image-frame-border);
    border-radius: var(--_radius);
    background-color: var(--image-frame-bg);
  }

  .image-frame__media > img {
    display: block;
    inline-size: 100%;
    block-size: 100%;
    object-fit: cover;
  }

  .image-frame__tag {
    position: absolute;
    inset-block-start: var(--image-frame-tag-offset);
    inset-inline-start: var(--image-frame-tag-offset);
    display: inline-flex;
    align-items: center;
    min-block-size: var(--image-frame-tag-height);
    padding-inline: var(--image-frame-tag-padding-inline);
    border-radius: var(--image-frame-tag-radius);
    background-color: var(--image-frame-tag-bg);
    color: var(--image-frame-tag-text);
    font-family: var(--image-frame-tag-font-family);
    font-size: var(--image-frame-tag-font-size);
    font-weight: var(--image-frame-tag-font-weight);
    white-space: nowrap;
  }

  .image-frame__caption {
    color: var(--image-frame-caption-color);
    font-size: var(--image-frame-caption-font-size);
  }

  /* Empty: no photo yet, a dashed frame that says so. */
  .image-frame--empty .image-frame__media {
    display: grid;
    place-items: center;
    padding: var(--image-frame-placeholder-padding);
    border-style: dashed;
    background-color: var(--image-frame-placeholder-bg);
    color: var(--image-frame-placeholder-text);
    text-align: center;
  }

  .image-frame__placeholder {
    font-size: var(--image-frame-placeholder-font-size);
  }
}
