/*
 * main.css  ページのスタイル
 *
 * 色・フォント・幅などの共通値は setting.css の :root にあります。
 * ブレイクポイント: SP = (width < 768px) / PC = (width >= 768px)（イベント導入部の2カラムのみ 1024px）
 * フォントサイズの clamp() は「SP 390px 時 → PC 1440px 時」の値です（コメントの数値は px）。
 */

@layer base, components, utilities;

/* =============================
   Base
============================= */
@layer base {
  html {
    scroll-behavior: smooth;
    scroll-padding-top: var(--header-height);
  }

  body {
    font-family: var(--font-main);
    font-size: 1rem;
    line-height: 1.6;
    color: var(--color-text);
    background: var(--color-bg);
    -webkit-font-smoothing: antialiased;
    overflow-wrap: anywhere;
  }

  body.is-menu-open {
    overflow: hidden;
  }

  :focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 3px;
  }

  .skip-link {
    position: fixed;
    top: 8px;
    left: 8px;
    z-index: calc(var(--z-header) + 1);
    padding: 8px 16px;
    background: var(--color-bg);
    border: 1px solid var(--color-text);
    translate: 0 -200%;

    &:focus-visible {
      translate: 0;
    }
  }

  .container {
    width: min(100% - var(--gutter) * 2, var(--content-width));
    margin-inline: auto;
  }
}

@layer components {

  /* =============================
     Header
  ============================= */
  .header {
    position: sticky;
    top: 0;
    z-index: var(--z-header);
    display: flex;
    gap: 24px;
    align-items: center;
    justify-content: space-between;
    height: var(--header-height);
    padding-inline: clamp(16px, 7px + 2.29vw, 40px) clamp(16px, 2px + 4.57vw, 64px);
    background: var(--color-bg);
  }

  .header__logo {
    flex-shrink: 0;
    width: clamp(116px, 92px + 6.1vw, 180px);

    & img {
      width: 100%;
    }
  }

  /* --- メニューボタン（SP のみ表示） --- */
  .menu-button {
    position: relative;
    display: none;
    width: 32px;
    height: 32px;

    @media (width < 768px) {
      display: block;
    }
  }

  .menu-button__bar {
    position: absolute;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--color-text);
    border-radius: 1px;
    transition: translate 0.3s var(--ease), rotate 0.3s var(--ease), opacity 0.3s, width 0.3s;

    &:nth-child(1) {
      top: 6px;
    }

    &:nth-child(2) {
      top: 15px;
    }

    &:nth-child(3) {
      top: 24px;
      width: 70%;
    }
  }

  .menu-button[aria-expanded="true"] .menu-button__bar {
    &:nth-child(1) {
      translate: 0 9px;
      rotate: 45deg;
    }

    &:nth-child(2) {
      opacity: 0;
    }

    &:nth-child(3) {
      width: 100%;
      translate: 0 -9px;
      rotate: -45deg;
    }
  }

  /* --- ナビゲーション --- */
  .global-nav__list {
    display: flex;
    gap: clamp(12px, -10.9px + 2.98vw, 32px);
    /* 768px で 12 → 1440px で 32（項目が増えても折り返さないように） */
  }

  .global-nav__link {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: clamp(0.75rem, 0.607rem + 0.298vw, 0.875rem);
    /* 768px で 12 → 1440px で 14 */
    white-space: nowrap;
    font-weight: 500;
    letter-spacing: 0.02em;
    transition: translate 0.3s var(--ease);

    &:hover {
      translate: 0 -5px;
    }
  }

  .global-nav__ja {
    display: none;
  }

  .global-nav__en {
    font-family: var(--font-en);
    font-size: 0.88rem;
    font-weight: 500;
    line-height: 1.4;
    letter-spacing: 0.028em;
  }

  @media (width < 768px) {
    .global-nav {
      position: fixed;
      inset: var(--header-height) 0 0;
      z-index: var(--z-menu);
      display: grid;
      place-content: center;
      overflow-y: auto;
      visibility: hidden;
      background: var(--color-menu-bg);
      backdrop-filter: blur(6px);
      opacity: 0;
      transition: opacity 0.3s var(--ease), visibility 0.3s;
    }

    .is-menu-open .global-nav {
      visibility: visible;
      opacity: 1;
    }

    .global-nav__list {
      flex-direction: column;
      gap: 40px;
      padding-block: 40px;
    }

    .global-nav__en {
      display: block;
      font-family: var(--font-en);
      font-size: 1.5rem;
      font-weight: 900;
      line-height: 1.4;
      color: var(--color-primary);
      letter-spacing: 0.06em;
    }

    .global-nav__ja {
      display: block;
      font-size: 0.75rem;
      color: #fff;
    }
  }

  /* =============================
     Main Visual
  ============================= */
  .mv {
    margin-bottom: clamp(48px, 12px + 9.14vw, 144px);
    /* 48→144 */
  }

  .mv__img {
    width: 100%;
    aspect-ratio: 3 / 4;
    object-fit: cover;

    @media (width >=768px) {
      aspect-ratio: 16 / 9;
    }
  }

  /* =============================
     Section（共通）
  ============================= */
  .section+.section {
    margin-top: var(--space-section);
  }

  .section-head__period {
    font-size: clamp(0.75rem, 0.657rem + 0.381vw, 1rem);
    /* 12→16 */
    font-weight: 700;
    line-height: 1.4;
    color: var(--color-primary);
    letter-spacing: 0.08em;
  }

  .section-head__title {
    font-size: clamp(1.625rem, 1.25rem + 2.6vw, 3rem);
    /* 26→48（390px で約30） */
    font-weight: 700;
    line-height: 1.4;
    letter-spacing: 0.02em;
  }

  .section-head__lead {
    font-size: clamp(0.75rem, 0.704rem + 0.19vw, 0.875rem);
    /* 12→14 */
    font-weight: 500;
    line-height: 1.6;
    letter-spacing: 0.1em;
  }

  /* =============================
     Event
  ============================= */
  .event__intro {
    display: grid;
    gap: 40px;
    margin-bottom: var(--space-block);

    /* 見出し＋ピックアップの2カラムは、見出しが折り返さない 1024px 以上で */
    @media (width >=1024px) {
      grid-template-columns: minmax(0, 415fr) minmax(0, 800fr);
      column-gap: clamp(32px, 5.5vw, 80px);
      align-items: start;
    }
  }

  .event__head {
    display: grid;
    gap: 4px;

    @media (width >=1024px) {
      position: sticky;
      top: var(--header-height);
      gap: 8px;
      padding-top: clamp(0px, 10vw, 144px);
    }
  }

  /* --- ピックアップイベント --- */
  .feature-list {
    display: grid;
    gap: clamp(40px, 37px + 0.76vw, 48px);
  }

  .feature {
    display: grid;
    gap: 16px;
  }

  .feature__img {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
  }

  .feature__body {
    display: grid;
    gap: clamp(4px, 9px - 0.33vw, 8px);
    justify-items: start;
  }

  .feature__date {
    font-size: clamp(1rem, 0.861rem + 0.571vw, 1.375rem);
    /* 16→22 */
    font-weight: 600;
    line-height: 1.4;
    letter-spacing: 0.04em;
  }

  .feature__title {
    font-size: clamp(1.375rem, 0.957rem + 1.714vw, 2.5rem);
    /* 22→40 */
    font-weight: 700;
    line-height: 1.4;
    color: var(--color-primary);
    letter-spacing: 0.04em;
  }

  .feature__text {
    font-size: clamp(0.875rem, 0.829rem + 0.19vw, 1rem);
    /* 14→16 */
    line-height: 1.75;
    letter-spacing: 0.04em;
  }

  .feature__body .button {
    margin-top: clamp(8px, 5px + 0.76vw, 16px);
  }

  /* =============================
     Button
  ============================= */
  .button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: clamp(210px, 193px + 4.4vw, 256px);
    min-height: clamp(46px, 41px + 1.3vw, 59px);
    padding: 8px 14px;
    font-size: clamp(0.8125rem, 0.766rem + 0.19vw, 0.9375rem);
    /* 13→15 */
    font-weight: 700;
    line-height: 1.4;
    color: var(--color-accent);
    text-align: center;
    background: var(--color-bg);
    border: 1px solid var(--color-accent);
    border-radius: 32px;
    transition: color 0.3s, background-color 0.3s;

    &:hover {
      color: #fff;
      background: var(--color-accent);
    }
  }

  /* =============================
     Card（イベント・グルメ共通）
  ============================= */
  .card-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: clamp(24px, 18px + 1.52vw, 40px) clamp(16px, 10px + 1.52vw, 32px);
    align-items: start;

    @media (width >=768px) {
      grid-template-columns: repeat(3, minmax(0, 1fr));
    }
  }

  .card {
    display: grid;
    gap: 8px;
    justify-items: start;
  }

  .card__main {
    display: grid;
    gap: 6px;
    width: 100%;
  }

  .card__img {
    width: 100%;
    aspect-ratio: 16 / 9;
    margin-bottom: clamp(6px, 3px + 0.57vw, 10px);
    object-fit: contain;
    transition: opacity 0.3s;
  }

  a.card__main:hover .card__img {
    opacity: 0.75;
  }

  .card__date {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    justify-content: space-between;
    font-size: clamp(0.75rem, 0.704rem + 0.19vw, 0.875rem);
    /* 12→14 */
    font-weight: 600;
    line-height: 1.4;
    letter-spacing: 0.04em;
  }

  .card__tag {
    flex-shrink: 0;
    padding: 1px 8px;
    font-size: clamp(0.625rem, 0.579rem + 0.19vw, 0.75rem);
    /* 10→12 */
    font-weight: 500;
    color: #fff;
    background: var(--color-accent);
    border-radius: 4px;
  }

  .card__title {
    font-size: clamp(0.9375rem, 0.868rem + 0.286vw, 1.125rem);
    /* 15→18 */
    font-weight: 600;
    line-height: 1.5;
    letter-spacing: 0.04em;

    @media (width >=768px) {
      font-weight: 700;
    }
  }

  .card__text {
    font-size: clamp(0.8125rem, 0.789rem + 0.095vw, 0.875rem);
    /* 13→14 */
    line-height: 1.75;
    letter-spacing: 0.04em;
  }

  .card__price {
    margin-top: 2px;
    font-size: clamp(0.8125rem, 0.789rem + 0.095vw, 0.875rem);
    /* 13→14 */
    font-weight: 700;
    line-height: 1.4;
  }

  /* 開催場所（ピンアイコンは CSS で表示） */
  .card__place {
    display: inline-flex;
    gap: 2px;
    align-items: flex-start;
    font-size: clamp(0.625rem, 0.579rem + 0.19vw, 0.75rem);
    /* 10→12 */
    font-weight: 500;
    line-height: 1.6;
    color: var(--color-text-sub);

    &::before {
      flex-shrink: 0;
      width: 1.5em;
      height: 1.5em;
      content: "";
      background: currentcolor;
      mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7zm0 9.5a2.5 2.5 0 1 1 0-5 2.5 2.5 0 0 1 0 5z'/%3E%3C/svg%3E") center / contain no-repeat;
    }
  }

  /* 店舗リンクはホバーで薄くする（下線は付けない） */
  a.card__place:not([href="#"]) {
    transition: opacity 0.3s;

    &:hover {
      opacity: 0.7;
    }
  }

  /* =============================
     Gourmet
  ============================= */
  /* 見出しと説明文を左右に並べる（グルメ・キャンペーン・STAY・With BASEBALL） */
  .gourmet__head,
  .section-row-head {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 24px;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-heading);

    @media (width < 768px) {
      flex-direction: column;
      align-items: flex-start;
    }
  }

  /* 夏LP（2026/summer）由来のセクション（CAMPAIGN・STAY・With BASEBALL）の見出しは夏LPのサイズに合わせる */
  .section-row-head {
    row-gap: 11px;

    & .section-head__title {
      font-size: clamp(2rem, 1.629rem + 1.524vw, 3rem);
      /* 390px で 32 → 1440px で 48 */
      line-height: clamp(44.8px, 43.61px + 0.305vw, 48px);
      letter-spacing: 0.04em;
    }
  }

  /* CAMPAIGN のカード（共通カードとの差分だけ。夏LPに合わせる） */
  .campaign {
    & .card__img {
      margin-bottom: clamp(2px, 4.74px - 0.19vw, 4px);
    }

    & .card__date {
      line-height: clamp(15.6px, 14.11px + 0.381vw, 19.6px);
    }

    & .card__title {
      line-height: clamp(19.5px, 16.05px + 0.886vw, 28.8px);
    }

    & .card__text {
      line-height: clamp(22.1px, 20.95px + 0.295vw, 25.2px);
    }
  }

  /* =============================
     Stay
  ============================= */
  /* サイズは夏LP（2026/summer）の STAY に合わせている */
  .stay__link {
    display: flex;
    flex-direction: column;
    gap: clamp(24px, 22.5px + 0.38vw, 28px);
    align-items: center;
    /* 見出しから写真まで、夏LPと同じく画面幅によらず 68px あける */
    padding-top: calc(68px - var(--space-heading));

    &:hover .button {
      color: #fff;
      background: var(--color-accent);
    }
  }

  /* SP は縦に3枚、PC は横に3枚並べる */
  .stay__photos {
    display: grid;
    width: 100%;

    @media (width >=768px) {
      grid-template-columns: repeat(3, 1fr);
    }
  }

  .stay__img {
    width: 100%;
    aspect-ratio: 2 / 1;
    object-fit: cover;

    @media (width >=768px) {
      height: clamp(300px, 195px + 13.13vw, 384px);
      /* 800px で 300 → 1440px で 384 */
      aspect-ratio: auto;
    }
  }

  .stay__button {
    width: clamp(196px, 116.5px + 20.38vw, 410px);
    /* 390px で 196 → 1440px で 410 */
    min-height: clamp(56px, 54.9px + 0.29vw, 59px);
    /* 390px で 56 → 1440px で 59 */
  }

  /* =============================
     With BASEBALL
  ============================= */
  .baseball__list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: clamp(17px, 8.46px + 2.19vw, 40px) clamp(11px, 3.2px + 2vw, 32px);
    /* 390px で 17 / 11 → 1440px で 40 / 32（夏LPに合わせる） */

    @media (width < 768px) {
      grid-template-columns: repeat(2, 1fr);
    }
  }

  .baseball__link {
    display: block;
    transition: opacity 0.3s;

    &:hover {
      opacity: 0.7;
    }
  }

  /* 夏LPと同じく切り抜かず、バナーの縦横比のまま表示する */
  .baseball__img {
    width: 100%;
  }

  .baseball__team {
    display: block;
    width: clamp(176px, 129.94px + 11.81vw, 300px);
    /* 390px で 176 → 1440px で 300 */
    margin: clamp(20px, 10.34px + 2.48vw, 46px) auto 0;
    transition: opacity 0.3s;

    &:hover {
      opacity: 0.7;
    }
  }

  /* =============================
     Calendar
  ============================= */
  .calendar {
    padding: clamp(40px, 31px + 2.29vw, 64px) var(--gutter);
    margin-top: var(--space-section);
    overflow: hidden;
    background: var(--color-calendar-bg);
  }

  .calendar__title {
    margin-bottom: -0.2em;
    font-family: var(--font-en);
    font-size: clamp(1.75rem, 0.411rem + 7.543vw, 7.2rem);
    /* 36→115.2 */
    font-weight: 900;
    line-height: 1;
    color: #fff;
    text-align: center;
    letter-spacing: 0.08em;
    white-space: nowrap;
  }

  .calendar__frame {
    position: relative;
    width: min(100%, 922px);
    padding: clamp(24px, 15px + 2.29vw, 48px) clamp(16px, 0px + 4.57vw, 64px);
    margin-inline: auto;
    background: var(--color-bg);
    border-radius: 12px;
  }

  .calendar__body {
    min-height: 460px;
    /* 読み込み中の高さの変化（CLS）を抑える */
    font-size: 12px;
    font-weight: 700;

    /* FullCalendar の配色（昨年LPの設定を引き継ぎ） */
    --fc-border-color: #000;
    --fc-neutral-bg-color: transparent;
    --fc-button-bg-color: transparent;
    --fc-button-border-color: transparent;
    --fc-button-text-color: #000;
    --fc-button-hover-bg-color: transparent;
    --fc-button-hover-border-color: transparent;
    --fc-button-active-bg-color: transparent;
    --fc-button-active-border-color: transparent;
    --fc-small-font-size: 10px;
  }

  .calendar__status {
    padding-block: 40px;
    font-weight: 500;
    color: var(--color-text-sub);
    text-align: center;
  }

  /* =============================
     Footer
  ============================= */
  .footer {
    display: grid;
    gap: 64px;
    justify-items: center;
    padding: 64px var(--gutter) 32px;
  }

  .footer__button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: clamp(218px, 171px + 12.1vw, 345px);
    min-height: clamp(54px, 51px + 0.8vw, 62px);
    padding: 8px 18px;
    font-size: clamp(0.875rem, 0.829rem + 0.19vw, 1rem);
    /* 14→16 */
    font-weight: 700;
    background: var(--color-bg);
    border: 2px solid var(--color-text);
    border-radius: 32px;
    transition: color 0.3s, background-color 0.3s;

    &:hover {
      color: #fff;
      background: var(--color-text);
    }
  }

  .footer__copyright {
    font-size: 0.6875rem;
    font-weight: 500;
    text-align: center;
  }

  /* =============================
     Ticket Button（追従）
  ============================= */
  .ticket-button-wrap {
    position: fixed;
    right: clamp(6px, 0px + 1.71vw, 24px);
    bottom: clamp(8px, 2px + 1.52vw, 24px);
    z-index: var(--z-ticket);
    transition: opacity 0.3s var(--ease), translate 0.3s var(--ease);
  }

  .ticket-button {
    display: grid;
    place-content: center;
    width: clamp(160px, 153px + 1.9vw, 180px);
    min-height: clamp(54px, 53px + 0.3vw, 57px);
    padding: 6px 4px 8px;
    font-size: clamp(0.8125rem, 0.789rem + 0.095vw, 0.875rem);
    /* 13→14 */
    font-weight: 700;
    line-height: 1.4;
    color: #060606;
    text-align: center;
    letter-spacing: 0.04em;
    background: var(--color-ticket);
    border: 1px solid #000;
    border-radius: 37px;

    transition: translate 0.3s var(--ease);

    &:hover {
      translate: 0 -3px;
    }
  }

  /* JS 有効時はページ先頭では隠し、スクロール開始後に表示する */
  .js .ticket-button-wrap:not(.is-visible) {
    opacity: 0;
    pointer-events: none;
  }

  .js .is-menu-open .ticket-button {
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
  }

  /* =============================
     Animation（スクロールで表示）
     JS が有効なときだけ非表示 → 画面内に入ったら表示
  ============================= */
  .js .fadein {
    opacity: 0;
    translate: 0 24px;
    transition: opacity 0.8s var(--ease), translate 0.8s var(--ease);

    &.is-inview {
      opacity: 1;
      translate: 0;
    }
  }
}

/* =============================
   Calendar Library（FullCalendar / tippy.js の上書き）
   ライブラリが JS で読み込む CSS より優先させるため、@layer の外に書いています。
============================= */
.calendar__body {
  & .fc .fc-toolbar.fc-header-toolbar {
    margin-bottom: 1em;
  }

  & .fc .fc-toolbar-title {
    font-size: 16px;
  }

  & .fc .fc-button:focus,
  & .fc .fc-button-primary:not(:disabled):active:focus {
    box-shadow: none;
  }

  & .fc .fc-button:focus-visible {
    outline: 2px solid var(--color-primary);
  }

  & .fc-daygrid-dot-event {
    color: #000;

    & .fc-event-title {
      font-weight: 400;
    }
  }

  & .fc-event {
    cursor: default;
  }
}

.tippy-box .tippy-content {
  max-width: 300px;
  font-size: 12px;

  & a {
    color: #fff;
    text-decoration: underline;
  }

  & .description {
    display: block;
    margin-top: 0.5em;
    font-size: 10px;
  }
}
