/* =========================================================
   MY TECH BLOG トップページ（mtb-top.css）
   置き場所：子テーマ直下。mtb-top.php がトップページだけで読み込む。
   ========================================================= */

/* ---------- 色と書体（ここを変えれば全体に反映） ---------- */
.mtb-top {
  --mtb-navy: #1f2a44;
  --mtb-navy-2: #2a3654;
  --mtb-navy-line: #3a4768;
  --mtb-ink: #1b2130;
  --mtb-sub: #5a6172;
  --mtb-line: #e3e6ea;
  --mtb-line-2: #cfd4db;
  --mtb-gray: #f5f6f8;
  --mtb-accent: #a33a2b;
  --mtb-accent-dark: #8a3124;
  --mtb-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: var(--mtb-ink);
  font-size: 15px;
  line-height: 1.7;
}

/* ---------- 帯を画面幅いっぱいに広げる ---------- */
body:has(.mtb-top) {
  overflow-x: clip;
}
.post_content > .mtb-top {
  margin: 0 calc(50% - 50vw) !important;
}

/* ---------- SWELL の本文装飾を打ち消す ---------- */
.mtb-top.mtb-top :where(h2, h3, p, ul, li, summary) {
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  box-shadow: none;
  color: inherit;
  font-size: inherit;
  line-height: inherit;
  letter-spacing: normal;
}
.mtb-top.mtb-top :where(h2, h3)::before,
.mtb-top.mtb-top :where(h2, h3)::after,
.mtb-top.mtb-top :where(li)::before {
  content: none;
}
.mtb-top.mtb-top :where(ul) {
  list-style: none;
}
.mtb-top.mtb-top :where(a) {
  color: inherit;
  text-decoration: none;
}
.mtb-top.mtb-top :where(a:focus-visible, summary:focus-visible) {
  outline: 2px solid var(--mtb-accent);
  outline-offset: 2px;
}
.mtb-top summary {
  list-style: none;
}
.mtb-top summary::-webkit-details-marker {
  display: none;
}

/* ---------- レイアウトの土台 ---------- */
.mtb-top .mtb-inner {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 24px;
  box-sizing: border-box;
}
.mtb-top.mtb-band {
  padding: 68px 0;
}
.mtb-top.mtb-band--navy {
  background: var(--mtb-navy);
  color: #ffffff;
}
.mtb-top.mtb-band--gray {
  background: var(--mtb-gray);
  border-top: 1px solid var(--mtb-line);
  border-bottom: 1px solid var(--mtb-line);
}
.mtb-top.mtb-band--white {
  background: #ffffff;
}
.mtb-top.mtb-band--line {
  border-top: 1px solid var(--mtb-line);
}

/* ---------- 共通パーツ ---------- */
.mtb-top .mtb-eyebrow {
  font-family: var(--mtb-mono);
  font-size: 12px;
  letter-spacing: .22em;
  color: #b9c3d8;
}
.mtb-top .mtb-eyebrow--accent {
  color: var(--mtb-accent);
}

/* 中央見出し（両脇に短い線） */
.mtb-top .mtb-sec__head {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin-bottom: 36px;
  text-align: center;
}
.mtb-top .mtb-sec__title {
  display: flex;
  align-items: center;
  gap: 18px;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: .06em;
  line-height: 1.4;
}
.mtb-top .mtb-sec__title::before,
.mtb-top .mtb-sec__title::after {
  content: "";
  display: block;
  position: static;
  flex: 0 0 36px;
  width: 36px;
  height: 2px;
  background: currentColor;
  border: 0;
  transform: none;
}
.mtb-top .mtb-sec__lead {
  max-width: 620px;
  font-size: 13px;
  line-height: 1.8;
  color: var(--mtb-sub);
}
.mtb-top .mtb-sec__foot {
  display: flex;
  justify-content: center;
  margin-top: 44px;
}

/* ボタン */
.mtb-top .mtb-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 28px;
}
.mtb-top .mtb-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 32px;
  box-sizing: border-box;
  background: #ffffff;
  border: 1px solid var(--mtb-line-2);
  border-radius: 4px;
  font-size: 13px;
  color: var(--mtb-ink);
}
.mtb-top .mtb-btn:hover {
  border-color: var(--mtb-navy);
  color: var(--mtb-ink);
}
.mtb-top .mtb-btn--accent {
  background: var(--mtb-accent);
  border: 0;
  border-radius: 23px;
  color: #ffffff;
  font-weight: 700;
}
.mtb-top .mtb-btn--accent:hover {
  background: var(--mtb-accent-dark);
  color: #ffffff;
}
.mtb-top .mtb-btn--ghost {
  background: transparent;
  border-color: #ffffff;
  color: #ffffff;
}
.mtb-top .mtb-btn--ghost:hover {
  background: rgba(255, 255, 255, .08);
  color: #ffffff;
}

/* ---------- ヒーロー ---------- */
.mtb-top.mtb-s-hero {
  padding: 60px 0 54px;
  text-align: center;
}
.mtb-top .mtb-hero__eyebrow {
  margin-bottom: 14px;
  font-size: 11px;
}
.mtb-top .mtb-hero__title {
  margin-bottom: 14px;
  font-size: 32px;
  font-weight: 700;
  letter-spacing: .06em;
  line-height: 1.45;
  color: #ffffff;
}
.mtb-top .mtb-hero__lead {
  max-width: 640px;
  margin: 0 auto;
  font-size: 14px;
  line-height: 1.85;
  color: #dbe1ec;
}

/* ---------- ツール欄 ---------- */
.mtb-top.mtb-s-tools {
  padding: 20px 0;
  border-top: 0;
}
.mtb-top .mtb-tools__label {
  margin-bottom: 10px;
  font-family: var(--mtb-mono);
  font-size: 12px;
  letter-spacing: .18em;
  color: var(--mtb-sub);
}
.mtb-top .mtb-tools__list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.mtb-top .mtb-tool {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 12px;
  box-sizing: border-box;
  background: #ffffff;
  border: 1px solid var(--mtb-line);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.4;
  text-align: center;
  color: var(--mtb-ink);
}
.mtb-top .mtb-tool:hover {
  border-color: var(--mtb-navy);
  color: var(--mtb-ink);
}
.mtb-top .mtb-tool svg {
  flex: 0 0 auto;
}

/* ---------- 新着記事・よく読まれている記事 ---------- */
.mtb-top .mtb-feed__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 56px;
}
.mtb-top .mtb-feed__title {
  margin-bottom: 6px;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: .06em;
  text-align: center;
}
.mtb-top .mtb-feed__note {
  margin-bottom: 22px;
  font-size: 12px;
  text-align: center;
  color: var(--mtb-sub);
}

/* 新着（横長サムネイル＋タイトル） */
.mtb-top .mtb-latest {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.mtb-top .mtb-latest__item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  color: var(--mtb-ink);
}
.mtb-top .mtb-latest__thumb {
  position: relative;
  flex: 0 0 132px;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #e8ebf0;
  border-radius: 4px;
}
.mtb-top .mtb-latest__thumb img,
.mtb-top .mtb-card__thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  margin: 0;
}
.mtb-top .mtb-cat {
  position: absolute;
  top: 0;
  left: 0;
  padding: 1px 7px;
  background: var(--mtb-navy);
  border-radius: 0 0 4px 0;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.6;
  color: #ffffff;
}
.mtb-top .mtb-latest__body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.mtb-top .mtb-latest__title {
  font-size: 14px;
  font-weight: 500;
  line-height: 1.55;
}
.mtb-top .mtb-latest__date {
  font-size: 12px;
  color: var(--mtb-sub);
}

/* よく読まれている（カード） */
.mtb-top .mtb-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px 16px;
}
.mtb-top .mtb-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: var(--mtb-ink);
}
.mtb-top .mtb-card__thumb {
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #e8ebf0;
  border-radius: 4px;
}
.mtb-top .mtb-card__title {
  font-size: 13px;
  font-weight: 500;
  line-height: 1.5;
}

.mtb-top .mtb-latest__item:hover .mtb-latest__title,
.mtb-top .mtb-card:hover .mtb-card__title,
.mtb-top .mtb-vuln:hover .mtb-vuln__title {
  color: var(--mtb-accent);
}

/* ---------- 最近の脆弱性対応記事 ---------- */
.mtb-top .mtb-vulns {
  overflow: hidden;
  background: #ffffff;
  border: 1px solid var(--mtb-line);
  border-radius: 8px;
}
.mtb-top .mtb-vulns > li + li {
  border-top: 1px solid #eef0f3;
}
.mtb-top .mtb-vuln {
  display: grid;
  grid-template-columns: 84px 110px 170px minmax(0, 1fr);
  align-items: center;
  gap: 6px 16px;
  padding: 16px 20px;
  color: var(--mtb-ink);
}
.mtb-top .mtb-vuln__date {
  font-size: 12px;
  color: var(--mtb-sub);
}
.mtb-top .mtb-vuln__vendor {
  justify-self: start;
  padding: 1px 10px;
  border: 1px solid var(--mtb-line-2);
  border-radius: 12px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.6;
  white-space: nowrap;
}
.mtb-top .mtb-vuln__vendor:empty {
  padding: 0;
  border: 0;
}
.mtb-top .mtb-vuln__cve {
  font-family: var(--mtb-mono);
  font-size: 12px;
  color: #3f4757;
  overflow-wrap: anywhere;
}
.mtb-top .mtb-vuln__title {
  font-size: 14px;
  font-weight: 500;
  line-height: 1.55;
}

/* ---------- FortiGate 運用まとめ ---------- */
.mtb-top .mtb-hub__head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px 32px;
  margin-bottom: 28px;
}
.mtb-top .mtb-hub__intro {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1 1 420px;
}
.mtb-top .mtb-hub__title {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: .06em;
  line-height: 1.4;
  color: #ffffff;
}
.mtb-top .mtb-hub__lead {
  font-size: 13px;
  color: #dbe1ec;
}
.mtb-top .mtb-hub__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  align-items: start;
  gap: 14px;
}
.mtb-top .mtb-hub__group {
  padding: 0 16px;
  background: var(--mtb-navy-2);
  border-radius: 6px;
}
.mtb-top .mtb-hub__group > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 52px;
  font-size: 14px;
  font-weight: 700;
  color: #ffffff;
}
.mtb-top .mtb-hub__count {
  font-family: var(--mtb-mono);
  font-size: 11px;
  font-weight: 500;
  color: #b9c3d8;
  white-space: nowrap;
}
.mtb-top .mtb-hub__group ul {
  margin-bottom: 14px;
  border-top: 1px solid var(--mtb-navy-line);
}
.mtb-top .mtb-hub__group li {
  border-bottom: 1px solid var(--mtb-navy-line);
}
.mtb-top .mtb-hub__group a {
  display: flex;
  align-items: center;
  min-height: 40px;
  padding: 6px 0;
  box-sizing: border-box;
  font-size: 13px;
  line-height: 1.5;
  color: #e6eaf2;
}
.mtb-top .mtb-hub__group a:hover {
  color: #ffffff;
  text-decoration: underline;
}

/* ---------- カテゴリ別の記事一覧 ---------- */
.mtb-top .mtb-cols {
  display: grid;
  grid-template-columns: repeat(var(--mtb-cols, 4), minmax(0, 1fr));
  gap: 40px 32px;
}
.mtb-top .mtb-col > summary {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.mtb-top .mtb-col__name {
  display: block;
  width: 100%;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--mtb-ink);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: .04em;
  text-align: center;
}
.mtb-top .mtb-col__icon {
  width: 44px;
  height: 44px;
  margin: 28px 0;
  fill: none;
  stroke: var(--mtb-ink);
  stroke-width: 1.3;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.mtb-top .mtb-links li {
  border-bottom: 1px solid var(--mtb-line);
}
.mtb-top .mtb-links a {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  min-height: 44px;
  padding: 10px 0;
  box-sizing: border-box;
  font-size: 13px;
  line-height: 1.55;
  color: var(--mtb-ink);
}
.mtb-top .mtb-links a::before {
  content: "";
  flex: 0 0 6px;
  height: 6px;
  margin-top: 8px;
  background: var(--mtb-accent);
  border-radius: 50%;
}
.mtb-top .mtb-links a:hover {
  color: var(--mtb-accent);
}
.mtb-top .mtb-badge {
  flex: 0 0 auto;
  margin-left: auto;
  padding: 0 6px;
  background: #e3e8f2;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 700;
  line-height: 18px;
  color: var(--mtb-navy);
}
.mtb-top .mtb-col__more {
  display: flex;
  justify-content: center;
  margin-top: 16px;
}
.mtb-top .mtb-col__more a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 22px;
  box-sizing: border-box;
  background: #ffffff;
  border: 1px solid var(--mtb-line-2);
  border-radius: 4px;
  font-size: 12px;
  color: var(--mtb-ink);
}
.mtb-top .mtb-col__more a:hover {
  border-color: var(--mtb-navy);
}

/* ---------- ベンダーから探す ---------- */
.mtb-top.mtb-s-vendors {
  padding: 56px 0;
}
.mtb-top .mtb-vendors__title {
  margin-bottom: 22px;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: .06em;
  text-align: center;
}
.mtb-top .mtb-chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 10px;
}
.mtb-top .mtb-chips a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 16px;
  box-sizing: border-box;
  background: #ffffff;
  border: 1px solid #d6dbe2;
  border-radius: 20px;
  font-size: 13px;
  color: var(--mtb-ink);
}
.mtb-top .mtb-chips a:hover {
  border-color: var(--mtb-navy);
}

/* ---------- PC・タブレット：アコーディオンは常に開いた見出しとして扱う ---------- */
@media (min-width: 600px) {
  .mtb-top .mtb-acc > details > summary {
    pointer-events: none;
    cursor: default;
  }
}

/* ---------- タブレット（959px 以下） ---------- */
@media (max-width: 959px) {
  .mtb-top .mtb-feed__grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 48px;
  }
  .mtb-top .mtb-cols {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .mtb-top .mtb-vuln {
    grid-template-columns: 84px 110px minmax(0, 1fr);
  }
  .mtb-top .mtb-vuln__title {
    grid-column: 1 / -1;
  }
}

/* ---------- スマートフォン（599px 以下） ---------- */
@media (max-width: 599px) {
  .mtb-top .mtb-inner {
    padding: 0 16px;
  }
  .mtb-top.mtb-band {
    padding: 48px 0;
  }
  .mtb-top.mtb-s-hero {
    padding: 40px 0 36px;
  }
  .mtb-top .mtb-hero__title {
    font-size: 22px;
  }
  .mtb-top .mtb-hero__lead {
    text-align: left;
  }
  .mtb-top.mtb-s-tools {
    padding: 16px 0;
  }
  .mtb-top .mtb-tools__list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
  .mtb-top .mtb-sec__head {
    margin-bottom: 24px;
  }
  .mtb-top .mtb-sec__title,
  .mtb-top .mtb-hub__title {
    font-size: 21px;
  }
  .mtb-top .mtb-sec__foot {
    margin-top: 24px;
  }
  .mtb-top .mtb-latest__thumb {
    flex-basis: 96px;
  }
  .mtb-top .mtb-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .mtb-top .mtb-vuln {
    grid-template-columns: auto auto minmax(0, 1fr);
    padding: 14px 16px;
  }
  .mtb-top.mtb-s-vendors {
    padding: 40px 0;
  }

  /* カテゴリ一覧：アコーディオン表示 */
  .mtb-top .mtb-cols {
    display: block;
    border-top: 1px solid #d6dbe2;
  }
  .mtb-top .mtb-col {
    border-bottom: 1px solid #d6dbe2;
  }
  .mtb-top .mtb-col > summary {
    flex-direction: row;
    gap: 12px;
    min-height: 56px;
    cursor: pointer;
  }
  .mtb-top .mtb-col__icon {
    order: -1;
    width: 24px;
    height: 24px;
    margin: 0;
    stroke-width: 1.5;
  }
  .mtb-top .mtb-col__name {
    flex: 1 1 auto;
    width: auto;
    padding: 0;
    border: 0;
    text-align: left;
  }
  .mtb-top .mtb-acc > details > summary::after {
    content: "+";
    flex: 0 0 auto;
    font-size: 18px;
    line-height: 1;
    color: var(--mtb-sub);
  }
  .mtb-top .mtb-acc > details[open] > summary::after {
    content: "−";
  }
  .mtb-top .mtb-col .mtb-links {
    padding-left: 36px;
  }
  .mtb-top .mtb-col .mtb-links li:last-child {
    border-bottom: 0;
  }
  .mtb-top .mtb-col__more {
    justify-content: flex-start;
    margin: 0 0 12px;
    padding-left: 36px;
  }

  /* FortiGate まとめ：1列のアコーディオン */
  .mtb-top .mtb-hub__grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
  }
  .mtb-top .mtb-hub__group > summary {
    cursor: pointer;
  }
  .mtb-top .mtb-hub__group > summary::after {
    color: #b9c3d8;
  }
}

/* ---------- ヘッダー（または写真）とヒーローの間の白い隙間をなくす ---------- */
body:has(.mtb-top) #content,
body:has(.mtb-top) .l-content {
  padding-top: 0 !important;
  margin-top: 0 !important;
}
body:has(.mtb-top) .post_content {
  margin-top: 0 !important;
}