/*
Theme Name: Stella Root
Theme URI: https://various-topics.info/
Description: ステラオンライン家庭教師 ルートドメイン用オリジナルテーマ。軽量・レスポンシブ。ブログ機能（サイドバー・人気記事・関連記事・パンくず）内蔵。Stork SEのコンテンツ装飾（box/voice/btn/open/kanren）と互換。
Author: Stella Online Tutoring
Version: 1.5.1
Requires at least: 6.0
Tested up to: 7.1
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: stella-root
*/

/* =====================================================
   1. ベース
   ===================================================== */
*, *::before, *::after { box-sizing: border-box; }

html {
  overflow-x: hidden;
  overflow-x: clip; /* clipなら position:sticky が生きる */
  scroll-behavior: smooth;
  scroll-padding-top: 110px; /* 追従ヘッダーの高さぶん */
  -webkit-text-size-adjust: 100%;
  font-size: 17px; /* remベースの全文字を一段大きく */
}

body {
  margin: 0;
  overflow-x: hidden;
  overflow-x: clip;
  font-family: "Zen Kaku Gothic New", "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Yu Gothic Medium", Meiryo, sans-serif;
  font-size: 1rem;
  font-weight: 500; /* 400だと細く読みにくいため */
  line-height: 1.9;
  color: var(--text, #2a2a2a);
  background: #fff;
  word-break: break-word;
}

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

a { color: #1b60d6; }
a:hover { opacity: 0.85; }

p { margin: 0 0 1.2em; }

table { border-collapse: collapse; max-width: 100%; }

hr {
  border: none;
  border-top: 1px solid #e8e4de;
  margin: 40px 0;
}

/* スクリーンリーダー用 */
.screen-reader-text {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(1px, 1px, 1px, 1px);
}

/* =====================================================
   2. レイアウト（1カラム・中央700px）
   ===================================================== */
.stl-content {
  padding: 0 0 60px;
}

.stl-content__inner {
  max-width: 900px; /* 旧Stork（--stk-main-width: 900px）に合わせる */
  margin: 0 auto;
  padding: 0 15px;
}

/* フル幅ページ（トップなど）：内側paddingなし。
   セクション側の width:100vw テクニックがそのまま機能する */
.stl-content--flat .stl-content__inner {
  padding: 0 15px;
}

/* =====================================================
   3. ヘッダー（スクロール追従・上下圧縮）
   ===================================================== */
.stl-header {
  background: #1a2744;
  position: sticky;
  top: 0;
  z-index: 900;
  box-shadow: 0 2px 12px rgba(10, 18, 38, 0.35);
}

.stl-header__band {
  background: #101c35;
  color: #cdd6e8;
  font-size: 11px;
  font-weight: 500;
  text-align: center;
  padding: 3px 8px;
  letter-spacing: 0.04em;
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stl-header__main {
  text-align: center;
  padding: 4px 12px 0;
}

/* front-pageでタイトルをh1で包んだ時のUAスタイル打ち消し */
h1.stl-header__title-wrap {
  margin: 0;
  font-size: 0;
  line-height: 1;
}

.stl-header__title {
  display: inline-block;
  color: #fff;
  font-size: clamp(18px, 5vw, 22px);
  font-weight: 900;
  letter-spacing: 0.04em;
  text-decoration: none;
  line-height: 1.35;
}

.stl-header__title:hover { opacity: 1; }

.stl-header__title .stl-header__title-sub {
  display: block;
  font-size: 0.68em;
  color: #e8d48e;
  font-weight: 700;
  letter-spacing: 0.08em;
}

/* グローバルナビ（ピル型・スマホは横スクロール） */
.stl-nav {
  padding: 3px 0 8px;
}

.stl-nav ul {
  display: flex;
  gap: 7px;
  list-style: none;
  margin: 0;
  padding: 0 12px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.stl-nav ul::-webkit-scrollbar { display: none; }

.stl-nav a {
  display: block;
  white-space: nowrap;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #fff;
  font-size: 12.5px; /* html 17px化の影響を受けないようpx固定（現状維持） */
  font-weight: 700;
  padding: 4px 13px;
  border-radius: 50px;
  text-decoration: none;
  letter-spacing: 0.02em;
}

@media (min-width: 768px) {
  .stl-nav ul {
    justify-content: center;
    flex-wrap: wrap;
    overflow-x: visible;
  }
}

/* =====================================================
   4. ページ・記事共通
   ===================================================== */
.stl-page-title {
  font-size: 1.4rem;
  font-weight: 900;
  color: #1a2744;
  line-height: 1.6;
  text-align: center;
  margin: 45px 0 10px;
}

.stl-page-title::after {
  content: '';
  display: block;
  width: 50px;
  height: 3px;
  background: linear-gradient(90deg, #c8a84e, #e8d48e);
  margin: 14px auto 0;
  border-radius: 2px;
}

.stl-article { padding-top: 10px; }

/* 記事本文の見出し（ブログ用）
   記事側に customh2 / customh3 / customh4 クラスが付いている見出しは、
   旧カスタマイザーCSSがデザインを持っているのでテーマ側は手を出さない。
   （手を出すと .stl-article h3 の方が詳細度で勝ってしまい、
     紺背景に紺文字＝見えない、という事故になる）
   共通の余白だけはどちらにも効かせる。 */
.stl-article h2 { margin: 50px 0 24px; }
.stl-article h3 { margin: 40px 0 20px; }
.stl-article h4 { margin: 32px 0 16px; }

.stl-article h2:not([class*="custom"]) {
  font-size: 1.2rem;
  font-weight: 800;
  color: #fff;
  line-height: 1.5;
  padding: 14px 16px;
  background: #182172;
  border-left: 6px solid transparent;
  border-image: linear-gradient(to bottom, #c8a84e, #3366cc) 1;
}

.stl-article h3:not([class*="custom"]) {
  font-size: 1.1rem;
  font-weight: 700;
  color: #1a2744;
  line-height: 1.5;
  padding: 10px 0;
  border-bottom: 4px solid #e8e4de;
  position: relative;
}

.stl-article h3:not([class*="custom"])::after {
  content: '';
  position: absolute;
  bottom: -4px; left: 0;
  width: 43px;
  height: 4px;
  background: #c8a84e;
}

/* 投稿メタ */
.stl-post-meta {
  text-align: center;
  color: #999;
  font-size: 0.8rem;
  margin-bottom: 30px;
}

/* アーカイブカード */
.stl-archive-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin: 30px 0 50px;
}

.stl-archive-card {
  display: flex;
  gap: 14px;
  align-items: center;
  background: #fff;
  border: 1px solid #e8e4de;
  border-radius: 12px;
  padding: 14px 16px;
  text-decoration: none;
  color: inherit;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.stl-archive-card__thumb {
  flex: none;
  width: 96px;
  height: 72px;
  border-radius: 8px;
  overflow: hidden;
  background: #f0ede8;
}

.stl-archive-card__thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}

.stl-archive-card__title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #1a2744;
  line-height: 1.6;
}

.stl-archive-card__date {
  display: block;
  font-size: 0.75rem;
  color: #999;
  font-weight: 500;
  margin-top: 4px;
}

/* ページネーション */
.stl-pagination {
  text-align: center;
  margin: 30px 0 50px;
}

.stl-pagination .page-numbers {
  display: inline-block;
  min-width: 38px;
  padding: 7px 10px;
  margin: 0 3px;
  border: 1px solid #d0d8e8;
  border-radius: 8px;
  text-decoration: none;
  color: #1a2744;
  font-weight: 700;
  font-size: 0.9rem;
}

.stl-pagination .page-numbers.current {
  background: #1a2744;
  color: #fff;
  border-color: #1a2744;
}

/* =====================================================
   5. フッター
   ===================================================== */
.stl-footer__bottom {
  background: #101c35;
  color: #8fa0bf;
  text-align: center;
  padding: 28px 16px 34px;
  font-size: 0.78rem;
}

.stl-footer__nav ul {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 20px;
  list-style: none;
  margin: 0 0 18px;
  padding: 0;
}

.stl-footer__nav a {
  color: #cdd6e8;
  text-decoration: none;
  font-weight: 500;
}

.stl-footer__copy { letter-spacing: 0.04em; }

/* トップへ戻る */
.stl-totop {
  position: fixed;
  right: 14px;
  bottom: 18px;
  width: 46px;
  height: 46px;
  border: none;
  border-radius: 10px;
  background: rgba(26, 39, 68, 0.85);
  color: #fff;
  font-size: 1.1rem;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  z-index: 50;
}

.stl-totop.is-show {
  opacity: 1;
  pointer-events: auto;
}

/* =====================================================
   6. ショートコード：吹き出し [voice]
   ===================================================== */
.stl-voice {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin: 26px 0;
}

.stl-voice--r { flex-direction: row-reverse; }

.stl-voice__figure {
  flex: none;
  width: 66px;
  text-align: center;
}

.stl-voice__icon {
  width: 62px;
  height: 62px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #e8e4de;
  display: block;
  margin: 0 auto;
}

.stl-voice__name {
  font-size: 0.68rem;
  color: #666;
  font-weight: 500;
  margin-top: 4px;
  line-height: 1.3;
}

.stl-voice__body {
  position: relative;
  background: #eef3fb;
  border-radius: 14px;
  padding: 14px 16px;
  font-size: 0.95rem;
  line-height: 1.85;
  flex: 1;
  min-width: 0;
}

.stl-voice__body p:last-child { margin-bottom: 0; }

.stl-voice--l .stl-voice__body::before {
  content: '';
  position: absolute;
  top: 22px;
  left: -8px;
  border-style: solid;
  border-width: 7px 10px 7px 0;
  border-color: transparent #eef3fb transparent transparent;
}

.stl-voice--r .stl-voice__body { background: #fdf1ec; }

.stl-voice--r .stl-voice__body::before {
  content: '';
  position: absolute;
  top: 22px;
  right: -8px;
  border-style: solid;
  border-width: 7px 0 7px 10px;
  border-color: transparent transparent transparent #fdf1ec;
}

/* =====================================================
   7. ショートコード：アコーディオン [open]
   ===================================================== */
.stl-open {
  border: 1px solid #e0dcd6;
  border-radius: 12px;
  margin: 16px 0;
  background: #fff;
  overflow: hidden;
}

.stl-open__summary {
  padding: 15px 42px 15px 17px;
  font-weight: 700;
  font-size: 0.97rem;
  color: #1a2744;
  line-height: 1.6;
  cursor: pointer;
  position: relative;
  list-style: none;
  background: #f8f6f2;
}

.stl-open__summary::-webkit-details-marker { display: none; }

/* 中央寄せセクション（.reviewback等）の中でも左寄せを維持 */
.stl-open__summary,
.stl-open__body {
  text-align: left;
}

.stl-open__summary::after {
  content: '＋';
  position: absolute;
  right: 15px;
  top: 50%;
  transform: translateY(-50%);
  color: #c8a84e;
  font-weight: 900;
  font-size: 1.1rem;
}

.stl-open[open] .stl-open__summary::after { content: '－'; }

.stl-open__body {
  padding: 16px 17px 6px;
  font-size: 0.93rem;
  line-height: 1.9;
  border-top: 1px solid #eeeae2;
}

/* =====================================================
   8. ショートコード：ボックス [box]／ボタン [btn]
   ===================================================== */
.stl-box {
  border: 2px solid #2c4a7c;
  border-radius: 12px;
  margin: 22px 0;
  background: #fff;
  overflow: hidden;
}

.stl-box__title {
  background: #2c4a7c;
  color: #fff;
  font-weight: 700;
  font-size: 0.95rem;
  padding: 8px 16px;
  line-height: 1.6;
}

.stl-box__body {
  padding: 14px 17px 4px;
  line-height: 1.9;
  font-size: 0.95rem;
}

.stl-btnwrap {
  text-align: center;
  margin: 26px 0;
}

.btn__link {
  display: inline-block;
  padding: 15px 34px;
  border-radius: 50px;
  font-weight: 700;
  font-size: 1.0rem;
  text-decoration: none;
  line-height: 1.4;
}

.btn__link-secondary {
  background: #fff;
  color: #1a2744;
  border: 2px solid #d0d8e8;
}

/* Stork互換：黄色マーカー */
.span__stk_maker_yellow {
  background: linear-gradient(transparent 60%, #ffef7a 60%);
  font-weight: inherit;
}

/* =====================================================
   9. 悩みチェック（全般版トップ）
   ===================================================== */
.stl-nayami {
  max-width: 640px;
  margin: 0 auto;
  padding: 65px 16px 20px;
}

.stl-nayami__list {
  list-style: none;
  margin: 0 0 30px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.stl-nayami__list li {
  position: relative;
  background: #fff;
  border: 1px solid #e8e4de;
  border-radius: 12px;
  padding: 14px 16px 14px 48px;
  font-weight: 700;
  font-size: 0.98rem;
  color: #2a2a2a;
  line-height: 1.7;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.stl-nayami__list li::before {
  content: '✓';
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: #d94040;
  color: #fff;
  font-size: 0.85rem;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
}

.stl-nayami__arrow {
  text-align: center;
  font-size: 1.8rem;
  color: #c8a84e;
  line-height: 1;
  margin-bottom: 22px;
}

.stl-nayami__punch {
  text-align: center;
  font-size: 1.25rem;
  font-weight: 900;
  color: #1a2744;
  line-height: 1.9;
}

.stl-nayami__punch .stl-accent { color: #d94040; }

.stl-nayami__sub {
  text-align: left;
  font-size: 0.95rem;
  color: #555;
  line-height: 2;
  margin-top: 14px;
}

/* =====================================================
   10. Tree of Study（幹枝葉）
   ===================================================== */
.stl-tree {
  width: 100vw;
  margin-left: calc(50% - 50vw);
  background: linear-gradient(180deg, #f2f6f0 0%, #ffffff 100%);
  padding: 65px 16px 55px;
}

.stl-tree__inner {
  max-width: 640px;
  margin: 0 auto;
}

.stl-tree__img {
  text-align: center;
  margin-bottom: 8px;
}

.stl-tree__img img {
  max-width: 480px;
  width: 100%;
  mix-blend-mode: multiply; /* イラストの白背景をセクション背景に溶け込ませる */
}

.stl-tree__caption {
  text-align: center;
  font-size: 0.8rem;
  color: #888;
  margin-bottom: 30px;
}

.stl-tree__level {
  border-radius: 12px;
  margin-bottom: 14px;
  overflow: hidden;
  background: #fff;
  border: 1px solid #e2ddd2;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.stl-tree__level-head {
  padding: 9px 16px;
  font-weight: 900;
  font-size: 1.0rem;
  color: #fff;
  line-height: 1.5;
}

.stl-tree__level--ne .stl-tree__level-head { background: #8a5a2c; }
.stl-tree__level--miki .stl-tree__level-head { background: #2e7d4f; }
.stl-tree__level--eda .stl-tree__level-head { background: #64748c; }

.stl-tree__level-body {
  padding: 13px 16px;
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.9;
  color: #2a2a2a;
}

.stl-tree__level-body small {
  display: block;
  font-weight: 500;
  color: #777;
  font-size: 0.85em;
}

.stl-tree__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding-top: 4px;
}

.stl-tree__tags span {
  background: #f1f4f8;
  border: 1px solid #dde3ec;
  color: #4a5568;
  font-size: 0.78rem;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 50px;
  line-height: 1.4;
}

.stl-tree .stl-open { margin-top: 8px; }

/* =====================================================
   11. トータルサポート4本柱
   ===================================================== */
.stl-pillars {
  display: grid;
  grid-template-columns: 1fr 1fr; /* スマホでも2枚×2行 */
  gap: 10px;
  max-width: 640px;
  margin: 24px auto 10px;
}

.stl-pillars > div {
  margin: 0;
  line-height: 0;
}

.stl-pillars img {
  border-radius: 12px;
  display: block;
  width: 100%;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.07);
}

.stl-pillars br { display: none; }

/* =====================================================
   12. 保護者の声
   ===================================================== */
.stl-parents {
  max-width: 640px;
  margin: 0 auto;
  padding: 20px 0 30px;
}

.stl-parents__note {
  text-align: center;
  font-size: 0.85rem;
  color: #888;
  margin-bottom: 18px;
}

/* =====================================================
   13. お問い合わせページ
   ===================================================== */
.stl-contact-lead {
  text-align: center;
  font-size: 0.98rem;
  line-height: 2.1;
  margin: 10px 0 30px;
}

/* フォーム外枠（[stella_contact] 使用時） */
.stl-contact-form {
  background: #f8f6f2;
  border: 1px solid #e8e4de;
  border-radius: 14px;
  padding: 26px 18px;
  margin: 26px 0 40px;
}

/* 入力欄のスタイル。
   .wpcf7-form も直接対象にしているので、[contact-form-7] を
   素で貼った場合も同じ見た目になる（size/cols属性より優先） */
.stl-contact-form label,
.wpcf7-form label {
  display: block;
  font-weight: 700;
  font-size: 0.92rem;
  color: #1a2744;
  margin-bottom: 6px;
}

.stl-contact-form input[type="text"],
.stl-contact-form input[type="email"],
.stl-contact-form input[type="tel"],
.stl-contact-form input[type="url"],
.stl-contact-form input[type="number"],
.stl-contact-form input[type="date"],
.stl-contact-form textarea,
.stl-contact-form select,
.wpcf7-form input[type="text"],
.wpcf7-form input[type="email"],
.wpcf7-form input[type="tel"],
.wpcf7-form input[type="url"],
.wpcf7-form input[type="number"],
.wpcf7-form input[type="date"],
.wpcf7-form textarea,
.wpcf7-form select {
  width: 100%;
  max-width: 100%;
  padding: 13px 14px;
  border: 1px solid #d5cfc4;
  border-radius: 10px;
  font-size: 16px; /* 16px未満だとiOSで自動ズームするため下限を守る */
  font-family: inherit;
  line-height: 1.6;
  color: #2a2a2a;
  background: #fff;
  margin-bottom: 18px;
  -webkit-appearance: none;
  appearance: none;
}

/* CF7は入力欄を span.wpcf7-form-control-wrap で包むのでブロック化 */
.wpcf7-form-control-wrap {
  display: block;
  width: 100%;
}

/* セレクトは内容に合わせた幅＋矢印を描画 */
.stl-contact-form select,
.wpcf7-form select {
  width: auto;
  min-width: 220px;
  padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%231a2744' stroke-width='2'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 12px 8px;
  cursor: pointer;
}

.stl-contact-form textarea,
.wpcf7-form textarea {
  min-height: 180px;
  resize: vertical;
}

.stl-contact-form input:focus,
.stl-contact-form textarea:focus,
.stl-contact-form select:focus,
.wpcf7-form input:focus,
.wpcf7-form textarea:focus,
.wpcf7-form select:focus {
  outline: 2px solid #3366cc;
  outline-offset: 1px;
  border-color: #3366cc;
}

/* ラジオ・チェックボックスは横並びの選択肢として整える */
.wpcf7-form .wpcf7-radio,
.wpcf7-form .wpcf7-checkbox,
.wpcf7-form .wpcf7-acceptance {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin-bottom: 18px;
}

.wpcf7-form .wpcf7-list-item {
  margin: 0;
}

.wpcf7-form .wpcf7-list-item label {
  display: flex;
  align-items: center;
  gap: 7px;
  font-weight: 500;
  font-size: 0.95rem;
  margin: 0;
  cursor: pointer;
}

.wpcf7-form input[type="radio"],
.wpcf7-form input[type="checkbox"] {
  width: 20px;
  height: 20px;
  margin: 0;
  accent-color: #3366cc;
  flex: none;
}

/* 必須マーク */
.wpcf7-form .required,
.stl-contact-form .required {
  color: #d94040;
  font-size: 0.8em;
  margin-left: 4px;
}

/* 送信ボタン */
.stl-contact-form .wpcf7-submit,
.stl-contact-form input[type="submit"],
.wpcf7-form .wpcf7-submit,
.wpcf7-form input[type="submit"] {
  display: block;
  width: 100%;
  max-width: 340px;
  margin: 10px auto 0;
  padding: 18px 20px;
  border: none;
  border-radius: 50px;
  background: linear-gradient(135deg, #3366cc, #4a8af4);
  color: #fff;
  font-size: 1.1rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(51, 102, 204, 0.3);
  -webkit-appearance: none;
  appearance: none;
}

.wpcf7-form .wpcf7-submit:hover { opacity: 0.9; }

/* 送信中スピナー位置 */
.wpcf7-form .wpcf7-spinner { display: block; margin: 12px auto 0; }

.stl-contact-form .wpcf7-not-valid-tip,
.wpcf7-form .wpcf7-not-valid-tip {
  color: #d94040;
  font-size: 0.82rem;
  font-weight: 700;
  margin: -14px 0 14px;
  display: block;
}

.stl-contact-form .wpcf7-response-output,
.wpcf7-form .wpcf7-response-output {
  border: 2px solid #c8a84e !important;
  border-radius: 10px;
  padding: 12px 14px !important;
  margin: 18px 0 0 !important;
  font-weight: 700;
  font-size: 0.9rem;
}

/* =====================================================
   14. 汎用ユーティリティ
   ===================================================== */
.stl-center { text-align: center; }

.stl-section-gap { height: 40px; }

.stl-note-small {
  font-size: 0.78rem;
  color: #888;
  text-align: center;
  line-height: 1.8;
}

/* 見出しタグ（h1〜h3）をデザインシステムクラスに載せた時のリセット */
h1.stl-heading__main, h2.stl-heading__main,
h2.stl-points__header-main, h2.stl-lesson__title,
h2.stl-cheap__q-main,
h3.stl-point__title, h3.stl-cheap__h-text, h3.stl-flow-step__title {
  margin: 0;
}

h3.stl-lesson-step__title { margin: 0 0 10px; }

/* WPコアブロック軽微対応 */
.aligncenter { display: block; margin-left: auto; margin-right: auto; }
.wp-caption { max-width: 100%; }
.wp-caption-text {
  font-size: 0.8rem;
  color: #888;
  text-align: center;
  margin-top: 6px;
  line-height: 1.6;
}

/* =====================================================
   15. ブログレイアウト（2カラム）※ルート版拡張
   ===================================================== */
/* 本文900px + サイドバー300px + gap40px + padding30px = 1270px
   （旧Storkの記事カラム900pxを維持するための逆算） */
.stl-layout {
  max-width: 1270px;
  margin: 0 auto;
  padding: 0 15px;
}

@media (min-width: 1000px) {
  .stl-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 40px;
    align-items: start;
  }
}

.stl-layout .stl-main { min-width: 0; }

/* サイドバー */
.stl-sidebar { margin-top: 40px; }

@media (min-width: 1000px) {
  .stl-sidebar {
    margin-top: 20px;
    position: sticky;
    top: 110px;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    scrollbar-width: thin;
  }
}

.stl-widget {
  background: #fff;
  border: 1px solid #e8e4de;
  border-radius: 12px;
  padding: 18px 16px;
  margin-bottom: 20px;
}

.stl-widget .widgettitle,
.stl-widget .widget-title {
  display: block;
  font-size: 1.0rem;
  font-weight: 900;
  color: #1a2744;
  padding-bottom: 8px;
  margin: 0 0 14px;
  border-bottom: 2px solid #e8e4de;
  position: relative;
}

.stl-widget .widgettitle::after,
.stl-widget .widget-title::after {
  content: '';
  position: absolute;
  bottom: -2px; left: 0;
  width: 40px;
  height: 2px;
  background: #c8a84e;
}

.stl-widget ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.stl-widget ul li { margin-bottom: 8px; }

.stl-widget ul li a {
  text-decoration: none;
  color: #2a2a2a;
  font-size: 0.9rem;
  line-height: 1.6;
}

/* ミニ記事リスト（人気・新着ウィジェット） */
.stl-mini-post {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  text-decoration: none;
  color: inherit;
  padding: 7px 0;
}

.stl-mini-post__thumb {
  flex: none;
  width: 72px;
  height: 54px;
  border-radius: 8px;
  overflow: hidden;
  background: #f0ede8;
}

.stl-mini-post__thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}

.stl-mini-post__title {
  font-size: 0.82rem;
  font-weight: 700;
  color: #1a2744;
  line-height: 1.55;
}

.stl-mini-post__meta {
  display: block;
  font-size: 0.72rem;
  color: #999;
  font-weight: 500;
  margin-top: 3px;
}

/* 検索フォーム */
.stl-search {
  display: flex;
  gap: 6px;
}

.stl-search input[type="search"] {
  flex: 1;
  min-width: 0;
  padding: 9px 12px;
  border: 1px solid #d5cfc4;
  border-radius: 8px;
  font-size: 0.9rem;
  font-family: inherit;
}

.stl-search button {
  flex: none;
  padding: 9px 14px;
  border: none;
  border-radius: 8px;
  background: #1a2744;
  color: #fff;
  font-family: inherit;
  font-weight: 700;
  cursor: pointer;
}

/* =====================================================
   16. パンくず
   ===================================================== */
.stl-breadcrumb {
  font-size: 0.75rem;
  color: #999;
  padding: 12px 0 0;
  line-height: 1.6;
}

.stl-breadcrumb a {
  color: #777;
  text-decoration: none;
}

.stl-breadcrumb .sep { margin: 0 6px; color: #ccc; }

/* =====================================================
   17. 記事ページ拡張
   ===================================================== */
.stl-cat-badge {
  display: inline-block;
  background: #e8f0fe;
  color: #3366cc;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 12px;
  border-radius: 50px;
  text-decoration: none;
  margin-right: 6px;
}

/* 関連記事 */
.stl-related {
  margin: 50px 0 20px;
}

.stl-related__title {
  font-size: 1.1rem;
  font-weight: 900;
  color: #1a2744;
  border-bottom: 2px solid #e8e4de;
  padding-bottom: 8px;
  margin-bottom: 18px;
  position: relative;
}

.stl-related__title::after {
  content: '';
  position: absolute;
  bottom: -2px; left: 0;
  width: 40px;
  height: 2px;
  background: #c8a84e;
}

.stl-related__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.stl-related__item {
  text-decoration: none;
  color: inherit;
}

.stl-related__item img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: 10px;
  display: block;
  background: #f0ede8;
}

.stl-related__item-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: #1a2744;
  line-height: 1.55;
  margin-top: 8px;
}

/* [kanren] ブログカード */
.stl-kanren {
  display: flex;
  gap: 14px;
  align-items: center;
  border: 2px solid #e0dcd6;
  border-radius: 12px;
  padding: 14px 16px;
  margin: 28px 0;
  text-decoration: none;
  color: inherit;
  position: relative;
  background: #fff;
}

.stl-kanren::before {
  content: 'あわせて読みたい';
  position: absolute;
  top: -11px;
  left: 14px;
  background: #c8a84e;
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 12px;
  border-radius: 50px;
}

.stl-kanren__thumb {
  flex: none;
  width: 110px;
  height: 74px;
  border-radius: 8px;
  overflow: hidden;
  background: #f0ede8;
}

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

.stl-kanren__title {
  font-size: 0.92rem;
  font-weight: 700;
  color: #1a2744;
  line-height: 1.6;
}

/* 前後記事ナビ */
.stl-postnav {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 40px 0 10px;
}

.stl-postnav a {
  flex: 1;
  max-width: 48%;
  text-decoration: none;
  color: #1a2744;
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.5;
  background: #f8f6f2;
  border: 1px solid #e8e4de;
  border-radius: 10px;
  padding: 12px 14px;
}

.stl-postnav a.next { text-align: right; margin-left: auto; }

/* =====================================================
   18. 記事カルーセル [stella_carousel]
   ===================================================== */
.stl-carousel {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x mandatory;
  padding: 10px 15px 18px;
  margin: 0 calc(50% - 50vw);
  width: 100vw;
}

.stl-carousel::-webkit-scrollbar { height: 5px; }
.stl-carousel::-webkit-scrollbar-thumb { background: #d0d8e8; border-radius: 3px; }

.stl-carousel__item {
  flex: 0 0 230px;
  scroll-snap-align: start;
  text-decoration: none;
  color: inherit;
  background: #fff;
  border: 1px solid #e8e4de;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.stl-carousel__item img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
  background: #f0ede8;
}

.stl-carousel__item-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: #1a2744;
  line-height: 1.55;
  padding: 10px 12px 12px;
}

/* =====================================================
   19. CF7 送信前の確認ダイアログ
   ===================================================== */
.stl-confirm {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px 14px;
}

.stl-confirm__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(16, 28, 53, 0.72);
  backdrop-filter: blur(2px);
}

.stl-confirm__panel {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 560px;
  max-height: 88vh;
  overflow-y: auto;
  background: #fff;
  border-radius: 16px;
  padding: 26px 22px 24px;
  box-shadow: 0 18px 50px rgba(10, 18, 38, 0.4);
  animation: stl-confirm-in 0.18s ease-out;
}

@keyframes stl-confirm-in {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .stl-confirm__panel { animation: none; }
}

.stl-confirm__head {
  font-size: 1.25rem;
  font-weight: 900;
  color: #1a2744;
  text-align: center;
  line-height: 1.5;
}

.stl-confirm__head::after {
  content: '';
  display: block;
  width: 46px;
  height: 3px;
  background: linear-gradient(90deg, #c8a84e, #e8d48e);
  margin: 12px auto 0;
  border-radius: 2px;
}

.stl-confirm__lead {
  font-size: 0.88rem;
  color: #666;
  text-align: center;
  line-height: 1.8;
  margin: 14px 0 20px;
}

.stl-confirm__list {
  margin: 0 0 24px;
  padding: 0;
  border-top: 1px solid #e8e4de;
}

.stl-confirm__row {
  display: grid;
  grid-template-columns: 34% 1fr;
  gap: 12px;
  padding: 13px 4px;
  border-bottom: 1px solid #e8e4de;
}

@media (max-width: 560px) {
  .stl-confirm__row {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}

.stl-confirm__label {
  margin: 0;
  font-size: 0.85rem;
  font-weight: 700;
  color: #1a2744;
  line-height: 1.6;
}

.stl-confirm__value {
  margin: 0;
  font-size: 0.95rem;
  color: #2a2a2a;
  line-height: 1.75;
  white-space: pre-wrap;
  word-break: break-word;
}

.stl-confirm__value.is-empty {
  color: #aaa;
  font-size: 0.85rem;
}

.stl-confirm__actions {
  display: flex;
  flex-direction: column-reverse;
  gap: 10px;
}

@media (min-width: 520px) {
  .stl-confirm__actions {
    flex-direction: row;
    justify-content: center;
  }
  .stl-confirm__btn { flex: 1; max-width: 240px; }
}

.stl-confirm__btn {
  padding: 16px 22px;
  border-radius: 50px;
  font-size: 1.02rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  line-height: 1.3;
  -webkit-appearance: none;
  appearance: none;
}

.stl-confirm__btn--back {
  background: #fff;
  color: #1a2744;
  border: 2px solid #d0d8e8;
}

.stl-confirm__btn--send {
  background: linear-gradient(135deg, #3366cc, #4a8af4);
  color: #fff;
  border: none;
  box-shadow: 0 4px 16px rgba(51, 102, 204, 0.3);
}

.stl-confirm__btn:focus-visible {
  outline: 3px solid #c8a84e;
  outline-offset: 2px;
}

/* 「まだ送信されていません」の注意書き */
.stl-confirm__notyet {
  text-align: center;
  font-size: 0.86rem;
  font-weight: 700;
  color: #e8862a;
  letter-spacing: 0.02em;
  margin-top: 12px;
}

/* =====================================================
   20. 送信完了ページ
   ===================================================== */
.stl-thanks {
  width: 100vw;
  margin-left: calc(50% - 50vw);
  background: linear-gradient(180deg, #f8f6f2 0%, #ffffff 100%);
  padding: 60px 18px 50px;
  text-align: center;
}

.stl-thanks__mark {
  width: 84px;
  height: 84px;
  margin: 0 auto 24px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2ea87a, #43c795);
  color: #fff;
  font-size: 2.4rem;
  line-height: 84px;
  font-weight: 900;
  box-shadow: 0 8px 24px rgba(46, 168, 122, 0.32);
}

.stl-thanks__title {
  font-size: 1.5rem;
  font-weight: 900;
  color: #1a2744;
  line-height: 1.7;
  margin: 0 0 6px;
}

.stl-thanks__title .stl-thanks__accent { color: #c8a84e; }

.stl-thanks__lead {
  font-size: 1.0rem;
  color: #555;
  line-height: 2;
  margin-top: 16px;
}

/* 次に起きることのステップ */
.stl-thanks-steps {
  max-width: 560px;
  margin: 36px auto 0;
  text-align: left;
  counter-reset: stl-thanks;
}

.stl-thanks-step {
  position: relative;
  background: #fff;
  border: 1px solid #e8e4de;
  border-radius: 14px;
  padding: 18px 20px 18px 64px;
  margin-bottom: 12px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  counter-increment: stl-thanks;
}

.stl-thanks-step::before {
  content: counter(stl-thanks);
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1a2744, #2a3d66);
  color: #fff;
  font-weight: 900;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.stl-thanks-step__title {
  font-size: 1.0rem;
  font-weight: 900;
  color: #1a2744;
  line-height: 1.5;
  margin-bottom: 4px;
}

.stl-thanks-step__text {
  font-size: 0.9rem;
  color: #555;
  line-height: 1.85;
}

/* 注意書き */
.stl-thanks-note {
  max-width: 560px;
  margin: 26px auto 0;
  background: linear-gradient(135deg, #fdf9ee, #f7eed6);
  border: 1px solid #e6d9b3;
  border-radius: 14px;
  padding: 18px 20px;
  text-align: left;
  font-size: 0.88rem;
  line-height: 1.9;
  color: #2a2a2a;
}

.stl-thanks-note__title {
  font-weight: 900;
  color: #1a2744;
  margin-bottom: 6px;
}

/* =====================================================
   21. wpautop対策 ＋ 図解セクションの微調整
   ===================================================== */

/* WordPressの自動整形が、レイアウト用のflex/gridコンテナの中に
   空の <p></p> や <br> を差し込むことがある。
   これらは幅0でも「隙間(gap)」を1つ余計に作るため、
   中身が左に寄って見える原因になる。表示上は無効化する。 */
:is(.stl-step-t-a__top,
    .stl-step-t-a__bottom,
    .stl-support__grid,
    .stl-team__cards,
    .stl-team__trust,
    .review-slider,
    .stl-price-hero__points,
    .stl-pricing__points,
    .stl-cheap__chips,
    .stl-cheap__costs,
    .stl-nayami__list,
    .stl-cta__buttons,
    .stl-widget-cta__buttons,
    .stl-pillars,
    .stl-plan-cards,
    .stl-merit-cards,
    .stl-combo__equation,
    .stl-carousel) > :is(p:empty, br) {
  display: none;
}

/* 「塾の授業」「テスト本番」カード：画像と本文が近すぎるので余白を足す
   （中央の「このステップが抜けていた！」カードは別指定のため影響なし） */
.stl-step-t-a__card--left .stl-step-t-a__text,
.stl-step-t-a__card--right .stl-step-t-a__text {
  padding-top: 11px;
}

/* =====================================================
   22. ウィジェット内のレイアウト補正
   ===================================================== */

/* トップページ用の「全幅セクション」(width:100vw + 負のmargin) を
   そのままウィジェットに貼ると、300pxの枠から大きくはみ出して
   本文の上に重なってしまう。ウィジェット内では全幅指定を打ち消す。 */
.stl-widget :is(
  .stl-widget-cta, .stl-cta, .stl-total, .stl-price-hero, .stl-line,
  .reviewback, .stl-heroB, .stl-hero, .stl-lesson, .stl-lesson-steps,
  .stl-effect, .stl-msg-a, .stl-step-t-a, .stl-cheap, .stl-points,
  .timeline-section, .stl-flow, .maxsection, .pointback, .stl-tree,
  .stl-opening-a, .stl-opening-area
) {
  width: auto;
  max-width: 100%;
  margin-left: 0;
  margin-right: 0;
}

/* 中身の固定幅も枠に合わせる */
.stl-widget :is(
  .stl-widget-cta__inner, .stl-cta__inner, .stl-total__inner,
  .stl-price-hero__inner, .stl-cheap__inner, .stl-msg-a__inner,
  .stl-opening-a__inner, .stl-flow__steps, .stl-note-box
) {
  max-width: 100%;
}

/* サイドバー幅に合わせて余白とボタンを詰める */
.stl-widget .stl-widget-cta { padding: 28px 16px 30px; border-radius: 12px; }
.stl-widget .stl-cta { padding: 28px 16px; border-radius: 12px; }
.stl-widget :is(.stl-widget-cta__btn, .stl-cta__btn) {
  padding: 14px 12px;
  font-size: 0.95rem;
}
.stl-widget .stl-widget-cta__buttons { gap: 12px; }
.stl-widget :is(.stl-widget-cta__brand, .stl-cta__title) { font-size: 1.05rem; }
.stl-widget :is(.stl-widget-cta__line-label, .stl-cta__line-label) {
  font-size: 0.72rem;
  white-space: normal;
}
.stl-widget .stl-widget-cta__line-divider { margin-top: 26px; }

/* =====================================================
   23. サイドバーはPCのみ
   ===================================================== */
/* スマホ・タブレットではサイドバーを出さない。
   記事の回遊はフッターの「人気の記事／新着記事」が担当する。 */
@media (max-width: 999px) {
  .stl-sidebar { display: none; }
}

/* =====================================================
   24. フッター定番セクション（人気記事＋新着記事）
   ===================================================== */
.stl-footer-posts {
  background: #f8f6f2;
  border-top: 1px solid #e8e4de;
  padding: 46px 15px 50px;
}

.stl-footer-posts__inner {
  max-width: 900px;
  margin: 0 auto;
}

.stl-footer-posts__block + .stl-footer-posts__block {
  margin-top: 40px;
}

.stl-footer-posts__title {
  font-size: 1.05rem;
  font-weight: 900;
  color: #1a2744;
  padding-bottom: 9px;
  margin-bottom: 14px;
  border-bottom: 2px solid #e0dcd6;
  position: relative;
}

.stl-footer-posts__title::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 44px;
  height: 2px;
  background: #c8a84e;
}

/* 中の記事リストは .stl-mini-post を流用。フッターでは少し大きめに */
.stl-footer-posts .stl-mini-post {
  padding: 10px 0;
  border-bottom: 1px solid #eae6df;
}

.stl-footer-posts .stl-mini-post:last-child {
  border-bottom: none;
}

.stl-footer-posts .stl-mini-post__thumb {
  width: 88px;
  height: 62px;
}

.stl-footer-posts .stl-mini-post__title {
  font-size: 0.9rem;
}

/* PCでは人気と新着を横に並べる */
@media (min-width: 800px) {
  .stl-footer-posts__inner {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: start;
  }
  .stl-footer-posts__block + .stl-footer-posts__block {
    margin-top: 0;
  }
}
