/*
Theme Name: Poipoipoinu
Author: Poipoipoinu
Description: Simple personal WordPress theme for a home server, YouTube, profile, and work logs.
Version: 0.1.0
Requires PHP: 8.0
License: GPLv2 or later
Text Domain: poipoipoinu
*/

@import url('https://fonts.googleapis.com/css2?family=Yomogi&family=Zen+Maru+Gothic:wght@400;500;700&display=swap');

/* =========================================
   Variables
========================================= */

:root {
  --bg: #f7fbff;
  --paper: #ffffff;
  --ink: #20242a;
  --muted: #667085;
  --line: #d9e4ef;
  --accent: #9bd7f4;
  --accent2: #5eb6df;
  --blue: #6aa9ff;
  --shadow: 0 10px 30px rgba(36, 70, 100, 0.08);
  --radius: 18px;
}

/* =========================================
   Base
========================================= */

* {
  box-sizing: border-box;
}

html {
  overflow-x: hidden;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(
      circle at 1px 1px,
      rgba(94, 182, 223, 0.15) 1px,
      transparent 0
    )
    0 0 / 18px 18px,
    var(--bg);
  font-family: "Zen Maru Gothic", "Hiragino Maru Gothic ProN", "Yu Gothic", sans-serif;
  line-height: 1.75;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

a:hover {
  color: var(--accent2);
}

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

/* =========================================
   Site wrapper
========================================= */

.site-wrap {
  width: 100%;
  max-width: none;
  margin: 0;
  padding-left: 12px;
  padding-right: 12px;
}

/* =========================================
   Header
========================================= */

.site-header {
  margin-top: 20px;
}

.hero {
  display: grid;
  grid-template-columns: auto minmax(260px, 0.75fr) minmax(560px, 1.45fr);
  align-items: center;
  gap: 24px;

  min-height: 136px;
  padding: 14px 28px;

  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
}

.site-logo-link {
  display: block !important;
  width: auto !important;
  height: auto !important;
  flex: 0 0 auto !important;
}

.site-logo,
.custom-logo {
  display: block !important;
  width: auto !important;
  height: auto !important;
  max-width: 122px !important;
  max-height: 122px !important;
  border-radius: 0 !important;
  object-fit: contain !important;
  border: none !important;
  padding: 0 !important;
  background: transparent !important;
}

.site-logo-placeholder {
  width: 96px;
  height: 96px;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 14px;
  background: #fff;
  border-radius: 999px;
}

.hero-text {
  min-width: 0;
}

.hero-kicker {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 14px;
}

.site-title {
  margin: 0;
  font-family: "Yomogi", "Zen Maru Gothic", sans-serif;
  font-size: clamp(34px, 3.6vw, 52px);
  letter-spacing: 0.04em;
  line-height: 1.12;
}

.site-title a {
  color: var(--ink);
}

.site-description {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 15px;
}

.hero-art {
  width: 100%;
  height: 104px;
  min-height: 104px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 0;
  overflow: visible;
}

.hero-art-image {
  display: block;
  width: 100%;
  height: 132px;
  max-height: 132px;
  object-fit: contain;
  object-position: center right;
  border-radius: 0;
}

/* =========================================
   Global navigation
========================================= */

.global-nav {
  margin: 14px 0 28px;
  border-top: 2px solid var(--ink);
  border-bottom: 2px solid var(--ink);
  background: rgba(255, 255, 255, 0.78);
}

.global-nav ul {
  list-style: none;
  display: flex;
  gap: 0;
  flex-wrap: wrap;
  margin: 0;
  padding: 0 8px;
}

.global-nav a {
  display: block;
  padding: 12px 16px;
  font-weight: 700;
  font-size: 15px;
}

.global-nav li + li a {
  border-left: 1px solid var(--line);
}

/* =========================================
   Layout
========================================= */

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 28px;
  align-items: start;
}

.main-column {
  min-width: 0;
}

.section-title {
  margin: 0 0 16px;
  font-family: "Yomogi", "Zen Maru Gothic", sans-serif;
  font-size: 26px;
  letter-spacing: 0.03em;
}

.section-title::before {
  content: "✦";
  margin-right: 8px;
  color: var(--blue);
}

/* =========================================
   Home page
   背景・キャラ・吹き出しは1枚画像。
   WordPress側では中央テキストだけ重ねる。
========================================= */

.home-hero {
  position: relative;
  width: 90%;
  max-width: 1200px;
  aspect-ratio: 1900 / 600;
  margin: 0 auto 6px;
  overflow: hidden;

  background: transparent;
  border: none;
  border-radius: 22px;
  box-shadow: none;
}

.home-hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;

  background-repeat: no-repeat;
  background-size: cover;
  background-position: center;
  opacity: 1;
  pointer-events: none;
}

/* 以前のキャラ・吹き出しHTMLが残っていても表示しない */
.home-character,
.speech {
  display: none !important;
}

/* 以前CSSで足していた中央装飾も背景画像側に任せる */
.home-hero::before,
.home-hero::after {
  display: none !important;
}

/* 中央テキスト */

.home-hero-text {
  position: absolute;
  z-index: 2;
  left: 45%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(46%, 700px);
  text-align: center;
}

.home-hero-text h1 {
  margin: 0 0 12px;

  font-family: "Yomogi", "Zen Maru Gothic", sans-serif;
  font-size: clamp(30px, 3vw, 48px);
  line-height: 1.15;
  letter-spacing: 0.05em;
  color: var(--ink);

  white-space: nowrap;

  text-decoration: underline wavy #78b7ff;
  text-underline-offset: 9px;
  text-decoration-thickness: 2px;
}

.home-hero-text p {
  margin: 7px 0;

  font-family: "Zen Maru Gothic", "Hiragino Maru Gothic ProN", "Yu Gothic", sans-serif;
  font-size: clamp(12px, 0.95vw, 15px);
  line-height: 1.75;
  font-weight: 500;
  color: #2f3b4a;
}

.home-latest {
  margin-top: 0;
}

.home-latest .section-title {
  font-size: 24px;
  margin: 4px 0 12px;
  letter-spacing: 0.03em;
}

/* =========================================
   Post grid
========================================= */

.post-grid,
.post-card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.post-card,
.home-post-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition:
    transform 0.14s ease,
    box-shadow 0.14s ease;
}

.post-card:hover,
.home-post-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 34px rgba(36, 70, 100, 0.13);
}

.post-card a,
.home-post-card a {
  display: block;
  color: inherit;
  text-decoration: none;
}

.post-thumb,
.home-post-thumb {
  aspect-ratio: 16 / 9;
  background:
    linear-gradient(
      135deg,
      rgba(155, 215, 244, 0.55),
      rgba(255, 255, 255, 0.5)
    ),
    #eaf6fd;
  display: grid;
  place-items: center;
  color: var(--accent2);
  font-size: 13px;
  font-weight: 800;
  overflow: hidden;
}

.post-thumb img,
.home-post-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.home-post-thumb.no-thumb {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #eaf5ff, #d6eaff);
}

.home-post-thumb.no-thumb span {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: 18px;
  background: #fff;
  color: var(--blue);
  font-size: 34px;
  font-weight: 800;
}

.post-body,
.home-post-body {
  padding: 14px;
}

.post-meta,
.home-post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
}

.home-post-meta span {
  display: inline-block;
  padding: 4px 9px;
  background: #eef6ff;
  border-radius: 999px;
}

.post-title,
.home-post-body h3 {
  margin: 0 0 8px;
  font-family: "Zen Maru Gothic", "Hiragino Maru Gothic ProN", "Yu Gothic", sans-serif;
  font-size: 17px;
  line-height: 1.45;
}

.post-excerpt,
.home-post-body p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.75;
}

.home-blog-link {
  margin-top: 22px;
  text-align: center;
}

.home-blog-link a {
  display: inline-block;
  padding: 10px 28px;
  border: 1px solid #77aef6;
  border-radius: 999px;
  color: #3478d8;
  background: #fff;
  text-decoration: none;
  font-weight: 700;
}

.home-blog-link a:hover {
  background: #eef6ff;
}

/* =========================================
   Sidebar / widgets
========================================= */

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

.widget,
.side-card {
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
}

.widget-title,
.side-card h2 {
  margin: 0 0 12px;
  font-family: "Yomogi", "Zen Maru Gothic", sans-serif;
  font-size: 20px;
  letter-spacing: 0.04em;
}

.profile-card {
  padding: 14px;
}

.profile-card h2 {
  margin-bottom: 10px;
}

.profile-mini {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.profile-mini-icon {
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  border-radius: 999px;
  border: 1px solid var(--ink);
  object-fit: cover;
  background: #fff;
}

.profile-mini-text {
  margin: 0;
  font-size: 13px;
  line-height: 1.55;
  color: var(--muted);
}

.profile-youtube-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  padding: 8px 12px;
  font-size: 13px;
  line-height: 1.3;
}

.youtube-button-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.youtube-button-icon svg {
  display: block;
  width: 18px;
  height: 18px;
}

.youtube-button-text {
  line-height: 1.2;
}

/* search form */
.search-form {
  display: flex;
  gap: 8px;
}

.search-field {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.search-submit,
.button-link {
  cursor: pointer;
  padding: 10px 14px;
  border: 0;
  border-radius: 12px;
  background: var(--ink);
  color: #fff;
  font-weight: 700;
}

.button-link {
  display: inline-block;
  margin-top: 10px;
}

.widget ul,
.side-card ul {
  margin: 0;
  padding-left: 18px;
}

/* =========================================
   Content pages
========================================= */

.content-card {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: min(5vw, 38px);
  box-shadow: var(--shadow);
}

.entry-title {
  margin-top: 0;
  font-family: "Yomogi", "Zen Maru Gothic", sans-serif;
  font-size: clamp(30px, 5vw, 44px);
  line-height: 1.25;
}

.entry-content a {
  color: var(--accent2);
  text-decoration: underline;
}

.nav-links {
  margin-top: 24px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

/* =========================================
   Footer
========================================= */

.site-footer {
  margin: 40px 0 24px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

/* =========================================
   Accessibility
========================================= */

.screen-reader-text {
  position: absolute;
  left: -9999px;
}

/* =========================================
   Responsive
========================================= */

@media (max-width: 1100px) {
  .home-hero-text {
    width: min(52%, 620px);
  }

  .home-hero-text h1 {
    font-size: clamp(28px, 3vw, 42px);
  }

  .home-hero-text p {
    font-size: clamp(11px, 1vw, 14px);
  }
}

@media (max-width: 900px) {
  .hero {
    grid-template-columns: auto 1fr;
    gap: 18px;
    padding: 16px 20px;
  }

  .hero-art {
    grid-column: 1 / -1;
    width: 100%;
    height: 120px;
    min-height: 120px;
    justify-content: center;
  }

  .hero-art-image {
    height: 130px;
    max-height: 130px;
    object-position: center;
  }

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

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

  .home-hero {
    aspect-ratio: 2172 / 724;
  }

  .home-hero-bg {
    background-size: cover;
  }

  .home-hero-text {
    width: min(58%, 620px);
  }

  .home-hero-text h1 {
    font-size: clamp(26px, 4vw, 36px);
  }

  .home-hero-text p {
    font-size: clamp(10px, 1.5vw, 13px);
    line-height: 1.65;
  }
}

@media (max-width: 560px) {
  .site-wrap {
    width: 100%;
    padding-left: 10px;
    padding-right: 10px;
  }

  .site-header {
    margin-top: 10px;
  }

  .hero {
    grid-template-columns: auto 1fr;
    align-items: center;
    justify-items: start;
    text-align: left;

    min-height: auto;
    padding: 14px 16px;
    gap: 12px;

    border-radius: 18px;
  }

  .site-logo-link {
    grid-column: 1;
    grid-row: 1;
  }

  .site-logo,
  .custom-logo {
    max-width: 72px !important;
    max-height: 72px !important;
  }

  .hero-text {
    grid-column: 2;
    grid-row: 1;
    min-width: 0;
  }

  .hero-kicker {
    margin: 0 0 2px;
    font-size: 11px;
    line-height: 1.35;
  }

  .site-title {
    margin: 0;
    font-size: 26px;
    line-height: 1.15;
    letter-spacing: 0.02em;
  }

  .site-description {
    margin: 3px 0 0;
    font-size: 12px;
    line-height: 1.35;
  }

  .hero-art {
    display: none;
  }

  .global-nav {
    margin: 12px 0 24px;
  }

  .global-nav ul {
    justify-content: center;
  }

  .global-nav a {
    padding: 10px 12px;
  }

  .global-nav li + li a {
    border-left: 0;
  }

  .post-grid,
  .post-card-grid {
    grid-template-columns: 1fr;
  }

  .search-form {
    flex-direction: column;
  }

  /* スマホでは横長背景をそのまま読むのは厳しいので、
     高さを確保して中央テキストだけ読みやすくする */
  .home-hero {
    aspect-ratio: auto;
    height: 360px;
    border-radius: 18px;
  }

  .home-hero-bg {
    background-size: cover;
    background-position: center;
  }

  .home-hero-text {
    width: calc(100% - 36px);
    top: 48%;
  }

  .home-hero-text h1 {
    font-size: 28px;
  }

  .home-hero-text p {
    font-size: 13px;
    line-height: 1.65;
  }

  .home-latest .section-title {
    font-size: 24px;
  }
}
