/* ==========================================================================
   News Page Styles
   ========================================================================== */

/* --- News Archive Page --- */
.news-page {
  max-width: calc(1300px + var(--pc-gutter) * 2);
  margin: 0 auto;
  padding: 80px var(--pc-gutter) 120px;
}

.news-header {
  text-align: center;
  margin-bottom: 80px;
}

.news-title {
  font-family: var(--font-en);
  font-size: 150px;
  font-weight: bold;
  line-height: 1;
  letter-spacing: -0.02em;
  margin: 0;
}

.news-list {}

.news-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 56px 8px;
  margin-bottom: 60px;
}

.news-item {
  overflow: hidden;
}

.news-item-link {
  display: block;
  text-decoration: none;
  color: inherit;
  transition: opacity 0.3s;

  &:hover {
    opacity: 0.8;
  }
}

.news-item-image {
  position: relative;
  overflow: hidden;
  margin-bottom: 23.9px;
  aspect-ratio: 432 / 267;

  & img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
  }
}

.news-item-placeholder {
  width: 100%;
  height: 100%;
  background-color: #e0e0e0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.news-item-content {
  display: flex;
  gap: 46.1px;
  padding: 0 8px 0 30px;
}

.news-item-content-left {
  flex: 1;
}

.news-item-title {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.4;
  margin: 0;
  min-height: 44px;
}

.news-item-date {
  font-size: 15px;
  order: -1;
  display: block;
}

.news-item-more {
  font-family: var(--font-en);
  font-size: 19px;
  text-transform: uppercase;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.news-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 0;
  color: #666;
}


/* --- Pagination --- */
.pagination {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 40px;

  .nav-links {
    display: flex;
    gap: 10px;
  }

  .page-numbers {
    padding: 2px 12px;
    text-decoration: none;
    border: 1px solid #ddd;
    transition: all 0.3s;

    &:hover,
    &.current {
      background-color: #000;
      color: #fff;
      border-color: #000;
    }
  }
}


/* --- News Detail Page --- */
.news-detail {
  max-width: calc(1300px + var(--pc-gutter) * 2);
  margin: 0 auto;
  padding: 40px var(--pc-gutter);
}

.news-detail-inner {}

.news-detail-header {
  margin-bottom: 50px;
}

.news-detail-date {
  font-family: var(--font-en);
  font-size: 25px;
  display: block;
  margin-bottom: 40px;
  max-width: 960px;
  margin: 0 auto;
  font-weight: 500;
}

.news-detail-title {
  font-size: 48px;
  font-weight: 600;
  line-height: 1.4;
  max-width: 960px;
  margin: 0 auto;
}

.news-detail-featured {
  margin-bottom: 96px;
  aspect-ratio: 432 / 267;

  & img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
  }
}

.news-detail-content {
  max-width: 800px;
  margin: 0 auto;
  font-family: var(--font-jp);
  font-size: 18px;
  line-height: 1.8;
  margin-bottom: 60px;

  >* {
    margin-top: 0 !important;
  }

  /* --- 基本要素 --- */
  & p {
    margin-bottom: 1.2em;
    line-height: 1.8;
  }

  /* --- 見出し --- */
  & h1 {
    font-size: 32px;
    font-weight: 700;
    line-height: 1.3;
    margin: 2.5em 0 1em;
    border-bottom: 2px solid #333;
    padding-bottom: 0.3em;
  }

  & h2 {
    font-size: 24px;
    font-weight: 600;
    line-height: 1.4;
    margin: 2em 0 1em;
  }

  & h3 {
    font-size: 24px;
    font-weight: 600;
    line-height: 1.4;
    margin: 1.8em 0 0.8em;
    background-color: #f8f9fa;
    padding: 0.5em 1em;
  }

  & h4 {
    font-size: 22px;
    font-weight: 600;
    margin: 1.5em 0 0.5em;
    color: #333;
  }

  & h5 {
    font-size: 20px;
    font-weight: 500;
    margin: 1.2em 0 0.5em;
  }

  & h6 {
    font-size: 18px;
    font-weight: 500;
    margin: 1em 0 0.5em;
    color: #666;
  }

  /* --- リスト --- */
  & ul,
  & ol {
    margin: 1.5em 0;
    padding-left: 2em;
  }

  & ul {
    list-style-type: disc;
  }

  & ol {
    list-style-type: decimal;
  }

  & li {
    margin-bottom: 0.5em;
    line-height: 1.7;
  }

  & ul ul,
  & ol ol,
  & ul ol,
  & ol ul {
    margin: 0.5em 0;
  }

  /* --- 引用 --- */
  & blockquote {
    margin: 2em 0;
    padding: 1.5em 2em;
    border-left: 4px solid #ddd;
    background-color: #f8f9fa;
    font-style: italic;

    & p {
      margin-bottom: 0.5em;
    }

    & cite {
      display: block;
      margin-top: 1em;
      font-size: 0.9em;
      color: #666;
      font-style: normal;
    }
  }

  /* --- 画像とキャプション --- */
  & img {
    max-width: 100%;
    height: auto;
    margin: 2em 0;
  }

  & figure {
    margin: 2em 0;

    & img {
      margin: 0;
    }

    & figcaption {
      margin-top: 0.5em;
      font-size: 0.9em;
      color: #666;
      text-align: center;
      font-style: italic;
    }
  }

  /* --- テーブル --- */
  & table {
    width: 100%;
    margin: 2em 0;
    border-collapse: collapse;
  }

  & th,
  & td {
    padding: 1em;
    text-align: left;
  }

  & th {
    background-color: #f8f9fa;
    font-weight: 600;
    border-bottom: 2px solid #333;
  }

  /* --- コードとプリフォーマット --- */
  & code {
    background-color: #f1f3f4;
    padding: 0.2em 0.4em;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    color: #d73a49;
  }

  & pre {
    background-color: #f6f8fa;
    padding: 1.5em;
    overflow-x: auto;
    margin: 2em 0;
    border: 1px solid #e1e4e8;

    & code {
      background: none;
      padding: 0;
      color: inherit;
    }
  }

  /* --- リンク --- */
  & a {
    color: #0066cc;
    text-decoration: underline;
    transition: color 0.3s;

    &:hover {
      color: #0052a3;
    }
  }

  /* --- 水平線 --- */
  & hr {
    margin: 3em 0;
    border: none;
    height: 1px;
    background: #ddd;
  }

  /* --- ブロックエディタ専用要素 --- */

  /* ボタンブロック */
  & .wp-block-button {
    margin: 2em 0;

    & .wp-block-button__link {
      background-color: white;
      font-family: var(--font-en) var(--font-jp);
      display: flex;
      gap: 10px;
      align-items: center;
      justify-content: center;
      padding: 20px 26px 20px 23px;
      border: 1px solid black;
      transition: .5s background-color, .5s color, .5s filter;
      font-family: var(--font-en);
      font-size: 20px;
      font-weight: bold;
      text-transform: uppercase;
      color: black;
      text-decoration: none;
      border-radius: 0;

      &::after {
        content: '';
        display: block;
        width: 18.04px;
        height: 13.79px;
        background: url('../img/top/arrow-right.svg') center center / contain no-repeat;
        transition: .5s transform;
      }

      &:hover {
        color: #fff;
        background-color: #000;
        border-color: #000;

        &::after {
          transform: translateX(4px);
          filter: brightness(0) invert(1);
        }
      }

    }
  }

  /* カラムブロック */
  & .wp-block-columns {
    margin: 2em 0;
    display: flex;
    gap: 2em;

    & .wp-block-column {
      flex: 1;
    }
  }

  /* グループブロック */
  & .wp-block-group {
    margin: 2em 0;
    padding: 1.5em;
    border: 1px solid #e1e4e8;
  }

  /* カバーブロック */
  & .wp-block-cover {
    margin: 2em 0;
    overflow: hidden;
  }

  /* メディアとテキスト */
  & .wp-block-media-text {
    margin: 2em 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2em;
    align-items: center;
  }

  /* セパレーター */
  & .wp-block-separator {
    margin: 3em 0;

    &.is-style-wide {
      width: 100%;
    }
  }

  /* 引用ブロック */
  & .wp-block-quote {
    margin: 2em 0;
    padding: 1.5em;
    border-left: 4px solid #333;
    background-color: #f8f9fa;

    & cite {
      font-size: 0.9em;
      color: #666;
    }
  }

  /* プルクオート */
  & .wp-block-pullquote {
    margin: 3em 0;
    padding: 2em;
    text-align: center;
    border: 1px solid #ddd;
    background-color: #f8f9fa;

    & blockquote {
      margin: 0;
      background: none;
      border: none;
      padding: 0;
      font-size: 1.2em;
    }
  }

  /* ギャラリー */
  & .wp-block-gallery {
    margin: 2em 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 0;

    /* デフォルトで3列レイアウト */
    &:not([class*="columns-"]) {
      grid-template-columns: repeat(3, 1fr);
    }

    /* 明示的なカラム設定 */
    &.columns-1 {
      grid-template-columns: 1fr;
    }

    &.columns-2 {
      grid-template-columns: repeat(2, 1fr);
    }

    &.columns-3 {
      grid-template-columns: repeat(3, 1fr);
    }

    &.columns-4 {
      grid-template-columns: repeat(4, 1fr);
    }

    &.columns-5 {
      grid-template-columns: repeat(5, 1fr);
    }

    &.columns-6 {
      grid-template-columns: repeat(6, 1fr);
    }

    /* ギャラリーアイテム統一 */
    & figure {
      margin: 0;
      aspect-ratio: 1;
      overflow: hidden;

      & img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        margin: 0;
        transition: transform 0.3s ease;
      }

      &:hover img {
        transform: scale(1.05);
      }

      & figcaption {
        margin-top: 0.5em;
        font-size: 0.8em;
        color: #666;
        text-align: center;
      }
    }

    /* レスポンシブ対応 */
    @media (max-width: 768px) {
      grid-template-columns: repeat(2, 1fr) !important;
      gap: 0;
    }

    @media (max-width: 480px) {
      grid-template-columns: 1fr !important;
    }

    /* ネストイメージの調整 */
    &.has-nested-images.columns-default figure.wp-block-image:not(#individual-image) {
      width: 100%;
    }
  }

  /* 埋め込み */
  & .wp-block-embed {
    margin: 2em 0;

    & iframe {
      width: 100%;
    }
  }
}

.news-detail-nav {
  border-top: 1px solid #eee;
  padding-top: 30px;
}

.news-back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-jp);
  font-size: 14px;
  text-decoration: none;
  color: #666;
  transition: color 0.3s;

  &:hover {
    color: #000;
  }
}

.news-back-arrow {
  font-size: 16px;
}

@media screen and (max-width: 1170px) {
  .news-page {
    padding: calc(80vw / var(--p)) var(--pc-gutter) calc(120vw / var(--p));
  }

  .news-header {
    margin-bottom: calc(80vw / var(--p));
  }

  .news-title {
    font-size: calc(150vw / var(--p));
  }

  .news-grid {
    gap: calc(56vw / var(--p)) calc(8vw / var(--p));
    margin-bottom: calc(60vw / var(--p));
  }

  .news-item-image {
    margin-bottom: calc(23.9vw / var(--p));
  }

  .news-item-content {
    gap: calc(46.1vw / var(--p));
    padding: 0 calc(8vw / var(--p)) 0 calc(30vw / var(--p));
  }

  .news-item-date {
    font-size: calc(15vw / var(--p));
  }

  .news-item-more {
    font-size: calc(19vw / var(--p));
    line-height: calc(28vw / var(--p));
    text-underline-offset: calc(3vw / var(--p));
  }

  .news-item-excerpt {
    font-size: calc(15vw / var(--p));
  }

  .news-item-title {
    font-size: calc(19vw / var(--p));
    text-underline-offset: calc(3vw / var(--p));
  }

  .news-pagination {
    padding: calc(60vw / var(--p)) 0;
  }

  .news-pagination-list {
    gap: calc(10vw / var(--p));
    margin-top: calc(40vw / var(--p));

    .page-numbers {
      padding: calc(8vw / var(--p)) calc(12vw / var(--p));
      border: calc(1vw / var(--p)) solid #ddd;
    }
  }

  .news-single {
    padding: calc(40vw / var(--p)) var(--pc-gutter);
  }

  .news-single-header {
    margin-bottom: calc(50vw / var(--p));
  }

  .news-single-category {
    font-size: calc(25vw / var(--p));
    margin-bottom: calc(40vw / var(--p));
    max-width: calc(800vw / var(--p));
  }

  .news-single-title {
    font-size: calc(60vw / var(--p));
    max-width: calc(800vw / var(--p));
  }

  .news-back-arrow {
    font-size: calc(16vw / var(--p));
  }
}

@media screen and (max-width: 768px) {
  .news-page {
    padding: calc(55.5vw / var(--s)) 0 0;
  }

  .news-title {
    font-size: calc(103vw / var(--s));
  }

  .news-grid {
    display: flex;
    flex-direction: column;
    flex-wrap: nowrap;
    gap: calc(55vw / var(--s));
  }

  .news-item-content {
    padding: 0 var(--sp-gutter);
    gap: calc(28.4vw / var(--s));
  }

  .news-item-title {
    font-size: calc(14vw / var(--s));
    min-height: auto;
  }

  .news-item-date {
    font-size: calc(14vw / var(--s));
  }

  .news-item-more {
    font-size: calc(17vw / var(--s));
    line-height: calc(25vw / var(--s));
    text-underline-offset: calc(5vw / var(--s));
    margin-top: calc(-3vw / var(--s));
  }

  .news-item-image {
    margin-bottom: calc(21.8vw / var(--s));
  }

  /* --- Pagination モバイル対応 --- */
  .pagination {
    margin: calc(40vw / var(--s)) 0 calc(60vw / var(--s));
    gap: calc(10vw / var(--s));
    padding: 0 var(--sp-gutter);

    .page-numbers {
      padding: calc(12vw / var(--s)) calc(16vw / var(--s));
      font-size: calc(14vw / var(--s));
      border: calc(1vw / var(--s)) solid #ddd;
    }
  }


  .news-detail-featured {
    margin-bottom: calc(53vw / var(--s));
  }

  .news-detail-date {
    font-size: calc(20vw / var(--s));
    margin-bottom: calc(24vw / var(--s));
    padding: 0 var(--sp-gutter);
  }

  .news-detail-title {
    font-size: calc(25vw / var(--s));
    line-height: 1.2;
    padding: 0 var(--sp-gutter);
  }

  .news-detail-header {
    margin-bottom: 0;
  }

  .news-detail {
    padding: calc(40vw / var(--s)) var(--sp-gutter);
  }

  .news-detail-content {
    font-size: calc(11vw / var(--s));
    margin-bottom: calc(60vw / var(--s));
    max-width: none;

    /* --- 見出し --- */
    & h1 {
      font-size: calc(32vw / var(--s));
      margin: calc(45vw / var(--s)) 0 calc(18vw / var(--s));
      padding-bottom: calc(5.4vw / var(--s));
      border-bottom: calc(2vw / var(--s)) solid #333;
    }

    & h2 {
      font-size: calc(14vw / var(--s));
      margin: calc(36vw / var(--s)) 0 calc(18vw / var(--s));
    }

    & h3 {
      font-size: calc(12vw / var(--s));
      margin: calc(32.4vw / var(--s)) 0 calc(14.4vw / var(--s));
      padding: calc(9vw / var(--s)) calc(18vw / var(--s));
    }

    & h4 {
      font-size: calc(12vw / var(--s));
      margin: calc(27vw / var(--s)) 0 calc(9vw / var(--s));
    }

    & h5 {
      font-size: calc(10vw / var(--s));
      margin: calc(21.6vw / var(--s)) 0 calc(9vw / var(--s));
    }

    & h6 {
      font-size: calc(10vw / var(--s));
      margin: calc(18vw / var(--s)) 0 calc(9vw / var(--s));
    }

    /* --- リスト --- */
    & ul,
    & ol {
      margin: calc(27vw / var(--s)) 0;
      padding-left: calc(36vw / var(--s));
    }

    & li {
      margin-bottom: calc(9vw / var(--s));
    }

    & ul ul,
    & ol ol,
    & ul ol,
    & ol ul {
      margin: calc(9vw / var(--s)) 0;
    }

    /* --- 引用 --- */
    & blockquote {
      margin: calc(36vw / var(--s)) 0;
      padding: calc(27vw / var(--s)) calc(36vw / var(--s));
      border-left: calc(4vw / var(--s)) solid #ddd;

      & cite {
        margin-top: calc(18vw / var(--s));
        font-size: calc(16.2vw / var(--s));
      }
    }

    /* --- 画像とキャプション --- */
    & img {
      margin: calc(36vw / var(--s)) 0;
    }

    & figure {
      margin: calc(36vw / var(--s)) 0;

      & figcaption {
        margin-top: calc(9vw / var(--s));
        font-size: calc(16.2vw / var(--s));
      }
    }

    /* --- テーブル --- */
    & table {
      margin: calc(36vw / var(--s)) 0;
      font-size: calc(11vw / var(--s));
    }

    & th,
    & td {
      padding: calc(18vw / var(--s));
      border-bottom: calc(2vw / var(--s)) solid #333;
    }

    & th {
      border-bottom: calc(36vw / var(--s)) solid #333;
    }

    /* --- コードとプリフォーマット --- */
    & code {
      padding: calc(3.6vw / var(--s)) calc(7.2vw / var(--s));
      font-size: calc(11vw / var(--s));
    }

    & pre {
      padding: calc(27vw / var(--s));
      margin: calc(36vw / var(--s)) 0;
      border: calc(1vw / var(--s)) solid #e1e4e8;
    }

    & p {
      font-size: calc(11vw / var(--s));
    }

    /* --- 水平線 --- */
    & hr {
      margin: calc(54vw / var(--s)) 0;
    }

    /* --- ボタンブロック --- */
    & .wp-block-button {
      margin: calc(36vw / var(--s)) 0;

      & .wp-block-button__link {
        padding: calc(20vw / var(--s)) calc(26vw / var(--s)) calc(20vw / var(--s)) calc(23vw / var(--s));
        border: calc(1vw / var(--s)) solid black;
        font-size: calc(14vw / var(--s));
        gap: calc(10vw / var(--s));

        &::after {
          width: calc(18.04vw / var(--s));
          height: calc(13.79vw / var(--s));
        }
      }
    }

    /* --- カラムブロック --- */
    & .wp-block-columns {
      margin: calc(36vw / var(--s)) 0;
      gap: calc(36vw / var(--s));
      flex-direction: column;
    }

    /* --- グループブロック --- */
    & .wp-block-group {
      margin: calc(36vw / var(--s)) 0;
      padding: calc(27vw / var(--s));
      border: calc(1vw / var(--s)) solid #e1e4e8;
    }

    /* --- カバーブロック --- */
    & .wp-block-cover {
      margin: calc(36vw / var(--s)) 0;
    }

    /* --- メディアとテキスト --- */
    & .wp-block-media-text {
      margin: calc(36vw / var(--s)) 0;
      grid-template-columns: 1fr;
      gap: calc(36vw / var(--s));
    }

    /* --- セパレーター --- */
    & .wp-block-separator {
      margin: calc(54vw / var(--s)) 0;
    }

    /* --- 引用ブロック --- */
    & .wp-block-quote {
      margin: calc(36vw / var(--s)) 0;
      padding: calc(27vw / var(--s));
      border-left: calc(4vw / var(--s)) solid #333;

      & cite {
        font-size: calc(11vw / var(--s));
      }
    }

    /* --- プルクオート --- */
    & .wp-block-pullquote {
      margin: calc(54vw / var(--s)) 0;
      padding: calc(36vw / var(--s));
      border: calc(1vw / var(--s)) solid #ddd;

      & blockquote {
        font-size: calc(14vw / var(--s));
      }
    }

    /* --- 埋め込み --- */
    & .wp-block-embed {
      margin: calc(36vw / var(--s)) 0;
    }
  }

  .news-detail-nav {
    padding-top: calc(30vw / var(--s));
  }

  .news-back-link {
    gap: calc(8vw / var(--s));
    font-size: calc(11vw / var(--s));
  }

  .news-back-arrow {
    font-size: calc(12vw / var(--s));
  }

}