*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Helvetica Neue', Arial, 'Hiragino Kaku Gothic ProN', 'Hiragino Sans', Meiryo, sans-serif; font-feature-settings: "palt" 1; font-kerning: normal; text-rendering: optimizeLegibility; color: #333; }
a { text-decoration: none; color: inherit; }

/* Header */
header { position: fixed; top: 0; left: 0; width: 100%; z-index: 100; display: flex; justify-content: flex-end; align-items: center; padding: 35px clamp(20px, 5vw, 80px); transition: background .3s, box-shadow .3s, transform .4s ease; }
header.hidden { transform: translateY(-100%); }
.header-logo { display: block; height: 65px; position: fixed; top: 10px; left: clamp(20px, 5vw, 80px); z-index: 101; transition: opacity .4s ease; }
.header-logo.is-hidden { opacity: 0; pointer-events: none; }
header nav ul { display: flex; list-style: none; gap: 32px; }
header nav ul li a { font-size: 12px; font-weight: 700; letter-spacing: .12em; color: #333; transition: opacity .2s; }
header nav ul li a:hover { opacity: .6; }

/* Bottom Nav */
#bottom-nav { position: fixed; bottom: 20px; left: 0; right: 0; margin: 0 auto; width: min(80vw, 900px); z-index: 200; background: rgba(255,255,255,.95); box-shadow: 0 8px 32px rgba(0,0,0,.18); border-radius: 16px; opacity: 0; transform: translateY(30px); transition: opacity .4s ease, transform .4s ease; display: flex; align-items: center; justify-content: space-between; padding: 16px; cursor: pointer; user-select: none; }
#bottom-nav.is-visible { opacity: 1; transform: translateY(0); }
#bottom-nav * { pointer-events: none; }
#bottom-nav-label { font-size: 14px; letter-spacing: .15em; color: #333; font-weight: 700; }
#nav-modal-open { background: none; border: none; cursor: pointer; padding: 4px; display: flex; align-items: center; justify-content: center; opacity: .6; transition: opacity .2s; }
#nav-modal-open:hover { opacity: 1; }
#nav-modal-open img { width: 6px; height: auto; transform: rotate(-90deg); filter: brightness(0); }

/* Nav Modal - Bottom Sheet */
#nav-modal { position: fixed; inset: 0; z-index: 198; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,0); visibility: hidden; pointer-events: none; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); transition: background-color .3s ease, visibility .3s; }
#nav-modal.is-open { background: rgba(0,0,0,.3); visibility: visible; pointer-events: auto; }
#nav-modal-inner { background: #fff; border-radius: 16px; padding: 40px 32px; width: 80vw; max-width: 900px; overflow-y: auto; position: relative; transform: translateY(40px) scaleY(.85); opacity: 0; transform-origin: center bottom; transition: transform .35s ease, opacity .35s ease; }
#nav-modal.is-open #nav-modal-inner { transform: translateY(0) scaleY(1); opacity: 1; }
#nav-modal-close { position: absolute; top: 16px; right: 16px; background: none; border: 1px solid #ccc; border-radius: 50%; width: 36px; height: 36px; font-size: 14px; cursor: pointer; color: #333; display: flex; align-items: center; justify-content: center; transition: background .2s; }
#nav-modal-close:hover { background: #f5f5f5; }
.nav-modal-title { font-size: 11px; font-weight: 700; letter-spacing: .2em; text-align: center; margin-bottom: 20px; color: #333; }
.nav-modal-grid { display: grid; grid-template-columns: repeat(2, 1fr); grid-template-rows: repeat(2, 1fr); gap: 12px; height: 380px; }
.nav-modal-card { border-radius: 10px; overflow: hidden; background: #fff; box-shadow: 0 2px 12px rgba(0,0,0,.1); display: flex; align-items: center; text-decoration: none; transition: opacity .2s; }
.nav-modal-card:hover { opacity: .85; }
.nav-modal-card img { height: 45%; width: auto; margin-left: 24px; flex-shrink: 0; }
.nav-modal-card-label { flex: 1; text-align: center; }
.nav-modal-card-label .ja { display: block; font-size: 20px; font-weight: 700; letter-spacing: .05em; color: #333; }
.nav-modal-card-label .en { display: block; font-size: 11px; letter-spacing: .15em; margin-top: 6px; color: #999; }

@media (max-width: 768px) {
  #bottom-nav { width: 80%; }
  #nav-modal-inner { width: 90vw; padding: 32px 20px; }
}

/* Footer */
#footer { background: #fff; padding: 60px clamp(20px, 5vw, 80px) 30px; text-align: center; }
.footer-inner { max-width: 1440px; margin: 0 auto; }
.footer-logo { display: flex; flex-direction: column; align-items: center; gap: 8px; margin-bottom: 30px; }
.footer-nav { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px 30px; list-style: none; margin-bottom: 20px; }
.footer-nav a { font-size: 10px; letter-spacing: .12em; color: #333; transition: opacity .2s; }
.footer-nav a:hover { opacity: .6; }
.footer-social { display: flex; justify-content: center; align-items: center; gap: 20px; margin-bottom: 10px; }
.footer-social a { color: #333; transition: opacity .2s; }
.footer-social a:hover { opacity: .6; }
.footer-privacy { margin-bottom: 12px; }
.footer-privacy a { font-size: 10px; letter-spacing: .12em; color: #333; transition: opacity .2s; }
.footer-privacy a:hover { opacity: .6; }
.footer-copy { font-size: 10px; color: #aaa; letter-spacing: .05em; }

@media (max-width: 768px) {
  header { padding: 14px 20px; justify-content: space-between; align-items: center; }
  .header-logo { height: 60px; top: 14px; }
  .nav-modal-card img,
  .nav-modal-card-label { display: none; }
  .nav-modal-card { background-size: cover; background-position: center; }
  .nav-modal-card--news { background-image: url('../image/sp_card01.png'); }
  .nav-modal-card--company { background-image: url('../image/sp_card02.png'); }
  .nav-modal-card--recruit { background-image: url('../image/sp_card03.png'); }
  .nav-modal-card--contact { background-image: url('../image/sp_card04.png'); }
  header nav {
    position: fixed; top: 0; right: 0; width: 240px; height: 100vh;
    background: rgba(255,255,255,.98); box-shadow: -4px 0 20px rgba(0,0,0,.1);
    padding: 80px 32px 40px; z-index: 150;
    opacity: 0; visibility: hidden; transform: translateX(24px);
    transition: opacity .35s ease, transform .35s ease, visibility .35s;
  }
  header nav.open { opacity: 1; visibility: visible; transform: translateX(0); }
  header nav ul { flex-direction: column; gap: 24px; }
  header nav ul li a { font-size: 13px; }
  #footer { padding: 40px 20px 24px; }
  .footer-nav { display: grid; grid-template-columns: repeat(3, 1fr); justify-items: center; gap: 14px 16px; }
  .footer-copy { font-size: 9px; }
}

/* ===== 一覧 (archive-news.php) ===== */
body.post-type-archive-news main {
  padding: 120px clamp(20px, 5vw, 80px) 80px;
}
.section-heading { text-align: center; margin: 60px 0 30px; }
main > .section-heading:first-child { margin-top: 50px; }
.section-heading h2 { font-size: 22px; font-weight: 700; letter-spacing: .05em; }
.section-heading .en { display: block; font-size: 10px; letter-spacing: .2em; color: #999; margin-top: 4px; }

.news-grid { width: 90%; max-width: 1000px; margin: 0 auto; display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px 24px; }
.news-card { display: flex; align-items: flex-start; gap: 16px; cursor: pointer; }
/* card-thumb は画像そのものではなく「枠」。aspect-ratioはこの枠(span)にだけ効かせ、
   中のimgはwidth/height 100%で枠いっぱいに敷き詰める。
   WordPressが<img>に付与するwidth/height属性とaspect-ratioの相性が悪く、
   直接imgにaspect-ratioを指定すると画面幅に応じて正しく追従しないため。 */
.news-card .card-thumb { width: 40%; flex: 0 0 40%; aspect-ratio: 3/4; background: rgba(92, 194, 207, 0.2); border-radius: 10px; overflow: hidden; display: block; transition: opacity .2s; }
.news-card .card-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.news-card .card-thumb--wide img { object-fit: contain; }
.news-card .card-thumb--placeholder { display: flex; align-items: center; justify-content: center; }
.news-card .card-thumb--placeholder img { width: 50%; height: 50%; object-fit: contain; display: block; }
.news-card:hover .card-thumb { opacity: .8; }
.news-card .card-text { flex: 1; }
.news-card .card-date { font-size: 10px; color: #999; margin-bottom: 6px; }
.news-card .card-title { font-size: 12px; line-height: 1.6; }
.back-link { display: inline-flex; align-items: center; gap: 6px; margin-top: 60px; font-size: 12px; letter-spacing: .05em; color: #333; transition: opacity .2s; }
.back-link:hover { opacity: .6; }

/* Pagination (WordPress標準の the_posts_pagination() が出力するマークアップに合わせる) */
.pagination.navigation { margin: 60px 0 0; }
.pagination .nav-links { display: flex; justify-content: center; align-items: center; gap: 8px; flex-wrap: wrap; }
.pagination .page-numbers { display: flex; align-items: center; justify-content: center; min-width: 40px; height: 40px; padding: 0 8px; border: 1px solid #ddd; border-radius: 50%; font-size: 13px; color: #333; transition: background .2s, color .2s, border-color .2s; }
.pagination a.page-numbers:hover { background: #333; color: #fff; border-color: #333; }
.pagination .page-numbers.current { background: #333; color: #fff; border-color: #333; }
.pagination .page-numbers.dots { border: none; }

@media (max-width: 768px) {
  .pagination.navigation { margin-top: 40px; }
  .pagination .nav-links { gap: 6px; }
  .pagination .page-numbers { min-width: 34px; height: 34px; font-size: 12px; }
}
.back-link img { height: 10px; width: auto; }

@media (max-width: 768px) {
  body.post-type-archive-news main { padding-top: 90px; padding-left: clamp(20px, 5vw, 80px); padding-right: clamp(20px, 5vw, 80px); }
  .news-grid { width: 100%; grid-template-columns: repeat(2, 1fr); gap: 24px 12px; }
  .news-card { flex-direction: column; gap: 10px; }
  .news-card .card-thumb { width: 100%; flex: none; }
  .news-card .card-date { font-size: 9px; }
  .news-card .card-title { font-size: 10px; }
}
@media (max-width: 480px) {
  body.post-type-archive-news main { padding-left: 20px; padding-right: 20px; }
}

/* ===== 詳細 (single-news.php) =====
   画像（アイキャッチ）の有無で1カラム／2カラムを自動切替 */
body.single-news main {
  padding: 120px clamp(20px, 5vw, 80px) 0; max-width: 1000px; margin: 0 auto;
}
.article-layout { display: flex; gap: 48px; align-items: flex-start; }
.article-media { flex: 0 0 42%; }
.article-content { flex: 1; min-width: 0; }
.article-title { width: 100%; margin: 0 auto 5px; font-size: 18px; font-weight: 700; line-height: 1.4; text-align: left; }
.article-date { font-size: 12px; color: #999; text-align: left; margin-bottom: 28px; }
/* article-thumb は画像そのものではなく「枠」。aspect-ratioはこの枠(span)にだけ効かせ、
   中のimgはwidth/height 100%で枠いっぱいに敷き詰める（本番と同じ3:4を維持しつつ、
   WordPressのimg width/height属性とaspect-ratioの相性問題を回避するため）。 */
.article-thumb {
  width: 100%;
  aspect-ratio: 3 / 4;
  background: rgba(92, 194, 207, 0.2);
  border-radius: 10px;
  overflow: hidden;
  display: block;
  margin: 0;
}

.article-thumb img { width: 100%; height: 100%; object-fit: cover; object-position: top; display: block; }
/* 横長の画像は枠を保ったまま全体を表示し、余白（背景色）を一覧ページと同じように見せる */
.article-thumb--wide img { object-fit: contain; object-position: center; }
/* アイキャッチ画像が未設定の記事は、枠の中央にロゴを縮小表示する（一覧ページと同じ扱い） */
.article-thumb--placeholder { display: flex; align-items: center; justify-content: center; }
.article-thumb--placeholder img { width: 50%; height: 50%; object-fit: contain; }
.article-body { font-size: clamp(12px, 3.2vw, 14px); line-height: 2; color: #555; text-align: left; }



.btn-view-more { display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: 260px; min-height: 61px; padding: 12px; border: 1px solid #333; font-size: 10px; line-height: 1.6; letter-spacing: .05em; text-align: center; transition: background .2s, color .2s; margin: 0 auto; }
.btn-view-more:hover { background: #333; color: #fff; }
.btn-view-more img { height: 10px; width: auto; flex-shrink: 0; }
.btn-view-more:hover img { filter: brightness(0) invert(1); }
.article-body p.has-btn { margin-top: 16px; }

/* ec/button ブロックの余白（1つ目は28px、2つ目以降は16pxで自動的に揃う） */
.btn-wrap { text-align: center; margin-top: 28px; }
.btn-wrap + .btn-wrap { margin-top: 16px; }

body.single-news .back-link { margin-top: 48px; }

@media (max-width: 768px) {
  body.single-news main { padding-top: 90px; }
  .article-layout { flex-direction: column; }
  .article-title { text-align: left; }
  .article-date { text-align: left; }
  .article-body { text-align: left; }
  .article-thumb { width: 100%; aspect-ratio: auto; height: auto; }
  .article-thumb img { position: static; height: auto; }
}
@media (max-width: 480px) {
  body.single-news main { padding: 90px 20px 0; }
}
