/* ブレイクポイント一覧 */
/*
--breakpoint-xl: 1600px;
--breakpoint-lg: 1200px;
--breakpoint-md: 960px;
--breakpoint-sm: 640px;
--breakpoint-xs: 320px;
*/

/* カスケードレイヤーの優先順位 */
@layer reset, base, components, overrides;

/* リセットCSS */
@import url('https://cdn.jsdelivr.net/npm/destyle.css@4.0.1/destyle.css') layer(reset);
/* 画像コンテナ切替（コンテナクエリ） */
@import url('./image-container.css?20250922a') layer(overrides);

@layer reset {
  :root {
    /* ハーフ・レディング トリム */
    --leading-trim: calc((1em - 1lh) / 2);
  }

  * {
    text-rendering: geometricPrecision;
  }

  html {
    margin-block: var(--leading-trim);
  }

  span {
    display: inline-block;
  }
}

/* ベースレイヤー - フォント、変数、基本スタイル */
@layer base {
  @font-face {
    font-family: 'LouisVuitton';
    src: url('/assets/index-assets/kusama/fonts/LouisVuitton-Regular.woff2') format('woff2');
    font-weight: 300;
    font-style: normal;
    font-display: block;
  }

  @font-face {
    font-family: 'LouisVuitton';
    src: url('/assets/index-assets/kusama/fonts/LouisVuitton-Regular-Oblique.woff2') format('woff2');
    font-weight: 300;
    font-style: oblique;
    font-display: block;
  }

  :root {
    /* フォント */
    --font-family-louis: 'LouisVuitton', sans-serif;

    /* フォントカラー */
    --font-color: #000;

    /* フォントサイズ - デスクトップ */
    --font-size-l3: 2rem;
    --font-size-l2: 1.625rem;
    --font-size-l1: 1.375rem;
    --font-size-default: 1.125rem;
    --font-size-s1: 0.5625rem;

    /* スペーシング - デスクトップ */
    --spacing-horizontal: 70px;
    --spacing-vertical: 50px;
  }

  @media screen and (max-width: 960px) {
    :root {
      --spacing-horizontal: 60px;
      --spacing-vertical: 40px;
    }
  }

  @media screen and (max-width: 640px) {
    :root {
      /* フォントサイズ - モバイル */
      --font-size-l3: 1.25rem;
      --font-size-l2: 1rem;
      --font-size-l1: 1rem;
      --font-size-default: 0.875rem;

      /* スペーシング - モバイル */
      --spacing-horizontal: 20px;
      --spacing-vertical: 20px;
    }
  }

  @media screen and (max-width: 320px) {
    :root {
      /* フォントサイズ - 極小モバイル */
      --font-size-l3: 1rem;
      --font-size-l2: 0.75rem;
      --font-size-l1: 0.75rem;
      --font-size-default: 0.625rem;

      /* スペーシング - 極小モバイル */
      --spacing-horizontal: 20px;
      --spacing-vertical: 20px;
    }
  }

  /* ベースフォント設定 */
  body {
    font-family: var(--font-family-louis);
    font-weight: normal;
    font-size: var(--font-size-default);
    font-feature-settings: "pwid" on;
    letter-spacing: 0.02rem;
  }

  /* 見出しスタイル */
  h2 {
    font-size: var(--font-size-l3);
  }

  /* セパレーター要素 */
  .separator {
    position: relative;
    padding: 0 0.9ch;
  }

  .separator::before {
    position: absolute;
    content: "--";
    top: -0.8lh;
    left: 0.555ch;
    letter-spacing: -0.02em;
  }

  /* Windows環境での調整 */
  .os-windows .separator::before {
    top: -0.96lh;
  }
}

/* コンポーネントレイヤー - (なるべく)再利用可能なコンポーネント */
@layer components {
  :root {
    --espace-width: 138px;
    --espace-height: 113px;
    --fondation-logo-width: 448px;
    --fondation-logo-height: 53px;
  }

  @media screen and (max-width: 1600px) {
    :root {
      --espace-width: 104px;
      --espace-height: 85px;
      --fondation-logo-width: 340px;
      --fondation-logo-height: 40px;
    }
  }

  @media screen and (max-aspect-ratio: 20 / 13) {
    :root {
      --espace-width: 138px;
      --espace-height: 113px;
      --fondation-logo-width: 448px;
      --fondation-logo-height: 53px;
    }
  }

  @media screen and (max-width: 1200px) {
    :root {
      --espace-width: 138px;
      --espace-height: 113px;
      --fondation-logo-width: 448px;
      --fondation-logo-height: 53px;
    }
  }

  @media screen and (max-width: 960px) {
    :root {
      --fondation-logo-width: 448px;
      --fondation-logo-height: 53px;
    }
  }

  @media screen and (max-width: 640px) {
    :root {
      --espace-width: 82px;
      --espace-height: 67px;
      --fondation-logo-width: 266px;
      --fondation-logo-height: 32px;
    }
  }

  /* ビューポートコンテナ */
  .viewport-container {
    display: flex;
    width: 100%;
    height: 100dvh;
    min-height: 100svh;
    max-height: 100lvh;
  }

  /* lg以上のレイアウト */
  .over-lg-layout {
    position: relative;
    min-width: 820px;
  }

  @media screen and (max-width: 1600px) {
    .over-lg-layout {
      min-width: 620px;
    }
  }

  @media screen and (max-aspect-ratio: 20 / 13) {
    .over-lg-layout {
      display: contents;
    }

    .viewport-container {
      flex-direction: column;
    }
  }

  @media screen and (max-width: 1200px) {
    .over-lg-layout {
      display: contents;
    }

    .viewport-container {
      flex-direction: column;
    }
  }

  /* ヘッダー */
  .header {
    display: flex;
    justify-content: space-between;
    align-items: normal;
    width: 100%;
  }

  .header .left-logo,
  .header .right-logo {
    display: inline-block;
    margin: var(--spacing-vertical) var(--spacing-horizontal);
    flex-shrink: 1;
  }

  .header .left-logo {
    width: var(--espace-width);
    aspect-ratio: var(--espace-width) / var(--espace-height);
    text-align: right;
  }

  .header .right-logo {
    width: var(--fondation-logo-width);
    aspect-ratio: var(--fondation-logo-width) / var(--fondation-logo-height);
  }

  .header .left-logo img,
  .header .right-logo img {
    display: inline;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: top;
  }

  @media screen and (min-width: 1200px) and (max-width: 1600px) {
    .header .left-logo {
      margin: var(--spacing-vertical) 0 var(--spacing-vertical) var(--spacing-horizontal);
    }

    .header .right-logo {
      margin: var(--spacing-vertical) var(--spacing-horizontal) var(--spacing-vertical) 0;
    }
  }

  /* 情報セクション */
  .info {
    padding-left: var(--spacing-horizontal);
    position: absolute;
    bottom: 50lvh;
    min-width: 0;
    transform: translateY(50%);
  }

  .info .other {
    margin-bottom: 0.9rem;
    font-size: var(--font-size-l1);
    font-weight: 300;
  }

  .info .description h2 {
    margin-bottom: 0.9rem;
    font-weight: 500;
  }

  .info .description .artist {
    display: block;
  }

  .info .description .title {
    display: block;
  }

  .info .description .related {
    font-style: oblique;
  }

  .period {
    position: absolute;
    width: 100%;
    bottom: 0;
    padding-bottom: calc(var(--spacing-vertical) * 0.8);
    font-size: var(--font-size-l2);
    font-weight: 300;
  }

  .period .date {
    display: grid;
    padding: 0 var(--spacing-horizontal);
    align-items: center;
    grid-template-columns: auto 1fr auto;
    grid-auto-flow: column dense;
    grid-gap: 2px
  }

  .period .date::before{
    content: "";
    display: inline-block;
    height: 100%;
    position: relative;
    bottom: 0.85ex;
    border-bottom: 2px solid var(--font-color);
    grid-column: 2;
  }

  .os-windows .period .date::before {
    bottom: 0.6ex;
  }

  @media screen and (max-aspect-ratio: 20 / 13) {
    .info {
      position: static;
      padding: var(--spacing-vertical) var(--spacing-horizontal);
      transform: translateY(0);
      order: 2;
    }

    .period {
      position: static;
      order: 3;
    }
  }

  @media screen and (max-width: 1200px) {
    .info {
      position: static;
      padding: var(--spacing-vertical) var(--spacing-horizontal);
      transform: translateY(0);
      order: 2;
    }

    .period {
      position: static;
      order: 3;
    }
  }

  @media screen and (min-width: 1200px) and (max-height: 640px) {
    .info {
      bottom: calc(var(--spacing-vertical) * 2);
      transform: translateY(0);
    }
  }

  @media screen and (max-width: 640px) {
    .info .other {
      margin-bottom: 1rem;
    }

    .info .description h2 {
      margin-bottom: 0.4rem;
    }

    .period {
      font-size: var(--font-size-l1);
    }

    .period .date::before {
      border-bottom: 1px solid var(--font-color);
    }
  }

  /* アートワーク */
  .artwork {
    display: inline-block;
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
    padding: var(--spacing-vertical) 0;
    box-sizing: border-box;
  }

  .artwork picture {
    display: block; /* pictureのデフォルトに近い値に戻す */
    width: 100%;
    height: 100%;
  }

  .artwork img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: right;
    padding: 0 var(--spacing-horizontal) 0 0;
  }

  .artwork .description {
    position: absolute;
    left: calc(100% - var(--spacing-horizontal) + 10px);
    bottom: var(--spacing-vertical);
    text-align: left;
    font-size: var(--font-size-s1);
    letter-spacing: 0;
    max-height: calc(100% - (var(--spacing-vertical) * 2));
    
    /* 縦書き */
    writing-mode: vertical-rl;
    text-orientation: mixed;
    transform: rotate(180deg);
  }

  .artwork .description .title {
    font-style: oblique;
  }

  @media screen and (max-aspect-ratio: 20 / 13) {
    .artwork {
      min-height: fit-content;
      order: 1;
      padding: 0 var(--spacing-horizontal);
    }

    .artwork img {
      object-position: center;
      padding: 0;
    }
  }

  @media screen and (max-width: 1200px) {
    .artwork {
      min-height: fit-content;
      order: 1;
      object-position: center;
      padding: 0 var(--spacing-horizontal); /* 縦のpaddingをリセット */
    }

    .artwork img {
      object-position: center;
      padding: 0;
    }
  }

  @media screen and (max-width: 640px) {  
    .artwork {
      min-height: initial;
      padding: 0;
    }

    .artwork .description {
      bottom: var(--spacing-vertical);
      left: initial;
      right: var(--spacing-horizontal);
      text-align: right;
      writing-mode: horizontal-tb;
      transform: none;
    }

    .artwork .description span {
      display: block;
    }

    .artwork .description .title {
      display: contents;
    }

    .artwork .description .year {
      display: contents;
    }
  }
}

/* オーバーライドレイヤー - 特定の調整や上書き */
@layer overrides {
  /* 必要に応じて特定の上書きスタイルをここに追加 */
}
