/* 下層ページ（今日・一覧・Profile など）共通スタイル。表紙の style.css と同じトーン */
:root {
  --bg: #ffffff;
  --fg: #111111;
  --muted: #8a8a8a;
  --line: #222222;
  --paper: #f4f2ee;
  --gutter: clamp(16px, 7.5vw, 64px);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
/* スマホで2回タップしたときの自動拡大を止める（誤操作防止） */
html { touch-action: manipulation; }

body {
  background: var(--bg);
  color: var(--fg);
  font-family: "DM Sans", "Zen Kaku Gothic New", system-ui, sans-serif;
  letter-spacing: .025em;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
img { max-width: 100%; display: block; }

/* ---------- ヘッダー ---------- */
.p-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
  flex-wrap: wrap;
  padding: 48px var(--gutter) 0;
}
.p-logo { font-family: "Zen Kurenaido", sans-serif; line-height: 1; }
.p-logo-en { display: block; font-size: 12px; letter-spacing: .06em; margin-bottom: 4px; }
.p-logo-ja { display: block; font-size: 30px; letter-spacing: .08em; }

.p-nav ul { display: flex; flex-wrap: wrap; gap: 6px 20px; font-size: 13px; }
.p-nav a:hover, .p-nav a[aria-current] { text-decoration: underline; text-underline-offset: 4px; }
.p-nav a.is-private { color: var(--muted); }

/* メニューボタン（スマホだけ表示） */
.p-menu-btn { display: none; }

/* ---------- 本文 ---------- */
main {
  flex: 1;
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  padding: 56px var(--gutter) 80px;
}
.p-title { font-size: 20px; letter-spacing: .06em; margin-bottom: 24px; }
.p-lead { font-size: 13px; color: var(--muted); margin-bottom: 32px; }
.p-body { max-width: 640px; }
.p-body h2 + p { margin-top: 1em; }
.p-body h2 { font-size: 15px; margin-top: 2.4em; }
.p-body a { text-decoration: underline; text-underline-offset: 3px; }
.p-preview-note {
  font-size: 12px;
  background: #fff4d6;
  border: 1px solid #e7cf8a;
  padding: 10px 14px;
  margin-bottom: 32px;
  border-radius: 4px;
}

.p-footer { text-align: center; font-size: 9px; letter-spacing: .04em; padding: 0 0 20px; }

/* ---------- 今日 ---------- */
.d-entry { max-width: 760px; margin: 0 auto; }
.d-date { display: block; font-size: 12px; letter-spacing: .08em; color: var(--muted); }
.d-title { font-size: 18px; letter-spacing: .04em; margin-top: 8px; }
.d-figure { margin: 20px 0; }
.d-figure img { width: 100%; height: auto; margin: 0 auto; background: var(--paper); }
.d-feed .d-entry + .d-entry { margin-top: 72px; }
.d-feed .d-date:hover { text-decoration: underline; text-underline-offset: 3px; }
.d-page-no { color: var(--muted); }
.d-pager-mid .d-page-no { margin-left: .8em; font-size: 11px; }
/* .d-text の文字組みは下の「本文の文字組み」でまとめて指定 */
.d-pager {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 12px;
  margin-top: 48px;
  padding-top: 20px;
  border-top: 1px solid #e5e5e5;
  font-size: 13px;
}
.d-pager a:hover { text-decoration: underline; text-underline-offset: 4px; }
/* 前の写真は左端、一覧は真ん中、次の写真は右端（スマホでボタン化しても崩れないよう位置で指定） */
.d-pager > :first-child { justify-self: start; }
.d-pager > :nth-child(2) { justify-self: center; }
.d-pager > :last-child { justify-self: end; text-align: right; }

/* 1枚表示：写真は高さ固定の枠に収める（縦でも横でもボタンの位置が同じになる） */
.d-single .d-figure {
  height: min(72vh, 720px);
  display: flex;
  align-items: center;
  justify-content: center;
}
.d-single .d-figure img { width: 100%; height: 100%; object-fit: contain; background: none; }
.d-single .d-pager {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}
.d-single .d-text { margin-top: 24px; }
.d-back { display: inline-flex; align-items: baseline; gap: .8em; }
.d-back .d-page-no { font-size: 11px; }
.d-arrows { display: flex; gap: 10px; }
.d-arrow {
  width: 40px; height: 40px;
  display: grid;
  place-items: center;
  border: 1px solid #555;
  border-radius: 50%;
  font-size: 15px;
  transition: background .2s, color .2s;
  -webkit-tap-highlight-color: transparent;
}
.d-arrow[aria-disabled] { opacity: .25; }
a.d-arrow:hover { background: var(--fg); color: var(--bg); border-color: var(--fg); text-decoration: none; }


/* ---------- 今日の一覧 ---------- */
.d-month + .d-month { margin-top: 48px; }
.d-month h2 { font-size: 14px; letter-spacing: .06em; margin-bottom: 16px; padding-left: 10px; border-left: 1px solid var(--line); }
.d-grid {
  /* 写真の縦横比のまま、行の高さをそろえて敷き詰める（--ar = 幅 / 高さ） */
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.d-grid::after { content: ""; flex-grow: 999; }
.d-grid li { flex: var(--ar, 1.5) 1 calc(var(--ar, 1.5) * 160px); }
.d-grid img { width: 100%; height: auto; aspect-ratio: var(--ar, 1.5); object-fit: cover; background: var(--paper); transition: opacity .2s; }
.d-grid a:hover img { opacity: .8; }
.d-day { font-size: 12px; font-weight: 500; letter-spacing: .06em; color: var(--muted); margin: 0 0 10px; }
.d-grid + .d-day { margin-top: 32px; }
.d-g-title { display: block; margin-top: 6px; font-size: 12px; font-weight: 500; }

/* ============================================================
 * スマホ（幅 720px 以下）
 * ============================================================ */
@media (max-width: 720px) {
  /* ヘッダー：ロゴは小さめ、右に丸いメニューボタン */
  .p-header {
    position: relative;
    z-index: 20;
    flex-wrap: nowrap;
    align-items: center;
    padding: calc(16px + env(safe-area-inset-top)) var(--gutter) 0;
    background: var(--bg);
  }
  .p-logo, .p-menu-btn { position: relative; z-index: 11; }   /* 開いたメニューの上に出す */
  .p-logo-en { font-size: 9px; margin-bottom: 3px; }
  .p-logo-ja { font-size: 21px; }

  .p-menu-btn {
    display: grid;
    place-items: center;
    flex: none;
    width: 48px;
    height: 48px;
    border: 1px solid var(--line);
    border-radius: 50%;
    background: var(--bg);
    color: var(--fg);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }
  .p-menu-ico { position: relative; width: 20px; height: 14px; }
  .p-menu-ico i {
    position: absolute;
    left: 0;
    width: 100%;
    height: 1px;
    background: currentColor;
    transition: transform .25s, opacity .2s, top .25s;
  }
  .p-menu-ico i:nth-child(1) { top: 0; }
  .p-menu-ico i:nth-child(2) { top: 6.25px; }
  .p-menu-ico i:nth-child(3) { top: 12.5px; }
  /* 開いているときは × */
  .menu-open .p-menu-ico i:nth-child(1) { top: 6.25px; transform: rotate(45deg); }
  .menu-open .p-menu-ico i:nth-child(2) { opacity: 0; }
  .menu-open .p-menu-ico i:nth-child(3) { top: 6.25px; transform: rotate(-45deg); }

  /* メニュー：ボタンの下に小さなパネルで縦積み（画面全体は覆わない） */
  .p-nav {
    position: absolute;
    top: calc(100% + 6px);
    right: calc(var(--gutter) - 12px);
    z-index: 10;
    padding: 18px 40px 22px 28px;
    background: var(--bg);
    box-shadow: 0 6px 24px rgba(0, 0, 0, .07);
    visibility: hidden;
    opacity: 0;
    transform: translateY(-4px);
    transition: opacity .18s, transform .18s, visibility 0s .18s;
  }
  .menu-open .p-nav { visibility: visible; opacity: 1; transform: none; transition: opacity .18s, transform .18s; }
  .p-nav ul { display: block; font-size: 16px; font-weight: 400; letter-spacing: .04em; }
  .p-nav a { display: flex; align-items: center; min-height: 40px; white-space: nowrap; }
  .p-nav a[aria-current] { text-decoration: none; color: var(--muted); }

  main { padding: 24px var(--gutter) calc(56px + env(safe-area-inset-bottom)); }
  .p-title { font-size: 20px; }
  /* 本文の大きさは PC と同じ 16px */

  /* 今日：写真は画面の端から端まで */
  .d-figure { margin: 12px calc(var(--gutter) * -1); }
  .d-date { font-size: 13px; }
  .d-title { font-size: 17px; }
  /* .d-text も同じ */
  .d-feed .d-entry + .d-entry { margin-top: 48px; }
  .d-pager { font-size: 15px; margin-top: 32px; }
  .d-pager a { display: inline-flex; align-items: center; min-height: 44px; }
  .d-pager-mid { display: flex; align-items: center; justify-content: center; }
  /* 1枚表示：枠は画面の高さの約6割。写真は枠の中で端から端まで */
  .d-single .d-figure { height: min(62svh, 133vw); margin-bottom: 8px; }
  .d-arrow { width: 48px; height: 48px; font-size: 18px; }
  .d-single .d-pager a.d-arrow { display: grid; }

  /* 今日の一覧 */
  .d-day { font-size: 13px; }
  .d-grid { gap: 6px; }
  .d-grid li { flex-basis: calc(var(--ar, 1.5) * 85px); }
}

/* ---------- Contact：SNS のアイコン（線の太さは stroke-width で調整） ---------- */
.p-social {
  display: flex;
  flex-wrap: wrap;
  gap: 28px;
  margin-top: 40px;
}
.p-social-link {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  color: var(--fg);
  transition: opacity .2s;
  -webkit-tap-highlight-color: transparent;
}
.p-social-link svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8px;
  vector-effect: non-scaling-stroke;
  stroke-linejoin: round;
  stroke-linecap: round;
  overflow: visible;
}
.p-social-link svg * { vector-effect: non-scaling-stroke; }
.p-social-link svg .fill { fill: currentColor; stroke: none; }
a.p-social-link[href]:hover { opacity: .5; }
.p-social-link.is-empty { opacity: .25; cursor: default; }

/* ============================================================
 * 本文の文字組み（文章のページ・「今日」の本文で共通）
 * POPEYE Web の記事本文に合わせる：
 *   16px / 行間 2（32px）/ 字間 0.065em / 段落の間 21px / 約物を詰める（palt）
 * 段落は空行で区切る。字下げしたい段落は、行頭に全角スペースを入れる。
 * ============================================================ */
.p-body p, .p-body h2, .d-text {
  font-size: 16px;
  line-height: 2;
  letter-spacing: .065em;
  font-weight: 400;
  font-feature-settings: "palt";
}
.p-body p + p, .d-text p + p { margin-top: 21px; }
.p-body h2 { font-weight: 500; }
