/*
Theme Name: Digisuku
Theme URI: https://ome-auto.jp
Description: デジスク - デジタルギフト買取トレンド分析メディア用シンプルテーマ
Version: 1.0
*/

/* ===== Reset & Base ===== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --navy: #cbd6df;
  --navy-light: #7d878f;
  --navy-dark: #6a8ab3;
  --red: #dc2626;
  --red-bg: #fef2f2;
  --green: #16a34a;
  --green-bg: #f0fdf4;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-500: #6b7280;
  --gray-700: #374151;
  --gray-900: #111827;
  --white: #ffffff;
	--font: "Hiragino Kaku Gothic ProN", "Hiragino Sans", Meiryo, sans-serif;
  --max-width: 820px;
  --side-width: 280px;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
}

body {
  font-family: var(--font);
  color: var(--gray-700);
  background: var(--gray-50);
  line-height: 1.85;
  overflow-x: hidden;
  word-break: break-word;
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: var(--navy);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* ===== Layout ===== */
.site-wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.site-container {
  width: 100%;
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 20px;
}

.site-main-flex {
  display: flex;
  gap: 40px;
  padding: 32px 0;
}

.site-content {
  flex: 1;
  min-width: 0; /* flexbox overflow fix */
}

/* ===== Header ===== */
.site-header {
  background: var(--white);
  padding: 0;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px 0;
}

.site-branding h1,
.site-branding p.site-title {
  margin: 0;
}

.site-branding a {
  color: var(--white);
  font-size: 1.5rem;
  font-weight: 700;
  text-decoration: none;
  letter-spacing: 0.02em;
}

.site-branding a:hover {
  text-decoration: none;
  opacity: 0.9;
}

.site-tagline {
	color: var(--navy-light);
  font-size: 0.75rem;
  margin-top: 2px;
	text-align: center;
}

.header-nav {
  background: var(--navy-light);
  border-top: 1px solid rgba(255,255,255,0.1);
}

.header-nav ul {
  list-style: none;
  display: flex;
  gap: 0;
  padding: 0;
  margin: 0;
}

.header-nav a {
  display: block;
  color: var(--gray-300);
  padding: 10px 20px;
  font-size: 0.85rem;
  text-decoration: none;
  transition: background 0.2s;
}

.header-nav a:hover {
  background: rgba(255,255,255,0.08);
  color: var(--white);
  text-decoration: none;
}

/* ===== Breadcrumb ===== */
.breadcrumb {
  font-size: 0.8rem;
  color: var(--gray-500);
  padding: 12px 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.breadcrumb a {
  color: var(--gray-500);
  text-decoration: underline;
}

/* ===== Article ===== */
.article-card {
  background: var(--white);
  border-radius: 6px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  overflow: hidden;
}

.article-header {
  padding: 28px 32px 20px;
  border-bottom: 1px solid var(--gray-200);
}

.article-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--gray-900);
  line-height: 1.5;
  margin-bottom: 12px;
}

.article-meta {
  font-size: 0.8rem;
  color: var(--gray-500);
}

.article-meta a {
  color: var(--gray-500);
}

.article-body {
  padding: 28px 32px 40px;
}

/* ===== Headings (記事内) ===== */
.article-body h2 {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--gray-900);
  border-bottom: 2px solid var(--navy);
  padding-bottom: 8px;
  margin: 2.2em 0 1em;
}

.article-body h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--gray-900);
  border-left: 3px solid var(--navy);
  padding-left: 12px;
  margin: 1.8em 0 0.8em;
}

.article-body h4 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--gray-900);
  margin: 1.5em 0 0.6em;
}

/* ===== Paragraph ===== */
.article-body p {
  margin-bottom: 1.2em;
}

.article-body strong {
  color: var(--gray-900);
}

/* ===== Lists ===== */
.article-body ul,
.article-body ol {
  padding-left: 1.5em;
  margin-bottom: 1.2em;
}

.article-body li {
  margin-bottom: 0.4em;
}

/* ===== Blockquote ===== */
.article-body blockquote {
  background: var(--gray-100);
  border-left: 3px solid var(--navy);
  padding: 16px 20px;
  margin: 1.2em 0;
  border-radius: 0 6px 6px 0;
  font-size: 0.95rem;
}

.article-body blockquote p:last-child {
  margin-bottom: 0;
}

/* ===== Tables ===== */
.table-scroll {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 1.2em 0;
}

.article-body table {
  width: 100%;
  min-width: 480px;
  border-collapse: collapse;
  font-size: 0.88rem;
  line-height: 1.6;
}

.article-body table th {
  background: var(--navy-dark);
  color: var(--white);
  font-weight: 600;
  padding: 10px 14px;
  text-align: left;
  white-space: nowrap;
}

.article-body table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--gray-200);
  vertical-align: top;
}

.article-body table tr:nth-child(even) td {
  background: var(--gray-50);
}

/* WordPress tables */
.wp-block-table {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 1.2em 0;
}

.wp-block-table table {
  min-width: 480px;
}

figure.wp-block-table {
  overflow-x: auto;
  margin: 1.2em 0;
}

/* ===== Boxes / Alert Styles ===== */

/* 警告ボックス（赤） */
.box-warning,
.alert-warning {
  background: var(--red-bg);
  border: 1px solid #fecaca;
  border-left: 4px solid var(--red);
  border-radius: 0 6px 6px 0;
  padding: 20px 24px;
  margin: 1.5em 0;
}

/* 情報ボックス（グレー） */
.box-info,
.alert-info {
  background: var(--gray-100);
  border: 1px solid var(--gray-200);
  border-left: 4px solid var(--navy);
  border-radius: 0 6px 6px 0;
  padding: 20px 24px;
  margin: 1.5em 0;
}

/* 安全ボックス（緑） */
.box-safe,
.alert-safe {
  background: var(--green-bg);
  border: 1px solid #bbf7d0;
  border-left: 4px solid var(--green);
  border-radius: 0 6px 6px 0;
  padding: 20px 24px;
  margin: 1.5em 0;
}

/* WordPress Gutenberg blocks - 背景色の上書き */
.wp-block-group.has-background {
  border-radius: 6px;
  padding: 20px 24px;
  margin: 1.5em 0;
}

/* 赤系背景 → 警告スタイル */
.has-vivid-red-background-color,
.has-luminous-vivid-amber-background-color,
[class*="has-"][style*="background-color"] {
  border-left: 4px solid var(--gray-300);
  border-radius: 0 6px 6px 0;
}

/* ===== TOC (目次) ===== */
.toc-box {
  background: var(--gray-100);
  border: 1px solid var(--gray-200);
  border-radius: 6px;
  padding: 20px 24px;
  margin: 1.5em 0;
}

.toc-box h3,
.toc-box .toc-title {
  border: none;
  padding: 0;
  margin: 0 0 12px;
  font-size: 1rem;
}

.toc-box ul {
  list-style: none;
  padding: 0;
}

.toc-box li {
  padding: 4px 0;
  border-bottom: 1px solid var(--gray-200);
}

.toc-box li:last-child {
  border-bottom: none;
}

.toc-box a {
  color: var(--gray-700);
  font-size: 0.9rem;
}

.toc-box a:hover {
  color: var(--navy-dark);
}

/* ===== Comparison Cards (安全 vs 危険) ===== */
.compare-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 1.5em 0;
}

.compare-card {
  border-radius: 6px;
  padding: 20px;
  font-size: 0.9rem;
}

.compare-card.safe {
  background: var(--green-bg);
  border: 1px solid #bbf7d0;
}

.compare-card.danger {
  background: var(--red-bg);
  border: 1px solid #fecaca;
}

.compare-card h4 {
  margin: 0 0 12px;
  font-size: 1rem;
}

.compare-card ul {
  list-style: none;
  padding: 0;
}

.compare-card li {
  padding: 4px 0;
  font-size: 0.85rem;
  line-height: 1.6;
}

/* ===== Sidebar ===== */
.site-sidebar {
  width: var(--side-width);
  flex-shrink: 0;
}

.sidebar-widget {
  background: var(--white);
  border-radius: 6px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  padding: 20px;
  margin-bottom: 20px;
}

.sidebar-widget h3,
.widget-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--gray-900);
  border-bottom: 2px solid var(--navy);
  padding-bottom: 8px;
  margin-bottom: 14px;
  border-left: none;
  padding-left: 0;
}

.sidebar-widget ul {
  list-style: none;
  padding: 0;
}

.sidebar-widget li {
  padding: 6px 0;
  border-bottom: 1px solid var(--gray-100);
  font-size: 0.85rem;
}

.sidebar-widget li:last-child {
  border-bottom: none;
}

.sidebar-widget a {
  color: var(--gray-700);
}

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

.search-form input[type="search"],
.search-form input[type="text"] {
  flex: 1;
  border: 1px solid var(--gray-300);
  border-right: none;
  border-radius: 4px 0 0 4px;
  padding: 8px 12px;
  font-size: 0.85rem;
  outline: none;
  font-family: var(--font);
}

.search-form input[type="search"]:focus,
.search-form input[type="text"]:focus {
  border-color: var(--navy);
}

.search-form button,
.search-form input[type="submit"] {
  background: var(--navy);
  color: var(--white);
  border: none;
  border-radius: 0 4px 4px 0;
  padding: 8px 16px;
  font-size: 0.85rem;
  cursor: pointer;
  font-family: var(--font);
}

/* ===== Footer ===== */
.site-footer {
	background: var(--navy-dark);
  color: var(--white);
  text-align: center;
  padding: 24px 20px;
  margin-top: auto;
  font-size: 0.8rem;
}

.site-footer a {
  color: var(--gray-300);
}

.footer-site-name {
  font-weight: 700;
  color: var(--white);
  font-size: 1rem;
  margin-bottom: 4px;
}

.footer-site-name img {
	width: 100px;
	height: 100px;
	display: inline;
}

.site-footer ul {
  list-style: none;
  margin: 0 0 20px 0;
  padding: 0;
  display: inline-flex;
  gap: 30px; /* メニュー間の余白 */
}

.site-footer ul li {
  display: inline;
}

.site-footer ul li a {
  text-decoration: none;
  font-weight: 500;
  letter-spacing: 0.05em;
  transition: opacity 0.2s ease;
}

.site-footer ul li a:hover {
  opacity: 0.6;
}

.site-footer ul li:not(:last-child)::after {
  content: " /";
  margin-left: 15px;
}

/* ===== Article Thumbnail (アイキャッチ画像) ===== */
.article-thumbnail {
  width: 100%;
  overflow: hidden;
}

.article-thumbnail img {
  width: 100%;
  height: auto;
  object-fit: cover;
  display: block;
}

/* ===== Post List (index) ===== */
.post-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.post-card {
  background: var(--white);
  border-radius: 6px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  display: flex;
  overflow: hidden;
  transition: box-shadow 0.2s;
}

.post-card:hover {
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.post-card-thumb {
  flex-shrink: 0;
  width: 200px;
  display: block;
}

.post-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.post-card-body {
  padding: 20px 24px;
  flex: 1;
  min-width: 0;
}

.post-card-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 8px;
  line-height: 1.5;
}

.post-card-title a {
  color: var(--gray-900);
}

.post-card-meta {
  font-size: 0.8rem;
  color: var(--gray-500);
  margin-bottom: 10px;
}

.post-card-excerpt {
  font-size: 0.9rem;
  color: var(--gray-500);
  line-height: 1.7;
}

/* ===== Pagination ===== */
.pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 32px 0;
}

.pagination a,
.pagination span {
  display: inline-block;
  padding: 8px 14px;
  border: 1px solid var(--gray-300);
  border-radius: 4px;
  font-size: 0.85rem;
  color: var(--gray-700);
}

.pagination .current {
  background: var(--navy);
  color: var(--white);
  border-color: var(--navy);
}

/* ===== WordPress core fixes ===== */
.wp-block-image {
  margin: 1.5em 0;
}

.wp-block-separator {
  border-color: var(--gray-200);
}

.alignwide,
.alignfull {
  max-width: 100%;
}

.wp-block-columns {
  gap: 16px;
}

/* WordPress Gutenberg block styles override */
.entry-content .wp-block-group {
  margin: 1.5em 0;
  padding: 20px 24px;
}

.entry-content .wp-block-group.has-background {
  border-radius: 6px;
}

/* Override inline styles that cause overflow */
.entry-content [style] {
  max-width: 100% !important;
}

.entry-content figure {
  max-width: 100%;
  overflow-x: auto;
}

/* ===== Fukidashi (吹き出し) ===== */
.fukidashi {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin: 1.5em 0;
}

.fukidashi.fuki-right {
  flex-direction: row-reverse;
}

.fuki-avatar {
  flex-shrink: 0;
  text-align: center;
  width: 64px;
}

.fuki-avatar img {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--gray-200);
}

.fuki-name {
  display: block;
  font-size: 0.7rem;
  color: var(--gray-500);
  margin-top: 4px;
  line-height: 1.3;
}

.fuki-bubble {
  position: relative;
  max-width: calc(100% - 90px);
  flex: 1;
}

.fuki-text {
  background: var(--gray-100);
  border: 1px solid var(--gray-200);
  border-radius: 12px;
  padding: 14px 18px;
  font-size: 0.93rem;
  line-height: 1.8;
  position: relative;
}

.fuki-text p:last-child {
  margin-bottom: 0;
}

/* 吹き出し三角（左） */
.fuki-left .fuki-text::before {
  content: "";
  position: absolute;
  left: -8px;
  top: 18px;
  border-width: 8px 8px 8px 0;
  border-style: solid;
  border-color: transparent var(--gray-200) transparent transparent;
}

.fuki-left .fuki-text::after {
  content: "";
  position: absolute;
  left: -6px;
  top: 19px;
  border-width: 7px 7px 7px 0;
  border-style: solid;
  border-color: transparent var(--gray-100) transparent transparent;
}

/* 吹き出し三角（右） */
.fuki-right .fuki-text::before {
  content: "";
  position: absolute;
  right: -8px;
  top: 18px;
  border-width: 8px 0 8px 8px;
  border-style: solid;
  border-color: transparent transparent transparent var(--gray-200);
}

.fuki-right .fuki-text::after {
  content: "";
  position: absolute;
  right: -6px;
  top: 19px;
  border-width: 7px 0 7px 7px;
  border-style: solid;
  border-color: transparent transparent transparent var(--gray-100);
}

/* 背景バリエーション */
.fuki-bg-warning .fuki-text {
  background: var(--red-bg);
  border-color: #fecaca;
}
.fuki-bg-warning.fuki-left .fuki-text::before { border-right-color: #fecaca; }
.fuki-bg-warning.fuki-left .fuki-text::after  { border-right-color: var(--red-bg); }
.fuki-bg-warning.fuki-right .fuki-text::before { border-left-color: #fecaca; }
.fuki-bg-warning.fuki-right .fuki-text::after  { border-left-color: var(--red-bg); }

.fuki-bg-safe .fuki-text {
  background: var(--green-bg);
  border-color: #bbf7d0;
}
.fuki-bg-safe.fuki-left .fuki-text::before { border-right-color: #bbf7d0; }
.fuki-bg-safe.fuki-left .fuki-text::after  { border-right-color: var(--green-bg); }
.fuki-bg-safe.fuki-right .fuki-text::before { border-left-color: #bbf7d0; }
.fuki-bg-safe.fuki-right .fuki-text::after  { border-left-color: var(--green-bg); }

.fuki-bg-info .fuki-text {
  background: #eff6ff;
  border-color: #bfdbfe;
}
.fuki-bg-info.fuki-left .fuki-text::before { border-right-color: #bfdbfe; }
.fuki-bg-info.fuki-left .fuki-text::after  { border-right-color: #eff6ff; }
.fuki-bg-info.fuki-right .fuki-text::before { border-left-color: #bfdbfe; }
.fuki-bg-info.fuki-right .fuki-text::after  { border-left-color: #eff6ff; }

/* ===== MOBILE ===== */
@media screen and (max-width: 768px) {
  html {
    font-size: 15px;
  }

  .site-container {
    padding: 0 16px;
  }

  /* Stack layout */
  .site-main-flex {
    flex-direction: column;
    gap: 24px;
    padding: 20px 0;
  }

  .site-sidebar {
    width: 100%;
  }

  /* Header */
  .header-inner {
    padding: 14px 0;
  }

  .site-branding a {
    font-size: 1.25rem;
  }

  .header-nav ul {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .header-nav a {
    padding: 8px 14px;
    font-size: 0.8rem;
    white-space: nowrap;
  }

  /* Article */
  .article-header {
    padding: 20px 16px 16px;
  }

  .article-title {
    font-size: 1.25rem;
  }

  .article-body {
    padding: 20px 16px 32px;
  }

  .article-body h2 {
    font-size: 1.15rem;
  }

  .article-body h3 {
    font-size: 1.05rem;
  }

  /* Tables */
  .article-body table {
    font-size: 0.8rem;
  }

  .article-body table th,
  .article-body table td {
    padding: 8px 10px;
  }

  /* Boxes */
  .box-warning,
  .box-info,
  .box-safe,
  .alert-warning,
  .alert-info,
  .alert-safe,
  .wp-block-group.has-background,
  .entry-content .wp-block-group {
    padding: 14px 16px;
    margin-left: 0;
    margin-right: 0;
  }

  /* Comparison grid */
  .compare-grid {
    grid-template-columns: 1fr;
  }

  /* Blockquote */
  .article-body blockquote {
    padding: 12px 16px;
  }

  /* Post card */
  .post-card {
    flex-direction: column;
  }

  .post-card-thumb {
    width: 100%;
    height: 180px;
  }

  .post-card-body {
    padding: 16px;
  }

  /* Article thumbnail */
  .article-thumbnail {
  }

  /* WordPress content overflow prevention */
  .article-body,
  .entry-content {
    overflow-x: hidden;
    overflow-wrap: break-word;
    word-wrap: break-word;
  }

  /* 吹き出しモバイル */
  .fuki-avatar {
    width: 48px;
  }

  .fuki-avatar img {
    width: 48px;
    height: 48px;
  }

  .fuki-name {
    font-size: 0.65rem;
  }

  .fuki-text {
    padding: 12px 14px;
    font-size: 0.88rem;
  }

  .fukidashi {
    gap: 10px;
  }

  /* WordPress tables - force scroll */
  .wp-block-table,
  figure.wp-block-table {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    display: block;
  }

  .wp-block-table table,
  figure.wp-block-table table,
  .article-body table {
    min-width: 400px;
  }

  .entry-content .wp-block-columns {
    flex-direction: column;
  }
}

@media screen and (max-width: 480px) {
  .article-header {
    padding: 16px 14px;
  }

  .article-body {
    padding: 16px 14px 28px;
  }

  .article-title {
    font-size: 1.15rem;
  }

  .article-body table {
    font-size: 0.75rem;
  }

  .article-body table th,
  .article-body table td {
    padding: 6px 8px;
  }
}
