/*
 * 公開側 top page (welcome/index.html.erb)。
 *
 * inline style 排除のため、`_supporter.html.erb` iframe と `_news_list`
 * placeholder div は専用 class (`.speakerdeck-iframe` /
 * `.top-news-list__placeholder`) に分離してある。
 */

/* =====================================================
   共通: top page wrapper
===================================================== */
.top {
  overflow-x: hidden;
}

.top-section {
  width: 75vw;
  margin: 15rem auto 5rem auto;
}

.top-section h2 {
  display: inline-block;
  font-size: 50px;
  font-style: italic;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  position: relative;
}

.top-section h2::after {
  font-size: 14px;
  color: rgb(150, 150, 150);
  position: absolute;
  bottom: 0;
  left: 0;
}

.top-section .top-section-title-news::after {
  content: "ニュース";
}

.top-section .top-section-title-about::after {
  content: "JASDLについて";
}

.top-section .top-section-title-service::after {
  content: "連盟組織について";
}

@media (max-width: 959px) {
  .top-section {
    margin: 7rem auto;
  }
}

@media (max-width: 519px) {
  .top-section {
    width: 90vw;
  }

  .top-section h2 {
    font-size: 40px;
  }
}

@media (min-width: 520px) and (max-width: 959px) {
  .top-section {
    width: 85vw;
  }
}

.first-section {
  margin-top: 10rem;
}

@media (max-width: 959px) {
  .first-section {
    margin-top: 5rem;
  }
}

/* =====================================================
   Page top (hero swiper)
===================================================== */
.top_swiper {
  height: 100dvh;
  cursor: pointer;
}

.top_swiper .swiper-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  height: auto;
}

.top_swiper .swiper-slide.no-fade {
  transition: none !important;
}

.top_swiper .swiper-slide.with-fade {
  transition: opacity 1s ease;
}

.top_swiper .top-img-vision {
  position: absolute;
  bottom: 1.5rem;
  right: 3%;
  text-align: right;
  font-size: 50px;
  font-weight: 900;
  color: rgb(255, 255, 255);
  text-shadow: 3px 3px 0px rgba(0, 0, 0, 1);
  z-index: 10;
}

@media (max-width: 959px) {
  .top_swiper {
    height: 35vh;
  }
}

@media (max-width: 519px) {
  .top_swiper {
    margin-top: 80px;
  }

  .top_swiper .top-img-vision {
    bottom: 1.4rem;
    font-size: 22px;
    line-height: 1.4;
    text-shadow: 1.5px 1.5px 0px rgba(0, 0, 0, 1);
  }
}

@media (min-width: 520px) and (max-width: 959px) {
  .top_swiper {
    margin-top: 100px;
  }

  .top_swiper .top-img-vision {
    font-size: 35px;
    text-shadow: 2px 2px 0px rgba(0, 0, 0, 1);
  }
}

/* =====================================================
   News (ul.top-news-list)
===================================================== */
.top-news-list {
  width: 100%;
  margin: 0 auto;
  padding-left: 10rem;
}

.top-news-list li {
  list-style: none;
  margin-left: 1rem;
  margin-bottom: 2.5rem;
  transition: all 0.2s;
}

.top-news-list li:hover {
  opacity: 0.5;
  transition: all 0.2s;
}

/* news 0 件時のレイアウト落ち防止 spacer (旧 inline `style="height:124px"` を class 化)。 */
.top-news-list__placeholder {
  list-style: none;
  height: 124px;
  margin: 0;
}

@media (max-width: 959px) {
  .top-news-list {
    padding-left: 2rem;
  }

  .top-news-list li {
    margin-bottom: 2rem;
  }
}

@media (max-width: 519px) {
  .top-news-list {
    margin: 1.5rem auto;
    padding-left: 1rem;
  }

  .top-news-list li {
    margin-left: 0;
    margin-bottom: 2rem;
  }
}

/* =====================================================
   MVV (top-vision)
===================================================== */
.top-vision {
  width: 90%;
  text-align: center;
  margin: 2rem auto 4rem auto;
}

.top-vision h3 {
  font-size: 35px;
  margin-bottom: 4rem;
}

.top-vision p {
  text-align: left;
}

@media (max-width: 519px) {
  .top-vision {
    margin: 2rem auto;
  }

  .top-vision h3 {
    font-size: 25px;
    margin-bottom: 1.5rem;
    line-height: 1.3;
  }

  .top-vision p {
    font-size: 12px;
  }
}

@media (min-width: 520px) and (max-width: 959px) {
  .top-vision h3 {
    font-size: 30px;
    margin-bottom: 2rem;
  }

  .top-vision p {
    font-size: 14px;
  }
}

.vision-section {
  position: relative;
  z-index: 10;
}

.vision-section::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100vw;
  height: 100%;
  background: linear-gradient(180deg, rgba(235, 235, 235, 0) 0%, rgba(235, 235, 235, 0.5) 7%, rgba(235, 235, 235, 1) 25%, rgba(240, 240, 240, 1));
  box-shadow: 0 20px 20px 0 rgba(200, 200, 200, 0.5);
  padding: 5rem 0;
  z-index: -1;
}

@media (max-width: 519px) {
  .vision-section::before {
    padding: 2rem 0;
  }
}

/* =====================================================
   連盟組織図 (fed-tree)
   JASDL(頂点) -> JHSDL / JUSDL / JCSDL(子) の org chart。
   線は全て ::before/::after の装飾(セマンティクスは list 構造のみ)。
   desktop は CSS Grid で中央寄せ、mobile/tablet は左スパインの
   file-tree(├─ / └─)に再構成する。
   ※ロゴ SVG は image_tag 直叩き(logo_picture は PNG variant 専用)。
===================================================== */
.fed-tree {
  margin-top: 3rem;
}

.fed-tree-children {
  position: relative;
  list-style: none;
  margin: 0;
  padding: 0;
}

/* --- 頂点ノード(JASDL) --- */
.fed-tree-apex {
  position: relative;
  display: flex;
  justify-content: center;
}

.fed-apex-logo {
  display: block;
  width: 200px;
  max-width: 60vw;
  height: auto;
  padding: 1.25rem 1.5rem;
  border: 1px solid rgb(225, 225, 225);
  border-radius: 0.5rem;
  background: rgb(255, 255, 255);
}

/* --- 子カード(リンク) --- */
.fed-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  padding: 1.5rem 1.25rem;
  border: 1px solid rgb(225, 225, 225);
  border-radius: 0.5rem;
  background: rgb(255, 255, 255);
  text-decoration: none;
  color: rgb(0, 0, 0);
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.fed-card:hover,
.fed-card:focus-visible {
  border-color: rgb(150, 150, 150);
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
}

.fed-card:focus-visible {
  outline: 2px solid rgb(50, 50, 50);
  outline-offset: 3px;
}

.fed-card-logo {
  display: block;
  width: 180px;
  max-width: 70%;
  height: auto;
}

.fed-card-name {
  font-size: 14px;
  letter-spacing: 0.02em;
  text-align: center;
  color: rgba(50, 50, 50, 0.8);
}

/* 図の下のビジョン訴求文。図とは独立した読み物なので幅を絞って中央寄せ。 */
.fed-tree-note {
  margin: 3rem auto 10rem auto;
  font-size: 15px;
  line-height: 2;
  color: rgba(50, 50, 50, 0.85);
}

@media (max-width: 519px) {
  .fed-tree-note {
    margin-top: 1.5rem;
    font-size: 14px;
    line-height: 1.9;
  }
}

/* ---------------------------------------------------------------------
   DESKTOP(>=960): 中央寄せ org chart
   親ドロップ → 横バス → 各カード中央への縦ドロップ。
   Grid repeat(3,1fr) で各トラック中央 = カード中央を保証する。
   --------------------------------------------------------------------- */
@media (min-width: 960px) {
  /* 親 → 横バスへ下りる縦ドロップ */
  .fed-tree-apex::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    height: 2.5rem;
    background: rgb(210, 210, 210);
  }

  .fed-tree-children {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    margin-top: 2.5rem;
    padding-top: 2.5rem;
  }

  /* 横バス: 両端を最初/最後のカード中心に合わせる。
     トラック幅 = (100% - 2*gap)/3、その半分のインセット = (100% - 2*gap)/6。 */
  .fed-tree-children::before {
    content: "";
    position: absolute;
    top: 0;
    left: calc((100% - 2 * 2rem) / 6);
    right: calc((100% - 2 * 2rem) / 6);
    height: 2px;
    background: rgb(210, 210, 210);
  }

  /* 各カード中央へ下りる縦ドロップ */
  .fed-tree-child {
    position: relative;
  }

  .fed-tree-child::before {
    content: "";
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    height: 2.5rem;
    background: rgb(210, 210, 210);
  }
}

/* ---------------------------------------------------------------------
   MOBILE + TABLET(<=959): 左スパインの file-tree(├─ / └─)
   各子が「上端 → 自分のエルボー(top:2.5rem)」の縦セグメントを ::after で
   描く。最後以外はさらに gap 分まで延長して連続させ、最後の子はエルボーで
   止めて └ にする(背景マスクを使わないので section 背景に依存しない)。
   --------------------------------------------------------------------- */
@media (max-width: 959px) {
  .fed-tree-apex {
    justify-content: flex-start;
  }

  /* 親 → スパイン上端への縦ドロップ */
  .fed-tree-apex::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 1.25rem;
    width: 2px;
    height: 1.5rem;
    background: rgb(210, 210, 210);
  }

  .fed-tree-children {
    margin-top: 1.5rem;
    padding-left: 3rem;
  }

  .fed-tree-child {
    position: relative;
    padding: 0.75rem 0;
  }

  .fed-tree-child + .fed-tree-child {
    margin-top: 1.25rem;
  }

  /* 横エルボー(─): スパインから各カードへ。left = -3rem(padding) + 1.25rem(spine) */
  .fed-tree-child::before {
    content: "";
    position: absolute;
    top: 2.5rem;
    left: -1.75rem;
    width: 1.75rem;
    height: 2px;
    background: rgb(210, 210, 210);
  }

  /* 縦スパイン: 全子が上端 → 自分のエルボーまで描く(これで最後の子は └ で停止)。 */
  .fed-tree-child::after {
    content: "";
    position: absolute;
    top: 0;
    height: 2.5rem;
    left: -1.75rem;
    width: 2px;
    background: rgb(210, 210, 210);
  }

  /* 最後以外は gap を越えて次の子の上端まで延長し、連続した縦線にする。 */
  .fed-tree-child:not(:last-child)::after {
    height: auto;
    bottom: -1.25rem;
  }

  /* 子カードは横並び(ロゴ + 名前)にして縦幅を節約 */
  .fed-card {
    flex-direction: row;
    align-items: center;
    gap: 1.25rem;
    text-align: left;
  }

  .fed-card-name {
    text-align: left;
  }
}

/* mobile のみロゴを少し縮める */
@media (max-width: 519px) {
  .fed-apex-logo {
    width: 160px;
  }

  .fed-card-logo {
    width: 130px;
  }
}

/* =====================================================
   Instagram embed slot
   2 個の wrapper が必要なため id ではなく class .ig-wrapper を使う。
===================================================== */
.top-service-ig {
  display: flex;
  justify-content: space-around;
  width: 100vw;
  margin: 0 -12.5vw;
}

.top-service-ig .ig {
  width: 35vw;
  padding: 1%;
  margin: 0 auto;
  font-family: -apple-system, "system-ui", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 14px;
  line-height: 14px;
  background: rgb(255, 255, 255);
  border-radius: 3px;
  border: 1px solid rgb(219, 219, 219);
}

.top-service-ig .ig .account_data {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  color: rgb(0, 0, 0);
  box-sizing: border-box;
  padding: 10px;
  border-bottom: 1px solid rgb(219, 219, 219);
}

.top-service-ig .ig .account_data .ig_link {
  background-color: rgb(0, 149, 246);
  border-radius: 3px;
  color: rgb(255, 255, 255);
  font-weight: 600;
  margin-left: 10px;
  padding: 5px 12px;
  line-height: 18px;
  transition: all 0.2s;
}

.top-service-ig .ig .account_data .ig_link:hover {
  background-color: rgb(0, 116, 204);
  transition: all 0.2s;
}

.top-service-ig .ig .account_data .account_profile {
  display: flex;
  flex-direction: row;
}

.top-service-ig .ig .account_data .account_profile .profile_img {
  align-items: center;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 2px;
  transition: all 0.2s;
}

.top-service-ig .ig .account_data .account_profile .profile_img img {
  width: 50px;
  height: 50px;
  border-radius: 50%;
}

.top-service-ig .ig .account_data .account_profile .profile_img:hover {
  opacity: 0.5;
  transition: all 0.2s;
}

.top-service-ig .ig .account_data .account_profile .profile_data {
  display: flex;
  flex-direction: column;
  align-self: center;
  flex-grow: 1;
  flex-shrink: 1;
  margin: 0 10px;
}

.top-service-ig .ig .account_data .account_profile .profile_data .ig_id {
  font-weight: 600;
  line-height: 18px;
  transition: all 0.2s;
}

.top-service-ig .ig .account_data .account_profile .profile_data .ig_id:hover {
  text-decoration: underline;
  transition: all 0.2s;
}

.top-service-ig .ig .account_data .account_profile .profile_data .follower {
  font-size: 12px;
  color: rgb(115, 115, 115);
}

.top-service-ig .ig ul {
  box-sizing: border-box;
  display: flex;
  flex-flow: row wrap;
  justify-content: space-between;
  padding: 0;
  margin: 0;
}

.top-service-ig .ig ul li {
  list-style: none;
  width: 32.75%;
  aspect-ratio: 3 / 4;
  position: relative;
  margin: 0.5% 0;
}

.top-service-ig .ig ul li .captionTxt {
  display: block;
  width: 100%;
  height: 100%;
  padding: 1rem;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 14px;
  line-height: 18px;
  text-align: left;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: rgba(0, 0, 0, 0.75);
  color: #fff;
  opacity: 0;
  transition: 0.5s opacity, 0.25s filter;
}

.top-service-ig .ig ul li :hover .captionTxt {
  transition: 0.5s opacity, 0.25s filter;
  opacity: 1;
}

.top-service-ig .ig ul li img {
  object-fit: cover;
  width: 100%;
  max-height: 100%;
  position: absolute;
  top: 50%;
  left: 0;
  transform: translateY(-50%);
}

.top-service-ig .ig ul li::before {
  content: "";
  padding-top: 100%;
  display: block;
}

.top-service-ig .ig p {
  color: rgba(0, 0, 0, 0.7);
  margin: 1rem auto;
}

.top-service-ig #ig_all_japan ul li {
  background-color: rgb(0, 0, 0);
}

.top-service-ig #ig_mcd ul li {
  background-color: rgb(255, 255, 255);
}

@media (max-width: 519px) {
  .top-service-ig {
    flex-direction: column;
    justify-content: center;
    margin: 0 -5vw;
  }

  .top-service-ig .ig {
    width: 90vw;
    font-size: 12px;
    line-height: 12px;
    margin: 1rem auto 0.5rem auto;
  }

  .top-service-ig .ig .account_data {
    padding: 5px;
  }

  .top-service-ig .ig .account_data .ig_link {
    border-radius: 2px;
    padding: 5px 8px;
    line-height: 10px;
  }

  .top-service-ig .ig .account_data .account_profile .profile_img img {
    width: 40px;
    height: 40px;
  }

  .top-service-ig .ig .account_data .account_profile .profile_data {
    margin: 0 6px;
  }

  .top-service-ig .ig .account_data .account_profile .profile_data .ig_id {
    line-height: 14px;
  }

  .top-service-ig .ig .account_data .account_profile .profile_data .follower {
    font-size: 10px;
  }

  .top-service-ig .ig ul li .captionTxt {
    padding: 0.5rem;
    font-size: 8px;
    line-height: 8px;
  }
}

@media (min-width: 520px) and (max-width: 959px) {
  .top-service-ig {
    margin: 0 -7.5vw;
  }

  .top-service-ig .ig {
    width: 47.5vw;
  }
}

/* =====================================================
   Supporter (SpeakerDeck iframe + CTA)
   `_supporter.html.erb` iframe の旧 inline style (border / background /
   margin / padding / border-radius / box-shadow / height / aspect-ratio)
   は CSP 対応のため `.speakerdeck-iframe` に集約してある。
===================================================== */
.supporter-section {
  width: 100vw;
  margin: 0;
  padding: 3rem 0;
  background-color: rgb(75, 75, 75);
  color: rgb(248, 248, 248);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.supporter-section h3 {
  font-style: italic;
  font-size: 26px;
  text-shadow: 3px 3px 3px rgba(0, 0, 0, 1);
  padding-bottom: 1.5rem;
}

.supporter-section .supporter-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-around;
  align-content: space-around;
  padding: 0 1rem;
}

.supporter-section .supporter-list li {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 5rem;
  width: 12.5rem;
  background-color: rgb(248, 248, 248);
  margin: 1rem 0.2rem;
}

.supporter-section .supporter-list li span {
  height: 80%;
  width: 80%;
  background-repeat: no-repeat;
  background-size: contain;
  background-position: center center;
}

/* 4 supporter logo background-image declarations。Propshaft の `CssAssetUrls`
   が `url("/clients/<name>_logo.png")` を fingerprint 付き URL に compile-time
   で書き換える。selector は `.supporter-section .supporter-list li > span`
   階層配下の `.<name>-logo`。 */
.supporter-section .supporter-list li .lotte-hd-logo {
  background-image: url("/assets/clients/lotte_hd_positive-ac9e9573.svg");
}

.supporter-section .supporter-list li .lotte-logo {
  background-image: url("/assets/clients/lotte_positive-08251d3d.svg");
}

.supporter-section .supporter-list li .torei-logo {
  background-image: url("/assets/clients/torei_positive-ca287a5a.svg");
}

.supporter-section .supporter-list li .spotify-logo {
  background-image: url("/assets/clients/spotify_positive-dae22f47.svg");
}

.supporter-section .supporter-viewmore {
  text-decoration: none;
  padding: 0.75rem 3rem;
  margin: 3rem auto;
  font-size: 18px;
  color: rgb(50, 50, 50);
  background-color: rgb(248, 248, 248);
  box-shadow: 2px 2px 5px rgb(50, 50, 50), -2px -2px 5px rgb(75, 75, 75);
  border-radius: 0.1rem;
  position: relative;
  transition: all 0.1s;
}

.supporter-section .supporter-viewmore span {
  font-weight: 600;
}

/* Heroicons solid chevron-right を SVG mask-image で描画。
   `background-color: currentColor` + mask-image により parent の `color`
   (default rgb(50,50,50) / hover rgb(248,248,248)) を icon の塗り色に継承。 */
.supporter-section .supporter-viewmore::after {
  content: "";
  display: block;
  width: 1em;
  height: 1em;
  background-color: currentColor;
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill-rule='evenodd' d='M16.28 11.47a.75.75 0 0 1 0 1.06l-7.5 7.5a.75.75 0 0 1-1.06-1.06L14.69 12 7.72 5.03a.75.75 0 0 1 1.06-1.06l7.5 7.5Z' clip-rule='evenodd'/%3E%3C/svg%3E");
          mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill-rule='evenodd' d='M16.28 11.47a.75.75 0 0 1 0 1.06l-7.5 7.5a.75.75 0 0 1-1.06-1.06L14.69 12 7.72 5.03a.75.75 0 0 1 1.06-1.06l7.5 7.5Z' clip-rule='evenodd'/%3E%3C/svg%3E");
  -webkit-mask-size: contain;
          mask-size: contain;
  -webkit-mask-repeat: no-repeat;
          mask-repeat: no-repeat;
  position: absolute;
  top: 50%;
  right: 0;
  transform: translate(-0.75rem, -50%);
  transition: all 0.1s;
}

.supporter-section .supporter-viewmore:hover {
  color: rgb(248, 248, 248);
  text-shadow: 1px 1px 0 rgb(0, 0, 0);
  background-color: rgb(150, 150, 150);
  transition: all 0.1s;
}

.supporter-section .supporter-viewmore:hover::after {
  transform: translate(-0.5rem, -50%);
}

/* SpeakerDeck iframe */
.supporter-section .speakerdeck-iframe {
  width: 70%;
  border: 0;
  background: padding-box padding-box rgba(0, 0, 0, 0.1);
  margin: 0;
  padding: 0;
  border-radius: 6px;
  box-shadow: rgba(0, 0, 0, 0.2) 0 5px 40px;
  height: auto;
  aspect-ratio: 560 / 315;
}

@media (max-width: 959px) {
  .supporter-section {
    padding: 2rem 0;
  }

  .supporter-section h3 {
    padding-bottom: 0.5rem;
  }

  .supporter-section .supporter-list {
    padding: 0 0.5rem;
  }

  .supporter-section .supporter-list li {
    height: 4rem;
    width: 10rem;
    margin: 0.5rem 0.2rem;
  }

  .supporter-section .speakerdeck-iframe {
    width: 90%;
  }
}

@media (max-width: 519px) {
  .supporter-section h3 {
    font-size: 20px;
  }

  .supporter-section .supporter-list li {
    height: 2.5rem;
    width: 7rem;
  }

  .supporter-section .supporter-viewmore {
    padding: 0.5rem 2rem;
    margin: 2rem auto;
    font-size: 14px;
  }
}

@media (min-width: 520px) and (max-width: 959px) {
  .supporter-section .supporter-list li {
    height: 4rem;
    width: 10rem;
  }
}

/* =====================================================
   View More link
===================================================== */
.view-more-link {
  text-align: right;
  font-size: 14px;
}

.view-more-link a {
  position: relative;
  padding: 0 1.5rem 0.3rem 1rem;
  transition: all 0.2s;
}

.view-more-link a::before,
.view-more-link a::after {
  content: "";
  position: absolute;
  top: 100%;
  height: 1px;
  background-color: rgb(150, 150, 150);
  transition: all 0.3s;
}

.view-more-link a::before {
  right: 0;
  width: 100%;
}

.view-more-link a::after {
  right: 0;
  width: 0.75rem;
  transform-origin: right bottom;
  transform: rotate(32deg);
}

.view-more-link a:hover {
  color: rgba(50, 50, 50, 0.7);
  transition: all 0.2s;
}

.view-more-link a:hover::before,
.view-more-link a:hover::after {
  top: 107%;
  right: -5%;
  opacity: 0.7;
  transition: all 0.3s;
}

.view-more-link a:hover::before {
  width: 105%;
}

.view-more-link a:hover::after {
  width: 1rem;
}

@media (max-width: 519px) {
  .view-more-link {
    font-size: 8px;
  }

  .view-more-link a {
    padding: 0 0.75rem 0.2rem 0.5rem;
  }

  .view-more-link a::after {
    width: 0.5rem;
  }

  .view-more-link a:hover::after {
    width: 0.75rem;
  }
}

