/*
Theme Name: My Note Blog
Theme URI: https://example.com/
Author: OpenAI
Description: A clean, original, note-inspired WordPress theme focused on readability.
Version: 1.3.19
Requires at least: 6.0
Requires PHP: 7.4
Text Domain: my-note-blog
*/

:root {
  --bg: #ffffff;
  --surface: #f7f7f5;
  --text: #242424;
  --muted: #707070;
  --line: #e8e8e6;
  --accent: #2f7d67;
  --accent-soft: #eaf4f0;
  --radius: 16px;
  --content: 760px;
  --wide: 1120px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Yu Gothic", Meiryo, sans-serif;
  line-height: 1.9;
  letter-spacing: .02em;
}
a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }
img { max-width: 100%; height: auto; display: block; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  max-width: var(--wide);
  margin: 0 auto;
  padding: 14px 22px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 24px;
}
.site-branding { display: flex; align-items: center; gap: 12px; }
.custom-logo { max-height: 36px; width: auto; }
.site-title {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  column-gap: .42em;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.45;
}
.site-title-main,
.site-title-sub { white-space: nowrap; }
.site-title-sub {
  font-size: .72em;
  font-weight: 650;
  letter-spacing: .01em;
}
.site-description { margin: 0; font-size: .78rem; color: var(--muted); }

.site-main { min-height: 70vh; }
.container { max-width: var(--wide); margin: 0 auto; padding: 34px 22px 72px; }
.content-narrow { max-width: var(--content); margin: 0 auto; }

.hero {
  max-width: var(--wide);
  margin: 0 auto;
  padding: 58px 22px 46px;
  display: grid;
  grid-template-columns: minmax(0, 1.75fr) minmax(250px, .65fr);
  gap: clamp(40px, 7vw, 84px);
  align-items: start;
}
.hero-introduction {
  min-width: 0;
  padding-top: 24px;
}
.hero-introduction p {
  max-width: 690px;
  margin: 0;
  color: #5f6368;
  font-size: clamp(1rem, 1.4vw, 1.12rem);
  line-height: 2.15;
  letter-spacing: .035em;
}
.hero-card {
  background: var(--surface);
  border-radius: 24px;
  padding: 30px 32px;
}
.hero-card strong {
  display: block;
  margin-bottom: 18px;
  font-size: 1.02rem;
}
.hero-card p {
  margin: 0;
  color: var(--muted);
  font-size: .96rem;
  line-height: 2;
}

.section-heading { display: flex; justify-content: space-between; align-items: end; gap: 20px; margin-bottom: 30px; padding-top: 4px; }
.section-heading h2 { margin: 0; font-size: 1.5rem; }
.section-heading p { margin: 0; color: var(--muted); font-size: .9rem; }

.post-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 28px; }
.post-card { border-bottom: 1px solid var(--line); padding-bottom: 24px; }
.post-card-link { display: block; color: inherit; }
.post-card-link:hover { color: inherit; }
.post-card-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 8px; border-radius: 4px; }
.post-card-thumb { aspect-ratio: 16/9; border-radius: var(--radius); overflow: hidden; background: var(--surface); margin-bottom: 16px; }
.post-card-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .25s ease; }
.post-card:hover .post-card-thumb img { transform: scale(1.025); }
.post-card-meta { color: var(--muted); font-size: .8rem; display: flex; flex-wrap: wrap; gap: 8px 14px; }
.post-card h2, .post-card h3 { margin: 8px 0 8px; line-height: 1.45; font-size: 1.14rem; }
.post-card-excerpt { display: block; margin: 0; color: var(--muted); font-size: .9rem; line-height: 1.75; }

.archive-title { margin-bottom: 34px; }
.archive-title h1 { margin: 0 0 8px; font-size: 2rem; }
.archive-title p { color: var(--muted); margin: 0; }

.article-header { padding: 44px 22px 28px; }
.article-header-inner { max-width: var(--content); margin: 0 auto; }
.article-meta { color: var(--muted); font-size: .74rem; display: flex; flex-wrap: wrap; gap: 10px 18px; }
.article-title { margin: 18px 0; font-size: clamp(1.65rem, 3.7vw, 2.55rem); line-height: 1.34; letter-spacing: -.02em; }
.article-lead { color: var(--muted); font-size: 1.05rem; }
.article-thumbnail { max-width: 980px; margin: 24px auto 50px; padding: 0 22px; }
.article-thumbnail img { width: 100%; border-radius: 20px; }

.entry-content { font-size: 1.04rem; }
.is-horizontal-article > .entry-content { padding-left: 22px; padding-right: 22px; }
.is-horizontal-article > .entry-content > :first-child { margin-top: .75em; }
.entry-content > * { max-width: var(--content); margin-left: auto; margin-right: auto; }
.entry-content > .alignwide { max-width: 980px; }
.entry-content > .alignfull { max-width: none; }
.entry-content h2 { margin-top: 3.2em; line-height: 1.45; font-size: 1.65rem; }
.entry-content h3 { margin-top: 2.5em; line-height: 1.5; font-size: 1.3rem; }
.entry-content p { margin-top: 1.6em; margin-bottom: 1.6em; }
.entry-content blockquote { border-left: 4px solid var(--accent); background: var(--accent-soft); padding: 18px 22px; border-radius: 0 12px 12px 0; color: #35564d; }
.entry-content pre { overflow-x: auto; background: #1f2328; color: #f6f8fa; padding: 20px; border-radius: 12px; }
.entry-content code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.entry-content ul, .entry-content ol { padding-left: 1.5em; }
.entry-content a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }

.article-footer { max-width: var(--content); margin: 56px auto 0; padding: 28px 0 0; border-top: 1px solid var(--line); }
.tags { display: flex; gap: 10px; flex-wrap: wrap; }
.tags a { background: var(--surface); border-radius: 999px; padding: 6px 12px; font-size: .82rem; }

.pagination { margin-top: 44px; display: flex; justify-content: center; gap: 10px; }
.pagination .page-numbers { padding: 8px 12px; border-radius: 10px; background: var(--surface); }
.pagination .current { background: var(--accent); color: #fff; }

.site-footer { border-top: 1px solid var(--line); }
.footer-inner { max-width: var(--wide); margin: 0 auto; padding: 18px 22px; display: flex; justify-content: space-between; gap: 12px; color: var(--muted); font-size: .74rem; line-height: 1.5; }

.search-form { display: flex; gap: 8px; }
.search-field { width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 11px 13px; font: inherit; }
.search-submit { border: 0; background: var(--text); color: #fff; border-radius: 10px; padding: 0 16px; }

@media (max-width: 860px) {
  .hero {
    grid-template-columns: minmax(0, 1.45fr) minmax(180px, .75fr);
    gap: clamp(18px, 4vw, 34px);
    padding-top: 42px;
    padding-bottom: 36px;
  }
  .hero-introduction { padding-top: 10px; }
  .hero-card { max-width: none; }
  .post-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 580px) {
  .container { padding-top: 28px; }
  .hero {
    grid-template-columns: minmax(0, 1.35fr) minmax(138px, .8fr);
    padding: 34px 14px 30px;
    gap: 14px;
    align-items: start;
  }
  .hero-introduction { padding-top: 6px; }
  .hero-introduction p {
    font-size: clamp(.88rem, 3.7vw, 1rem);
    line-height: 1.95;
    letter-spacing: .015em;
  }
  .hero-card {
    padding: 20px 16px;
    border-radius: 20px;
  }
  .hero-card strong {
    margin-bottom: 12px;
    font-size: .94rem;
  }
  .hero-card p {
    font-size: .82rem;
    line-height: 1.85;
    overflow-wrap: anywhere;
  }
  .site-title {
    column-gap: .34em;
    line-height: 1.4;
  }
  .site-title-sub { font-size: .66em; }
  .section-heading { display: block; margin-bottom: 24px; }
  .section-heading p { margin-top: 6px; }
  .post-grid { grid-template-columns: 1fr; }
  .article-header { padding: 20px 22px 8px; }
  .article-title { margin-top: 14px; margin-bottom: 0; font-size: 1.55rem; }
  .is-horizontal-article > .entry-content { padding-left: 22px; padding-right: 22px; }
  .is-horizontal-article > .entry-content > :first-child { margin-top: .55em; }
  .footer-inner { flex-direction: column; padding: 14px 24px; gap: 0; }
}


/* Vertical writing and ruby */
ruby { ruby-position: over; ruby-align: center; }
ruby rt { font-size: .52em; font-weight: 400; color: inherit; }

.article-body-vertical {
  --vertical-height: 70vh;
  --vertical-height-mobile: 60vh;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 22px;
}
.article-body-vertical .entry-content {
  max-width: none;
  height: var(--vertical-height);
  min-height: 360px;
  overflow-x: auto;
  overflow-y: hidden;
  writing-mode: vertical-rl;
  text-orientation: mixed;
  overscroll-behavior-inline: contain;
  scrollbar-gutter: stable;
  padding: 28px 20px;
  border-block: 1px solid var(--line);
}
.article-body-vertical .entry-content > * {
  max-width: none;
  margin-top: 0;
  margin-bottom: 0;
  margin-inline: 1.5em;
}
.article-body-vertical .entry-content h2,
.article-body-vertical .entry-content h3 { margin-block: 1.8em .8em; }
.article-body-vertical .entry-content blockquote {
  border-left: 0;
  border-top: 4px solid var(--accent);
  border-radius: 0 0 12px 12px;
}

.vertical-poem-block {
  position: relative;
  max-width: 980px !important;
  margin-top: 3em !important;
  margin-bottom: 3em !important;
}
.vertical-poem-scroll {
  height: var(--poem-height, 60vh);
  min-height: 300px;
  overflow-x: auto;
  overflow-y: hidden;
  writing-mode: vertical-rl;
  text-orientation: mixed;
  overscroll-behavior-inline: contain;
  scrollbar-gutter: stable;
  border-block: 1px solid var(--line);
  background: linear-gradient(90deg, rgba(247,247,245,.55), transparent 12%, transparent 88%, rgba(247,247,245,.55));
  padding: 28px 22px;
}
.vertical-poem-text {
  font-family: "Yu Mincho", "Hiragino Mincho ProN", "Hiragino Mincho Pro", serif;
  font-size: var(--poem-font-size, 1.1rem);
  line-height: 2.15;
  letter-spacing: .09em;
  white-space: pre-wrap;
  min-height: 100%;
}
.vertical-scroll-hint {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: .76rem;
  text-align: right;
}
.vertical-poem-scroll:focus { outline: 2px solid var(--accent); outline-offset: 3px; }

@media (max-width: 580px) {
  .article-body-vertical .entry-content { height: var(--vertical-height-mobile); min-height: 300px; }
  .vertical-poem-scroll { height: var(--poem-height-mobile, 52vh); min-height: 280px; }
  .vertical-poem-block { margin-left: -8px !important; margin-right: -8px !important; }
}


/* Home layout: profile below recent posts */
.hero.hero-intro-only {
  display: block;
  padding-bottom: 34px;
}
.hero.hero-intro-only .hero-introduction {
  padding-top: 18px;
}
.home-profile {
  max-width: 760px;
  margin: 40px auto 0;
  padding: 0;
  background: transparent;
  border-radius: 0;
}
.home-profile strong {
  display: block;
  margin-bottom: 14px;
  color: var(--muted);
  font-size: .74rem;
  font-weight: 600;
  letter-spacing: .08em;
}
.home-profile p {
  margin: 0;
  color: var(--muted);
  font-size: .96rem;
  line-height: 2;
}
@media (max-width: 580px) {
  .hero.hero-intro-only {
    display: block;
    padding: 34px 20px 26px;
  }
  .hero.hero-intro-only .hero-introduction { padding-top: 0; }
  .home-profile {
    margin-top: 30px;
    padding: 0;
  }
  .home-profile strong {
    margin-bottom: 12px;
    font-size: .8rem;
  }
  .home-profile p { font-size: .9rem; line-height: 1.9; }
}

/* v1.3.7: Hide WordPress credit on every page, including the home page. */
.powered-by-wordpress,
.site-info .powered-by,
.site-info a[href*="wordpress.org"] {
  display: none !important;
}

/* v1.3.9: Compact the vertical space around the home-page profile. */
.home .container {
  padding-bottom: 40px;
}
@media (max-width: 580px) {
  .home .container { padding-bottom: 30px; }
}

/* v1.3.10: Make the copyright text quieter and more compact. */
@media (max-width: 680px) {
  .footer-inner { font-size: .68rem; }
}

/* v1.3.11: Ruby display normalization. */
ruby { ruby-position: over; ruby-align: center; }
ruby rt { font-size: .55em; line-height: 1; }

/* v1.3.13: Keep ruby text the same color as its base text. */
ruby, ruby rt { color: inherit; }
/* v1.3.14: Show home-page excerpts in three lines on small screens. */
@media (max-width: 580px) {
  .home .post-card-excerpt {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    overflow: hidden;
  }
}

/* v1.3.16: Tighten the transition from the final home article to the profile. */
.home .pagination:empty {
  display: none;
}
.home .post-grid + .pagination:empty + .home-profile {
  margin-top: 24px;
}
@media (max-width: 580px) {
  .home .post-grid + .pagination:empty + .home-profile {
    margin-top: 16px;
  }
}


/* v1.3.17: Use a smaller intentional blank line inside the home profile. */
.home-profile .profile-gap {
  display: block;
  height: .55em;
}
@media (max-width: 580px) {
  .home-profile .profile-gap { height: .4em; }
}


/* v1.3.18: Tighten the gap between the profile heading and the profile text. */
.home-profile strong {
  margin-bottom: 8px;
}
@media (max-width: 580px) {
  .home-profile strong { margin-bottom: 6px; }
}

/* v1.3.19: Tighten spacing between content blocks in horizontal articles. */
.is-horizontal-article > .entry-content p {
  margin-top: 1.15em;
  margin-bottom: 1.15em;
}

@media (max-width: 720px) {
  .is-horizontal-article > .entry-content p {
    margin-top: 1em;
    margin-bottom: 1em;
  }
}
