/* ============================================================
   mori.chiba.jp v9 — 「凪」 editorial refresh
   palette: 白磁 / 墨藍 / 海碧 / 砂 / 茜
   type:    Shippori Mincho (display) / Zen Kaku Gothic New (body)
            IBM Plex Mono (labels — a nod to the computing journey)
   ============================================================ */
:root {
  --paper: #f5f6f3;
  --sand: #eae4d6;
  --ink: #17242e;
  --deep: #0e1f2b;
  --sea: #166b7d;
  --sea-soft: #e2ecea;
  --akane: #cf4a52;
  --muted: #5a6a72;
  --line: rgba(23, 36, 46, .16);
  --line-light: rgba(245, 246, 243, .22);
  --serif: "Shippori Mincho", "Yu Mincho", "Hiragino Mincho ProN", serif;
  --sans: "Zen Kaku Gothic New", "Hiragino Sans", "Yu Gothic UI", Meiryo, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "Cascadia Mono", monospace;
}
* { box-sizing: border-box }
html { scroll-behavior: smooth }
[id] { scroll-margin-top: 84px }
body { margin: 0; padding-top: 76px; font-family: var(--sans); font-weight: 400; color: var(--ink); background: var(--paper); line-height: 1.9; overflow-x: hidden }
a { color: inherit; text-decoration: none }
img { max-width: 100%; height: auto; display: block }
h1, h2, h3, blockquote { font-family: var(--serif); font-weight: 700 }

/* ---------- header ---------- */
.site-header { position: fixed; z-index: 50; top: 0; left: 0; right: 0; height: 76px; padding: 0 clamp(20px, 4vw, 64px); display: flex; align-items: center; justify-content: space-between; background: rgba(14, 31, 43, .97); border-bottom: 1px solid var(--line-light); color: #fff; transition: height .35s }
.site-header.scrolled { height: 62px; backdrop-filter: blur(14px) }
.brand { display: inline-flex; align-items: center; gap: 10px; font-family: var(--serif); font-weight: 700; font-size: 19px; letter-spacing: .01em }
.brand-mark { width: 30px; height: 30px; border-radius: 4px; background: var(--paper); color: var(--deep); display: grid; place-items: center; font-family: var(--serif); font-style: italic; font-size: 17px }
.global-nav { display: flex; align-items: center; gap: 30px; font-family: var(--mono); font-size: 12px; font-weight: 500; letter-spacing: .12em }
.global-nav a { position: relative; padding-bottom: 2px }
.global-nav a::after { content: ""; position: absolute; left: 0; bottom: -3px; width: 0; height: 1px; background: currentColor; transition: .25s }
.global-nav a:hover::after { width: 100% }
.menu-button { display: none; background: none; border: 1px solid rgba(255, 255, 255, .55); border-radius: 3px; color: #fff; padding: 8px 14px; font: 500 12px/1 var(--mono); letter-spacing: .1em }

/* ---------- hero ---------- */
.hero { height: min(880px, calc(100svh - 76px)); min-height: 640px; position: relative; background: var(--deep); color: #fff; overflow: hidden }
.hero-image-wrap { position: absolute; inset: 0 }
.hero-image { width: 100%; height: 100%; object-fit: cover; object-position: center }
.hero-poster { display: none }
.hero-shade { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(8, 22, 33, .84) 0%, rgba(8, 22, 33, .5) 36%, rgba(8, 22, 33, .02) 68%), linear-gradient(0deg, rgba(8, 22, 33, .55), transparent 38%) }
.hero-copy { position: absolute; z-index: 3; left: clamp(24px, 7vw, 112px); top: 50%; transform: translateY(-42%); max-width: 720px }
.eyebrow { font-family: var(--mono); font-size: 11px; font-weight: 600; letter-spacing: .3em; margin: 0 0 26px; color: rgba(255, 255, 255, .85) }
.hero h1 { font-size: clamp(44px, 5.6vw, 82px); line-height: 1.28; letter-spacing: .04em; margin: 0 0 26px; white-space: nowrap; text-shadow: 0 3px 26px rgba(0, 0, 0, .28) }
.hero-lead { font-size: clamp(15px, 1.5vw, 19px); line-height: 2.1; margin: 0 0 38px; color: rgba(255, 255, 255, .92) }
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 50px; padding: 0 26px; border-radius: 3px; font-size: 14px; font-weight: 700; letter-spacing: .06em; transition: .25s }
.button-primary { background: var(--paper); color: var(--deep) }
.button-primary:hover { background: #fff; transform: translateY(-2px) }
.button-ghost { border: 1px solid rgba(255, 255, 255, .65); color: #fff; background: rgba(255, 255, 255, .05); backdrop-filter: blur(6px) }
.button-ghost:hover { background: rgba(255, 255, 255, .14); transform: translateY(-2px) }
.scroll-cue { position: absolute; z-index: 3; right: clamp(22px, 4vw, 64px); bottom: 26px; font-family: var(--mono); font-size: 10px; letter-spacing: .26em; writing-mode: vertical-rl; display: flex; align-items: center; gap: 8px; color: rgba(255, 255, 255, .85) }
.scroll-cue span { font-size: 16px; animation: bob 1.6s infinite }
@keyframes bob { 50% { transform: translateY(6px) } }

/* ---------- marquee (tide line) ---------- */
.marquee { overflow: hidden; background: var(--paper); border-block: 1px solid var(--line); white-space: nowrap }
.marquee-track { display: inline-flex; gap: 34px; align-items: center; padding: 13px 0; font-family: var(--mono); font-size: 11px; font-weight: 600; letter-spacing: .26em; color: var(--sea); animation: marquee 34s linear infinite }
.marquee-track i { font-style: normal; color: var(--akane) }
@keyframes marquee { to { transform: translateX(-50%) } }

/* ---------- section framework + 縦書きラベル (signature) ---------- */
.section { position: relative; padding: clamp(84px, 10vw, 150px) clamp(22px, 7vw, 112px) }
.section-kicker { position: absolute; top: clamp(90px, 10.5vw, 156px); left: clamp(18px, 2.6vw, 42px); writing-mode: vertical-rl; font-family: var(--mono); font-size: 11px; font-weight: 600; letter-spacing: .32em; color: var(--sea); margin: 0 }
.section-kicker::before { content: ""; display: inline-block; width: 1px; height: 42px; background: var(--sea); margin-bottom: 16px }
.section-heading { display: grid; grid-template-columns: 1.15fr .65fr; gap: 50px; align-items: end; margin-bottom: 64px; padding-bottom: 36px; border-bottom: 1px solid var(--line) }
.section-heading > p { margin: 0; color: var(--muted); font-size: 15px }
.intro h2, .section-heading h2, .profile-header h2, .compact-dtm-copy h2 { font-size: clamp(34px, 4.2vw, 60px); line-height: 1.42; letter-spacing: .03em; margin: 0 }

/* ---------- intro ---------- */
.nb { display: inline-block }
.intro { text-align: center }
.intro-grid { display: block; max-width: 760px; margin: 0 auto }
.intro-grid h2 { margin-bottom: 34px }
.intro-grid h2::after { content: ""; display: block; width: 56px; height: 1px; background: var(--akane); margin: 34px auto 0 }
.intro-photo { margin: 72px auto 0; max-width: 1040px }
.intro-photo img { border-radius: 8px; border: 1px solid var(--line); box-shadow: 0 24px 60px rgba(23, 36, 46, .12) }
.intro-photo figcaption { margin-top: 14px; text-align: right; font-family: var(--mono); font-size: 10.5px; letter-spacing: .14em; color: #7a8a91 }
.intro-copy { font-size: clamp(15px, 1.25vw, 18px); color: #43535c }
.intro-copy p:first-child { margin-top: .4em }

/* ---------- profile ---------- */
.profile-section { background: linear-gradient(180deg, #eaf2f0 0%, var(--sea-soft) 100%); border-top: 1px solid var(--line) }
.profile-header { display: grid; grid-template-columns: 1.05fr .75fr; gap: 60px; align-items: end; margin-bottom: 56px; padding-bottom: 36px; border-bottom: 1px solid var(--line) }
.profile-header > p { margin: 0; color: var(--muted); font-size: 15px }
.profile-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px }
.profile-card { background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 34px; transition: border-color .3s }
.profile-card:hover { border-color: var(--sea) }
.profile-main { grid-column: 1 / -1; display: grid; grid-template-columns: 200px 1fr; gap: 46px; align-items: center; padding: 46px }
.profile-avatar { aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle at 35% 25%, #fff 0 8%, #d7ebe8 9% 40%, var(--sea) 41% 100%); display: grid; place-items: center; position: relative; overflow: hidden; box-shadow: inset 0 0 0 8px rgba(255, 255, 255, .7) }
.avatar-cat { font-size: 78px; filter: drop-shadow(0 12px 14px rgba(0, 0, 0, .18)); transform: translateY(4px) }
.avatar-wave { position: absolute; bottom: 8px; left: 0; right: 0; text-align: center; font: 700 66px/1 Georgia, serif; color: #fff; opacity: .7 }
.profile-label { font-family: var(--mono); font-size: 10px; letter-spacing: .24em; font-weight: 600; color: var(--sea); margin: 0 0 16px }
.profile-main h3 { font-size: clamp(27px, 3vw, 44px); line-height: 1.5; letter-spacing: .02em; margin: 0 0 22px }
.profile-main p:not(.profile-label) { color: #46565f; margin: 12px 0 }
.profile-main strong { color: var(--sea); font-weight: 700 }
.profile-card:not(.profile-main) h3 { font-size: 21px; line-height: 1.5; margin: 0 0 12px; padding-bottom: 12px; border-bottom: 1px solid var(--line) }
.profile-card:not(.profile-main) p { color: #52626b; margin: 0; font-size: 14.5px }

/* ---------- computing journey ---------- */
.timeline-section { background: #fff }
.timeline { display: grid; grid-template-columns: repeat(5, 1fr); gap: 0; margin-top: 8px; border-top: 1px solid var(--line) }
.timeline-item { padding: 34px 24px 30px 0; border-right: 1px solid var(--line); margin-right: 24px }
.timeline-item:last-child { border-right: 0; margin-right: 0 }
.timeline-era { font-family: var(--mono); font-weight: 600; font-size: 11px; letter-spacing: .12em; color: var(--akane); margin: 0 0 18px }
.timeline-item h3 { font-size: 19px; line-height: 1.6; margin: 0 0 12px }
.timeline-item p:last-child { color: #52626b; margin: 0; font-size: 13.5px; line-height: 1.85 }

/* ---------- MS-DOS / DTM ---------- */
.dtm-section { background: linear-gradient(180deg, var(--sand) 0%, var(--paper) 100%) }
.compact-dtm { padding-top: 96px; padding-bottom: 96px }
.compact-dtm-grid { display: grid; grid-template-columns: 1.08fr .92fr; gap: 52px; align-items: center }
.compact-dtm-copy h2 { margin: 0 0 30px }
.compact-dtm-copy p { color: #4a5a63; font-size: 15px }
.compact-dtm-copy strong { color: var(--sea); font-weight: 700 }
.compact-definition { display: grid; grid-template-columns: auto 1fr; gap: 16px; align-items: start; margin: 26px 0; padding: 18px 20px; border-left: 2px solid var(--akane); background: rgba(255, 255, 255, .72) }
.compact-definition span { padding-top: 4px; font: 600 10px/1 var(--mono); letter-spacing: .16em; color: var(--akane); white-space: nowrap }
.compact-definition p { margin: 0; font-size: 13px }
.compact-highlight { margin: 28px 0 0; padding-top: 24px; border-top: 1px solid var(--line); font-weight: 700; line-height: 2 }
.compact-dtm-images { display: grid; grid-template-columns: 1.12fr .88fr; grid-template-rows: 1fr 1fr auto; gap: 12px; max-width: 560px; margin-left: auto }
.compact-dtm-images figure { margin: 0; overflow: hidden; border-radius: 4px; background: #fff; border: 1px solid var(--line); box-shadow: 0 14px 34px rgba(23, 36, 46, .1) }
.compact-book { grid-row: 1 / span 2 }
.compact-book img { width: 100%; height: 100%; object-fit: cover }
.compact-screen img { width: 100%; height: 100%; aspect-ratio: 1.34/1; object-fit: cover; object-position: top }
.compact-caption { grid-column: 1 / -1; margin: 4px 0 0 !important; text-align: right; font-family: var(--mono); font-size: 10.5px !important; letter-spacing: .06em; color: #7a8a91 !important }

/* ---------- philosophy ---------- */
.philosophy { background: var(--deep); color: #fff; display: grid; grid-template-columns: .85fr 1.15fr; gap: clamp(50px, 8vw, 140px); align-items: center }
.quote-card { border: 1px solid var(--line-light); padding: clamp(36px, 5vw, 70px); border-radius: 6px; position: relative; background: linear-gradient(160deg, rgba(22, 107, 125, .28), rgba(14, 31, 43, 0)) }
.quote-mark { font: 90px/1 var(--serif); color: var(--akane) }
blockquote { margin: 0 0 26px; font-size: clamp(32px, 3.6vw, 54px); font-weight: 700; line-height: 1.6; letter-spacing: .04em }
.quote-card p { color: #b9cdd6; margin: 0 }
.philosophy-list article { display: grid; grid-template-columns: 52px 1fr; gap: 24px; padding: 32px 0; border-bottom: 1px solid var(--line-light) }
.philosophy-list article > span { font-family: var(--serif); font-size: 24px; font-weight: 700; color: var(--akane); line-height: 1.4 }
.philosophy-list h3 { font-size: 21px; margin: 0 0 8px }
.philosophy-list p { color: #aec2cc; margin: 0; font-size: 14.5px }

/* ---------- works ---------- */
.work-grid { display: grid; grid-template-columns: 1.25fr 1fr; grid-template-rows: 1fr 1fr; gap: 16px }
.work-card { background: #fff; border-radius: 6px; padding: 36px; min-height: 250px; position: relative; border: 1px solid var(--line); transition: border-color .3s, transform .3s }
.work-card:hover { border-color: var(--sea); transform: translateY(-4px) }
.work-card-large { grid-row: 1 / 3; min-height: 520px; background: linear-gradient(165deg, var(--sea-soft), #fff 70%) }
.work-icon { font-size: 44px; margin: 46px 0 32px; color: var(--sea) }
.work-card-large .work-icon { font-size: 86px; margin-top: 96px }
.work-card h3 { font-size: clamp(23px, 2.3vw, 34px); line-height: 1.4; margin: 0 0 14px }
.work-card p { max-width: 440px; color: #52626b; font-size: 14.5px }
.tag { position: absolute; left: 36px; bottom: 28px; font-family: var(--mono); font-size: 10px; font-weight: 600; letter-spacing: .2em; color: var(--akane) }
.principles { margin-top: 24px; border: 1px solid var(--line); border-radius: 3px; padding: 18px 24px; display: flex; align-items: center; justify-content: center; gap: 18px; flex-wrap: wrap; background: #fff; font-family: var(--mono); font-size: 11px; font-weight: 600; letter-spacing: .16em; color: var(--sea) }
.principles p { margin: 0 }
.principles span { color: var(--akane) }

/* ---------- links ---------- */
.links-section { background: var(--sea-soft) }
.link-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 20px }
.link-card { min-height: 400px; border-radius: 8px; padding: 36px; color: #fff; position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; transition: .3s }
.link-card:hover { transform: translateY(-6px) }
.mirador-card { background: linear-gradient(160deg, #14586c, var(--deep)) }
.nekonote-card { background: linear-gradient(160deg, var(--akane), #7e2f38) }
.link-card-top, .link-card-footer { font-family: var(--mono); font-size: 10.5px; letter-spacing: .2em; font-weight: 600; display: flex; justify-content: space-between }
.link-card-body { display: flex; gap: 24px; align-items: center }
.mini-logo { width: 72px; height: 72px; border-radius: 6px; background: var(--paper); color: var(--deep); font: italic 700 40px/1 var(--serif); display: grid; place-items: center; flex: 0 0 auto }
.mini-logo.paw { color: var(--akane); font-family: var(--sans); font-style: normal }
.link-card h3 { font-size: clamp(32px, 3.6vw, 52px); margin: 0; line-height: 1.25 }
.link-card p { margin: 14px 0 0; color: rgba(255, 255, 255, .85); max-width: 430px; font-size: 14.5px }
.link-card-footer { border-top: 1px solid rgba(255, 255, 255, .3); padding-top: 20px }

/* ---------- closing ---------- */
.closing { position: relative; background: var(--deep); color: #fff; text-align: center; padding: clamp(110px, 13vw, 180px) 22px; overflow: hidden; border-bottom: 1px solid var(--line-light) }
.closing-inner { position: relative; z-index: 2 }
.closing h2 { font-size: clamp(38px, 5.2vw, 74px); line-height: 1.5; letter-spacing: .03em; margin: 0 0 34px }
@media (min-width: 601px) { .closing h2 { white-space: nowrap } }
.closing-note { font-size: 15px; color: #b9cdd6; margin: 0 }

/* ---------- visitor counter / footer ---------- */
.visitor-counter { display: flex; align-items: center; justify-content: center; gap: 14px; padding: 34px 20px 8px; background: var(--deep); color: #8ba3b0; font-family: var(--mono); letter-spacing: .08em }
.visitor-counter span { font-size: 13px }
.visitor-counter strong { min-width: 44px; color: #fff; font-size: 18px; font-weight: 600; font-variant-numeric: tabular-nums }
.visitor-counter i { width: 1px; height: 18px; margin: 0 5px; background: rgba(255, 255, 255, .22) }
footer { background: var(--deep); color: #8ba3b0; padding: 34px clamp(22px, 7vw, 112px) 40px; display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 30px; font-size: 12px }
.footer-brand { color: #fff }

/* ---------- reveal ---------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s ease, transform .7s ease }
.reveal.visible { opacity: 1; transform: none }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .timeline { grid-template-columns: repeat(3, 1fr) }
  .timeline-item:nth-child(3n) { border-right: 0; margin-right: 0 }
}
@media (max-width: 900px) {
  .global-nav { display: none; position: absolute; top: calc(100% + 8px); left: 16px; right: 16px; background: rgba(14, 31, 43, .97); border: 1px solid var(--line-light); border-radius: 6px; padding: 22px; flex-direction: column; align-items: stretch; gap: 18px }
  .global-nav.open { display: flex }
  .menu-button { display: block }
  .hero { min-height: 660px }
  .hero-image { object-position: 65% center }
  .hero-shade { background: linear-gradient(90deg, rgba(8, 22, 33, .88), rgba(8, 22, 33, .3)), linear-gradient(0deg, rgba(8, 22, 33, .58), transparent) }
  .section-kicker { position: static; writing-mode: horizontal-tb; margin-bottom: 26px }
  .section-kicker::before { width: 34px; height: 1px; margin: 0 12px 4px 0 }
  .philosophy, .section-heading, .profile-header, .compact-dtm-grid { grid-template-columns: 1fr }
  .profile-main { grid-template-columns: 150px 1fr }
  .timeline { grid-template-columns: repeat(2, 1fr) }
  .timeline-item { border-right: 1px solid var(--line); margin-right: 24px }
  .timeline-item:nth-child(2n), .timeline-item:last-child { border-right: 0; margin-right: 0 }
  .work-grid { grid-template-columns: 1fr; grid-template-rows: auto }
  .work-card-large { grid-row: auto; min-height: 420px }
  .work-card-large .work-icon { margin-top: 56px }
  .link-cards { grid-template-columns: 1fr }
  .compact-dtm-images { margin: 0; max-width: 620px }
  footer { grid-template-columns: 1fr; text-align: center; justify-items: center }
}
@media (max-width: 700px) {
  .profile-grid { grid-template-columns: 1fr }
  .profile-main { grid-column: auto; grid-template-columns: 1fr; padding: 30px }
  .profile-avatar { width: 150px }
}
@media (max-width: 650px) {
  .timeline { grid-template-columns: 1fr }
  .timeline-item { border-right: 0; margin-right: 0; border-bottom: 1px solid var(--line) }
  .timeline-item:last-child { border-bottom: 0 }
}
@media (max-width: 600px) {
  .hero h1 { font-size: 38px }
  .hero-lead { font-size: 14px }
  .button { width: 100% }
  .link-card { min-height: 380px; padding: 28px }
  .link-card-body { align-items: flex-start; flex-direction: column }
  .section { padding-left: 20px; padding-right: 20px }
  .site-header { padding: 0 18px }
  .scroll-cue { display: none }
  /* スマホ: 縦型ポスター画像に出し分け（PCは横長ヒーローのまま） */
  .hero { height: auto; min-height: 0 }
  .hero-image-wrap, .hero-shade, .hero-copy { display: none }
  .hero-poster { display: block; width: 100%; height: auto }
}
@media (max-width: 560px) {
  .compact-dtm { padding-top: 72px; padding-bottom: 72px }
  .compact-dtm-images { grid-template-columns: 1fr 1fr; grid-template-rows: auto auto }
  .compact-book { grid-column: 1 / -1; grid-row: auto; max-height: 420px }
  .compact-book img { object-position: top }
}
@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; animation: none !important; transition: none !important }
  .reveal { opacity: 1; transform: none }
}

/* ============================================================
   v9.3 — ギャラリー (ミラたぐ君たち / 日記)
   ============================================================ */
.gallery-empty { font-family: var(--mono); font-size: 12px; letter-spacing: .14em; color: var(--muted); margin: 0 }
.gallery-more { margin: 34px 0 0; text-align: right }
.gallery-more a { font-family: var(--mono); font-size: 12px; font-weight: 600; letter-spacing: .14em; color: var(--sea); border-bottom: 1px solid currentColor; padding-bottom: 2px }
.gallery-more a:hover { color: var(--akane) }

/* --- トップ: 写真ストリップ --- */
.photos-section { background: #fff }
.photo-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px }
.photo-cell { position: relative; display: block; aspect-ratio: 1; overflow: hidden; border-radius: 6px; border: 1px solid var(--line); background: var(--sea-soft) }
.photo-cell img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s }
.photo-cell:hover img { transform: scale(1.05) }
.photo-count { position: absolute; right: 8px; bottom: 8px; padding: 2px 8px; border-radius: 3px; background: rgba(14, 31, 43, .78); color: #fff; font: 600 10.5px/1.6 var(--mono); letter-spacing: .08em; pointer-events: none }

/* --- トップ: 日記カード --- */
.diary-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px }
.diary-card { display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; transition: border-color .3s, transform .3s }
.diary-card:hover { border-color: var(--sea); transform: translateY(-4px) }
.diary-thumb { display: block; aspect-ratio: 16/10; overflow: hidden; background: var(--sea-soft) }
.diary-thumb img { width: 100%; height: 100%; object-fit: cover }
.diary-meta { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px 0; font-family: var(--mono); font-size: 11px; font-weight: 600; letter-spacing: .12em; color: var(--sea) }
.diary-meta i { font-style: normal; color: var(--akane) }
.diary-excerpt { display: block; padding: 8px 18px 18px; font-size: 13.5px; line-height: 1.85; color: #52626b }

/* --- サブページ共通 --- */
.subpage { padding-top: 0 }
.subpage .site-header { position: sticky }
.subpage main { min-height: 60svh }
.page-section { padding-top: clamp(56px, 7vw, 96px) }
.subnav { display: flex !important; position: static !important }
.subnav a[aria-current="page"] { color: var(--akane) }
.subnav a[aria-current="page"]::after { width: 100% }

/* --- photos.php: グリッド --- */
.photo-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px }
.photo-item { margin: 0 }
.photo-open { display: block; position: relative; width: 100%; padding: 0; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; cursor: zoom-in; background: var(--sea-soft) }
.photo-item .photo-open { aspect-ratio: 1 }
.photo-open img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .4s }
.photo-open:hover img { transform: scale(1.05) }
.photo-item figcaption { display: flex; justify-content: space-between; align-items: center; margin-top: 8px }
.photo-item time { font-family: var(--mono); font-size: 10.5px; font-weight: 600; letter-spacing: .12em; color: var(--muted) }

/* --- いいね --- */
.like-btn { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border: 1px solid var(--line); border-radius: 999px; background: none; cursor: pointer; font: 600 11px/1.6 var(--mono); letter-spacing: .08em; color: var(--muted); transition: .25s }
.like-btn:hover { border-color: var(--akane); color: var(--akane) }
.like-btn.liked { border-color: var(--akane); background: var(--akane); color: #fff }
.like-btn:disabled { opacity: .6 }

/* --- diary.php: 投稿一覧 --- */
.diary-list { display: grid; gap: 20px; max-width: 860px }
.d-post { background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 26px; scroll-margin-top: 96px }
.d-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; padding-bottom: 14px; border-bottom: 1px solid var(--line) }
.d-head time { font-family: var(--mono); font-size: 12px; font-weight: 600; letter-spacing: .14em; color: var(--sea) }
.d-images { display: grid; gap: 8px }
.d-images .photo-open { aspect-ratio: 16/10 }
.d-images.n1 { grid-template-columns: 1fr }
.d-images.n2 { grid-template-columns: 1fr 1fr }
.d-images.n3 { grid-template-columns: 1fr 1fr 1fr }
.d-images.n4 { grid-template-columns: 1fr 1fr }
.d-images.n4 .photo-open { aspect-ratio: 16/9 }
.d-caption { margin-top: 18px; font-size: 14.5px; line-height: 2; color: #43535c }

/* --- ページ送り --- */
.pager { display: flex; justify-content: center; align-items: center; gap: 26px; margin-top: 48px; font-family: var(--mono); font-size: 12px; font-weight: 600; letter-spacing: .12em }
.pager span { color: var(--muted) }
.pager a { color: var(--sea); border-bottom: 1px solid currentColor; padding-bottom: 2px }
.pager a:hover { color: var(--akane) }

/* --- ライトボックス --- */
.lightbox { position: fixed; inset: 0; z-index: 100; display: none; align-items: center; justify-content: center; background: rgba(8, 18, 26, .93); padding: 48px }
.lightbox.open { display: flex }
.lightbox img { max-width: min(1280px, 92vw); max-height: 84svh; border-radius: 4px; box-shadow: 0 30px 90px rgba(0, 0, 0, .6) }
.lb-close, .lb-prev, .lb-next { position: absolute; background: none; border: none; color: rgba(255, 255, 255, .85); cursor: pointer; font-family: var(--sans); line-height: 1; padding: 12px }
.lb-close { top: 16px; right: 20px; font-size: 34px }
.lb-prev, .lb-next { top: 50%; transform: translateY(-50%); font-size: 52px }
.lb-prev { left: 10px }
.lb-next { right: 10px }
.lb-close:hover, .lb-prev:hover, .lb-next:hover { color: #fff }
.lb-counter { position: absolute; bottom: 20px; left: 0; right: 0; text-align: center; font: 600 12px/1 var(--mono); letter-spacing: .2em; color: rgba(255, 255, 255, .75) }

/* --- ギャラリーのレスポンシブ --- */
@media (max-width: 900px) {
  .photo-strip, .photo-grid { grid-template-columns: repeat(3, 1fr) }
  .diary-cards { grid-template-columns: 1fr }
}
@media (max-width: 600px) {
  .photo-strip, .photo-grid { grid-template-columns: repeat(2, 1fr); gap: 10px }
  .d-post { padding: 18px }
  .d-images.n3 { grid-template-columns: 1fr 1fr }
  .lightbox { padding: 12px }
  .subnav { gap: 18px !important }
}
