/* ============================================
   SAIYA LOG - WordPress Overrides (Layer 4)
   WP生成クラスとテーマの橋渡し
   ============================================ */

/* --- Navigation: WP menu classes → is-current --- */
.global-nav .current-menu-item > a,
.global-nav .current_page_item > a {
  border-bottom: 3px solid var(--color-primary, #111);
}

/* --- wp_nav_menu output normalization --- */
.global-nav .menu-item a {
  text-decoration: none;
}

/* Desktop nav: match existing styles */
.desktop-nav .menu {
  display: flex;
  gap: 24px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.desktop-nav .menu-item a {
  font-size: 0.9rem;
  font-weight: 500;
  padding-bottom: 4px;
}

/* Mobile nav: match existing styles */
.mobile-menu .menu {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.mobile-menu .menu-item a {
  font-size: 1.25rem;
  font-weight: 500;
}

/* Footer nav */
.site-footer__nav .menu {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-footer__nav .menu-item a {
  font-size: 0.85rem;
}

/* --- Pagination (the_posts_pagination) --- */
.navigation.pagination {
  margin-top: 32px;
}

.navigation.pagination .nav-links {
  display: flex;
  justify-content: center;
  gap: 8px;
}

.navigation.pagination .page-numbers {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 2px solid var(--color-border, #222);
  text-decoration: none;
  font-size: 0.85rem;
  font-family: var(--font-mono, monospace);
  font-weight: 700;
  color: var(--color-text, #222);
  transition: background 0.15s ease, color 0.15s ease;
}

.navigation.pagination .page-numbers:hover {
  background: var(--color-primary, #111);
  color: var(--color-bg, #fff);
}

.navigation.pagination .page-numbers.current {
  background: var(--color-primary, #111);
  color: var(--color-bg, #fff);
}

/* --- Search Form --- */
.search-form {
  display: flex;
  gap: 0;
}

.search-form .search-field {
  flex: 1;
  padding: 8px 12px;
  border: 2px solid var(--color-border, #222);
  font-size: 0.9rem;
  font-family: inherit;
  border-right: none;
}

.search-form .search-field:focus {
  outline: none;
  box-shadow: 3px 3px 0 var(--color-primary, #111);
}

.search-form .search-submit {
  padding: 8px 16px;
  background: var(--color-primary, #111);
  color: var(--color-bg, #fff);
  border: 2px solid var(--color-primary, #111);
  font-family: var(--font-heading, sans-serif);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.search-form .search-submit:hover {
  background: var(--color-bg, #fff);
  color: var(--color-primary, #111);
}

/* --- Gutenberg Block Overrides --- */
.wp-block-image {
  margin: 24px 0;
}

.wp-block-image img {
  max-width: 100%;
  height: auto;
}

.alignwide {
  margin-left: -16px;
  margin-right: -16px;
}

.alignfull {
  margin-left: calc(-50vw + 50%);
  margin-right: calc(-50vw + 50%);
  max-width: 100vw;
  width: 100vw;
}

/* --- Gallery --- */
.wp-block-gallery {
  gap: 8px;
}

/* --- Image Captions --- */
.wp-block-image figcaption,
.wp-caption-text {
  font-size: 0.8rem;
  color: var(--color-text-secondary, #555);
  margin-top: 8px;
  text-align: center;
}

/* --- Blockquote --- */
.wp-block-quote,
blockquote {
  border-left: 4px solid var(--color-primary, #111);
  background: var(--color-surface, #f5f5f5);
  padding: 16px 20px;
  margin: 24px 0;
  font-style: normal;
}

.wp-block-quote cite,
blockquote cite {
  display: block;
  font-size: 0.8rem;
  color: var(--color-text-secondary, #555);
  margin-top: 8px;
}

/* --- Table --- */
.wp-block-table table {
  width: 100%;
  border-collapse: collapse;
  border: 2px solid var(--color-border, #222);
}

.wp-block-table th,
.wp-block-table td {
  padding: 8px 12px;
  border: 1px solid var(--color-border-light, #ccc);
  font-size: 0.9rem;
}

.wp-block-table th {
  background: var(--color-primary, #111);
  color: var(--color-bg, #fff);
  font-weight: 700;
}

.wp-block-table tr:nth-child(even) {
  background: var(--color-surface, #f5f5f5);
}

/* --- Post Thumbnail (the_post_thumbnail) --- */
.post-card__thumb img,
.product-card__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* --- Author / Profile Avatar --- */
.author-box img.avatar,
.profile-intro img.avatar,
.profile-intro__avatar img.avatar,
.profile-detail__avatar img.avatar {
  border-radius: 50%;
  object-fit: cover;
}

.profile-intro__avatar {
  width: 96px;
  height: 96px;
  flex-shrink: 0;
}

.profile-intro__avatar img {
  width: 100%;
  height: 100%;
  display: block;
}

.profile-detail__avatar {
  width: 120px;
  height: 120px;
  margin: 0 auto;
}

.profile-detail__avatar img {
  width: 100%;
  height: 100%;
  display: block;
}

/* --- Hero inner layout --- */
.hero__inner {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  flex-direction: column;
  gap: 8px;
  min-height: 40vh;
  padding: 48px 16px;
}

.hero__title {
  font-size: 2rem;
  font-weight: 700;
  font-family: var(--font-heading, sans-serif);
  letter-spacing: 0.1em;
}

.hero__subtitle {
  font-size: 1rem;
  font-family: var(--font-heading, sans-serif);
  letter-spacing: 0.05em;
}

.hero__tagline {
  font-size: 0.9rem;
  color: var(--color-text-tertiary, #888);
}

/* Hero with image */
.hero--with-image {
  background-size: cover;
  background-position: center;
  position: relative;
}

.hero__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
}

.hero--with-image .hero__inner {
  position: relative;
  z-index: 1;
  color: #fff;
}

.hero--with-image .hero__tagline {
  color: rgba(255, 255, 255, 0.7);
}

/* --- Screen Reader Text --- */
.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;
}

/* --- Widget Areas --- */
.widget-area-before-content,
.widget-area-after-content {
  padding: 24px 0;
  background: var(--color-surface, #f5f5f5);
}

.site-header__widgets {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
}

/* Footer 3-column widget grid */
.site-footer__widgets {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  padding: 32px 0;
  border-bottom: 1px solid var(--color-border-light, #ccc);
  margin-bottom: 24px;
}

.site-footer__widget-col .widget {
  margin-bottom: 16px;
}

.site-footer__widget-col .widget-title {
  font-size: 0.9rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 12px;
  font-family: var(--font-heading, sans-serif);
}

@media (max-width: 768px) {
  .site-footer__widgets {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .site-header__widgets {
    display: none;
  }
}

/* Single post widget areas */
.single-widget-before,
.single-widget-after {
  margin: 16px 0;
}

/* --- Growth Log (投稿ベース) --- */
.growth-log__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.growth-log__card {
  border: 2px solid var(--color-border, #222);
  padding: 20px;
  display: flex;
  flex-direction: column;
}

.growth-log__card-title {
  font-size: 1rem;
  font-weight: 700;
  font-family: var(--font-heading, sans-serif);
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.growth-log__icon {
  font-size: 1.1rem;
}

.growth-log__card-text {
  font-size: 0.8rem;
  color: var(--color-text-secondary, #555);
  margin-bottom: 12px;
}

.growth-log__latest {
  background: var(--color-surface, #f5f5f5);
  padding: 12px;
  border-radius: 2px;
  flex: 1;
}

.growth-log__latest--empty {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 60px;
}

.growth-log__date {
  font-size: 0.75rem;
  color: var(--color-text-tertiary, #888);
  font-family: var(--font-mono, monospace);
}

.growth-log__post-title {
  font-size: 0.9rem;
  font-weight: 600;
  margin-top: 4px;
}

.growth-log__post-title a {
  color: inherit;
  text-decoration: none;
}

.growth-log__post-title a:hover {
  text-decoration: underline;
}

.growth-log__excerpt {
  font-size: 0.8rem;
  color: var(--color-text-secondary, #555);
  margin-top: 6px;
  line-height: 1.5;
}

.growth-log__no-data {
  font-size: 0.85rem;
  color: var(--color-text-tertiary, #888);
}

.growth-log__more {
  display: inline-block;
  margin-top: 12px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-primary, #111);
  text-decoration: none;
}

.growth-log__more:hover {
  text-decoration: underline;
}

@media (max-width: 768px) {
  .growth-log__grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}

/* --- Purpose Nav (目的から探す) --- */
.purpose-nav__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}

.purpose-nav__item {
  display: block;
  padding: 14px 18px;
  border: 2px solid var(--color-border, #222);
  text-decoration: none;
  color: var(--color-text, #222);
  font-size: 0.9rem;
  font-weight: 600;
  transition: background 0.15s ease, color 0.15s ease, transform 0.1s ease;
}

.purpose-nav__item:hover {
  background: var(--color-primary, #111);
  color: var(--color-bg, #fff);
  transform: translateY(-2px);
}

@media (max-width: 768px) {
  .purpose-nav__grid {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .purpose-nav__item {
    padding: 12px 14px;
    font-size: 0.85rem;
  }
}

/* --- Product Card Category Label --- */
.product-card__category {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-primary, #111);
  border: 1px solid var(--color-border-light, #ccc);
  padding: 2px 8px;
  margin-bottom: 6px;
}

/* --- Store Categories Tab Count --- */
.store-categories__count {
  font-size: 0.75rem;
  color: var(--color-text-tertiary, #888);
  font-weight: 400;
}

/* --- Store Grid --- */
.store-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
  margin-top: 16px;
}

/* --- Store Section transition for filter --- */
.store-section {
  transition: opacity 0.2s ease;
}

/* --- BLOG Tabs --- */
.blog-tabs__list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.blog-tabs__item {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  min-width: 90px;
  padding: 10px 22px;
  background: #f5f5f5;
  background: var(--color-surface, #f5f5f5);
  border: 2px solid #ddd;
  border: 2px solid var(--color-border, #ddd);
  border-radius: 0;
  text-decoration: none;
  color: #222;
  color: var(--color-text, #222);
  font-size: 0.85rem;
  font-weight: 700;
  font-family: var(--font-heading, sans-serif);
  letter-spacing: 0.03em;
  text-align: center;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.blog-tabs__item:hover {
  background: #e0e0e0;
  background: var(--color-border-light, #e0e0e0);
  border-color: #222;
  border-color: var(--color-primary, #222);
  box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.1);
}

.blog-tabs__item.is-active {
  background: #111;
  background: var(--color-primary, #111);
  color: #fff;
  color: var(--color-bg, #fff);
  border-color: #111;
  border-color: var(--color-primary, #111);
  box-shadow: none;
}

/* --- Live Status --- */
.live-status__single {
  display: flex;
  justify-content: center;
}

.live-status__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.live-status__single .live-status__card {
  min-width: 200px;
  max-width: 320px;
  padding: 20px 32px;
}

.live-status__card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 16px 12px;
  border: 2px solid var(--color-border-light, #ddd);
  text-align: center;
  transition: border-color 0.2s ease;
}

.live-status__card--live {
  border-color: var(--color-primary, #111);
  animation: live-pulse 2s ease-in-out infinite;
}

@keyframes live-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(0,0,0,0); }
  50% { box-shadow: 0 0 0 4px rgba(0,0,0,0.08); }
}

.live-status__dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
}

.live-status__card--live .live-status__dot {
  animation: dot-blink 1.5s ease-in-out infinite;
}

@keyframes dot-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

.live-status__name {
  font-size: 0.85rem;
  font-weight: 700;
  font-family: var(--font-heading, sans-serif);
}

.live-status__badge {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.live-status__badge--live {
  background: #d32f2f;
  color: #fff;
}

.live-status__badge--offline {
  background: var(--color-surface, #f5f5f5);
  color: var(--color-text-tertiary, #888);
}

.live-status__watch {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-primary, #111);
  text-decoration: none;
}

.live-status__watch:hover {
  text-decoration: underline;
}

.stream-status__note {
  font-size: 0.75rem;
  color: var(--color-text-tertiary, #888);
  margin-top: 12px;
  text-align: center;
}

@media (max-width: 768px) {
  .live-status__grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* --- Weekly Schedule (横レイアウト) --- */
.week-schedule__grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
  overflow-x: auto;
}

.week-schedule__card {
  border: 2px solid var(--color-border-light, #ddd);
  min-width: 100px;
  display: flex;
  flex-direction: column;
}

.week-schedule__card--today,
.week-schedule__card.is-today {
  border-color: var(--color-primary, #111);
  border-width: 3px;
  background: var(--color-primary, #111);
  color: var(--color-bg, #fff);
}

.week-schedule__card.is-today .week-schedule__dow,
.week-schedule__card.is-today .week-schedule__date,
.week-schedule__card.is-today .week-schedule__content,
.week-schedule__card.is-today .week-schedule__time,
.week-schedule__card.is-today .week-schedule__off {
  color: var(--color-bg, #fff);
}

.week-schedule__card.is-today .week-schedule__today-badge {
  background: var(--color-bg, #fff);
  color: var(--color-primary, #111);
}

.week-schedule__card.is-today .week-schedule__header {
  border-bottom-color: rgba(255, 255, 255, 0.2);
}

.week-schedule__card--has-event:not(.is-today) {
  background: var(--color-surface, #f5f5f5);
}

.week-schedule__header {
  padding: 8px;
  text-align: center;
  border-bottom: 1px solid var(--color-border-light, #ddd);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.week-schedule__dow {
  font-size: 0.85rem;
  font-weight: 700;
  font-family: var(--font-heading, sans-serif);
}

.week-schedule__date {
  font-size: 0.75rem;
  color: var(--color-text-secondary, #555);
  font-family: var(--font-mono, monospace);
}

.week-schedule__today-badge {
  display: inline-block;
  background: var(--color-primary, #111);
  color: var(--color-bg, #fff);
  font-size: 0.6rem;
  font-weight: 700;
  padding: 1px 6px;
  letter-spacing: 0.1em;
}

.week-schedule__body {
  padding: 8px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 60px;
}

.week-schedule__event {
  font-size: 0.75rem;
  line-height: 1.4;
}

.week-schedule__event--done {
  opacity: 0.5;
  text-decoration: line-through;
}

.week-schedule__event--off {
  color: var(--color-text-tertiary, #888);
}

.week-schedule__time {
  font-weight: 700;
  font-family: var(--font-mono, monospace);
  display: block;
}

.week-schedule__content {
  display: block;
}

.week-schedule__bullets {
  list-style: disc;
  padding-left: 14px;
  margin: 2px 0 0;
  font-size: 0.7rem;
  line-height: 1.4;
}

.week-schedule__bullets li {
  margin-bottom: 1px;
}

.week-schedule__card.is-today .week-schedule__bullets {
  color: var(--color-bg, #fff);
}

.week-schedule__status {
  font-size: 0.65rem;
  color: var(--color-text-tertiary, #888);
}

.week-schedule__off {
  font-size: 0.8rem;
  color: var(--color-text-tertiary, #888);
  text-align: center;
  margin: auto 0;
}

@media (max-width: 768px) {
  .week-schedule__grid {
    grid-template-columns: repeat(7, minmax(80px, 1fr));
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
  }

  .week-schedule__card {
    scroll-snap-align: start;
    min-width: 80px;
  }
}

/* --- Stream SNS Grid --- */
.stream-sns__grid {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 12px;
}

.stream-sns__item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border: 2px solid var(--color-border, #222);
  text-decoration: none;
  color: var(--color-text, #222);
  font-size: 0.9rem;
  font-weight: 600;
  transition: background 0.15s ease, color 0.15s ease;
}

.stream-sns__item:hover {
  background: var(--color-primary, #111);
  color: var(--color-bg, #fff);
}

.stream-sns__icon {
  flex-shrink: 0;
}

/* --- Stream Calendar bullets (箇条書き) --- */
.stream-calendar__events {
  list-style: none;
  padding: 0;
  margin: 4px 0 0;
}

.stream-calendar__bullets {
  list-style: disc;
  padding-left: 14px;
  margin: 2px 0 0;
  font-size: 0.65rem;
}

.stream-calendar__bullets li {
  line-height: 1.4;
}

/* --- Q&A Styles --- */
.qa-list {
  max-width: 720px;
  margin: 0 auto;
}

.qa-item {
  margin-bottom: 32px;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--color-border-light, #ddd);
}

.qa-item:last-child {
  border-bottom: none;
}

.qa-item__question,
.qa-item__answer {
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
}

.qa-item__answer {
  margin-bottom: 0;
  padding-left: 8px;
}

.qa-item__badge {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  font-weight: 900;
  font-family: var(--font-heading, sans-serif);
}

.qa-item__badge--q {
  background: var(--color-primary, #111);
  color: var(--color-bg, #fff);
}

.qa-item__badge--a {
  background: var(--color-surface, #f5f5f5);
  color: var(--color-primary, #111);
  border: 2px solid var(--color-border, #222);
}

.qa-item__content {
  flex: 1;
}

.qa-item__text {
  font-size: 0.95rem;
  line-height: 1.8;
}

.qa-item__meta {
  font-size: 0.75rem;
  color: var(--color-text-tertiary, #888);
  margin-top: 4px;
}

.qa-item__name {
  font-weight: 600;
}

@media (max-width: 768px) {
  .qa-item__badge {
    width: 28px;
    height: 28px;
    font-size: 0.85rem;
  }

  .qa-item__text {
    font-size: 0.9rem;
  }
}

/* --- Admin Bar offset --- */
body.admin-bar .site-header {
  top: 32px;
}

@media (max-width: 782px) {
  body.admin-bar .site-header {
    top: 46px;
  }
}
