/*
Theme Name: Hsu Personal Blog
Theme URI: https://example.com/hsu-personal-blog
Author: Hsu
Author URI: https://example.com
Description: A maintainable Japanese-inspired WordPress block theme for code notes, tennis coaching, everyday life, and a Japanese Taiwan gift guide.
Version: 1.3.1
Requires at least: 6.6
Requires PHP: 8.1
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: hsu-personal-blog
Tags: blog, block-patterns, full-site-editing, editor-style, one-column, two-columns
*/

:root {
  --hsu-bg: #f3f5f4;
  --hsu-surface: #ffffff;
  --hsu-surface-soft: #f8f9f8;
  --hsu-text: #202522;
  --hsu-muted: #68716c;
  --hsu-line: #d9dfdc;
  --hsu-accent: #45675b;
  --hsu-accent-soft: #e8efec;
  --hsu-warm: #a85f4b;
  --hsu-code: #50677f;
  --hsu-radius-sm: 8px;
  --hsu-radius-md: 8px;
  --hsu-radius-lg: 8px;
  --hsu-shadow: 0 18px 48px rgba(34, 36, 38, 0.08);
  --hsu-wrap: 1120px;
  --hsu-measure: 760px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  background: var(--hsu-bg);
  color: var(--hsu-text);
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Yu Gothic", "YuGothic", "Segoe UI", sans-serif;
  line-height: 1.82;
}

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

a {
  color: var(--hsu-accent);
  text-decoration-thickness: 0.06em;
  text-underline-offset: 0.2em;
}

a:hover {
  color: var(--hsu-warm);
}

.wp-site-blocks {
  display: flex;
  min-height: 100vh;
  flex-direction: column;
  padding: 0;
}

.site-main {
  flex: 1;
}

.wp-site-blocks .wrap {
  width: min(var(--hsu-wrap), calc(100% - 40px));
  max-width: none;
  margin-inline: auto;
}

.wp-site-blocks > header .site-header {
  position: sticky;
  z-index: 20;
  top: 0;
  border-bottom: 1px solid rgba(217, 223, 220, 0.84);
  background: rgba(243, 245, 244, 0.9);
  backdrop-filter: blur(18px) saturate(160%);
}

.admin-bar .wp-site-blocks > header .site-header {
  top: 32px;
}

.header-inner,
.footer-inner {
  gap: 24px;
  min-height: 70px;
  padding: 12px 0;
}

.brand {
  gap: 12px;
}

.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  place-items: center;
  margin: 0;
  border: 1px solid var(--hsu-line);
  border-radius: 50%;
  background: var(--hsu-surface);
  color: var(--hsu-accent);
  font-weight: 760;
  line-height: 1;
}

.brand-mark a {
  color: inherit;
  text-decoration: none;
}

.brand-copy {
  gap: 0;
}

.brand-name,
.brand-line {
  margin: 0;
  line-height: 1.25;
}

.brand-name {
  font-size: 0.96rem;
  font-weight: 760;
}

.brand-name a {
  color: var(--hsu-text);
  text-decoration: none;
}

.brand-line {
  color: var(--hsu-muted);
  font-size: 0.78rem;
}

.site-nav,
.footer-nav,
.mobile-about-nav,
.topic-nav {
  font-size: 0.9rem;
  font-weight: 650;
}

.site-nav .wp-block-navigation__container,
.footer-nav .wp-block-navigation__container {
  gap: 18px;
}

.site-nav a,
.footer-nav a,
.mobile-about-nav a,
.topic-nav a {
  color: var(--hsu-text);
  text-decoration: none;
}

.site-nav a:hover,
.footer-nav a:hover,
.mobile-about-nav a:hover,
.topic-nav a:hover,
.current-menu-item > a {
  color: var(--hsu-accent);
}

.mobile-about-nav,
.topic-nav {
  display: none;
}

.home-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 0.72fr);
  gap: clamp(36px, 7vw, 88px);
  align-items: center;
  padding: 64px 0 40px;
}

.home-hero > * {
  min-width: 0;
}

.eyebrow,
.post-card-meta,
.article-meta,
.topic-kicker {
  margin: 0 0 12px;
  color: var(--hsu-muted);
  font-size: 0.78rem;
  font-weight: 760;
  letter-spacing: 0;
  text-transform: uppercase;
}

.home-hero h1 {
  max-width: 860px;
  margin: 0;
  font-size: 3.75rem;
  font-weight: 760;
  line-height: 1.16;
  overflow-wrap: anywhere;
}

.hero-text {
  max-width: 720px;
  margin-top: 1.5rem;
  color: var(--hsu-muted);
  font-size: 1.18rem;
}

.hero-actions {
  gap: 16px;
  margin-top: 2.5rem;
}

.wp-element-button {
  min-height: 44px;
  border: 1px solid var(--hsu-text);
  border-radius: 999px;
  background: var(--hsu-text);
  color: var(--hsu-surface);
  font-weight: 720;
  padding: 9px 18px;
}

.wp-element-button:hover {
  border-color: var(--hsu-accent);
  background: var(--hsu-accent);
  color: var(--hsu-surface);
}

.is-style-outline > .wp-element-button {
  border-color: transparent;
  background: transparent;
  color: var(--hsu-accent);
  padding-inline: 4px;
}

.hero-visual {
  position: relative;
  min-height: 340px;
}

.visual-panel {
  border: 1px solid var(--hsu-line);
  border-radius: var(--hsu-radius-lg);
  background: var(--hsu-surface);
  box-shadow: var(--hsu-shadow);
}

.code-panel {
  position: absolute;
  top: 10px;
  right: 0;
  width: min(100%, 420px);
  overflow: hidden;
}

.panel-bar {
  display: flex;
  gap: 7px;
  padding: 14px;
  border-bottom: 1px solid var(--hsu-line);
}

.panel-bar span {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--hsu-line);
}

.panel-bar span:nth-child(2) {
  background: #d9c9aa;
}

.panel-bar span:nth-child(3) {
  background: var(--hsu-accent);
}

.code-panel pre {
  margin: 0;
  overflow: auto;
  border-radius: 0;
  background: var(--hsu-surface);
  color: var(--hsu-text);
  padding: 24px;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 0.88rem;
  line-height: 1.75;
}

.court-panel {
  position: absolute;
  right: 38px;
  bottom: 12px;
  width: min(84%, 330px);
  aspect-ratio: 1.32;
  overflow: hidden;
  background: #edf4ef;
}

.court-panel::before,
.court-panel::after,
.court-line {
  position: absolute;
  background: rgba(69, 103, 91, 0.35);
  content: "";
}

.court-panel::before {
  inset: 24px;
  border: 2px solid rgba(69, 103, 91, 0.35);
  background: transparent;
}

.court-panel::after {
  top: 50%;
  right: 24px;
  left: 24px;
  height: 2px;
}

.court-line.center {
  top: 24px;
  bottom: 24px;
  left: 50%;
  width: 2px;
}

.court-line.service {
  top: 31%;
  right: 24px;
  left: 24px;
  height: 2px;
}

.ball-path {
  position: absolute;
  right: 76px;
  bottom: 72px;
  width: 120px;
  height: 68px;
  border-top: 2px solid rgba(168, 95, 75, 0.48);
  border-radius: 50%;
  transform: rotate(-17deg);
}

.ball {
  position: absolute;
  right: 80px;
  bottom: 118px;
  width: 15px;
  height: 15px;
  border-radius: 999px;
  background: var(--hsu-warm);
}

.topic-grid {
  display: grid;
  width: min(var(--hsu-wrap), calc(100% - 40px));
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-inline: auto;
  padding: 16px 0 64px;
}

.topic-card {
  display: grid;
  min-height: 250px;
  gap: 12px;
  border: 1px solid var(--hsu-line);
  border-radius: var(--hsu-radius-lg);
  background: var(--hsu-surface);
  padding: 24px;
}

.topic-card > * {
  margin-top: 0;
  margin-bottom: 0;
}

.topic-card h2 {
  font-size: 1.28rem;
  line-height: 1.2;
}

.topic-card p:not(.topic-kicker, .topic-link) {
  color: var(--hsu-muted);
}

.topic-card .topic-link {
  align-self: end;
  font-weight: 720;
}

.topic-kicker.code {
  color: var(--hsu-code);
}

.topic-kicker.tennis {
  color: var(--hsu-warm);
}

.topic-kicker.life {
  color: var(--hsu-accent);
}

.content-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  gap: clamp(36px, 7vw, 76px);
  align-items: start;
  padding-bottom: 64px;
}

.content-layout > * {
  min-width: 0;
}

.section-heading {
  margin-bottom: 24px;
}

.section-heading h2,
.about-band h2,
.project-band h2 {
  margin: 0;
  font-size: 2.2rem;
  line-height: 1.16;
}

.post-card {
  border-bottom: 1px solid var(--hsu-line);
  padding: 24px 0;
}

.post-card:first-child {
  padding-top: 0;
}

.post-card:last-child {
  border-bottom: 0;
}

.post-card-meta {
  gap: 8px;
  margin-bottom: 10px;
}

.post-card-meta a,
.article-meta a {
  color: inherit;
  text-decoration: none;
}

.post-card .wp-block-post-title {
  margin: 0;
  font-size: 1.28rem;
  line-height: 1.28;
}

.post-card .wp-block-post-title a {
  color: var(--hsu-text);
  text-decoration: none;
}

.post-card .wp-block-post-title a:hover {
  color: var(--hsu-accent);
}

.post-card .wp-block-post-excerpt {
  margin-top: 12px;
  color: var(--hsu-muted);
}

.post-card .wp-block-post-excerpt__excerpt {
  margin: 0;
}

.post-card .wp-block-post-excerpt__more-text {
  display: none;
}

.tag-row {
  margin-top: 10px;
  color: var(--hsu-muted);
  font-size: 0.82rem;
  font-weight: 650;
}

.tag-row a {
  color: var(--hsu-muted);
  text-decoration: none;
}

.tag-row a:hover {
  color: var(--hsu-accent);
  text-decoration: underline;
}

.sidebar {
  display: grid;
  gap: 16px;
}

.sidebar-box {
  border-top: 1px solid var(--hsu-line);
  padding: 24px 0;
}

.sidebar-box h2 {
  margin: 0;
  font-size: 1.02rem;
}

.sidebar-box ul {
  margin: 14px 0 0;
  padding-left: 1.1rem;
}

.sidebar-box .wp-block-categories-list,
.recent-list {
  display: grid;
  gap: 10px;
}

.recent-list {
  list-style: none;
  padding-left: 0 !important;
}

.sidebar-box a {
  color: var(--hsu-text);
  text-decoration: none;
}

.sidebar-box a:hover {
  color: var(--hsu-accent);
}

.about-band,
.project-band-inner {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr) auto;
  gap: 40px;
  align-items: center;
}

.about-band {
  margin-bottom: 64px;
  border-top: 1px solid var(--hsu-line);
  border-bottom: 1px solid var(--hsu-line);
  padding: 40px;
}

.about-band > p,
.project-band-inner > p {
  color: var(--hsu-muted);
}

.project-band {
  border-top: 1px solid var(--hsu-line);
  background: var(--hsu-surface-soft);
}

.project-band-inner {
  padding-top: 40px;
  padding-bottom: 40px;
}

.page-heading {
  max-width: 820px;
  padding: clamp(56px, 9vw, 96px) 0 40px;
}

.page-heading h1,
.page-heading .wp-block-query-title {
  margin: 0;
  font-size: 3.25rem;
  line-height: 1.16;
}

.archive-page .content-layout {
  padding-bottom: 80px;
}

.wp-block-query-pagination {
  margin-top: 32px;
  border-top: 1px solid var(--hsu-line);
  padding-top: 20px;
}

.article-page {
  max-width: 980px;
  padding: clamp(56px, 9vw, 96px) 0 64px;
}

.article-header {
  margin-inline: auto;
}

.article-header .wp-block-post-title {
  margin: 0 0 16px;
  font-size: 3rem;
  line-height: 1.16;
}

.article-excerpt {
  color: var(--hsu-muted);
  font-size: 1.16rem;
}

.article-featured {
  margin: 40px 0 32px;
}

.article-featured img,
.article-body img,
.standard-page img {
  border-radius: var(--hsu-radius-sm);
  background: var(--hsu-surface-soft);
}

.article-body {
  font-size: 1rem;
}

.article-body > * + * {
  margin-top: 24px;
}

.article-body h2,
.article-body h3 {
  margin-top: 40px;
}

.article-body pre,
.standard-page pre,
.profile-page pre,
.cv-wp-page pre {
  overflow: auto;
  border-radius: var(--hsu-radius-md);
  background: #f0f4f3;
  color: var(--hsu-text);
  padding: 24px;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 0.88rem;
  line-height: 1.75;
}

.article-body blockquote,
.profile-page blockquote,
.cv-wp-page blockquote {
  border-left: 3px solid var(--hsu-warm);
  background: var(--hsu-surface-soft);
  padding: 18px 20px;
}

.article-taxonomy,
.article-actions {
  max-width: var(--hsu-measure);
  margin-top: 40px;
  margin-inline: auto;
  border-top: 1px solid var(--hsu-line);
  padding-top: 24px;
}

.article-taxonomy > p {
  margin: 0;
  color: var(--hsu-muted);
  font-size: 0.78rem;
  font-weight: 760;
}

.standard-page,
.profile-page,
.cv-wp-page,
.contact-wp-page {
  padding: clamp(52px, 8vw, 88px) 0 80px;
}

.search-page,
.error-page {
  padding-bottom: 80px;
}

.error-page {
  padding-top: clamp(72px, 12vw, 128px);
}

.error-page h1 {
  margin: 0;
  font-size: 3rem;
}

.error-home a {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  border-radius: 999px;
  background: var(--hsu-text);
  color: var(--hsu-surface);
  font-weight: 720;
  padding: 9px 18px;
  text-decoration: none;
}

.wp-block-search__inside-wrapper {
  border-color: var(--hsu-line);
  border-radius: var(--hsu-radius-sm);
  background: var(--hsu-surface);
  padding: 4px;
}

.wp-block-search__button {
  border: 0;
  border-radius: 6px;
  background: var(--hsu-text);
  color: var(--hsu-surface);
}

.standard-page > .wp-block-post-title {
  margin-top: 0;
  font-size: 3rem;
  line-height: 1.2;
}

.profile-page .wp-block-post-content > h1,
.cv-wp-page .wp-block-post-content > h1,
.contact-wp-page .wp-block-post-content > h1 {
  margin-top: 0;
  font-size: 3.2rem;
  line-height: 1.2;
}

.profile-page .wp-block-post-content > h2,
.cv-wp-page .wp-block-post-content > h2 {
  margin-top: 48px;
  border-top: 1px solid var(--hsu-line);
  padding-top: 32px;
  font-size: 1.65rem;
}

.profile-page .has-large-font-size,
.cv-wp-page .has-large-font-size,
.contact-wp-page .has-large-font-size {
  color: var(--hsu-muted);
  font-size: 1.18rem !important;
}

.wp-site-blocks > footer .site-footer {
  margin-top: auto;
  border-top: 1px solid rgba(217, 223, 220, 0.84);
}

.footer-inner {
  color: var(--hsu-muted);
}

.footer-inner p {
  margin: 0;
}

@media (max-width: 920px) {
  .home-hero,
  .content-layout,
  .about-band,
  .project-band-inner {
    grid-template-columns: 1fr;
  }

  .home-hero {
    gap: 32px;
  }

  .hero-visual {
    min-height: 300px;
  }

  .topic-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .sidebar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 40px;
  }
}

@media (max-width: 860px) {
  .admin-bar .wp-site-blocks > header .site-header {
    top: 46px;
  }

  .header-inner {
    column-gap: 10px;
    row-gap: 0;
    min-height: auto;
    padding: 8px 0 0;
  }

  .site-nav {
    display: none;
  }

  .mobile-about-nav {
    display: flex;
    min-height: 44px;
    margin-left: auto;
    font-size: 0.88rem;
  }

  .topic-nav {
    display: block;
    order: 3;
    width: 100vw;
    margin-inline: calc(50% - 50vw);
    border-top: 1px solid var(--hsu-line);
    background: var(--hsu-surface);
    padding-inline: max(14px, calc((100vw - var(--hsu-wrap)) / 2));
  }

  .topic-nav .wp-block-navigation__container {
    display: grid;
    width: 100%;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0;
  }

  .topic-nav .wp-block-navigation-item {
    min-width: 0;
  }

  .topic-nav a {
    display: grid;
    min-height: 44px;
    place-items: center;
    border-bottom: 2px solid transparent;
    padding: 7px 4px 5px;
    font-size: 0.86rem;
    text-align: center;
  }

  .topic-nav .current-menu-item > a {
    border-bottom-color: var(--hsu-accent);
  }

  .content-layout > .wp-block-template-part {
    display: none;
  }

  .content-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  .wp-site-blocks .wrap,
  .topic-grid {
    width: min(100% - 28px, var(--hsu-wrap));
  }

  .footer-inner {
    align-items: flex-start;
    flex-direction: column;
  }

  .footer-nav .wp-block-navigation__container {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 20px;
  }

  .topic-grid,
  .sidebar {
    grid-template-columns: 1fr;
  }

  .home-hero {
    gap: 18px;
    padding: 24px 0 20px;
  }

  .home-hero h1 {
    font-size: 2.1rem;
  }

  .hero-text {
    margin-top: 16px;
    font-size: 1rem;
  }

  .hero-actions {
    margin-top: 24px;
  }

  .hero-visual {
    min-height: 140px;
  }

  .code-panel {
    top: 0;
    width: 72%;
  }

  .code-panel .panel-bar {
    padding: 9px;
  }

  .code-panel .panel-bar span {
    width: 7px;
    height: 7px;
  }

  .code-panel pre {
    padding: 10px;
    font-size: 0.65rem;
    line-height: 1.5;
  }

  .court-panel {
    right: 0;
    bottom: 0;
    width: 50%;
  }

  .court-panel::before {
    inset: 14px;
  }

  .court-panel::after,
  .court-line.service {
    right: 14px;
    left: 14px;
  }

  .court-line.center {
    top: 14px;
    bottom: 14px;
  }

  .ball-path {
    right: 38px;
    bottom: 36px;
    width: 64px;
    height: 34px;
  }

  .ball {
    right: 38px;
    bottom: 68px;
    width: 11px;
    height: 11px;
  }

  .topic-grid {
    gap: 12px;
    padding-top: 0;
    padding-bottom: 48px;
  }

  .topic-card {
    min-height: 0;
    border-radius: var(--hsu-radius-md);
    padding: 20px;
  }

  .section-heading h2,
  .about-band h2,
  .project-band h2 {
    font-size: 1.55rem;
  }

  .post-list {
    display: grid;
    gap: 12px;
  }

  .post-card,
  .post-card:first-child,
  .post-card:last-child {
    overflow: hidden;
    border: 1px solid var(--hsu-line);
    border-radius: var(--hsu-radius-sm);
    background: var(--hsu-surface);
    padding: 16px;
  }

  .post-card .wp-block-post-title {
    font-size: 1.18rem;
  }

  .post-card .wp-block-post-excerpt__excerpt {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
  }

  .about-band,
  .project-band-inner {
    gap: 20px;
    padding: 24px 20px;
  }

  .about-band {
    width: min(100% - 28px, var(--hsu-wrap));
    margin-bottom: 48px;
    border-radius: var(--hsu-radius-md);
    background: var(--hsu-surface);
  }

  .page-heading {
    padding: 24px 0 20px;
  }

  .page-heading h1,
  .page-heading .wp-block-query-title,
  .article-header .wp-block-post-title,
  .standard-page > .wp-block-post-title {
    font-size: 2rem;
  }

  .article-page,
  .standard-page,
  .profile-page,
  .cv-wp-page,
  .contact-wp-page,
  .error-page {
    padding-top: 28px;
    padding-bottom: 56px;
  }

  .profile-page .wp-block-post-content > h1,
  .cv-wp-page .wp-block-post-content > h1,
  .contact-wp-page .wp-block-post-content > h1 {
    font-size: 1.95rem;
    line-height: 1.28;
  }

  .profile-page .wp-block-post-content > h2,
  .cv-wp-page .wp-block-post-content > h2 {
    margin-top: 32px;
    padding-top: 24px;
    font-size: 1.4rem;
    line-height: 1.34;
  }

  .profile-page .has-large-font-size,
  .cv-wp-page .has-large-font-size,
  .contact-wp-page .has-large-font-size {
    font-size: 1rem !important;
  }

  .article-body pre,
  .standard-page pre,
  .profile-page pre,
  .cv-wp-page pre {
    max-width: 100%;
    padding: 16px;
    font-size: 0.8rem;
  }
}

@media (max-width: 480px) {
  .brand-line {
    display: none;
  }

  .brand-mark {
    width: 34px;
    height: 34px;
    flex-basis: 34px;
  }

  .mobile-about-nav,
  .topic-nav a {
    font-size: 0.8rem;
  }

  .home-hero h1 {
    font-size: 1.8rem;
  }

  .page-heading h1,
  .page-heading .wp-block-query-title,
  .article-header .wp-block-post-title,
  .standard-page > .wp-block-post-title {
    font-size: 1.75rem;
  }

  .profile-page .wp-block-post-content > h1,
  .cv-wp-page .wp-block-post-content > h1,
  .contact-wp-page .wp-block-post-content > h1 {
    font-size: 1.72rem;
  }
}
