/*
Theme Name: Bitentis
Theme URI: https://bitentis.com/
Author: Bitentis
Description: Bitentis専用の軽量な読み物テーマ。
Version: 1.0.0
Requires at least: 6.6
Requires PHP: 8.0
Text Domain: bitentis
*/

:root {
  --bg: #f7f5f0;
  --surface: #fff;
  --soft: #efede7;
  --ink: #18202b;
  --muted: #66717f;
  --line: #dedbd2;
  --brand: #28366f;
  --brand-strong: #17204b;
  --accent: #e7654f;
  --work: #3f68c7;
  --love: #c25372;
  --money: #25846e;
  --stories: #7357aa;
  --radius: 18px;
  --shadow: 0 18px 50px rgba(28, 34, 55, .08);
  --wide: 1180px;
  --content: 760px;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Sans", "Yu Gothic", Meiryo, sans-serif;
  font-size: 16px;
  line-height: 1.85;
  text-rendering: optimizeLegibility;
}

body.nav-open { overflow: hidden; }
a { color: var(--brand); text-decoration-thickness: .08em; text-underline-offset: .18em; }
a:hover { color: var(--accent); }
img { display: block; height: auto; max-width: 100%; }
button, input, select, textarea { font: inherit; }

.screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link:focus {
  clip: auto;
  width: auto;
  height: auto;
  top: 12px;
  left: 12px;
  z-index: 9999;
  padding: 10px 16px;
  background: var(--surface);
  color: var(--ink);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.shell { width: min(calc(100% - 40px), var(--wide)); margin-inline: auto; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(247, 245, 240, .94);
  border-bottom: 1px solid rgba(222, 219, 210, .9);
  backdrop-filter: blur(16px);
}

.header-inner {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
}

.branding { min-width: 0; }
.site-title {
  margin: 0;
  color: var(--brand-strong);
  font-family: Georgia, "Times New Roman", "Yu Mincho", serif;
  font-size: clamp(1.5rem, 2vw, 1.9rem);
  letter-spacing: .025em;
  line-height: 1;
}
.site-title a { color: inherit; text-decoration: none; }
.site-tagline { margin: 6px 0 0; color: var(--muted); font-size: .74rem; line-height: 1.3; }

.primary-nav ul {
  display: flex;
  align-items: center;
  gap: 26px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.primary-nav a { color: var(--ink); font-size: .92rem; font-weight: 700; text-decoration: none; }
.primary-nav a:hover,
.primary-nav .current-menu-item > a { color: var(--accent); }

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  cursor: pointer;
}
.nav-toggle span:not(.screen-reader-text),
.nav-toggle span:not(.screen-reader-text)::before,
.nav-toggle span:not(.screen-reader-text)::after {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--ink);
}
.nav-toggle span:not(.screen-reader-text) { position: relative; margin: auto; }
.nav-toggle span:not(.screen-reader-text)::before,
.nav-toggle span:not(.screen-reader-text)::after { content: ""; position: absolute; left: 0; }
.nav-toggle span:not(.screen-reader-text)::before { top: -6px; }
.nav-toggle span:not(.screen-reader-text)::after { top: 6px; }

.site-main { min-height: 60vh; }

.hero {
  position: relative;
  overflow: hidden;
  padding: clamp(68px, 10vw, 130px) 0 clamp(60px, 9vw, 110px);
  background:
    radial-gradient(circle at 78% 18%, rgba(231, 101, 79, .17), transparent 28%),
    radial-gradient(circle at 13% 76%, rgba(63, 104, 199, .16), transparent 30%),
    linear-gradient(150deg, #f9f8f4, #f0eee8);
  border-bottom: 1px solid var(--line);
}
.hero::after {
  content: "";
  position: absolute;
  right: -90px;
  bottom: -180px;
  width: 430px;
  height: 430px;
  border: 1px solid rgba(40, 54, 111, .14);
  border-radius: 50%;
  box-shadow: 0 0 0 70px rgba(40, 54, 111, .035), 0 0 0 140px rgba(40, 54, 111, .02);
}
.hero-content { position: relative; z-index: 1; max-width: 790px; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 22px;
  color: var(--brand);
  font-size: .76rem;
  font-weight: 800;
  letter-spacing: .16em;
  text-transform: uppercase;
}
.eyebrow::before { content: ""; width: 28px; height: 2px; background: var(--accent); }

.hero-title {
  max-width: 720px;
  margin: 0;
  color: var(--brand-strong);
  font-family: Georgia, "Times New Roman", "Yu Mincho", serif;
  font-size: clamp(2.5rem, 7vw, 5.2rem);
  letter-spacing: -.035em;
  line-height: 1.12;
}
.hero-lead { max-width: 650px; margin: 30px 0 0; color: #4e5968; font-size: clamp(1rem, 2vw, 1.16rem); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 34px; }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 11px 22px;
  border: 1px solid var(--brand);
  border-radius: 999px;
  background: var(--brand);
  color: #fff;
  font-size: .9rem;
  font-weight: 800;
  text-decoration: none;
  transition: transform 160ms ease, background 160ms ease;
}
.button:hover { transform: translateY(-2px); background: var(--brand-strong); color: #fff; }
.button-secondary { background: transparent; color: var(--brand); }
.button-secondary:hover { color: #fff; }

.home-section { padding: clamp(62px, 8vw, 102px) 0; }
.home-section + .home-section { border-top: 1px solid var(--line); }
.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 34px;
}
.section-title,
.archive-title,
.entry-title {
  margin: 0;
  color: var(--brand-strong);
  font-family: Georgia, "Times New Roman", "Yu Mincho", serif;
  letter-spacing: -.02em;
  line-height: 1.25;
}
.section-title { font-size: clamp(1.8rem, 4vw, 2.65rem); }
.section-description { max-width: 560px; margin: 10px 0 0; color: var(--muted); font-size: .94rem; }
.text-link { flex: 0 0 auto; font-size: .86rem; font-weight: 800; text-decoration: none; }
.text-link::after { content: " →"; }

.category-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.category-tile {
  position: relative;
  overflow: hidden;
  min-height: 210px;
  padding: 27px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 10px 30px rgba(30, 34, 52, .035);
  text-decoration: none;
  transition: transform 180ms ease, box-shadow 180ms ease;
}
.category-tile:hover { transform: translateY(-5px); box-shadow: var(--shadow); }
.category-tile::after {
  content: "";
  position: absolute;
  right: -36px;
  bottom: -36px;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: var(--tone, var(--brand));
  opacity: .1;
}
.category-kicker { color: var(--tone, var(--brand)); font-size: .72rem; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; }
.category-name { margin: 24px 0 8px; color: var(--ink); font-size: 1.28rem; line-height: 1.4; }
.category-copy { margin: 0; color: var(--muted); font-size: .85rem; line-height: 1.7; }

.post-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.post-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 10px 32px rgba(30, 34, 52, .04);
  transition: transform 180ms ease, box-shadow 180ms ease;
}
.post-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.post-card-media {
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(40, 54, 111, .95), rgba(115, 87, 170, .78));
}
.post-card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform 300ms ease; }
.post-card:hover .post-card-media img { transform: scale(1.035); }
.post-card-placeholder {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  color: rgba(255,255,255,.9);
  font-family: Georgia, serif;
  font-size: 2rem;
}
.post-card-body { padding: 22px 22px 24px; }
.post-meta { display: flex; flex-wrap: wrap; gap: 8px 12px; color: var(--muted); font-size: .73rem; font-weight: 700; }
.category-label { color: var(--tone, var(--brand)); text-decoration: none; }
.post-card-title { margin: 12px 0 0; font-size: 1.12rem; line-height: 1.55; }
.post-card-title a { color: var(--ink); text-decoration: none; }
.post-card-excerpt { margin-top: 12px; color: var(--muted); font-size: .84rem; line-height: 1.75; }

.empty-state {
  padding: 40px;
  border: 1px dashed #c9c5ba;
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--muted);
  text-align: center;
}

.editorial-note {
  display: grid;
  grid-template-columns: 1.3fr .7fr;
  gap: 50px;
  align-items: center;
  padding: clamp(34px, 6vw, 64px);
  border-radius: 26px;
  background: var(--brand-strong);
  color: #fff;
  box-shadow: var(--shadow);
}
.editorial-note h2 { margin: 0; font-family: Georgia, "Yu Mincho", serif; font-size: clamp(1.7rem, 4vw, 2.6rem); line-height: 1.35; }
.editorial-note p { margin: 18px 0 0; color: rgba(255,255,255,.76); font-size: .92rem; }
.editorial-note .button { justify-self: end; border-color: #fff; background: #fff; color: var(--brand-strong); }

.archive-header { padding: clamp(58px, 8vw, 94px) 0 48px; border-bottom: 1px solid var(--line); }
.archive-title { max-width: 850px; font-size: clamp(2rem, 5vw, 3.6rem); }
.archive-description { max-width: 720px; margin-top: 18px; color: var(--muted); }
.archive-content { padding: 54px 0 90px; }

.entry-wrap { width: min(calc(100% - 40px), var(--content)); margin-inline: auto; padding: clamp(54px, 8vw, 92px) 0; }
.entry-header { margin-bottom: 34px; }
.entry-title { margin-top: 14px; font-size: clamp(2rem, 5.5vw, 3.7rem); letter-spacing: -.025em; line-height: 1.28; }
.entry-thumbnail { margin: 0 0 42px; overflow: hidden; border-radius: var(--radius); box-shadow: var(--shadow); }
.entry-content { font-size: clamp(1rem, 1.5vw, 1.08rem); }
.entry-content h2,
.entry-content h3 { color: var(--brand-strong); line-height: 1.45; }
.entry-content h2 { margin: 2.5em 0 .85em; padding-bottom: .45em; border-bottom: 2px solid var(--line); font-size: 1.55em; }
.entry-content h3 { margin: 2em 0 .75em; font-size: 1.28em; }
.entry-content p,
.entry-content ul,
.entry-content ol,
.entry-content blockquote { margin-top: 1.35em; margin-bottom: 1.35em; }
.entry-content blockquote { padding: 1.2em 1.4em; border-left: 4px solid var(--accent); background: var(--soft); }
.entry-content table { width: 100%; border-collapse: collapse; font-size: .92em; }
.entry-content th,
.entry-content td { padding: 12px; border: 1px solid var(--line); text-align: left; }
.entry-content th { background: var(--soft); }
.content-notice { margin-top: 38px; padding: 18px 20px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--muted); font-size: .82rem; }

.nav-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 46px; }
.page-numbers {
  display: grid;
  place-items: center;
  min-width: 42px;
  height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
}
.page-numbers.current,
.page-numbers:hover { background: var(--brand); border-color: var(--brand); color: #fff; }

.site-footer { padding: 58px 0 28px; background: #12182c; color: rgba(255,255,255,.76); }
.footer-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 50px; }
.footer-brand { margin: 0; color: #fff; font-family: Georgia, serif; font-size: 1.8rem; }
.footer-copy { max-width: 520px; margin: 14px 0 0; font-size: .85rem; }
.footer-nav ul { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 12px 22px; margin: 0; padding: 0; list-style: none; }
.footer-nav a { color: #fff; font-size: .82rem; font-weight: 700; text-decoration: none; }
.footer-bottom { display: flex; justify-content: space-between; gap: 24px; margin-top: 44px; padding-top: 24px; border-top: 1px solid rgba(255,255,255,.14); font-size: .74rem; }
.footer-bottom p { margin: 0; }

@media (max-width: 940px) {
  .category-grid,
  .post-grid { grid-template-columns: repeat(2, 1fr); }
  .nav-toggle { display: block; }
  .primary-nav {
    position: fixed;
    inset: 77px 0 auto;
    padding: 24px 20px 34px;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    transform: translateY(-120%);
    visibility: hidden;
    transition: transform 220ms ease, visibility 220ms ease;
  }
  .primary-nav.is-open { transform: translateY(0); visibility: visible; }
  .primary-nav ul { width: min(100%, var(--wide)); margin-inline: auto; flex-direction: column; align-items: stretch; gap: 0; }
  .primary-nav li + li { border-top: 1px solid var(--line); }
  .primary-nav a { display: block; padding: 14px 4px; font-size: 1rem; }
}

@media (max-width: 680px) {
  .shell,
  .entry-wrap { width: min(calc(100% - 28px), var(--wide)); }
  .header-inner { min-height: 68px; }
  .site-tagline { display: none; }
  .primary-nav { top: 69px; }
  .hero { padding-top: 66px; }
  .hero-title { font-size: clamp(2.35rem, 13vw, 3.6rem); }
  .section-heading { align-items: start; flex-direction: column; }
  .category-grid,
  .post-grid { grid-template-columns: 1fr; }
  .category-tile { min-height: 175px; }
  .editorial-note { grid-template-columns: 1fr; gap: 28px; }
  .editorial-note .button { justify-self: start; }
  .footer-grid { grid-template-columns: 1fr; }
  .footer-nav ul { justify-content: flex-start; }
  .footer-bottom { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
