/*
Theme Name: OshiLife
Theme URI: https://oshilife.jp
Author: OshiLife
Author URI: https://oshilife.jp/about
Description: 推し活を、もっと楽に、もっと楽しく。グッズ収納・会場情報・推し活グッズ比較など、推し活の「困った」を解決する情報メディア。
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: oshilife
*/

/* ========================================
   CSS Variables
   ======================================== */
:root {
  /* Colors - OshiLife Palette */
  --color-primary: #ffb5c5;
  --color-primary-dark: #e89aab;
  --color-primary-light: #fff0f3;
  --color-secondary: #e6e0f8;
  --color-secondary-dark: #d4ccf0;
  --color-accent: #ff7f8e;
  --color-accent-dark: #e56b79;
  --color-text: #333333;
  --color-text-light: #666666;
  --color-text-muted: #999999;
  --color-bg: #ffffff;
  --color-bg-gray: #faf9f8;
  --color-bg-dark: #f5f4f3;
  --color-border: #e8e8e8;
  --color-success: #4caf50;
  --color-warning: #f5a623;

  /* Category Badge Colors */
  --color-badge-news: #ffe4e8;
  --color-badge-news-text: #d64c5b;
  --color-badge-storage: #e8f4ff;
  --color-badge-storage-text: #4a90d9;
  --color-badge-comparison: #e6e0f8;
  --color-badge-comparison-text: #7b61ff;
  --color-badge-venue: #e0f8e8;
  --color-badge-venue-text: #4caf50;
  --color-badge-tmi: #fff4e0;
  --color-badge-tmi-text: #f5a623;

  /* Typography */
  --font-sans: "Noto Sans JP", "Inter", -apple-system, BlinkMacSystemFont,
    "Segoe UI", Roboto, sans-serif;
  --font-size-base: 16px;
  --line-height-base: 1.8;

  /* Spacing */
  --container-max: 1200px;
  --container-narrow: 800px;
  --container-padding: 1.5rem;
  --section-spacing: 5rem;

  /* Border Radius - Larger for cute feel */
  --radius-sm: 0.5rem;
  --radius-md: 1rem;
  --radius-lg: 1.25rem;
  --radius-xl: 1.5rem;
  --radius-pill: 9999px;

  /* Shadows - Softer */
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.08);
  --shadow-xl: 0 16px 32px rgba(0, 0, 0, 0.1);
}

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

html {
  font-size: var(--font-size-base);
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  line-height: var(--line-height-base);
  color: var(--color-text);
  background-color: var(--color-bg);
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--color-primary-dark);
}

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

/* ========================================
   Typography
   ======================================== */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: 700;
  line-height: 1.3;
  margin-top: 0;
  margin-bottom: 0.75em;
  color: var(--color-text);
}

h1 {
  font-size: 2.75rem;
  letter-spacing: -0.02em;
}
h2 {
  font-size: 2rem;
  letter-spacing: -0.01em;
}
h3 {
  font-size: 1.5rem;
}
h4 {
  font-size: 1.25rem;
}
h5 {
  font-size: 1.125rem;
}
h6 {
  font-size: 1rem;
}

p {
  margin-top: 0;
  margin-bottom: 1.5rem;
}

.lead {
  font-size: 1.25rem;
  color: var(--color-text-light);
  line-height: 1.6;
}

/* ========================================
   Layout
   ======================================== */
.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--container-padding);
}

.container-narrow {
  max-width: var(--container-narrow);
  margin: 0 auto;
  padding: 0 var(--container-padding);
}

.site-content {
  min-height: calc(100vh - 200px);
}

.section {
  padding: var(--section-spacing) 0;
}

.section-gray {
  background-color: var(--color-bg-gray);
}

/* ========================================
   Header
   ======================================== */
.site-header {
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem var(--container-padding);
  max-width: var(--container-max);
  margin: 0 auto;
}

.site-branding {
  flex-shrink: 0;
}

.site-branding .site-logo {
  display: block;
  line-height: 0;
}

.site-branding .site-logo img {
  height: 32px;
  width: auto;
  max-width: 150px;
  object-fit: contain;
}

.site-branding .site-title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
}

.site-branding .site-title a {
  color: var(--color-text);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.site-branding .site-title a:hover {
  color: var(--color-primary);
}

.site-branding .logo-icon {
  font-size: 1.5rem;
}

/* Header Actions (Language + Menu Toggle) */
.header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Navigation */
.main-navigation {
  display: flex;
  align-items: center;
}

.main-navigation ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 0.125rem;
}

.main-navigation a {
  color: var(--color-text-light);
  font-weight: 500;
  font-size: 0.875rem;
  padding: 0.5rem 0.75rem;
  display: inline-block;
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
}

.main-navigation a:hover,
.main-navigation .current-menu-item a {
  color: var(--color-primary);
  background: var(--color-primary-light);
}

/* Mobile Navigation Active State */
.main-navigation.active {
  display: block !important;
}

/* Mobile Menu Toggle */
.menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  padding: 0.5rem;
  cursor: pointer;
  color: var(--color-text);
}

/* Language Switcher */
.language-switcher {
  position: relative;
  margin-left: 0.75rem;
}

.language-switcher-toggle {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  background: transparent;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  padding: 0.375rem 0.625rem;
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-text-light);
  transition: all 0.2s ease;
}

.language-switcher-toggle:hover {
  background: var(--color-bg-gray);
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.language-switcher-toggle svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.language-switcher-toggle .current-lang {
  font-weight: 600;
  letter-spacing: 0.02em;
}

.language-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 0.375rem;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  list-style: none;
  padding: 0.375rem;
  min-width: 100px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: all 0.15s ease;
  z-index: 200;
}

.language-switcher:hover .language-dropdown,
.language-switcher-toggle[aria-expanded="true"] + .language-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.language-dropdown li,
.language-dropdown .lang-item {
  margin: 0;
  list-style: none;
}

.language-dropdown li a,
.language-dropdown .lang-item a {
  display: block;
  padding: 0.5rem 0.75rem;
  color: var(--color-text);
  font-size: 0.8125rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
  transition: all 0.15s ease;
  white-space: nowrap;
}

.language-dropdown li a:hover,
.language-dropdown .lang-item a:hover {
  background: var(--color-bg-gray);
  color: var(--color-primary);
}

.language-dropdown li.current-lang a,
.language-dropdown .lang-item.current-lang a,
.language-dropdown .current-lang a {
  background: var(--color-primary-light);
  color: var(--color-primary);
  font-weight: 600;
}

/* ========================================
   Hero Section
   ======================================== */
.hero {
  padding: 5rem 0 4rem;
  background: linear-gradient(
    180deg,
    var(--color-primary-light) 0%,
    var(--color-bg) 100%
  );
}

.hero-inner {
  max-width: 800px;
  margin: 0 auto;
  text-align: center;
}

.hero h1 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  letter-spacing: -0.02em;
  color: var(--color-text);
}

@media (min-width: 768px) {
  .hero h1 {
    font-size: 3rem;
  }
}

.hero .lead {
  font-size: 1.125rem;
  margin-bottom: 2rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
  color: var(--color-text-light);
}

.hero-search {
  max-width: 500px;
  margin: 0 auto;
}

.hero-search form {
  display: flex;
  background: white;
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  border: 2px solid var(--color-border);
  transition: border-color 0.2s ease;
}

.hero-search form:focus-within {
  border-color: var(--color-primary);
}

.hero-search-input {
  flex: 1;
  border: none;
  padding: 1rem 1.5rem;
  font-size: 1rem;
  outline: none;
  background: transparent;
}

.hero-search-input::placeholder {
  color: var(--color-text-muted);
}

.hero-search-btn {
  background: var(--color-accent);
  border: none;
  padding: 1rem 1.5rem;
  cursor: pointer;
  color: white;
  transition: background 0.2s ease;
}

.hero-search-btn:hover {
  background: var(--color-accent-dark);
}

/* ========================================
   Venue Pickup Section
   ======================================== */
.venue-pickup-section h2 {
  text-align: center;
  margin-bottom: 2rem;
}

.venue-cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

@media (max-width: 768px) {
  .venue-cards {
    grid-template-columns: 1fr;
  }
}

.venue-card {
  display: block;
  background: linear-gradient(
    135deg,
    var(--color-secondary) 0%,
    var(--color-primary-light) 100%
  );
  border-radius: var(--radius-lg);
  padding: 2rem;
  transition: all 0.3s ease;
  text-decoration: none;
}

.venue-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.venue-card-inner h3 {
  font-size: 1.25rem;
  color: var(--color-text);
  margin-bottom: 0.5rem;
}

.venue-card-inner p {
  font-size: 0.9375rem;
  color: var(--color-text-light);
  margin: 0;
}

/* ========================================
   Newsletter Section
   ======================================== */
.newsletter-section {
  background: var(--color-primary-light);
  padding: 4rem 0;
}

.newsletter-inner {
  max-width: 600px;
  margin: 0 auto;
  text-align: center;
}

.newsletter-inner h2 {
  font-size: 1.75rem;
  margin-bottom: 0.75rem;
}

.newsletter-inner p {
  color: var(--color-text-light);
  margin-bottom: 1.5rem;
}

.newsletter-form {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  justify-content: center;
}

.newsletter-input {
  flex: 1;
  min-width: 250px;
  max-width: 350px;
  padding: 1rem 1.5rem;
  border: 2px solid var(--color-border);
  border-radius: var(--radius-pill);
  font-size: 1rem;
  outline: none;
  transition: border-color 0.2s ease;
}

.newsletter-input:focus {
  border-color: var(--color-primary);
}

/* ========================================
   Buttons
   ======================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 1rem 2rem;
  font-size: 1rem;
  font-weight: 600;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
  text-decoration: none;
}

.btn-primary {
  background: var(--color-accent);
  color: white;
}

.btn-primary:hover {
  background: var(--color-accent-dark);
  color: white;
  transform: scale(1.02);
  box-shadow: var(--shadow-md);
}

.btn-secondary {
  background: white;
  color: var(--color-text);
  border: 2px solid var(--color-primary);
}

.btn-secondary:hover {
  background: var(--color-primary-light);
  color: var(--color-text);
  border-color: var(--color-primary-dark);
}

.btn-accent {
  background: var(--color-accent);
  color: white;
}

.btn-accent:hover {
  background: var(--color-accent-dark);
  color: white;
  transform: scale(1.02);
}

/* ========================================
   Category Cards
   ======================================== */
.category-cards {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1.5rem;
}

@media (max-width: 1024px) {
  .category-cards {
    grid-template-columns: repeat(3, 1fr);
  }
}

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

@media (max-width: 480px) {
  .category-cards {
    grid-template-columns: 1fr;
  }
}

.category-card {
  background: white;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  transition: all 0.3s ease;
  text-align: center;
}

.category-card:hover {
  border-color: var(--color-primary);
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
}

.category-card-icon {
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
}

.category-card h3 {
  font-size: 1.125rem;
  margin-bottom: 0.5rem;
}

.category-card p {
  color: var(--color-text-light);
  margin-bottom: 1rem;
  font-size: 0.875rem;
  line-height: 1.5;
}

.category-card .card-link {
  font-weight: 600;
  font-size: 0.875rem;
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  color: var(--color-accent);
}

.category-card .card-link:hover {
  gap: 0.625rem;
  color: var(--color-accent-dark);
}

/* Category Badges */
.badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.375rem 0.75rem;
  border-radius: var(--radius-pill);
}

.badge-news {
  background: var(--color-badge-news);
  color: var(--color-badge-news-text);
}

.badge-storage,
.badge-goods-storage {
  background: var(--color-badge-storage);
  color: var(--color-badge-storage-text);
}

.badge-comparison,
.badge-goods-comparison {
  background: var(--color-badge-comparison);
  color: var(--color-badge-comparison-text);
}

.badge-venue,
.badge-venue-guide {
  background: var(--color-badge-venue);
  color: var(--color-badge-venue-text);
}

.badge-tmi {
  background: var(--color-badge-tmi);
  color: var(--color-badge-tmi-text);
}

/* ========================================
   Japanese Perspective Section
   ======================================== */
.perspective-section {
  background: var(--color-text);
  color: white;
  padding: var(--section-spacing) 0;
}

.perspective-inner {
  max-width: 800px;
  margin: 0 auto;
}

.perspective-section h2 {
  color: white;
  font-size: 2rem;
  margin-bottom: 1.5rem;
}

.perspective-section p {
  color: rgba(255, 255, 255, 0.85);
  font-size: 1.0625rem;
  margin-bottom: 1.25rem;
}

.perspective-list {
  list-style: none;
  padding: 0;
  margin: 2rem 0 0;
}

.perspective-list li {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 1rem;
  color: rgba(255, 255, 255, 0.9);
}

.perspective-list li::before {
  content: "→";
  color: var(--color-secondary);
  font-weight: bold;
}

/* ========================================
   Popular Guides Section
   ======================================== */
.guides-section {
  padding: var(--section-spacing) 0;
}

.guides-section h2 {
  text-align: center;
  margin-bottom: 3rem;
}

.guides-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
}

.guide-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem;
  background: white;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
}

.guide-item:hover {
  border-color: var(--color-primary);
  background: var(--color-primary-light);
}

.guide-item-number {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  background: var(--color-bg-gray);
  color: var(--color-text-light);
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 0.875rem;
  flex-shrink: 0;
}

.guide-item:hover .guide-item-number {
  background: var(--color-primary);
  color: white;
}

.guide-item-title {
  font-weight: 600;
  color: var(--color-text);
  font-size: 0.9375rem;
}

/* ========================================
   About Takko Mini Section
   ======================================== */
.about-mini {
  background: var(--color-bg-gray);
  padding: var(--section-spacing) 0;
}

.about-mini-inner {
  max-width: 700px;
  margin: 0 auto;
  text-align: center;
}

.about-mini h2 {
  font-size: 1.75rem;
  margin-bottom: 1rem;
}

.about-mini p {
  color: var(--color-text-light);
  margin-bottom: 1.5rem;
}

/* ========================================
   Hero Concept Section (Top Page)
   ======================================== */
.hero-concept {
  background: linear-gradient(
    135deg,
    var(--color-primary-light) 0%,
    var(--color-secondary) 100%
  );
  padding: 4rem 0;
  text-align: center;
}

.hero-concept-inner {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 var(--container-padding);
}

.hero-concept-title {
  font-size: 2rem;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 1rem;
  letter-spacing: -0.01em;
}

.hero-concept-subtitle {
  font-size: 1.0625rem;
  color: var(--color-text-light);
  margin-bottom: 2rem;
  line-height: 1.7;
}

.hero-concept-categories {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  background: var(--color-bg);
  color: var(--color-text);
  padding: 0.5rem 1rem;
  border-radius: var(--radius-pill);
  font-size: 0.875rem;
  font-weight: 500;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}

.hero-tag:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  color: var(--color-primary-dark);
}

.hero-tag-icon {
  font-size: 1rem;
}

/* Section Title */
.section-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 0;
  padding-top: 2rem;
}

@media (max-width: 768px) {
  .hero-concept {
    padding: 3rem 0;
  }

  .hero-concept-title {
    font-size: 1.5rem;
  }

  .hero-concept-subtitle {
    font-size: 0.9375rem;
  }

  .hero-tag {
    font-size: 0.8125rem;
    padding: 0.375rem 0.875rem;
  }
}

/* ========================================
   Posts Grid (Archive/Category)
   ======================================== */
.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 2rem;
}

.post-card {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all 0.2s ease;
}

.post-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.post-card-thumbnail {
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--color-bg-gray);
}

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

.post-card-content {
  padding: 1.5rem;
}

.post-card-category {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-primary);
  background: var(--color-primary-light);
  padding: 0.25rem 0.625rem;
  border-radius: var(--radius-sm);
  margin-bottom: 0.75rem;
}

.post-card-title {
  font-size: 1.125rem;
  margin-bottom: 0.75rem;
  line-height: 1.4;
}

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

.post-card-title a:hover {
  color: var(--color-primary);
}

.post-card-excerpt {
  font-size: 0.9375rem;
  color: var(--color-text-light);
  margin-bottom: 1rem;
  line-height: 1.6;
}

.post-card-meta {
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* ========================================
   Single Post
   ======================================== */
.single-post-header {
  padding: 4rem 0 3rem;
  background: var(--color-bg-gray);
}

.single-post-header-inner {
  max-width: 800px;
  margin: 0 auto;
  text-align: center;
}

.single-post-category {
  display: inline-block;
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-primary);
  background: var(--color-primary-light);
  padding: 0.375rem 0.875rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1.25rem;
}

.single-post-title {
  font-size: 2.5rem;
  max-width: 700px;
  margin: 0 auto 1.25rem;
  letter-spacing: -0.02em;
}

.single-post-meta {
  color: var(--color-text-light);
  font-size: 0.9375rem;
}

.single-post-thumbnail {
  max-width: 900px;
  margin: -2rem auto 3rem;
  padding: 0 var(--container-padding);
}

.single-post-thumbnail img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
}

.single-post-content {
  max-width: var(--container-narrow);
  margin: 0 auto;
  padding: 0 0 4rem;
}

.single-post-content h2 {
  margin-top: 3rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--color-primary);
}

.single-post-content h3 {
  margin-top: 2.5rem;
}

.single-post-content ul,
.single-post-content ol {
  padding-left: 1.5rem;
  margin-bottom: 1.5rem;
}

.single-post-content li {
  margin-bottom: 0.5rem;
}

.single-post-content blockquote {
  border-left: 4px solid var(--color-primary);
  margin: 2rem 0;
  padding: 1.25rem 1.5rem;
  background: var(--color-bg-gray);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  font-style: italic;
}

.single-post-content blockquote p:last-child {
  margin-bottom: 0;
}

.single-post-content pre {
  background: #1e293b;
  color: #e2e8f0;
  padding: 1.5rem;
  border-radius: var(--radius-md);
  overflow-x: auto;
  margin: 2rem 0;
}

.single-post-content code {
  font-family: "JetBrains Mono", "Fira Code", monospace;
  font-size: 0.875rem;
}

.single-post-content p > code {
  background: var(--color-bg-dark);
  padding: 0.125rem 0.5rem;
  border-radius: var(--radius-sm);
  color: var(--color-secondary);
}

/* ========================================
   Table of Contents (TOC) - Sticky Sidebar
   ======================================== */

/* Post body layout with TOC sidebar */
.single-post-body {
  max-width: var(--container-narrow);
  margin: 0 auto;
  padding: 0 var(--container-padding);
  position: relative;
}

.single-post-body.has-toc {
  max-width: 1100px;
}

/* Move content to the right on large screens */
@media (min-width: 1200px) {
  .single-post-body.has-toc {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 3rem;
    align-items: start;
  }

  .single-post-body.has-toc .single-post-content {
    max-width: var(--container-narrow);
    padding: 0;
  }

  /* Ensure proper grid placement */
  .single-post-body.has-toc .single-post-toc-sidebar {
    grid-column: 1;
    grid-row: 1;
  }

  .single-post-body.has-toc .single-post-content {
    grid-column: 2;
    grid-row: 1;
  }

  /* Hide mobile-only elements on PC */
  .single-post-body.has-toc .toc-floating-btn,
  .single-post-body.has-toc .toc-drawer,
  .single-post-body.has-toc .toc-drawer-overlay {
    display: none !important;
  }
}

/* Sticky TOC Sidebar (PC only) */
.single-post-toc-sidebar {
  display: none;
}

@media (min-width: 1200px) {
  .single-post-toc-sidebar {
    display: block;
    position: sticky;
    top: 100px;
    max-height: calc(100vh - 140px);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--color-border) transparent;
  }

  .single-post-toc-sidebar::-webkit-scrollbar {
    width: 4px;
  }

  .single-post-toc-sidebar::-webkit-scrollbar-track {
    background: transparent;
  }

  .single-post-toc-sidebar::-webkit-scrollbar-thumb {
    background: var(--color-border);
    border-radius: 2px;
  }

  .single-post-toc-sidebar .toc {
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
  }

  .single-post-toc-sidebar .toc-header {
    display: none;
  }

  .single-post-toc-sidebar .toc-content {
    padding: 1rem;
    max-height: none;
  }

  .single-post-toc-sidebar .toc-link {
    font-size: 0.8125rem;
    padding: 0.375rem 0;
  }

  .single-post-toc-sidebar .toc-item-h3 > .toc-link {
    font-size: 0.75rem;
    padding: 0.25rem 0;
  }

  .single-post-toc-sidebar .toc-sublist {
    padding-left: 1rem;
  }
}

/* Floating TOC Button (SP only) */
.toc-floating-btn {
  display: none;
}

@media (max-width: 1199px) {
  .toc-floating-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    position: fixed;
    /* Account for iPhone safe area (home indicator / Safari bottom bar) */
    bottom: calc(24px + env(safe-area-inset-bottom, 0px));
    right: 20px;
    z-index: 90;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-pill);
    padding: 0.75rem 1rem;
    box-shadow: var(--shadow-lg);
    cursor: pointer;
    color: var(--color-text);
    font-size: 0.875rem;
    font-weight: 600;
    /* Use transform3d for hardware acceleration to prevent jank */
    transform: translate3d(0, 0, 0);
    /* Smoother transitions without affecting position during scroll */
    transition: opacity 0.2s ease, visibility 0.2s ease, box-shadow 0.2s ease,
      background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
    /* Prevent repaints during scroll */
    will-change: opacity, visibility;
    /* Prevent iOS tap highlight */
    -webkit-tap-highlight-color: transparent;
  }

  .toc-floating-btn:hover {
    background: var(--color-primary-light);
    border-color: var(--color-primary);
    color: var(--color-primary);
    box-shadow: var(--shadow-xl);
  }

  .toc-floating-btn:active {
    transform: translate3d(0, 2px, 0);
  }

  .toc-floating-btn svg {
    color: var(--color-primary);
  }

  .toc-floating-btn.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
  }
}

/* TOC Drawer (SP) */
.toc-drawer-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 998;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.toc-drawer-overlay.active {
  opacity: 1;
  visibility: visible;
}

.toc-drawer {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 999;
  background: var(--color-bg);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.15);
  max-height: 70vh;
  /* Account for iPhone safe area */
  padding-bottom: env(safe-area-inset-bottom, 0px);
  transform: translate3d(0, 100%, 0);
  transition: transform 0.3s ease;
  /* Hardware acceleration */
  will-change: transform;
  -webkit-overflow-scrolling: touch;
}

.toc-drawer.active {
  transform: translate3d(0, 0, 0);
}

.toc-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--color-border);
}

.toc-drawer-title {
  font-weight: 600;
  font-size: 1rem;
  color: var(--color-text);
}

.toc-drawer-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: var(--color-bg-gray);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  color: var(--color-text-light);
  transition: all 0.2s ease;
}

.toc-drawer-close:hover {
  background: var(--color-primary-light);
  color: var(--color-primary);
}

.toc-drawer-content {
  padding: 1rem 1.25rem 2rem;
  overflow-y: auto;
  max-height: calc(70vh - 60px);
}

.toc-drawer-content .toc {
  background: transparent;
  border: none;
  border-radius: 0;
}

.toc-drawer-content .toc-header {
  display: none;
}

.toc-drawer-content .toc-content {
  padding: 0;
  max-height: none;
}

@media (max-width: 1199px) {
  .toc-drawer-overlay,
  .toc-drawer {
    display: block;
  }

  /* Hide sidebar TOC on mobile */
  .single-post-toc-sidebar {
    display: none;
  }
}

/* Base TOC Styles */
.toc {
  background: var(--color-bg-gray);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.toc-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem 1.25rem;
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
  cursor: pointer;
  user-select: none;
}

.toc-icon {
  display: flex;
  align-items: center;
  color: var(--color-primary);
}

.toc-title {
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--color-text);
  flex: 1;
}

.toc-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: var(--color-bg-gray);
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--color-text-light);
  transition: all 0.2s ease;
}

.toc-toggle:hover {
  background: var(--color-primary-light);
  color: var(--color-primary);
}

.toc-toggle-icon {
  transition: transform 0.3s ease;
}

.toc-toggle[aria-expanded="false"] .toc-toggle-icon {
  transform: rotate(-90deg);
}

.toc-content {
  padding: 1rem 1.25rem 1.25rem;
  max-height: 500px;
  overflow-y: auto;
  transition: max-height 0.3s ease, padding 0.3s ease, opacity 0.3s ease;
}

.toc.collapsed .toc-content {
  max-height: 0;
  padding-top: 0;
  padding-bottom: 0;
  opacity: 0;
  overflow: hidden;
}

.toc-list {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: toc-counter;
}

.toc-item {
  position: relative;
}

.toc-item-h2 {
  counter-increment: toc-counter;
}

.toc-item-h2 > .toc-link::before {
  content: counter(toc-counter) ".";
  color: var(--color-primary);
  font-weight: 600;
  flex-shrink: 0;
  min-width: 1.5em;
  margin-right: 0.25em;
}

.toc-link {
  display: flex;
  align-items: flex-start;
  padding: 0.5rem 0;
  color: var(--color-text);
  font-size: 0.9375rem;
  line-height: 1.5;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: all 0.2s ease;
}

.toc-link:hover {
  color: var(--color-primary);
}

.toc-item-h2 > .toc-link {
  font-weight: 500;
}

.toc-sublist {
  list-style: none;
  margin: 0;
  padding: 0 0 0 1.25rem;
  counter-reset: toc-sub-counter;
}

.toc-item-h3 {
  counter-increment: toc-sub-counter;
}

.toc-item-h3 > .toc-link {
  font-size: 0.875rem;
  color: var(--color-text-light);
  padding: 0.375rem 0;
}

.toc-item-h3 > .toc-link::before {
  content: "・";
  color: var(--color-text-muted);
  flex-shrink: 0;
  margin-right: 0.125rem;
}

.toc-item-h3 > .toc-link:hover {
  color: var(--color-primary);
}

/* TOC Active State (for scroll spy) */
.toc-link.active {
  color: var(--color-primary);
  font-weight: 600;
}

.toc-item-h3 > .toc-link.active {
  color: var(--color-primary);
}

/* Smooth scroll offset for fixed header */
html {
  scroll-padding-top: 80px;
}

/* Callout Boxes */
.callout {
  padding: 1.25rem 1.5rem;
  border-radius: var(--radius-md);
  margin: 2rem 0;
}

.callout-tip {
  background: #ecfdf5;
  border-left: 4px solid var(--color-success);
}

.callout-warning {
  background: #fffbeb;
  border-left: 4px solid var(--color-warning);
}

.callout-info {
  background: var(--color-primary-light);
  border-left: 4px solid var(--color-primary);
}

/* ========================================
   About Page
   ======================================== */
.about-hero {
  padding: 5rem 0;
  background: var(--color-bg-gray);
  text-align: center;
}

.about-hero h1 {
  font-size: 2.75rem;
  margin-bottom: 1rem;
}

.about-hero .lead {
  max-width: 600px;
  margin: 0 auto;
}

.about-section {
  padding: 4rem 0;
}

.about-section h2 {
  font-size: 1.75rem;
  margin-bottom: 1.5rem;
}

.about-section p {
  color: var(--color-text-light);
  margin-bottom: 1.25rem;
}

.promise-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.promise-list li {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--color-border);
}

.promise-list li:last-child {
  border-bottom: none;
}

.promise-list .promise-icon {
  color: var(--color-success);
  font-size: 1.25rem;
  flex-shrink: 0;
}

.promise-list strong {
  color: var(--color-text);
}

/* ========================================
   Category Archive Header
   ======================================== */
.archive-header {
  padding: 4rem 0;
  background: var(--color-bg-gray);
  text-align: center;
}

.archive-header h1 {
  font-size: 2.25rem;
  margin-bottom: 1rem;
}

.archive-description {
  max-width: 600px;
  margin: 0 auto;
  color: var(--color-text-light);
}

/* ========================================
   Footer
   ======================================== */
.site-footer {
  background: var(--color-text);
  color: rgba(255, 255, 255, 0.7);
  padding: 4rem 0 2rem;
  margin-top: 5rem;
}

.footer-inner {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--container-padding);
}

.footer-top {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 3rem;
  padding-bottom: 3rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-brand h3 {
  color: white;
  font-size: 1.25rem;
  margin-bottom: 1rem;
}

.footer-brand h3 a {
  color: white;
  text-decoration: none;
}

.footer-brand h3 a:hover {
  opacity: 0.8;
}

.footer-logo {
  display: inline-block;
  margin-bottom: 1rem;
  transition: opacity 0.2s ease;
}

.footer-logo:hover {
  opacity: 0.8;
}

.footer-logo img {
  height: 40px;
  width: auto;
  max-width: 180px;
  object-fit: contain;
}

.footer-brand p {
  font-size: 0.9375rem;
  line-height: 1.6;
  margin: 0;
}

.footer-nav h4 {
  color: white;
  font-size: 0.9375rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.footer-nav ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-nav li {
  margin-bottom: 0.625rem;
}

.footer-nav a {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.875rem;
  transition: color 0.2s ease;
}

.footer-nav a:hover {
  color: white;
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 2rem;
  font-size: 0.875rem;
}

/* ========================================
   Pagination
   ======================================== */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  margin-top: 4rem;
}

.pagination a,
.pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.75rem;
  height: 2.75rem;
  padding: 0 0.875rem;
  border-radius: var(--radius-md);
  font-weight: 500;
  transition: all 0.2s ease;
}

.pagination a {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  color: var(--color-text);
}

.pagination a:hover {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: white;
}

.pagination .current {
  background: var(--color-primary);
  color: white;
  border: 1px solid var(--color-primary);
}

/* ========================================
   Responsive Design
   ======================================== */
@media (max-width: 1024px) {
  .footer-top {
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
  }
}

@media (max-width: 768px) {
  :root {
    --font-size-base: 16px;
    --section-spacing: 3.5rem;
    --container-padding: 1rem;
  }

  h1 {
    font-size: 2rem;
  }
  h2 {
    font-size: 1.5rem;
  }
  h3 {
    font-size: 1.25rem;
  }

  .hero h1 {
    font-size: 2.25rem;
  }

  .hero .lead {
    font-size: 1.125rem;
  }

  .header-inner {
    flex-wrap: wrap;
  }

  .site-branding {
    order: 1;
  }

  .main-navigation {
    display: none;
    width: 100%;
    order: 3;
    padding: 1rem 0 0.5rem;
    border-top: 1px solid var(--color-border);
    margin-top: 0.75rem;
  }

  .main-navigation.active {
    display: block !important;
  }

  .main-navigation ul {
    flex-direction: column;
    gap: 0;
  }

  .main-navigation li {
    border-bottom: 1px solid var(--color-border);
  }

  .main-navigation li:last-child {
    border-bottom: none;
  }

  .main-navigation a {
    display: block;
    padding: 0.875rem 0;
    font-size: 0.9375rem;
  }

  .main-navigation a:hover {
    background: transparent;
  }

  .header-actions {
    order: 2;
    gap: 0.25rem;
  }

  .menu-toggle {
    display: flex;
  }

  .language-switcher {
    margin-left: 0;
  }

  .language-switcher-toggle {
    padding: 0.25rem 0.5rem;
    font-size: 0.6875rem;
  }

  .language-dropdown {
    right: 0;
    min-width: 90px;
  }

  .category-cards {
    grid-template-columns: 1fr;
  }

  .single-post-title {
    font-size: 1.75rem;
  }

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

  .footer-top {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .footer-bottom {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }
}

/* ========================================
   Utility Classes
   ======================================== */
.text-center {
  text-align: center;
}
.text-left {
  text-align: left;
}
.text-right {
  text-align: right;
}

.mt-1 {
  margin-top: 0.5rem;
}
.mt-2 {
  margin-top: 1rem;
}
.mt-3 {
  margin-top: 1.5rem;
}
.mt-4 {
  margin-top: 2rem;
}
.mt-5 {
  margin-top: 3rem;
}

.mb-1 {
  margin-bottom: 0.5rem;
}
.mb-2 {
  margin-bottom: 1rem;
}
.mb-3 {
  margin-bottom: 1.5rem;
}
.mb-4 {
  margin-bottom: 2rem;
}
.mb-5 {
  margin-bottom: 3rem;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Screen reader only */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* ========================================
   Source Link Cards (引用元・参考リンク)
   ======================================== */
.source-cards {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1.5rem;
}

.source-card {
  display: flex;
  align-items: stretch;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  overflow: hidden;
  text-decoration: none;
  color: var(--color-text);
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.source-card:hover {
  border-color: var(--color-primary);
  box-shadow: 0 4px 12px rgba(255, 181, 197, 0.2);
  transform: translateY(-2px);
}

.source-card-image {
  flex-shrink: 0;
  width: 120px;
  min-height: 90px;
  background: var(--color-bg-gray);
  overflow: hidden;
}

.source-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.source-card-content {
  flex: 1;
  padding: 0.875rem 1rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}

.source-card-title {
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.4;
  margin: 0 0 0.375rem 0;
  color: var(--color-text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.source-card-description {
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--color-text-light);
  margin: 0 0 0.5rem 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.source-card-site {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.source-card-site::before {
  content: "";
  display: inline-block;
  width: 12px;
  height: 12px;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="%23999" stroke-width="2"><circle cx="12" cy="12" r="10"/><line x1="2" y1="12" x2="22" y2="12"/><path d="M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z"/></svg>')
    center/contain no-repeat;
}

/* Source card without image - placeholder icon */
.source-card-no-image {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(
    135deg,
    var(--color-bg-gray) 0%,
    var(--color-bg-dark) 100%
  );
}

.source-card-no-image svg {
  width: 32px;
  height: 32px;
  color: var(--color-text-muted);
  opacity: 0.6;
}

.source-card-fallback .source-card-content {
  padding: 1rem 1.25rem;
}

/* Hide unwanted elements inside source-cards (WordPress wpautop fix) */
.source-cards > p,
.source-cards > br,
.source-cards > hr {
  display: none;
}

/* Mobile responsive */
@media (max-width: 480px) {
  .source-card {
    flex-direction: column;
  }

  .source-card-image {
    width: 100%;
    height: 140px;
    min-height: auto;
  }

  .source-card-content {
    padding: 0.75rem 1rem;
  }

  .source-card-title {
    font-size: 0.875rem;
  }

  .source-card-description {
    font-size: 0.75rem;
    -webkit-line-clamp: 1;
  }
}
