@use '../abstracts' as *;

// ============================================================
// The blog home's intro (Customizer → Home intro)
// ============================================================

.min-intro {
  display: flex;
  align-items: flex-start;
  gap: 40px;
  margin-bottom: 76px;

  @include below(mobile) {
    flex-direction: column;
    align-items: flex-start;
    gap: 22px;
    margin-bottom: 52px;
  }

  .min-intro-text {
    flex: 1;
    min-width: 0;
  }

  h1 {
    font-family: $font-serif;
    font-size: clamp(26px, 3.6vw, 34px);
    font-weight: 400;
    line-height: 1.5;
    margin-bottom: 16px;
    max-width: 22ch;
  }

  .min-intro-desc {
    color: var(--ink-soft);
    font-size: 16.5px;
    font-weight: 300;
    max-width: 52ch;

    > * + * { margin-top: 0.8em; }

    a {
      color: var(--accent-deep);
      text-decoration-color: var(--rule-strong);
      text-underline-offset: 3px;
    }
  }

  // Links — the "Home intro links" menu location
  .links ul {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 20px;
    margin-top: 22px;
    list-style: none;
  }

  .links a {
    display: block; // a flex item in the template — same height inside an li
    font-size: 14.5px;
    color: var(--ink-soft);
    text-decoration: none;
    border-bottom: 1px solid var(--rule-strong);
    padding-bottom: 3px;
    transition: color 0.28s ease, border-color 0.28s ease;

    &:hover {
      color: var(--accent-deep);
      border-color: var(--accent);
    }
  }

  // Author photo — on the right, as tall as the text block (heading to links);
  // a small square above the text on phones.
  // The img is absolute, so its own aspect ratio cannot push the height up —
  // the wrapper stretches to the text's height only
  .min-intro-photo {
    position: relative;
    flex-shrink: 0;
    align-self: stretch;
    width: 180px;
    min-height: 150px;
    margin-top: 6px; // matches the h1's half-leading above its first line

    img {
      position: absolute;
      inset: 0;
      width: 100%;
      height: 100%;
      border-radius: var(--radius-md);
      object-fit: cover;
      display: block;
      padding: 4px;
      background: var(--ring-grad);
      box-shadow: var(--shadow-soft);
      filter: var(--img-filter);
    }

    @include below(mobile) {
      order: -1;
      width: 104px;
      height: 104px;
      min-height: 0;
      margin-top: 0;

      img {
        padding: 3px;
        border-radius: 14px;
      }
    }
  }
}
