/* September public presentation layer. Loaded after the existing custom CSS. */
/* Shared on every public page: reserve the mail control's full fixed lane.
   This must follow logo.css, whose tablet rule otherwise leaves only 24px. */
@media (min-width: 768px) {
  .header_fixed { box-sizing: border-box; min-width: 0; padding-right: calc(2% + 78px); gap: 24px; }
  .header_fixed .logo { flex-shrink: 0; }
  .header_fixed .navi { flex: 1; min-width: 0; }
  .header_fixed .navi > ul { justify-content: center; flex-wrap: wrap; gap: 0 clamp(10px, 1.5vw, 24px); font-size: clamp(12px, 1.2vw, 14px); letter-spacing: .08em; }
  .header_fixed .navi > ul > li { margin: 0; white-space: nowrap; }
}
[data-cms-grouped-text] { white-space: pre-line; }
.mv .mv_button a > [data-cms-field="ami-home-hero-line-label"] { display: block; width: 102px; text-align: center; white-space: pre-line; font-size: 13px; line-height: 1.5; letter-spacing: 0.03em; }
.ami-instagram__posts { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(12px, 2vw, 24px); align-items: start; padding-block: 24px; }
.ami-instagram__post { width: 100%; min-width: 0; }
.ami-instagram__posts:focus-visible { outline: 2px solid #17677f; outline-offset: 4px; }
.ami-instagram__post .instagram-media { box-sizing: border-box; width: 100% !important; min-width: 0 !important; margin: 0 !important; }
.ami-instagram__post iframe.instagram-media { position: static !important; max-width: 100% !important; }
.ami-instagram__post iframe.instagram-media[height="0"] { display: none !important; }
.ami-instagram__post blockquote { padding: 28px; background: #f3f9fb; border: 1px solid #d5e8ee; line-height: 1.8; }
.ami-instagram__post blockquote > a { display: block; font-weight: 700; }
.ami-instagram__post time { display: block; margin-block: 16px; font-size: 13px; color: #52676f; }
.mv .mv_txt .ami-hero-vertical,
.top_about .catch .ami-profile-vertical {
  box-sizing: border-box;
  margin: 0;
  color: #163d4d;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 8px 22px rgba(18, 51, 67, 0.12);
  font-family: "Noto Sans JP", "Hiragino Kaku Gothic ProN", "Yu Gothic", sans-serif;
  font-weight: 700;
  letter-spacing: 0.12em;
  line-height: 1.7;
  text-align: start;
  white-space: pre-line;
  writing-mode: vertical-rl;
  text-orientation: mixed;
}

.mv .mv_txt .ami-hero-vertical {
  width: 100%;
  min-height: 225px;
  padding: 15px 13px;
  font-size: clamp(0.9rem, 1.32vw, 1.08rem);
}

.top_about .catch .ami-profile-vertical {
  width: max-content;
  max-width: 100%;
  min-height: 0;
  margin: 0 0 0 auto;
  padding: 0;
  background: none;
  box-shadow: none;
  color: #17677f;
  font-size: clamp(1.15rem, 2vw, 1.7rem);
  line-height: 1.75;
}

/* Keep longer edited biographies in flow, with the message on the right. */
.section_top_about .top_about {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(200px, 1fr);
  grid-template-areas: "bio message" "bio cat";
  gap: 36px clamp(40px, 7vw, 100px);
  align-items: start;
}
.section_top_about .top_about .desc { grid-area: bio; width: 100%; height: auto !important; }
.section_top_about .top_about .catch { grid-area: message; width: 100%; height: auto !important; padding-right: clamp(16px, 3vw, 48px); }
.section_top_about .top_about .shirokuma { grid-area: cat; width: 100%; height: auto !important; }

.ami-home-profile-copy,
.mako-profile-prose .ami-profile-bio {
  white-space: pre-line;
}

/* A square frame gives the full portrait 50% more height without cropping. */
.contents_kurashi.big .img.ami-learning-portrait-frame {
  display: grid;
  aspect-ratio: 1;
  /* The vertical label starts above the portrait (-20px / -15px).
     Keep its hashtag visible; the contained image does not need clipping. */
  overflow: visible;
  background: #eaf5f8;
}

.contents_kurashi.big .img.ami-learning-portrait-frame .ami-learning-portrait {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  object-fit: contain;
  object-position: center;
}

.ami-instagram {
  box-sizing: border-box;
  padding: 96px 0;
  background: #edf7fa;
}

.ami-instagram__inner {
  box-sizing: border-box;
  width: min(92%, 1040px);
  margin: 0 auto;
  padding: clamp(20px, 3vw, 40px);
  border: 1px solid rgba(23, 103, 127, 0.28);
  background: #fff;
}

.ami-instagram__eyebrow {
  margin: 0 0 12px;
  color: #3189a7;
  font-family: Roboto, sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.ami-instagram__title {
  margin: 0;
  color: #303030;
  font-size: clamp(1.7rem, 3.2vw, 3rem);
  letter-spacing: 0.07em;
  line-height: 1.45;
}

.ami-instagram__copy {
  max-width: 45ch;
  margin: 20px 0 0;
  color: #455157;
  font-size: 0.96rem;
  letter-spacing: 0.06em;
  line-height: 2;
}

.ami-instagram__posts {
  display: grid;
  min-height: 96px;
  margin: 34px 0 25px;
  border-block: 1px solid #d5e8ee;
  place-items: start stretch;
}

.ami-instagram__posts > p {
  margin: 0;
  color: #52676f;
  font-size: 0.88rem;
  letter-spacing: 0.05em;
  line-height: 1.8;
}

.ami-instagram__link,
.ami-newsletter-card {
  text-decoration: none;
}

.ami-instagram__link {
  display: inline-block;
  color: #17677f;
  font-family: "Noto Sans JP", sans-serif;
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0.09em;
}

.ami-instagram__link::after {
  content: "";
  display: block;
  width: 100%;
  height: 1px;
  margin-top: 7px;
  background: currentColor;
  transform-origin: left;
  transition: transform 160ms ease-out;
}

.ami-instagram__link:hover::after { transform: scaleX(0.58); }

.ami-events {
  box-sizing: border-box;
  padding: 112px 0;
  background: #fff;
}

.ami-events__inner {
  box-sizing: border-box;
  width: min(84%, 1200px);
  margin: 0 auto;
}

.ami-events__header {
  display: block;
  padding-bottom: 36px;
  border-bottom: 1px solid #303030;
}

.ami-events__eyebrow {
  grid-column: 1;
  margin: 0 0 13px;
  color: #3189a7;
  font-family: Roboto, sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.ami-events__title {
  grid-column: 1;
  margin: 0;
  color: #303030;
  font-size: clamp(1.8rem, 3vw, 3.15rem);
  letter-spacing: 0.08em;
  line-height: 1.42;
}

.ami-events__introduction {
  max-width: 38ch;
  margin: 18px 0 0;
  text-align: left;
  color: #52676f;
  font-size: 0.94rem;
  letter-spacing: 0.06em;
  line-height: 2;
}

/* This is deliberately empty until an editor creates a real event item. */
.ami-events__list {
  min-height: 132px;
}

.ami-events__list:empty {
  display: grid;
  place-items: center;
  border-bottom: 1px solid #d5e8ee;
}

.ami-events__empty {
  display: grid;
  min-height: 76px;
  border-bottom: 1px solid #d5e8ee;
  color: #52676f;
  place-items: center start;
}

.ami-events__empty p {
  margin: 0;
  font-size: 0.9rem;
  letter-spacing: 0.06em;
  line-height: 1.9;
}

.ami-events__list:has(.ami-events__item) {
  min-height: 0;
}

.ami-events__list:has(.ami-events__item) + .ami-events__empty {
  display: none;
}

.ami-events__item {
  border-bottom: 1px solid #d5e8ee;
}

.ami-events__item-link {
  display: grid;
  grid-template-columns: minmax(120px, 0.34fr) minmax(0, 1fr) 34px;
  gap: clamp(18px, 3vw, 46px);
  align-items: center;
  padding: 29px 0;
  color: inherit;
  text-decoration: none;
}

.ami-events__item-date,
.ami-events__item-location,
.ami-events__item-copy h3 {
  margin: 0;
}

.ami-events__item-date {
  color: #3189a7;
  font-family: Roboto, sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.ami-events__item-copy h3 {
  color: #303030;
  font-size: clamp(1.05rem, 1.7vw, 1.38rem);
  letter-spacing: 0.06em;
  line-height: 1.55;
}

.ami-events__item-location {
  margin-top: 8px;
  color: #52676f;
  font-size: 0.84rem;
  letter-spacing: 0.05em;
  line-height: 1.7;
}

.ami-events__item-arrow {
  color: #17677f;
  font-size: 1.3rem;
  transition: transform 160ms ease-out;
}

.ami-events__item-link:hover .ami-events__item-arrow,
.ami-events__item-link:focus-visible .ami-events__item-arrow {
  transform: translateX(5px);
}

.ami-events__item-link:focus-visible {
  outline: 3px solid #53c7e5;
  outline-offset: -3px;
}

.ami-newsletter-card {
  box-sizing: border-box;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  width: 160px;
  min-height: 160px;
  aspect-ratio: 1;
  align-content: center;
  padding: 8px;
  border: 1px solid rgba(49, 137, 167, 0.4);
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 12px 30px rgba(18, 51, 67, 0.18);
  color: #163d4d;
  position: fixed;
  top: auto;
  bottom: 24px;
  right: 20px;
  z-index: 2;
}

.ami-newsletter-card > img {
  width: 100%;
  height: 48px;
  margin-bottom: 4px;
  object-fit: cover;
  object-position: center;
}

.ami-newsletter-card__eyebrow,
.ami-newsletter-card__copy,
.ami-newsletter-card__cta,
.ami-newsletter-card__title {
  display: block;
}

.ami-newsletter-card__eyebrow {
  color: #3189a7;
  font-family: Roboto, sans-serif;
  font-size: 0.56rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.ami-newsletter-card__title {
  margin: 2px 0;
  color: #17677f;
  font-family: "Noto Sans JP", sans-serif;
  font-size: 0.86rem;
  font-weight: 700;
  line-height: 1.45;
  white-space: pre-line;
}

.ami-newsletter-card__copy {
  color: #52676f;
  font-size: 0.66rem;
  line-height: 1.5;
}

.ami-newsletter-card__cta {
  margin-top: 3px;
  color: #17677f;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.ami-newsletter-card:hover,
.ami-newsletter-card:focus-visible {
  border-color: #17677f;
  box-shadow: 0 15px 34px rgba(18, 51, 67, 0.25);
}

.ami-newsletter-card:focus-visible,
.ami-instagram__link:focus-visible {
  outline: 3px solid #53c7e5;
  outline-offset: 4px;
}

/* The footer repeats these links; avoid a collision on short displays. */
@media (min-width: 768px) and (max-height: 600px) {
  body:has(.ami-newsletter-card) .fixed_sns { display: none; }
}

@media (max-width: 767px) {
  .mv .mv_txt .ami-hero-vertical {
    min-height: 192px;
    padding: 13px 11px;
    font-size: 0.88rem;
  }

  .top_about .catch .ami-profile-vertical {
    width: max-content;
    min-height: 0;
    padding: 0;
    font-size: 1.25rem;
  }

  .section_top_about .top_about { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-areas: "cat message" "bio bio"; gap: 32px 20px; }
  .section_top_about .top_about .catch { margin: 0; padding-right: 0; }
  .section_top_about .top_about .shirokuma { align-self: end; }
  .section_top_about .top_about .shirokuma .img { width: 100%; }

  .contents_kurashi.big .img.ami-learning-portrait-frame {
    aspect-ratio: 1;
  }

  .ami-instagram { padding: 64px 0; }
  .ami-instagram__inner { width: calc(100% - 32px); padding: 28px 16px; }
  .ami-instagram__posts { display: flex; gap: 16px; min-height: 82px; margin-block: 28px 22px; overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory; scroll-padding-inline: 0; scrollbar-width: thin; -webkit-overflow-scrolling: touch; }
  .ami-instagram__post { flex: 0 0 80%; scroll-snap-align: start; }
  .ami-instagram__post blockquote { padding: 20px; }

  .ami-events { padding: 72px 0; }
  .ami-events__inner { width: calc(100% - 40px); }
  .ami-events__header { display: block; padding-bottom: 27px; }
  .ami-events__eyebrow { margin-bottom: 10px; }
  .ami-events__title { font-size: 1.7rem; }
  .ami-events__introduction { margin-top: 18px; }
  .ami-events__list { min-height: 112px; }
  .ami-events__empty { min-height: 70px; }
  .ami-events__item-link { grid-template-columns: 1fr 24px; gap: 12px; padding: 23px 0; }
  .ami-events__item-date { grid-column: 1; }
  .ami-events__item-copy { grid-column: 1; }
  .ami-events__item-arrow { grid-column: 2; grid-row: 1 / span 2; }

  /* Before events on phones, not between official channels and the footer. */
  .ami-newsletter-card {
    width: 160px;
    margin: 24px 20px 0 auto;
    position: static;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ami-instagram__link::after { transition: none; }
  .ami-events__item-arrow { transition: none; }
}

/* Keep the existing hero height while favouring faces in the upper frame. */
.mv .mv_slide .mv_slide_img img { object-position: center top; }
.top_works .slide_works_box a .img:has(img[src*="books-media-"]:not([src*="video"])) { padding-top: 0; aspect-ratio: 6 / 7; }
.top_works .slide_works_box a .img img[src*="books-media-"]:not([src*="video"]) { width: 100%; height: 100%; object-fit: contain; }
.ami-youtube-band { background: #f4f5f6; padding: 25px 24px; text-align: center; }
.ami-youtube-band a { display: inline-flex; align-items: center; gap: 12px; color: #353535; font-size: 24px; font-weight: 700; line-height: 1.4; }
.ami-youtube-band svg { width: 32px; height: 23px; flex: none; }
.ami-youtube-band a:hover { color: #007f9d; }
.ami-youtube-band a:focus-visible { outline: 3px solid #007f9d; outline-offset: 8px; border-radius: 3px; }
