.ac27-themes {
  padding: 88px 0 78px;
  overflow: hidden;
  color: #24334b;
  background: #fcfcfa;
}

.ac27-themes [hidden] { display: none !important; }

.ac27-themes-heading {
  display: grid;
  grid-template-columns: 1fr 1.05fr;
  align-items: end;
  gap: 48px;
  margin-bottom: 44px;
}

.ac27-themes-heading h2 {
  margin: 0;
  font-family: var(--studio-display, "Noto Serif JP", "Yu Mincho", serif);
  font-size: clamp(28px, 3vw, 38px);
  font-weight: 600;
  line-height: 1.65;
  letter-spacing: -.035em;
}

.ac27-themes-heading > p {
  margin: 0 0 4px;
  padding-left: 28px;
  border-left: 1px solid #c9bdd7;
  color: #526078;
  font-size: 14px;
  line-height: 2;
}

.ac27-gallery-group + .ac27-gallery-group { margin-top: 38px; }

.ac27-gallery-group-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 15px;
}

.ac27-gallery-group-heading h3 {
  margin: 0;
  font-family: var(--studio-display, "Noto Serif JP", "Yu Mincho", serif);
  font-size: 21px;
  font-weight: 600;
  line-height: 1.6;
  letter-spacing: .025em;
}

.ac27-gallery-controls {
  display: flex;
  flex: none;
  align-items: center;
  gap: 8px;
}

.ac27-gallery-controls button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border: 1px solid #d1c8dc;
  border-radius: 50%;
  background: #fff;
  color: #624b78;
  font: inherit;
  cursor: pointer;
}

.ac27-gallery-controls .ac27-gallery-arrow {
  width: 44px;
  padding: 0;
  font-size: 20px;
}

.ac27-gallery-controls .ac27-gallery-auto {
  margin-right: 8px;
  padding: 8px 4px;
  border: 0;
  border-radius: 0;
  background: transparent;
  font-size: 12px;
  line-height: 1.5;
  text-underline-offset: 4px;
}

.ac27-gallery-controls button:hover:not(:disabled) {
  border-color: #836f97;
  background-color: #f3eff7;
}

.ac27-gallery-controls .ac27-gallery-auto:hover:not(:disabled) {
  background: transparent;
  text-decoration: underline;
}

.ac27-gallery-controls button:disabled {
  opacity: .42;
  cursor: default;
}

.ac27-gallery-controls button:focus-visible,
.ac27-gallery-track:focus-visible {
  outline: 3px solid #695382;
  outline-offset: 4px;
}

.ac27-gallery-track {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 270px;
  align-items: stretch;
  gap: 18px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x proximity;
  scroll-padding-inline: 0;
  scrollbar-width: thin;
  scrollbar-color: #c3b6d1 #eeebf2;
  padding: 4px 46px 16px 0;
  -webkit-overflow-scrolling: touch;
}

.ac27-gallery-track::-webkit-scrollbar { height: 5px; }
.ac27-gallery-track::-webkit-scrollbar-track { background: #eeebf2; }
.ac27-gallery-track::-webkit-scrollbar-thumb { background: #c3b6d1; border-radius: 5px; }

.ac27-gallery-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
  padding: 20px 23px 24px;
  border: 1px solid #e4dfe9;
  border-radius: 3px;
  background: #fff;
  scroll-snap-align: start;
}

.ac27-gallery-art {
  display: block;
  flex: none;
  width: 110px;
  height: 110px;
  margin: 0 auto 13px;
  background-repeat: no-repeat;
}

.ac27-gallery-art--core {
  background-image: url("/studio-assets/academy-theme-sprite.png");
  background-size: 300% 200%;
}

.ac27-gallery-art--extra {
  background-image: url("/studio-assets/academy-theme-extra.png");
  background-size: 400% 300%;
}

.ac27-gallery-card h4 {
  width: 100%;
  min-height: 54px;
  margin: 0 0 8px;
  color: #24334b;
  font-size: 17px;
  font-weight: 600;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.ac27-gallery-card > p {
  margin: 0;
  color: #526078;
  font-size: 13px;
  line-height: 1.9;
  overflow-wrap: anywhere;
}

.ac27-gallery-status {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

@media (max-width: 760px) {
  .ac27-themes { padding: 58px 0 54px; }
  .ac27-themes-heading { grid-template-columns: 1fr; gap: 20px; margin-bottom: 30px; }
  .ac27-themes-heading > p { padding-left: 17px; font-size: 13px; }
  .ac27-gallery-group + .ac27-gallery-group { margin-top: 30px; }
  .ac27-gallery-group-heading { flex-wrap: wrap; gap: 8px 15px; margin-bottom: 11px; }
  .ac27-gallery-group-heading h3 { font-size: 19px; }
  .ac27-gallery-controls { margin-left: auto; }
  .ac27-gallery-controls .ac27-gallery-auto { font-size: 11px; margin-right: 2px; }
  .ac27-gallery-controls .ac27-gallery-arrow { width: 44px; }
  .ac27-gallery-track { grid-auto-columns: 240px; gap: 14px; padding-right: 34px; }
  .ac27-gallery-card { padding: 17px 20px 22px; }
  .ac27-gallery-art { width: 104px; height: 104px; margin-bottom: 12px; }
  .ac27-gallery-card h4 { min-height: 51px; font-size: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  .ac27-gallery-track { scroll-behavior: auto; }
}
