/* v10.8 — image composition and responsive visual rhythm.
   Keep this after site.css; source illustrations use a 3:2 canvas. */
@media screen {
  .hero .hero-aside:has(.v5-service-image) {
    gap: 24px;
    min-width: 0;
  }

  .hero .hero-aside .v5-service-image {
    width: 100%;
    max-width: none;
    margin: 0;
    overflow: hidden;
    border-radius: 6px;
  }

  .hero .hero-aside .v5-service-image img {
    display: block;
    width: 100%;
    height: auto;
    max-height: none;
    aspect-ratio: 3 / 2;
    object-fit: contain;
    border-radius: inherit;
    background: transparent;
  }

  .hero .hero-aside:has(.v5-service-image) .factcard {
    min-width: 0;
    margin: 0;
  }

  .v9-city img {
    aspect-ratio: 3.2;
    object-position: 50% 52%;
    border-radius: 6px;
  }

  /* A quieter frame, with clear separation between the papers and caption. */
  .v6-language-art {
    min-width: 0;
    min-height: 342px;
    padding: 68px 30px 62px;
    border-radius: 6px;
    background: linear-gradient(145deg, #f1ede3, #e8ece2);
    overflow: hidden;
    isolation: isolate;
  }
  .v6-language-art .v6-paper {
    min-width: 0;
    min-height: 190px;
    padding: 20px 16px;
    box-shadow: 0 5px 16px #273b3310;
  }
  .v6-language-art .v6-paper-zh { transform: rotate(-4deg); }
  .v6-language-art .v6-paper-en { transform: rotate(4deg); }
  .v6-language-art > p { bottom: 17px; margin: 0; line-height: 1.5; }
  .v6-art-caption { top: 28px; }
  .v6-language-art .v6-translate-arrow { top: 50%; transform: translateY(-50%); }

  .qr img, .wx-in img, .ok-wx img {
    display: block;
    flex-shrink: 0;
    object-fit: contain;
    background: #fff;
  }
  .wx-in img { margin-left: auto; margin-right: auto; }
  .v5-quicknav a { display: block; flex: 0 0 auto; line-height: 28px; }

  /* Let narrow content columns shrink to the actual viewport. */
  .hero.solo > .wrap { grid-template-columns: minmax(0, 1fr); }
  .hero > .wrap > *, .trust li > div, .oitem,
  .v9-two-col > *, .v9-fee-list > a > div { min-width: 0; }
}

@media screen and (max-width: 480px) {
  .oi-top { flex-wrap: wrap; }
}

@media screen and (max-width: 370px) {
  .trust ul { grid-template-columns: minmax(0, 1fr); }
}

@media screen and (min-width: 761px) and (max-width: 1024px) {
  body:not(.home-page) .hero:has(.v5-service-image) > .wrap {
    grid-template-columns: minmax(0, 1fr);
    gap: 30px;
  }
  .hero .hero-aside:has(.v5-service-image) {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
    align-items: start;
    gap: 32px;
  }
  .hero .hero-aside:has(.v5-service-image) .factcard {
    grid-column: auto;
  }
  body:not(.home-page) .hero.v6-translation-hero > .wrap {
    grid-template-columns: minmax(0, 1fr) !important;
  }
  .v6-language-art { width: 100%; max-width: 520px; margin: 0 auto; }
}

@media screen and (max-width: 760px) {
  .hero .hero-aside:has(.v5-service-image) {
    display: flex;
    flex-direction: column;
    gap: 22px;
    align-items: stretch;
  }
  .hero .hero-aside .v5-service-image { align-self: stretch; }

  /* Keep the city photograph close to the introduction on a small screen. */
  .v9-hero > .wrap { display: flex; flex-direction: column; }
  .v9-hero-top { display: contents; }
  .v9-hero-top > div:first-child { order: 0; padding-top: 32px; }
  .v9-hero .v9-city { order: 1; margin: 28px 0 0; }
  .v9-city img { aspect-ratio: 2.1; object-position: 50% 54%; }
  .v9-city figcaption { margin: 0; padding: 11px 0; border-bottom: 0; }
  .v9-hero-office {
    order: 2;
    margin: 14px 0 0;
    padding: 22px 0 28px;
  }
  .v9-hero-office .v9-phone { margin-top: 3px; }

  .v6-language-art {
    min-height: 294px;
    padding: 62px 20px 56px;
    max-width: 480px;
  }
  .v6-language-art .v6-paper { min-height: 172px; padding: 16px 12px; }
  .v6-language-art .v6-paper b { margin: 10px 0; }
  .v6-language-art .v6-paper-en b { font-size: clamp(21px, 6vw, 27px); }
  .v6-language-art .v6-translate-arrow { width: 40px; height: 40px; font-size: 25px; box-shadow: 0 0 0 5px #e8e9df; }
  .v6-art-caption { top: 25px; }
}
