/*
Theme Name: Resper Column
Theme URI: https://resper.jp/
Author: Resper
Author URI: https://resper.jp/
Description: 訪問介護ゆらぎ管理者のひとりごと用のシンプルなブログテーマ。Noto Sans JPベース、モダンミニマル。
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 8.0
License: GNU GPL v2 or later
Text Domain: resper-column
*/

:root {
  --brand: #AB3059;
  --brand-dark: #8a2549;
  --text: #1a1a1a;
  --mute: #888;
  --sub: #555;
  --line: #ededed;
  --bg: #fff;
  --bg-soft: #f3f3f3;
  --max-width: 1100px;
  --font-jp: "Noto Sans JP", -apple-system, BlinkMacSystemFont, "Hiragino Kaku Gothic ProN", "Yu Gothic", "Meiryo", sans-serif;
}

/* ===== Reset ===== */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-jp);
  font-weight: 400;
  font-size: 16px;
  line-height: 1.85;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img, svg, video { display: block; max-width: 100%; height: auto; }
a { color: var(--brand); text-decoration: none; transition: color 0.15s ease; }
a:hover { color: var(--brand-dark); }
h1, h2, h3, h4, h5, h6 { margin: 0; line-height: 1.5; }
p, ul, ol { margin: 0 0 1.2em; }
button { font: inherit; cursor: pointer; }

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  padding: 8px 12px;
  background: var(--brand);
  color: #fff;
  z-index: 9999;
}
.skip-link:focus { left: 0; color: #fff; }

.screen-reader-text {
  border: 0;
  clip: rect(1px, 1px, 1px, 1px);
  clip-path: inset(50%);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  width: 1px;
  word-wrap: normal !important;
}

/* ===== Layout ===== */
.l-container {
  max-width: var(--max-width);
  box-sizing: content-box;
  margin: 0 auto;
  padding: 0 24px;
}
@media (max-width: 767px) {
  .l-container { padding: 0 16px; }
}
.l-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 48px;
  padding: 40px 0 60px;
}
@media (max-width: 991px) {
  .l-main { grid-template-columns: 1fr; gap: 40px; padding: 24px 0 40px; }
}

/* ===== Header ===== */
.site-header {
  background: #fff;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 100;
}
.site-header__inner {
  position: relative;
  max-width: var(--max-width);
  box-sizing: content-box;
  margin: 0 auto;
  padding: 20px 24px 16px;
}
.site-title {
  margin: 0 0 14px;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.4;
  text-align: center;
}
.site-title a { color: var(--brand); }
.site-title br { display: none; }

.gnav__list {
  display: flex;
  justify-content: center;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 28px;
  flex-wrap: wrap;
}
.gnav__list a {
  color: var(--text);
  font-weight: 500;
  font-size: 14px;
  padding: 8px 2px;
  border-bottom: 2px solid transparent;
  display: inline-block;
}
.gnav__list a:hover,
.gnav__list .current-menu-item a {
  color: var(--brand);
  border-bottom-color: var(--brand);
}

.nav-toggle {
  display: none;
  background: none;
  border: 0;
  padding: 8px;
  color: var(--text);
}
.nav-toggle__bar {
  display: block;
  width: 24px;
  height: 2px;
  background: currentColor;
  margin: 5px 0;
  transition: transform 0.2s, opacity 0.2s;
}
.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 767px) {
  .site-header__inner {
    padding: 14px 16px;
  }
  .site-title {
    margin: 0;
    padding: 0 40px;
    font-size: 18px;
  }
  .site-title br { display: inline; }
  .nav-toggle {
    display: block;
    position: absolute;
    top: 50%;
    right: 8px;
    transform: translateY(-50%);
  }
  .gnav { display: none; margin-top: 12px; }
  .gnav.is-open { display: block; }
  .gnav__list {
    flex-direction: column;
    gap: 0;
    border-top: 1px solid var(--line);
  }
  .gnav__list li { border-bottom: 1px solid var(--line); }
  .gnav__list a {
    display: block;
    padding: 14px 8px;
    text-align: center;
    border-bottom: 0;
  }
  .gnav__list a:hover,
  .gnav__list .current-menu-item a { border-bottom: 0; }
}

/* ===== Breadcrumb ===== */
.breadcrumb {
  margin: 0 0 20px;
  font-size: 12px;
  color: var(--mute);
}
.breadcrumb__list {
  display: flex;
  flex-wrap: wrap;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 0;
  line-height: 1.7;
}
.breadcrumb__list li {
  display: inline-flex;
  align-items: center;
}
.breadcrumb__list li + li::before {
  content: "›";
  margin: 0 8px;
  color: var(--mute);
}
.breadcrumb__list a { color: var(--brand); }
.breadcrumb__list a:hover { text-decoration: underline; }
.breadcrumb__list [aria-current] { color: var(--sub); }

/* ===== Page title ===== */
.page-title {
  font-size: 20px;
  font-weight: 700;
  margin: 0 0 24px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--brand);
}

/* ===== Card grid ===== */
.card-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  margin: 0 0 32px;
}
@media (max-width: 991px) {
  .card-grid { gap: 16px; }
}
@media (max-width: 600px) {
  .card-grid { grid-template-columns: 1fr; gap: 14px; }
}

.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.08);
  border-color: #e3e3e3;
}
.card > a { color: inherit; display: block; }
.card > a:hover { color: inherit; }
.card__thumb {
  aspect-ratio: 16 / 10;
  background: var(--bg-soft);
  overflow: hidden;
}
.card__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}
.card:hover .card__thumb img { transform: scale(1.04); }
.card__thumb--empty {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #f0f0f0, #fafafa);
}
.card__body { padding: 16px 18px 20px; }
.card__meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--mute);
  margin-bottom: 8px;
  flex-wrap: wrap;
}
.card__cat {
  background: var(--brand);
  color: #fff;
  padding: 2px 10px;
  border-radius: 2px;
  font-size: 11px;
  line-height: 1.6;
}
.card__title {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.5;
  margin: 0 0 8px;
  color: var(--text);
  word-break: break-all;
  overflow-wrap: anywhere;
}
.card:hover .card__title { color: var(--brand); }
.card__excerpt {
  font-size: 13px;
  line-height: 1.7;
  color: var(--sub);
  margin: 0;
}
@media (max-width: 600px) {
  .card__body { padding: 14px 16px 18px; }
  .card__title { font-size: 15px; line-height: 1.5; margin-bottom: 8px; }
  .card__excerpt { font-size: 12px; line-height: 1.7; }
}

/* ===== Pagination ===== */
.pagination {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin: 32px 0;
}
.pagination .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  background: #fff;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.pagination .page-numbers:hover,
.pagination .page-numbers.current {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}
.pagination .dots {
  border: 0;
  background: transparent;
}
.pagination .dots:hover { background: transparent; color: var(--text); }

/* ===== Single article ===== */
.article__header { margin-bottom: 28px; }
.article__meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  color: var(--mute);
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.article__cat {
  background: var(--brand);
  color: #fff;
  padding: 2px 10px;
  border-radius: 2px;
  font-size: 12px;
  line-height: 1.6;
}
.article__cat:hover { background: var(--brand-dark); color: #fff; }
.article__title {
  font-size: 28px;
  font-weight: 700;
  line-height: 1.5;
  margin: 0;
}
@media (max-width: 600px) {
  .article__title { font-size: 21px; }
}
.article__thumb {
  margin: 0 0 32px;
  border-radius: 6px;
  overflow: hidden;
}
.article__thumb img { width: 100%; height: auto; display: block; }

.article__content {
  font-size: 16px;
  line-height: 1.95;
}
.article__content > * + * { margin-top: 1.4em; }
.article__content h2 {
  font-size: 22px;
  font-weight: 700;
  line-height: 1.5;
  margin: 2.2em 0 0.8em;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--brand);
}
.article__content h3 {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.5;
  margin: 1.8em 0 0.6em;
  padding-left: 12px;
  border-left: 4px solid var(--brand);
}
.article__content p { margin: 0 0 1.4em; }
.article__content img {
  border-radius: 6px;
  margin: 1em auto;
}
.article__content blockquote {
  border-left: 3px solid var(--line);
  padding: 4px 0 4px 20px;
  color: var(--sub);
  margin: 1.4em 0;
}
.article__content ul,
.article__content ol {
  padding-left: 1.4em;
  margin: 0 0 1.4em;
}
.article__content li { margin-bottom: 0.4em; }
.article__content code {
  background: var(--bg-soft);
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 0.92em;
}
.article__content a {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Tags */
.article__footer {
  margin-top: 36px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}
.article__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.article__tags a {
  display: inline-block;
  padding: 3px 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--sub);
  font-size: 12px;
}
.article__tags a:hover {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}

/* Author box */
.author-box {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 20px;
  align-items: start;
  margin: 40px 0 0;
  padding: 24px;
  background: var(--bg-soft);
  border-radius: 6px;
}
.author-box__avatar img {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  display: block;
}
.author-box__name {
  font-size: 16px;
  font-weight: 700;
  margin: 0 0 8px;
}
.author-box__bio {
  font-size: 14px;
  line-height: 1.8;
  color: var(--sub);
  margin: 0;
}
@media (max-width: 600px) {
  .author-box {
    grid-template-columns: 64px 1fr;
    gap: 14px;
    padding: 16px;
  }
  .author-box__avatar img { width: 64px; height: 64px; }
  .author-box__bio { font-size: 13px; }
}

/* Post navigation */
.post-nav {
  display: flex;
  gap: 16px;
  margin-top: 32px;
  font-size: 13px;
}
.post-nav > * {
  flex: 1 1 0;
  min-width: 0;
}
.post-nav a {
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text);
  background: #fff;
  display: block;
  line-height: 1.5;
}
.post-nav a:hover {
  border-color: var(--brand);
  color: var(--brand);
}
.post-nav__label {
  display: block;
  font-size: 11px;
  color: var(--mute);
  margin-bottom: 4px;
}
.post-nav__next { text-align: right; }

/* ===== Sidebar ===== */
.sidebar { font-size: 14px; }
.widget { margin-bottom: 32px; }
.widget__title,
.widget .side-title,
.widget .wp-block-heading {
  font-size: 14px;
  font-weight: 700;
  padding-bottom: 8px;
  margin: 0 0 14px;
  border-bottom: 2px solid var(--brand);
}
.widget ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.widget li {
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}
.widget li:last-child { border-bottom: 0; }
.widget a { color: var(--text); }
.widget a:hover { color: var(--brand); }
/* リスト項目のリンクのみブロック化（recent-card / tagcloud は除外） */
.widget li > a:not(.recent-card) { display: block; }

/* Recent posts (shortcode) */
.widget__recent { list-style: none; padding: 0; margin: 0; }
.widget__recent li {
  border-bottom: 1px solid var(--line);
  padding: 12px 0;
}
.widget__recent li:last-child { border-bottom: 0; }
.recent-card {
  display: flex;
  gap: 12px;
  align-items: stretch;
  color: inherit !important;
}
.recent-card:hover { color: inherit !important; }
.recent-card:hover .recent-card__title { color: var(--brand); }
.recent-card__thumb {
  flex: 0 0 80px;
  width: 80px;
  height: 80px;
  background: var(--bg-soft);
  border-radius: 3px;
  overflow: hidden;
}
.recent-card__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.recent-card__thumb .card__thumb--empty {
  width: 100%; height: 100%;
}
.recent-card__info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
}
.recent-card__title {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  color: var(--text);
  transition: color 0.15s ease;
}
.recent-card__date {
  font-size: 11px;
  color: var(--mute);
}

/* Tag cloud */
.tagcloud,
.wp-block-tag-cloud {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 0;
}
.tagcloud a,
.wp-block-tag-cloud a {
  display: inline-block !important;
  padding: 3px 12px;
  line-height: 1.7;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--sub) !important;
  text-decoration: none;
}
.tagcloud a:hover,
.wp-block-tag-cloud a:hover {
  background: var(--brand);
  color: #fff !important;
  border-color: var(--brand);
}

/* Search form (theme & block widget) */
.search-form {
  display: flex;
  gap: 0;
}
.search-form__input,
.wp-block-search__input {
  flex: 1;
  min-width: 0;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 4px 0 0 4px;
  border-right: 0;
  font-size: 14px;
  font-family: inherit;
}
.search-form__input:focus,
.wp-block-search__input:focus {
  outline: 1px solid var(--brand);
  border-color: var(--brand);
}
.search-form__submit,
.wp-block-search__button {
  background: var(--brand) !important;
  color: #fff !important;
  border: 0;
  margin: 0 !important;
  padding: 0 16px;
  border-radius: 0 4px 4px 0;
  font-size: 13px;
  font-weight: 500;
  transition: background 0.15s ease;
  cursor: pointer;
}
.search-form__submit:hover,
.wp-block-search__button:hover {
  background: var(--brand-dark) !important;
}
.wp-block-search__inside-wrapper {
  display: flex;
  width: 100%;
  gap: 0;
}
.wp-block-search__label { display: none; }

/* Archive widget dropdown */
.widget select {
  width: 100%;
  padding: 9px 36px 9px 12px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='%23888' d='M5 6L0 0h10z'/%3E%3C/svg%3E") no-repeat right 12px center;
  font-family: inherit;
  font-size: 14px;
  color: var(--text);
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}
.widget select:focus {
  outline: 1px solid var(--brand);
  border-color: var(--brand);
}

/* ===== Footer ===== */
.site-footer {
  background: var(--bg-soft);
  border-top: 1px solid var(--line);
  text-align: center;
  padding: 28px 24px;
  margin-top: 40px;
}
.site-footer__copyright {
  font-size: 12px;
  color: var(--mute);
  margin: 0;
}

/* ===== 404 / no-result ===== */
.error-404,
.no-result {
  text-align: center;
  padding: 48px 0;
}
.error-404 h1 {
  font-size: 36px;
  margin-bottom: 16px;
  color: var(--brand);
}

/* ===== Pagetop button ===== */
.pagetop {
  position: fixed;
  right: 18px;
  bottom: 18px;
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--brand);
  color: #fff;
  border-radius: 50%;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 50;
}
.pagetop.is-visible {
  opacity: 1;
  pointer-events: auto;
}
.pagetop:hover {
  background: var(--brand-dark);
  color: #fff;
  transform: translateY(-2px);
}
.pagetop::before {
  content: "";
  display: block;
  width: 10px;
  height: 10px;
  border-top: 2px solid currentColor;
  border-right: 2px solid currentColor;
  transform: rotate(-45deg);
  margin-top: 3px;
}

/* ===== Reduced motion ===== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition: none !important;
    animation: none !important;
  }
}
