/*
Theme Name: Bosai Textbook
Theme URI: https://ai-day.info/
Author: Codex
Description: 防災の教科書向けのメディアテーマ
Version: 1.0.0
Requires at least: 6.0
Text Domain: bosai-textbook
*/

:root {
  --ink: #0c0d0c;
  --muted: #5f675e;
  --green: #47763e;
  --green-dark: #315c2d;
  --green-soft: #eff4ea;
  --cream: #f7f5ed;
  --line: #dcded8;
  --paper: #ffffff;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "BIZ UDPGothic", "Noto Sans JP", "Yu Gothic Medium", "Yu Gothic", "Hiragino Sans", "Meiryo", system-ui, sans-serif;
  font-size: 16px;
  letter-spacing: 0;
  line-height: 1.9;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

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

.bt-shell {
  width: min(1120px, calc(100% - 72px));
  margin: 0 auto;
}

.site-header {
  padding: 34px 0 28px;
}

.header-row {
  display: grid;
  grid-template-columns: 310px 1fr 34px;
  align-items: start;
  gap: 32px;
}

.brand-title {
  display: block;
  font-size: 29px;
  font-weight: 900;
  line-height: 1.15;
  letter-spacing: .12em;
}

.brand-subtitle {
  margin-top: 10px;
  color: #28302a;
  font-size: 13px;
  font-weight: 500;
}

.main-nav {
  display: flex;
  justify-content: center;
  gap: 38px;
  padding-top: 8px;
  font-size: 14px;
  font-weight: 800;
}

.main-nav a {
  position: relative;
  padding: 0 0 14px;
}

.main-nav a.is-active::after {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 3px;
  background: var(--green);
  content: "";
}

.search-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  margin-top: 2px;
}

.hero {
  display: grid;
  grid-template-columns: .9fr 1.1fr;
  align-items: center;
  gap: 34px;
  padding: 56px 0 60px;
}

.hero-copy {
  min-width: 0;
}

.hero h1 {
  margin: 0 0 28px;
  font-size: clamp(40px, 5.2vw, 68px);
  font-weight: 950;
  line-height: 1.17;
  letter-spacing: .08em;
  white-space: nowrap;
}

.hero-lead {
  margin: 0 0 28px;
  font-size: 25px;
  font-weight: 500;
  line-height: 1.85;
}

.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 226px;
  height: 50px;
  padding: 0 28px;
  border-radius: 999px;
  background: linear-gradient(135deg, #568747, #3e7037);
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  box-shadow: 0 14px 26px rgba(60, 104, 53, .18);
}

.primary-button span {
  margin-left: 28px;
  font-size: 20px;
  line-height: 1;
}

.note-pill {
  display: flex;
  align-items: center;
  gap: 17px;
  width: min(470px, 100%);
  margin-top: 36px;
  padding: 12px 20px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: #2c332d;
  font-size: 14px;
  font-weight: 700;
}

.hero-art {
  min-width: 0;
}

.hero-image {
  display: block;
  width: min(100%, 620px);
  margin-left: auto;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin: 12px 0 20px;
}

.section-heading h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 900;
}

.view-all {
  color: var(--green);
  font-size: 13px;
  font-weight: 800;
}

.view-all span {
  margin-left: 14px;
  font-size: 20px;
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 16px;
}

.category-card {
  min-height: 216px;
  padding: 24px 18px 18px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.category-card:hover {
  transform: translateY(-3px);
  border-color: #b8c9b3;
  box-shadow: 0 18px 34px rgba(26, 42, 22, .08);
}

.category-icon {
  display: grid;
  place-items: center;
  height: 58px;
  color: var(--green);
}

.category-card h3 {
  margin: 14px 0 10px;
  text-align: center;
  font-size: 15px;
  font-weight: 900;
}

.category-card p {
  min-height: 54px;
  margin: 0;
  text-align: center;
  color: #313832;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.9;
}

.card-arrow {
  display: block;
  margin-top: 12px;
  text-align: right;
  color: var(--green);
  font-size: 22px;
}

.articles-layout {
  display: grid;
  grid-template-columns: 1fr 244px;
  gap: 22px;
  margin-top: 42px;
}

.post-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.post-card {
  overflow: hidden;
  min-height: 354px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.post-thumb {
  height: 128px;
  background: var(--cream);
}

.post-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.post-card-body {
  padding: 20px 18px 15px;
}

.post-date {
  color: #7b8378;
  font-size: 12px;
  font-weight: 600;
}

.post-category {
  display: block;
  margin: 12px 0 9px;
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
}

.post-card h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 900;
  line-height: 1.8;
}

.post-card .card-arrow {
  margin-top: 22px;
}

.ranking-box {
  align-self: start;
  padding: 22px 20px 24px;
  border-radius: 8px;
  background: linear-gradient(135deg, #f4f6ee, #eef4e8);
}

.ranking-box h2 {
  margin: 0 0 18px;
  font-size: 20px;
  font-weight: 900;
}

.ranking-list {
  display: grid;
  gap: 18px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ranking-list a {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 12px;
  align-items: start;
}

.ranking-number {
  color: var(--green);
  font-size: 24px;
  font-weight: 800;
  line-height: 1.1;
}

.ranking-title {
  font-size: 12px;
  font-weight: 900;
  line-height: 1.75;
}

.ranking-more {
  display: block;
  margin-top: 18px;
  text-align: right;
  color: var(--green);
  font-size: 13px;
  font-weight: 800;
}

.about-band {
  display: grid;
  grid-template-columns: 220px 1fr 240px;
  align-items: center;
  gap: 42px;
  margin: 32px 0 54px;
  padding: 24px 48px;
  border-radius: 8px;
  background: linear-gradient(135deg, #f4f6ed, #fbfaf4);
}

.about-figure {
  display: flex;
  align-items: center;
  justify-content: center;
}

.about-figure svg {
  width: 178px;
  max-width: 100%;
}

.about-band h2 {
  margin: 0 0 8px;
  font-size: 22px;
  font-weight: 900;
}

.about-band p {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  line-height: 2;
}

.outline-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 48px;
  padding: 0 28px;
  border: 1px solid var(--green);
  border-radius: 999px;
  color: var(--green-dark);
  font-size: 13px;
  font-weight: 900;
}

.outline-button span {
  margin-left: 18px;
  font-size: 20px;
}

.site-footer {
  padding: 44px 0 26px;
  background: #f7f7f5;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.1fr .7fr .7fr 1.2fr;
  gap: 62px;
}

.footer-brand {
  font-size: 23px;
  font-weight: 900;
  letter-spacing: .12em;
}

.footer-copy,
.footer-text,
.footer-links a {
  color: #333a34;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.9;
}

.footer-title {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 900;
}

.footer-links {
  display: grid;
  gap: 3px;
}

.socials {
  display: flex;
  gap: 22px;
  margin-top: 26px;
  color: #111;
}

.copyright {
  margin-top: 22px;
  text-align: center;
  color: #777d75;
  font-size: 12px;
}

.content-page {
  width: min(820px, calc(100% - 72px));
  margin: 36px auto 76px;
}

.content-page h1 {
  margin: 0 0 24px;
  font-size: clamp(34px, 5vw, 54px);
  font-weight: 950;
  line-height: 1.25;
  letter-spacing: .05em;
}

.content-page h2 {
  margin-top: 38px;
  font-size: 26px;
}

.content-page p,
.content-page li {
  font-size: 17px;
  line-height: 2;
}

.content-page a {
  color: var(--green);
  font-weight: 800;
}

.single-featured-image {
  margin: 0 0 34px;
}

.single-featured-image img {
  display: block;
  width: 100%;
  border-radius: 8px;
  box-shadow: 0 18px 42px rgba(26, 34, 22, .08);
}

@media (max-width: 980px) {
  .bt-shell {
    width: min(100% - 36px, 720px);
  }

  .header-row {
    grid-template-columns: 1fr 34px;
  }

  .main-nav {
    grid-column: 1 / -1;
    order: 3;
    justify-content: flex-start;
    gap: 22px;
    overflow-x: auto;
    padding-bottom: 6px;
  }

  .hero,
  .articles-layout,
  .about-band,
  .footer-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    padding-top: 30px;
  }

  .hero-art {
    order: -1;
  }

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

  .about-band {
    padding: 26px 24px;
  }
}

@media (max-width: 620px) {
  .site-header {
    padding-top: 24px;
  }

  .brand-title {
    font-size: 23px;
  }

  .hero h1 {
    font-size: clamp(32px, 10vw, 42px);
    letter-spacing: .04em;
  }

  .hero-lead {
    font-size: 19px;
  }

  .category-grid,
  .post-grid {
    grid-template-columns: 1fr;
  }

  .articles-layout {
    margin-top: 28px;
  }

  .footer-grid {
    gap: 28px;
  }
}
