/* のぞみチャペル — base stylesheet */

:root {
  --navy:  #012646;
  --blue:  #034c8c;
  --teal:  #84a4a9;
  --sand:  #d3ccba;
  --pale:  #d6ecf0;
  --ink:   #2f2e2e;
  --grey:  #605e5e;
  --line:  #e3e7ea;
  --paper: #ffffff;
  --mist:  #f4f7f8;

  --maxw: 1100px;
  --header-h: 96px;

  --serif: "Libre Baskerville", "Noto Serif JP", "Hiragino Mincho ProN", "Yu Mincho", serif;
  --sans:  "Open Sans", "Noto Sans JP", "Hiragino Kaku Gothic ProN", "Yu Gothic", sans-serif;
}

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

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

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.9;
  color: var(--blue);
  background: var(--paper);
}

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

a { color: var(--blue); }

h1, h2, h3, h4, h5, h6 {
  font-family: var(--serif);
  color: var(--navy);
  font-weight: 400;
  line-height: 1.5;
  margin: 0;
}

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

/* ---------- global nav ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, .96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: saturate(180%) blur(8px);
}

.site-header .wrap {
  min-height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand { display: flex; align-items: center; flex-shrink: 0; }
.brand img { width: 165px; height: auto; }

.nav-toggle, .nav-toggle-label { display: none; }

.nav ul {
  display: flex;
  align-items: center;
  gap: 28px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav a {
  font-size: 14px;
  letter-spacing: .04em;
  color: var(--navy);
  text-decoration: none;
  padding: 6px 0;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  transition: color .18s, border-color .18s;
}

.nav a:hover { color: var(--teal); }
.nav a[aria-current="page"] { border-bottom-color: var(--teal); color: var(--teal); }

/* ---------- hero ---------- */

.hero {
  position: relative;
  background: #ccc;
  overflow: hidden;
}

.hero img {
  width: 100%;
  height: clamp(280px, 42vw, 480px);
  object-fit: cover;
  object-position: center;
}

.hero--tall img { height: clamp(320px, 52vw, 620px); }
.hero--top img { object-position: center 32%; }

.hero-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  background: linear-gradient(90deg, rgba(1, 38, 70, .55) 0%, rgba(1, 38, 70, .18) 60%, rgba(1, 38, 70, 0) 100%);
}

.hero-overlay .wrap { width: 100%; }

.hero-overlay h1,
.hero-overlay h2 {
  color: #fff;
  font-size: clamp(28px, 4.2vw, 52px);
  margin: 0 0 12px;
  text-shadow: 0 2px 18px rgba(1, 38, 70, .45);
}

.hero-overlay p {
  color: #fff;
  max-width: 34em;
  margin: 0 0 24px;
  font-size: clamp(14px, 1.4vw, 17px);
  text-shadow: 0 1px 12px rgba(1, 38, 70, .5);
}

/* Home: small h1 for search engines above the big decorative "Welcome" */
.hero-overlay .hero-eyebrow {
  font-family: var(--sans);
  font-size: clamp(12px, 1.2vw, 15px);
  letter-spacing: .12em;
  margin: 0 0 8px;
  text-shadow: 0 1px 12px rgba(1, 38, 70, .5);
}

.hero-overlay .hero-title {
  font-family: var(--serif);
  font-size: clamp(28px, 4.2vw, 52px);
  line-height: 1.5;
  max-width: none;
  margin: 0 0 12px;
  text-shadow: 0 2px 18px rgba(1, 38, 70, .45);
}

/* ---------- buttons ---------- */

.btn {
  display: inline-block;
  font-family: var(--sans);
  font-size: 14px;
  letter-spacing: .06em;
  text-decoration: none;
  padding: 13px 30px;
  border: 1px solid currentColor;
  border-radius: 2px;
  transition: background .2s, color .2s, border-color .2s;
}

.btn + .btn { margin-left: 12px; }

.btn--light { color: #fff; }
.btn--light:hover { background: #fff; color: var(--navy); }

.btn--solid { color: #fff; background: var(--navy); border-color: var(--navy); }
.btn--solid:hover { background: var(--teal); border-color: var(--teal); }

.btn--outline { color: var(--navy); }
.btn--outline:hover { background: var(--navy); color: #fff; }

/* ---------- content ---------- */

main { display: block; }

.section { padding: 72px 0; }
.section--mist { background: var(--mist); }
.section--pale { background: var(--pale); }
.section--tight { padding: 48px 0; }

.section-head { text-align: center; margin-bottom: 48px; }

.section-head h1,
.section-head h2 {
  font-size: clamp(24px, 3vw, 38px);
  margin-bottom: 16px;
}

.section-head p {
  max-width: 44em;
  margin: 0 auto;
  color: var(--blue);
}

.section-head p + p { margin-top: 1.2em; }

.lede { font-size: 17px; }

.prose p { margin: 0 0 1.2em; }
.prose p:last-child { margin-bottom: 0; }

/* ---------- feature cards ---------- */

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 40px;
}

.card {
  display: flex;
  flex-direction: column;
  text-align: center;
}

.card img {
  width: 100%;
  aspect-ratio: 310 / 282;
  object-fit: cover;
  border-radius: 3px;
  margin-bottom: 22px;
}

.card h3 {
  font-size: 21px;
  margin-bottom: 12px;
}

.card p { margin: 0 0 18px; font-size: 15px; }

.card .more {
  align-self: center;
  margin-top: auto;
  font-size: 14px;
  letter-spacing: .05em;
  color: var(--teal);
  text-decoration: none;
  border-bottom: 1px solid currentColor;
  padding-bottom: 2px;
}

.card .more:hover { color: var(--navy); }

/* ---------- media rows (image + text) ---------- */

.media-row {
  display: grid;
  grid-template-columns: minmax(0, 340px) minmax(0, 1fr);
  gap: 48px;
  align-items: start;
  margin-bottom: 64px;
}

.media-row:last-child { margin-bottom: 0; }
.media-row--flip { grid-template-columns: minmax(0, 1fr) minmax(0, 340px); }
.media-row--flip .media-row__img { order: 2; }

.media-row__img img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 3px;
}

.media-row__body h3 {
  font-size: 24px;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

/* ---------- definition-style info list ---------- */

.info-list { margin: 0 0 24px; padding: 0; list-style: none; }

.info-list li {
  padding: 10px 0;
  border-bottom: 1px dashed var(--line);
  font-size: 15px;
}

.info-list li:last-child { border-bottom: none; }

.note { font-size: 14px; color: var(--grey); }

.center { text-align: center; }

/* ---------- news ---------- */

.news { max-width: 820px; margin: 0 auto; }

.news-item {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 20px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
  align-items: baseline;
}

.news-item:last-child { border-bottom: none; }

.news-item time {
  font-size: 14px;
  letter-spacing: .05em;
  color: var(--teal);
}

.news-item p { margin: 0; font-size: 15px; }
.news-item a { color: var(--navy); }

/* ---------- messages (sermon list) ---------- */

.message-list { max-width: 820px; margin: 0 auto; }

.message-item {
  padding: 24px 0;
  border-bottom: 1px solid var(--line);
}

.message-item:last-child { border-bottom: none; }

.message-item time {
  display: block;
  font-size: 14px;
  letter-spacing: .06em;
  color: var(--teal);
  margin-bottom: 8px;
}

.message-item h3 { font-size: 20px; margin-bottom: 6px; }
.message-item .speaker { margin: 0; font-size: 14px; color: var(--grey); }

/* ---------- gallery ---------- */

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
}

.gallery img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 3px;
}

/* ---------- opening hours ---------- */

.hours {
  max-width: 520px;
  margin: 0 auto;
  padding: 40px;
  text-align: center;
  background: var(--mist);
  border-radius: 3px;
}

.hours h2 { font-size: 24px; margin-bottom: 20px; }
.hours__days { margin: 0 0 4px; font-size: 16px; }
.hours__time { margin: 0 0 20px; font-size: 22px; font-family: var(--serif); color: var(--navy); }
.hours .note { margin: 0 0 20px; }

/* ---------- map ---------- */

.map {
  width: 100%;
  height: 420px;
  border: 0;
  border-radius: 3px;
}

/* ---------- contact form ---------- */

.form { max-width: 720px; }

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

.field { display: flex; flex-direction: column; gap: 8px; }
.field--full { grid-column: 1 / -1; }

.field label {
  font-size: 13px;
  letter-spacing: .05em;
  color: var(--navy);
}

.field input,
.field textarea {
  font-family: var(--sans);
  font-size: 15px;
  color: var(--ink);
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: #fff;
}

.field input:focus,
.field textarea:focus {
  outline: 2px solid var(--teal);
  outline-offset: 1px;
  border-color: var(--teal);
}

.field textarea { min-height: 150px; resize: vertical; }

/* Contact Form 7 wraps each input in an inline span */
.field .wpcf7-form-control-wrap { display: block; }
.field .wpcf7-form-control-wrap input,
.field .wpcf7-form-control-wrap textarea { width: 100%; box-sizing: border-box; }
.field .wpcf7-not-valid-tip { margin-top: 6px; font-size: 13px; }
.wpcf7 .wpcf7-response-output { margin: 20px 0 0; padding: 12px 14px; font-size: 14px; }

/* ---------- footer ---------- */

.site-footer {
  background: var(--navy);
  color: rgba(255, 255, 255, .82);
  padding: 72px 0 32px;
  font-size: 14px;
  line-height: 1.9;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 48px;
  padding-bottom: 48px;
  border-bottom: 1px solid rgba(255, 255, 255, .16);
}

.site-footer h2,
.site-footer h3 { color: #fff; }

.site-footer h2 { font-size: 20px; margin-bottom: 16px; }

.site-footer h3 {
  font-size: 13px;
  font-family: var(--sans);
  letter-spacing: .12em;
  text-transform: uppercase;
  margin-bottom: 16px;
  color: var(--teal);
}

.site-footer p { margin: 0 0 12px; }

.site-footer ul { margin: 0; padding: 0; list-style: none; }
.site-footer li { margin-bottom: 10px; }

.site-footer a { color: rgba(255, 255, 255, .82); text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }

.social { display: flex; align-items: center; gap: 12px; margin-top: 16px; }

.social a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: rgba(255, 255, 255, .82);
}

.social svg { width: 22px; height: 22px; fill: currentColor; }

.footer-bottom {
  padding-top: 28px;
  text-align: center;
  font-size: 13px;
  color: rgba(255, 255, 255, .55);
}

/* ---------- responsive ---------- */

@media (max-width: 900px) {
  :root { --header-h: 72px; }

  .nav-toggle-label {
    display: block;
    cursor: pointer;
    padding: 10px;
    color: var(--navy);
  }

  .nav-toggle-label span,
  .nav-toggle-label span::before,
  .nav-toggle-label span::after {
    display: block;
    width: 24px;
    height: 2px;
    background: currentColor;
    content: "";
    transition: transform .2s;
  }

  .nav-toggle-label span::before { transform: translateY(-7px); }
  .nav-toggle-label span::after  { transform: translateY(5px); }

  .nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border-bottom: 1px solid var(--line);
    display: none;
  }

  .nav-toggle:checked ~ .nav { display: block; }

  .nav ul { flex-direction: column; align-items: stretch; gap: 0; padding: 8px 24px 20px; }
  .nav li { border-bottom: 1px solid var(--line); }
  .nav li:last-child { border-bottom: none; }
  .nav a { display: block; padding: 14px 0; border-bottom: none; }

  .brand img { width: 132px; }

  .media-row,
  .media-row--flip { grid-template-columns: 1fr; gap: 28px; }
  .media-row--flip .media-row__img { order: 0; }
  .media-row__img { max-width: 340px; }

  .section { padding: 56px 0; }

  .footer-grid { grid-template-columns: 1fr; gap: 36px; }

  .form-grid { grid-template-columns: 1fr; }

  .news-item { grid-template-columns: 1fr; gap: 4px; }
}

/* ================================================================
   WordPress ブロック対応
   ブロックエディターが出力するマークアップ（figure や button の
   ラッパー div など）に、上のデザインをそのまま当てるための調整。
   ================================================================ */

/* 画像ブロックは <figure> で囲まれる。余白を消して素の <img> と同じ扱いにする */
figure.wp-block-image { margin: 0; }
figure.wp-block-image img { display: block; }

/* ヒーロー画像の高さ。core の .wp-block-image img { height: auto } に勝たせる。
   固定ページのヒーロー画像はアイキャッチ画像ブロック（.wp-block-post-featured-image）で出している */
.hero figure.wp-block-image img,
.hero figure.wp-block-post-featured-image img { height: clamp(280px, 42vw, 480px); }
.hero--tall figure.wp-block-image img,
.hero--tall figure.wp-block-post-featured-image img { height: clamp(320px, 52vw, 620px); }
.hero figure.wp-block-post-featured-image { margin: 0; }
.hero figure.wp-block-post-featured-image img { display: block; object-fit: cover; }

/* ボタンブロック。クラスはラッパー div に付くので、中の <a> に見た目を渡す */
div.wp-block-buttons { display: flex; flex-wrap: wrap; gap: 12px; margin: 0; }
.is-content-justification-center { justify-content: center; }
.hours div.wp-block-buttons { justify-content: center; }

div.wp-block-button.is-btn { margin: 0; }

div.wp-block-button.is-btn > .wp-block-button__link {
  display: inline-block;
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.9;
  letter-spacing: .06em;
  text-decoration: none;
  padding: 13px 30px;
  background: none;
  border: 1px solid currentColor;
  border-radius: 2px;
  transition: background .2s, color .2s, border-color .2s;
}

div.wp-block-button.is-btn--light > .wp-block-button__link { color: #fff; }
div.wp-block-button.is-btn--light > .wp-block-button__link:hover { background: #fff; color: var(--navy); }

div.wp-block-button.is-btn--solid > .wp-block-button__link {
  color: #fff;
  background: var(--navy);
  border-color: var(--navy);
}
div.wp-block-button.is-btn--solid > .wp-block-button__link:hover { background: var(--teal); border-color: var(--teal); }

div.wp-block-button.is-btn--outline > .wp-block-button__link { color: var(--navy); }
div.wp-block-button.is-btn--outline > .wp-block-button__link:hover { background: var(--navy); color: #fff; }

/* カード下部の「もっと詳しく」。<a> ではなく段落ブロックになる */
.card p.more { margin-bottom: 0; }
.card p.more a { color: inherit; text-decoration: none; }

/* 日付。<time> ではなく段落ブロックになる */
.news-item .news-date { font-size: 14px; letter-spacing: .05em; color: var(--teal); }

.message-item .message-date {
  display: block;
  font-size: 14px;
  letter-spacing: .06em;
  color: var(--teal);
  margin: 0 0 8px;
}

/* 静的サイトで style 属性だったもの */
.map-note { margin-top: 12px; }
.contact-note { margin-top: 24px; }

/* 編集画面（ブロックエディター）だけで必要になる調整。
   エディター側の CSS の方が優先度が高いため、同じ見た目にするには上書きが要る。
   表示側では結果が変わらないので、条件分けはしていない。 */
.hero figure.wp-block-image img,
.hero figure.wp-block-post-featured-image img { width: 100%; }
.hero .wp-block-group.hero-overlay { position: absolute; inset: 0; }

/* ---------- 投稿・一覧・検索テンプレート ---------- */

/* 記事本文とシンプルな固定ページの幅。お知らせ一覧（.news）とそろえる */
.post { max-width: 820px; margin: 0 auto; }

.section-head .news-date { font-size: 14px; letter-spacing: .05em; color: var(--teal); margin: 0 0 8px; }
.section-head .post-terms { font-size: 14px; margin: 0; }
.section-head .post-terms a { color: var(--teal); }

.post-image { margin: 0 0 40px; }
.post-image img { width: 100%; }

.post-body h2 { font-size: clamp(22px, 2.4vw, 28px); margin: 2em 0 .8em; }
.post-body h3 { font-size: 20px; margin: 1.8em 0 .6em; }
.post-body ul,
.post-body ol { margin: 0 0 1.2em; padding-left: 1.5em; }
.post-body figure { margin: 0 0 1.2em; }
.post-body blockquote { margin: 0 0 1.2em; padding: 4px 0 4px 20px; border-left: 3px solid var(--sand); }

.post-tags { margin: 32px 0 0; }

.post-nav {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  font-size: 15px;
}
.post-nav a { color: var(--navy); text-decoration: none; }
.post-nav a:hover { color: var(--teal); }
.post-nav .post-navigation-link-next { margin-left: auto; text-align: right; }

/* クエリーブロックでは記事ごとに li で囲まれ、どの .news-item も :last-child になるので、区切り線は li 単位で引く */
.news .wp-block-post-template > li:not(:last-child) > .news-item { border-bottom: 1px solid var(--line); }

.news-item h3 { font-size: 17px; }
.news-item h3 a { text-decoration: none; }
.news-item h3 a:hover { text-decoration: underline; }
.news-item p.note { margin: 4px 0 0; }

/* ページ送り */
.wp-block-query-pagination { gap: 16px; margin-top: 40px; font-size: 15px; }
.wp-block-query-pagination a { color: var(--navy); text-decoration: none; }
.wp-block-query-pagination a:hover { color: var(--teal); }
.wp-block-query-pagination .page-numbers { padding: 0 6px; }
.wp-block-query-pagination .page-numbers.current { color: var(--teal); border-bottom: 1px solid var(--teal); }

/* 検索フォーム。入力欄はお問い合わせフォーム、ボタンは .btn--solid と同じ見た目 */
.site-search { max-width: 480px; margin: 28px auto 0; }
.site-search .wp-block-search__inside-wrapper { display: flex; gap: 8px; }
.site-search .wp-block-search__input {
  flex: 1;
  font-family: var(--sans);
  font-size: 15px;
  color: var(--ink);
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: #fff;
}
.site-search .wp-block-search__input:focus { outline: 2px solid var(--teal); outline-offset: 1px; border-color: var(--teal); }
.site-search .wp-block-search__button {
  margin: 0;
  font-family: var(--sans);
  font-size: 14px;
  letter-spacing: .06em;
  padding: 12px 24px;
  color: #fff;
  background: var(--navy);
  border: 1px solid var(--navy);
  border-radius: 2px;
  cursor: pointer;
  transition: background .2s, border-color .2s;
}
.site-search .wp-block-search__button:hover { background: var(--teal); border-color: var(--teal); }

@media (max-width: 900px) {
  .post-nav { flex-direction: column; }
  .post-nav .post-navigation-link-next { text-align: left; margin-left: 0; }
}

/* ---------- ニュースのカードとカテゴリーのピル ---------- */

/* カテゴリーのピル。押すとそのカテゴリーの一覧ページへ移動する */
.cat-nav { margin: 0 0 40px; }
.cat-pills {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}
.cat-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--navy);
  font-size: 14px;
  letter-spacing: .05em;
  line-height: 1.6;
  text-decoration: none;
  transition: background-color .2s ease, border-color .2s ease, color .2s ease;
}
.cat-pill:hover,
.cat-pill:focus-visible { border-color: var(--teal); color: var(--teal); }
.cat-pill.is-current { background: var(--navy); border-color: var(--navy); color: #fff; }
.cat-pill__count { font-size: 12px; color: var(--teal); }
.cat-pill.is-current .cat-pill__count { color: var(--pale); }

/* カードの並び。li（記事 1 件）ごとにグリッドのマスになる */
.news-cards .wp-block-post-template {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 32px;
}
.news-cards .wp-block-post-template > li { display: flex; }

.post-card {
  display: flex;
  flex-direction: column;
  width: 100%;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 3px;
  box-shadow: 0 2px 10px rgba(1, 38, 70, .04);
  transition: transform .2s ease, box-shadow .2s ease;
}
.post-card:hover { transform: translateY(-3px); box-shadow: 0 10px 28px rgba(1, 38, 70, .1); }

.post-card .wp-block-post-featured-image { margin: 0; }
.post-card .wp-block-post-featured-image img { width: 100%; height: auto; object-fit: cover; }

.post-card__body { padding: 18px 22px 24px; }
.post-card__meta { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; margin-bottom: 8px; }
.post-card__meta .news-date { margin: 0; font-size: 14px; letter-spacing: .05em; color: var(--teal); }
.post-card__cats { margin: 0; font-size: 13px; color: var(--teal); }
.post-card__cats a { color: var(--teal); text-decoration: none; }
.post-card__cats a:hover { text-decoration: underline; }

.post-card h3 { font-size: 17px; line-height: 1.7; }
.post-card h3 a { color: var(--navy); text-decoration: none; }
.post-card h3 a:hover { color: var(--teal); }

@media (prefers-reduced-motion: reduce) {
  .post-card,
  .post-card:hover { transition: none; transform: none; }
}

/* ---------- 礼拝メッセージ録音（投稿タイプ message） ---------- */

/* 一覧。お知らせと同じカード（.news-cards / .post-card）を使う。静的サイト由来の幅制限は外す */
.news-cards.message-list { max-width: none; }

.post-body .wp-block-audio audio { width: 100%; }
div.wp-block-buttons.message-back { margin-top: 40px; }
