/*
Theme Name: NOIR
Theme URI: https://noir.caorisoma.com
Author: Caori Soma
Author URI: https://caorisoma.com
Description: 写真と、日々のひとりごと。余白とタイポグラフィで魅せる、エディトリアルなクラシックWordPressテーマ。Genesisからの刷新にあたり、機能はWordPress標準のテンプレート階層のみに依存し、外部フレームワークには依存しない。
Version: 1.0.9
Requires at least: 6.4
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: noir
*/

/* ==========================================================
   デザイントークン
   ========================================================== */
:root{
  --color-bg:#ffffff;
  --color-text:#161616;
  --color-muted:#6b6b6b;      /* WCAG AA対応（白背景でコントラスト比 4.5:1 以上） */
  --color-line:#161616;
  --color-line-soft:#e2e2e2;
  --color-photo-bg1:#eceae6;
  --color-photo-bg2:#f6f5f2;
  --color-photo-label:#767676;
  --color-focus:#1a5fb4;

  --content-w: 640px;
  --wide-w: 920px;
  --gap-section: 80px;
  --gap-section-sm: 48px;
  --gap-article-body: 64px;
  --title-size: 32px;
  --item-title-size: 22px;
  --hero-ratio: 21 / 9;

  --font-head: 'Inter', 'Noto Sans JP', sans-serif;
  --font-body: 'Inter', 'Noto Sans JP', sans-serif;
  --head-weight: 300;
}

/* ==========================================================
   ベース
   ========================================================== */
*, *::before, *::after{ box-sizing:border-box; }
html{ -webkit-text-size-adjust:100%; }

body{
  margin:0;
  min-height:100vh;
  background-color:#d2d0cb;
  background-image:
    radial-gradient(ellipse at 20% 10%, rgba(255,255,255,.35), transparent 55%),
    radial-gradient(ellipse at 82% 92%, rgba(0,0,0,.05), transparent 55%),
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='140' height='140'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix type='saturate' values='0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)' opacity='0.05'/></svg>");
  background-repeat: no-repeat, no-repeat, repeat;
  color:var(--color-text);
  font-family:var(--font-body);
  font-size:17px;
  line-height:1.85;
  -webkit-font-smoothing:antialiased;
}

a{ color:inherit; text-decoration:none; }
img{ max-width:100%; height:auto; }

/* アクセシビリティ：キーボード操作時のフォーカス可視化 */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible{
  outline: 2px solid var(--color-focus);
  outline-offset: 3px;
}

/* WordPress標準：スキップリンク／スクリーンリーダー専用テキスト */
.screen-reader-text{
  border:0; clip:rect(1px,1px,1px,1px); clip-path:inset(50%);
  height:1px; margin:-1px; overflow:hidden; padding:0; position:absolute;
  width:1px; word-wrap:normal !important;
}
.skip-link.screen-reader-text:focus{
  background:#161616; color:#fff; display:block; height:auto; width:auto;
  padding:12px 20px; left:16px; top:16px; z-index:100000;
  clip:auto; clip-path:none;
}

/* ==========================================================
   紙面コンテナ（モルタル調背景の上に置かれる白い紙面）
   ========================================================== */
.paper{
  max-width:1180px;
  margin:44px auto;
  background:#fff;
  border-radius:0;
  box-shadow: 0 0 0 1px rgba(0,0,0,.07), 0 8px 30px rgba(0,0,0,.06);
}
@media (max-width:680px){
  .paper{ margin:10px; }
}

/* ==========================================================
   ヘッダー／ロゴ／ナビゲーション
   ========================================================== */
.paper-header{
  position:relative;
  width:100%;
  height:260px;
}
.paper-header .hr-line{
  position:absolute; left:100px; right:100px; height:1px; background:var(--color-line);
}
.hr-line.hr-top{ top:110px; }
.hr-line.hr-bottom{ bottom:80px; }

.logo-square{
  position:absolute; top:70px; left:50%; z-index:2;
  transform:translateX(-50%);
  width:150px; height:150px;
  background:#111;
  overflow:hidden;
  display:flex; align-items:center; justify-content:center;
}
.logo-square img{ display:block; width:100%; height:100%; object-fit:cover; }
.site-title-heading{ margin:0; }
/* カスタムロゴ画像へのリンクは、トップページ／記事ページで常に同じ見た目（枠いっぱいに表示）にする */
.logo-square .custom-logo-link{ display:block; width:100%; height:100%; }
/* ロゴ未設定時のサイト名フォールバック（テキストリンク）のみに適用 */
.site-title-heading a:not(.custom-logo-link){
  display:flex; width:100%; height:100%; color:#fff;
  font-family:var(--font-head); font-weight:400; font-size:22px;
  align-items:center; justify-content:center; text-align:center; padding:10%;
}

.site-nav{
  margin:12px 0 0;
  display:flex; justify-content:center; flex-wrap:wrap; gap:32px;
  font-size:12px; letter-spacing:.16em; text-transform:uppercase;
  list-style:none; padding:0 16px;
}
.site-nav li{ display:inline-flex; }
.site-nav a{ padding:0 12px 2px; text-decoration:none; }
.site-nav a:hover,
.site-nav .current-menu-item > a{
  text-decoration:underline;
  text-decoration-color:var(--color-line);
  text-decoration-thickness:1px;
  text-underline-offset:4px;
}

/* ==========================================================
   共通レイアウト
   ========================================================== */
.wrap{ max-width:1400px; margin:0 auto; padding:0 24px; }

section, article.lead-article, article.list-item, article.single-article{
  margin-top: var(--gap-section);
}
.site-header + .wrap > *:first-child{ margin-top: calc(var(--gap-section) * 0.9); }

.welcome{ text-align:center; }
.welcome h1, .welcome h2{
  font-family:var(--font-head); font-weight:var(--head-weight);
  letter-spacing:.14em; text-transform:uppercase;
  font-size:15px; margin:0 0 10px;
}
.welcome p{ margin:0; color:var(--color-muted); font-size:14px; letter-spacing:.02em; }

/* ==========================================================
   写真（投稿サムネイル）
   ========================================================== */
.photo{
  position:relative; overflow:hidden;
  background:linear-gradient(135deg,var(--color-photo-bg1),var(--color-photo-bg2));
  border:1px solid var(--color-line-soft);
}
.photo img{
  position:absolute; inset:0; width:100%; height:100%;
  object-fit:cover; display:block;
}
.photo.placeholder{
  display:flex; align-items:center; justify-content:center;
  color:var(--color-photo-label);
  font-size:11px; letter-spacing:.08em; text-transform:uppercase;
  text-align:center; padding:12px; aspect-ratio:3/2;
}
.photo.full{ width:100%; aspect-ratio:var(--hero-ratio); }

/* ==========================================================
   リード記事（フロントページ最新記事）
   ========================================================== */
.lead-article .article-title{ margin-top:44px; text-align:center; }
.article-title{
  font-family:var(--font-head); font-weight:var(--head-weight);
  font-size:var(--title-size);
  max-width:var(--content-w); margin-left:auto; margin-right:auto;
  line-height:1.4;
}
.lead-article .article-title a{ color:inherit; }
.article-meta{
  text-align:center;
  max-width:var(--content-w); margin:14px auto 0;
  font-size:12px; letter-spacing:.08em; text-transform:uppercase; color:var(--color-muted);
}
.lead-excerpt{
  max-width:var(--content-w); margin:28px auto 0;
  font-size:14px; color:var(--color-text); text-align:left;
}
.lead-excerpt p:last-child{ margin-bottom:0; }

/* ==========================================================
   記事一覧
   ========================================================== */
.article-list{ }
.list-item{ text-align:center; }
.list-item .photo{
  width:100%; max-width:var(--wide-w); margin:0 auto 28px;
  aspect-ratio:16/9;
}
.item-title{
  font-family:var(--font-head); font-weight:var(--head-weight);
  font-size:var(--item-title-size);
  max-width:var(--content-w); margin:0 auto;
  line-height:1.5;
}
.item-title a{ color:inherit; }
.item-meta{
  text-align:center;
  max-width:var(--content-w); margin:8px auto 0;
  font-size:11.5px; letter-spacing:.08em; text-transform:uppercase; color:var(--color-muted);
}
.item-excerpt{
  max-width:var(--content-w); margin:16px auto 0; color:var(--color-text);
  font-size:14px; text-align:left;
}
.item-excerpt p:last-child{ margin-bottom:0; }
.article-list .list-item + .list-item{ margin-top: calc(var(--gap-section) * 1.5); }

.pagination,
.navigation.pagination{
  text-align:center; margin-top: var(--gap-section);
  font-size:12px; letter-spacing:.1em; text-transform:uppercase;
}
.pagination .nav-links{ display:flex; justify-content:center; gap:24px; }
.pagination a{ border-bottom:1px solid var(--color-line); padding-bottom:2px; }

/* ==========================================================
   個別記事／固定ページ
   ========================================================== */
.single-article .article-title{ margin-top:48px; text-align:center; }
.article-category{
  text-align:center; margin-top: var(--gap-section-sm);
  font-size:11.5px; letter-spacing:.1em; text-transform:uppercase; color:var(--color-muted);
}
.article-category a{ border-bottom:1px solid transparent; }
.article-category a:hover{ border-bottom-color:var(--color-line); }

.article-body{
  max-width:var(--content-w); margin:var(--gap-article-body) auto;
  font-size:14px; text-align:left;
}
.article-body p{ margin:0 0 26px; }
.article-body img{ display:block; }
.article-body .alignwide{ max-width:var(--wide-w); width:100%; margin-left:auto; margin-right:auto; }
.article-body .alignfull{ width:100%; }
.article-body figure{ margin:var(--gap-section-sm) 0; }
.article-body .page-links{
  clear:both; font-size:13px; letter-spacing:.04em;
}

.prev-next{
  max-width:var(--content-w); margin: var(--gap-section-sm) auto 0;
  display:flex; justify-content:space-between; gap:16px;
  font-size:12px; letter-spacing:.06em;
  border-top:1px solid var(--color-line-soft); padding-top:20px;
}
.prev-next a{ border-bottom:1px solid transparent; }
.prev-next a:hover{ border-bottom-color:var(--color-line); }

/* ---- コメント ---- */
.article-comments{
  max-width:var(--content-w); margin:var(--gap-section-sm) auto 0;
  font-size:14px;
}
.comments-title{
  font-family:var(--font-head); font-weight:var(--head-weight);
  font-size:18px; margin:0 0 24px;
}
.comment-list{ list-style:none; margin:0 0 32px; padding:0; }
.comment-list .comment-body{ border-top:1px solid var(--color-line-soft); padding:20px 0; }
.comment-list .comment-author{ font-weight:500; font-size:13px; }
.comment-list .comment-metadata{ font-size:11px; color:var(--color-muted); margin-bottom:8px; }
.comment-respond input,
.comment-respond textarea{
  width:100%; font-family:var(--font-body); font-size:14px;
  padding:10px; border:1px solid var(--color-line-soft); border-radius:0;
}
.comment-respond label{ display:block; font-size:12px; margin-bottom:6px; }
.comment-respond p{ margin:0 0 16px; }
.comment-respond .form-submit input{
  width:auto; background:#111; color:#fff; border-color:#111;
  padding:10px 24px; cursor:pointer; text-transform:uppercase; letter-spacing:.08em; font-size:12px;
}

/* ==========================================================
   フッター
   ========================================================== */
.site-footer{
  margin-top: calc(var(--gap-section) * 1.3);
  border-top:1px solid var(--color-line);
  padding: 40px 24px 60px;
  text-align:center;
}
.footer-links{
  display:flex; justify-content:center; flex-wrap:wrap; gap:26px;
  font-size:12px; letter-spacing:.1em; text-transform:uppercase;
  list-style:none; padding:0; margin:0 0 22px;
}
.footer-links a{ border-bottom:1px solid transparent; }
.footer-links a:hover{ border-bottom-color:var(--color-line); }

/* コピーライト（フッター最下部）。footer-widgets がある時だけ上に区切り線を出す */
.footer-bottom{ padding-top:0; }
.footer-widgets + .footer-bottom{
  margin-top:28px; padding-top:24px;
  border-top:1px solid var(--color-line-soft);
}
.footer-credit{ font-size:12px; color:var(--color-muted); margin:0 0 6px; }
.footer-copyright{ font-size:11px; color:var(--color-muted); margin:0; letter-spacing:.04em; }

/* Footer Widget Area：PC=3カラム／タブレット=2カラム／SP=1カラム。
   ウィジェット数が1〜2個の時は :has() で列数を実数に合わせ、余分な空白が出ないようにする。 */
.footer-widgets{
  max-width:var(--wide-w); margin:28px auto 0;
  text-align:left;
  display:grid;
  grid-template-columns:repeat(3, 1fr);
  gap:28px;
}
.footer-widgets:has(.widget:only-child){ grid-template-columns:1fr; max-width:var(--content-w); }
.footer-widgets:has(.widget:first-child:nth-last-child(2)){ grid-template-columns:repeat(2, 1fr); }

.footer-widgets .widget{ min-width:0; }
.footer-widgets .widget-title{
  font-size:12px; text-transform:uppercase; letter-spacing:.1em;
  margin:0 0 10px; color:var(--color-text);
}
.footer-widgets .widget ul{ list-style:none; padding:0; margin:0; }
.footer-widgets .widget li{ margin:0 0 8px; font-size:13px; color:var(--color-muted); }
.footer-widgets .widget a{ border-bottom:1px solid transparent; }
.footer-widgets .widget a:hover{ border-bottom-color:var(--color-line); }
.footer-widgets .widget p{ font-size:13px; color:var(--color-muted); margin:0 0 10px; }

/* Instagramフィード用：横幅いっぱいに使い、画像は横並びにする。
   ブロックエディタの「追加CSSクラス」に widget-wide を指定するか、
   プラグインが出力するクラス名に instagram を含む場合は自動で適用される。 */
.footer-widgets .widget-wide,
.footer-widgets [class*="instagram"]{
  grid-column: 1 / -1;
}
.footer-widgets .widget-wide ul,
.footer-widgets [class*="instagram"] ul{
  display:flex; flex-wrap:wrap; gap:10px;
  list-style:none; padding:0; margin:0;
}
.footer-widgets .widget-wide li,
.footer-widgets [class*="instagram"] li{
  flex:1 1 90px; max-width:120px; margin:0;
}
.footer-widgets .widget-wide img,
.footer-widgets [class*="instagram"] img{
  width:100%; height:auto; display:block;
}

/* ==========================================================
   レスポンシブ（タブレット）
   ========================================================== */
@media (max-width:1024px){
  .footer-widgets,
  .footer-widgets:has(.widget:first-child:nth-last-child(2)){
    grid-template-columns:repeat(2, 1fr);
  }
  .footer-widgets:has(.widget:only-child){ grid-template-columns:1fr; }
}

/* ==========================================================
   レスポンシブ（スマートフォン）
   ========================================================== */
@media (max-width:680px){
  :root{
    --content-w: 100%;
    --wide-w: 100%;
    --gap-section: 56px;
    --gap-section-sm: 32px;
    --gap-article-body: 40px;
    --title-size: 26px;
    --item-title-size: 19px;
  }
  .paper-header .hr-line{ left:40px; right:40px; }
  .wrap{ padding:0 20px; }
  .site-nav{ margin-top:8px; gap:28px; font-size:11px; letter-spacing:.1em; }
  body{ font-size:16px; }
  .prev-next{ flex-direction:column; gap:12px; }
  .footer-widgets,
  .footer-widgets:has(.widget:only-child),
  .footer-widgets:has(.widget:first-child:nth-last-child(2)){
    grid-template-columns:1fr; text-align:center; gap:24px;
  }
  .lead-article .article-title{ text-align:left; font-size:24px; }
  .item-title{ text-align:left; }
}

/* 印刷時：モルタル背景と装飾線を省略 */
@media print{
  body{ background:#fff; }
  .paper{ box-shadow:none; margin:0; max-width:none; }
  .hr-line{ display:none; }
}
