/*
Theme Name: GATE News
Theme URI: https://gate-series.com/
Author: idearecord
Description: GATEシリーズお知らせサイト(news-tottokun.jp)専用テーマ。GATE管理画面のデザインに合わせたお知らせ一覧・詳細ページ。
Version: 1.0.0
Requires PHP: 7.4
Text Domain: gate-news
*/

:root {
  --gate-dark: #1a1a1a;
  --gate-accent: #f8662a;
  --gate-bg: #f0f0f2;
  --gate-card: #ffffff;
  --gate-text: #2b2b2b;
  --gate-muted: #808080;
  --gate-border: #e3e3e6;
  --gate-red: #e60012;
  --gate-gray: #595959;
  --gate-link: #1668b8;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: 'Noto Sans JP', 'Hiragino Kaku Gothic ProN', 'Hiragino Sans', Meiryo, sans-serif;
  background-color: var(--gate-bg);
  color: var(--gate-text);
  font-size: 15px;
  line-height: 1.9;
  font-feature-settings: 'palt';
}

a {
  color: var(--gate-link);
}

img {
  max-width: 100%;
  height: auto;
}

/* ---------- ヘッダー ---------- */

.site-header {
  background-color: var(--gate-dark);
  color: #fff;
}

.site-header__inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.site-header__brand {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
  color: #fff;
}

.site-header__brand img {
  width: 118px;
  height: auto;
  display: block;
}

.site-header__sitename {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.04em;
  border-left: 1px solid rgba(255, 255, 255, 0.35);
  padding-left: 14px;
  line-height: 1.4;
}

.site-header__date {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.75);
  white-space: nowrap;
}

@media screen and (max-width: 599px) {
  .site-header__date {
    display: none;
  }
  .site-header__brand img {
    width: 96px;
  }
  .site-header__sitename {
    font-size: 12px;
  }
}

/* ---------- ページタイトル帯 ---------- */

.page-band {
  background: linear-gradient(135deg, #1a1a1a 0%, #333 100%);
  color: #fff;
  padding: 26px 20px 30px;
}

.page-band__inner {
  max-width: 960px;
  margin: 0 auto;
}

.page-band__title {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.page-band__title::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 22px;
  background-color: var(--gate-accent);
  border-radius: 3px;
  margin-right: 12px;
  vertical-align: -3px;
}

.page-band__lead {
  margin: 6px 0 0;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.72);
}

/* ---------- レイアウト ---------- */

.site-main {
  max-width: 960px;
  margin: -14px auto 0;
  padding: 0 20px 56px;
}

.card {
  background-color: var(--gate-card);
  border: 1px solid var(--gate-border);
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

/* ---------- カテゴリバッジ ---------- */

.cat-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.cat-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 500;
  line-height: 1;
  color: #fff;
  background-color: var(--gate-gray);
  border-radius: 999px;
  padding: 4px 10px 4px 8px;
  white-space: nowrap;
}

.cat-badge svg {
  width: 13px;
  height: 13px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.cat-badge--important {
  background-color: var(--gate-red);
}

.cat-badge--update {
  background-color: var(--gate-accent);
}

/* ---------- 一覧 ---------- */

.news-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.news-list__item + .news-list__item {
  border-top: 1px solid var(--gate-border);
}

.news-list__link {
  display: block;
  text-decoration: none;
  color: inherit;
  padding: 18px 22px;
  transition: background-color 0.15s;
}

.news-list__link:hover {
  background-color: #fff7f3;
}

.news-list__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
}

.news-list__date {
  font-size: 13px;
  color: var(--gate-muted);
  letter-spacing: 0.04em;
}

.news-list__title {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--gate-text);
  line-height: 1.6;
}

.news-list__link:hover .news-list__title {
  color: var(--gate-accent);
}

.news-list__empty {
  padding: 40px 22px;
  text-align: center;
  color: var(--gate-muted);
}

/* ページネーション */

.pagination {
  margin-top: 24px;
  text-align: center;
  font-size: 14px;
}

.pagination .nav-links {
  display: inline-flex;
  gap: 6px;
  align-items: center;
}

.pagination .page-numbers {
  display: inline-block;
  min-width: 36px;
  padding: 6px 10px;
  border-radius: 8px;
  background-color: #fff;
  border: 1px solid var(--gate-border);
  color: var(--gate-text);
  text-decoration: none;
  line-height: 1.4;
}

.pagination .page-numbers.current {
  background-color: var(--gate-dark);
  border-color: var(--gate-dark);
  color: #fff;
}

.pagination .page-numbers:hover:not(.current) {
  border-color: var(--gate-accent);
  color: var(--gate-accent);
}

/* ---------- 詳細ページ ---------- */

.single-article {
  padding: 30px 34px 40px;
}

@media screen and (max-width: 599px) {
  .single-article {
    padding: 22px 18px 30px;
  }
}

.single-article__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.single-article__date {
  font-size: 14px;
  color: var(--gate-muted);
  letter-spacing: 0.04em;
}

.single-article__title {
  margin: 0 0 22px;
  font-size: 24px;
  font-weight: 700;
  line-height: 1.55;
  padding-bottom: 18px;
  border-bottom: 3px solid var(--gate-dark);
}

@media screen and (max-width: 599px) {
  .single-article__title {
    font-size: 19px;
  }
}

/* 本文 */

.entry-content {
  font-size: 15px;
}

.entry-content p {
  margin: 0 0 1.4em;
}

.entry-content a {
  color: var(--gate-link);
  word-break: break-all;
}

.entry-content h2 {
  font-size: 19px;
  margin: 2em 0 0.8em;
  padding-left: 12px;
  border-left: 5px solid var(--gate-accent);
  line-height: 1.5;
}

.entry-content h3 {
  font-size: 17px;
  margin: 1.8em 0 0.7em;
}

.entry-content ul,
.entry-content ol {
  margin: 0 0 1.4em;
  padding-left: 1.6em;
}

.entry-content table {
  border-collapse: collapse;
  margin: 0 0 1.4em;
  width: 100%;
  font-size: 14px;
}

.entry-content th,
.entry-content td {
  border: 1px solid var(--gate-border);
  padding: 8px 12px;
  text-align: left;
}

.entry-content th {
  background-color: #f6f6f8;
}

/* 図版: 原寸ベースで大きく表示し、クリックで拡大 */

.entry-content img {
  display: block;
  margin: 1.6em auto;
  max-width: min(100%, 720px);
  width: auto;
  height: auto;
  border: 1px solid var(--gate-border);
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  background-color: #fff;
  cursor: zoom-in;
}

.entry-content img.no-frame {
  border: none;
  box-shadow: none;
  cursor: default;
}

/* 画像拡大(ライトボックス) */

.gate-lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background-color: rgba(0, 0, 0, 0.82);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  cursor: zoom-out;
}

.gate-lightbox img {
  max-width: 96vw;
  max-height: 92vh;
  width: auto;
  height: auto;
  border-radius: 6px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
}

/* 前後の記事ナビ */

.post-nav {
  margin-top: 26px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

@media screen and (max-width: 599px) {
  .post-nav {
    grid-template-columns: 1fr;
  }
}

.post-nav__link {
  display: block;
  padding: 14px 16px;
  text-decoration: none;
  color: inherit;
  background-color: #fff;
  border: 1px solid var(--gate-border);
  border-radius: 10px;
  transition: border-color 0.15s;
}

.post-nav__link:hover {
  border-color: var(--gate-accent);
}

.post-nav__link--next {
  text-align: right;
}

.post-nav__label {
  display: block;
  font-size: 11px;
  color: var(--gate-muted);
  margin-bottom: 2px;
}

.post-nav__title {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* 一覧へ戻る */

.back-to-list {
  margin-top: 26px;
  text-align: center;
}

.back-to-list a {
  display: inline-block;
  padding: 11px 46px;
  background-color: var(--gate-dark);
  color: #fff;
  text-decoration: none;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.06em;
  transition: background-color 0.15s;
}

.back-to-list a:hover {
  background-color: var(--gate-accent);
}

/* ---------- フッター ---------- */

.site-footer {
  background-color: var(--gate-dark);
  color: #fff;
  margin-top: 40px;
}

.site-footer__inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 22px 20px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.site-footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  font-size: 12px;
}

.site-footer__links a {
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
}

.site-footer__links a:hover {
  color: var(--gate-accent);
}

.site-footer__copy {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.6);
}
