/*
Theme Name: KawariSoft Theme
Theme URI: https://kawari-soft.com/
Author: KawariSoft Team
Description: 有料ソフトの無料代替品が見つかる辞典サイト。比較表とソフトカードに特化した超軽量テーマ。
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: kawarisoft
*/

/* ==========================================================================
   0. CSS Custom Properties
   ========================================================================== */

:root {
  /* Colors */
  --c-primary: #2563eb;
  --c-primary-light: #3b82f6;
  --c-primary-dark: #1d4ed8;
  --c-primary-50: #eff6ff;
  --c-primary-100: #dbeafe;
  --c-primary-200: #bfdbfe;
  --c-accent: #f59e0b;
  --c-accent-light: #fbbf24;
  --c-success: #10b981;
  --c-success-light: #d1fae5;
  --c-error: #ef4444;
  --c-error-light: #fee2e2;
  --c-warning: #f59e0b;
  --c-text: #1e293b;
  --c-text-secondary: #64748b;
  --c-text-muted: #94a3b8;
  --c-bg: #ffffff;
  --c-bg-gray: #f8fafc;
  --c-bg-dark: #f1f5f9;
  --c-border: #e2e8f0;
  --c-border-light: #f1f5f9;

  /* Typography */
  --font-sans: 'Noto Sans JP', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --fs-xs: 0.75rem;
  --fs-sm: 0.875rem;
  --fs-base: 1rem;
  --fs-lg: 1.125rem;
  --fs-xl: 1.25rem;
  --fs-2xl: 1.5rem;
  --fs-3xl: 1.875rem;
  --fs-4xl: 2.25rem;
  --lh-body: 1.85;
  --lh-heading: 1.4;

  /* Spacing (4px scale) */
  --sp-1: 0.25rem;
  --sp-2: 0.5rem;
  --sp-3: 0.75rem;
  --sp-4: 1rem;
  --sp-5: 1.25rem;
  --sp-6: 1.5rem;
  --sp-8: 2rem;
  --sp-10: 2.5rem;
  --sp-12: 3rem;
  --sp-16: 4rem;

  /* Layout */
  --content-width: 780px;
  --site-width: 1100px;
  --sidebar-width: 300px;
  --radius: 8px;
  --radius-lg: 12px;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
}

/* ==========================================================================
   0. CSS Reset & Base
   ========================================================================== */

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  color: var(--c-text);
  background-color: var(--c-bg);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

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

a:hover {
  color: var(--c-primary-dark);
  text-decoration: underline;
}

ul,
ol {
  list-style: none;
}

/* ==========================================================================
   1. Skip Link (Accessibility)
   ========================================================================== */

.skip-link {
  position: absolute;
  top: -100%;
  left: 0;
  z-index: 10000;
  padding: var(--sp-2) var(--sp-4);
  background: var(--c-primary);
  color: #fff;
  font-size: var(--fs-sm);
  text-decoration: none;
}

.skip-link:focus {
  top: 0;
}

/* ==========================================================================
   2. Header
   ========================================================================== */

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

.header-inner {
  max-width: var(--site-width);
  margin: 0 auto;
  padding: 0 var(--sp-4);
  display: flex;
  align-items: center;
  height: 64px;
  gap: var(--sp-4);
}

/* Logo */
.header-logo {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  text-decoration: none;
  flex-shrink: 0;
}

.header-logo-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius);
  flex-shrink: 0;
  object-fit: contain;
}

.header-logo-text {
  font-size: var(--fs-xl);
  font-weight: 800;
  color: var(--c-text);
  line-height: 1;
}

.header-logo-text:hover {
  text-decoration: none;
}

.header-logo-catch {
  font-size: var(--fs-xs);
  color: var(--c-text-muted);
  display: block;
  line-height: 1.2;
}

/* Navigation */
.header-nav {
  display: flex;
  align-items: center;
  gap: var(--sp-1);
  margin-left: auto;
}

.header-nav a {
  padding: var(--sp-2) var(--sp-3);
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--c-text-secondary);
  border-radius: var(--radius);
  text-decoration: none;
  transition: background 0.2s, color 0.2s;
}

.header-nav a:hover {
  background: var(--c-bg-gray);
  color: var(--c-primary);
  text-decoration: none;
}

/* Search */
.header-search {
  display: flex;
  align-items: center;
  margin-left: var(--sp-4);
}

.header-search form {
  position: relative;
  display: flex;
  align-items: center;
}

.header-search-input {
  width: 220px;
  padding: 8px 40px 8px 14px;
  border: 1px solid var(--c-border);
  border-radius: 999px;
  font-size: var(--fs-sm);
  font-family: var(--font-sans);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s, width 0.3s;
  background: var(--c-bg-gray);
}

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

.header-search-input:focus {
  border-color: var(--c-primary);
  box-shadow: 0 0 0 3px var(--c-primary-100);
  background: var(--c-bg);
  width: 260px;
}

.header-search-btn {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  background: var(--c-primary);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s;
}

.header-search-btn:hover {
  background: var(--c-primary-dark);
}

/* Mobile menu button */
.header-menu-btn {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--sp-2);
  color: var(--c-text);
}

.header-menu-btn span {
  display: block;
  width: 22px;
  height: 2px;
  background: currentColor;
  margin: 5px 0;
  transition: transform 0.3s, opacity 0.3s;
}

/* ==========================================================================
   3. Breadcrumb
   ========================================================================== */

.breadcrumb {
  max-width: var(--site-width);
  margin: 0 auto;
  padding: var(--sp-3) var(--sp-4);
  font-size: var(--fs-xs);
  color: var(--c-text-muted);
}

.breadcrumb a {
  color: var(--c-primary);
  text-decoration: none;
}

.breadcrumb a:hover {
  text-decoration: underline;
}

.breadcrumb-sep {
  margin: 0 var(--sp-1);
  color: var(--c-text-muted);
}

.breadcrumb-sep::after {
  content: ">";
}

/* ==========================================================================
   4. Site Layout
   ========================================================================== */

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

.content-area {
  display: flex;
  gap: var(--sp-8);
  padding: var(--sp-8) 0;
}

.main-content {
  flex: 1;
  max-width: var(--content-width);
  min-width: 0;
}

.sidebar {
  width: var(--sidebar-width);
  flex-shrink: 0;
}

/* ==========================================================================
   5. Article Styles
   ========================================================================== */

/* Article Header */
.article-header {
  margin-bottom: var(--sp-8);
}

.article-category {
  display: inline-block;
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--c-primary);
  background: var(--c-primary-50);
  padding: var(--sp-1) var(--sp-3);
  border-radius: 999px;
  margin-bottom: var(--sp-3);
  text-decoration: none;
}

.article-category:hover {
  background: var(--c-primary-100);
  text-decoration: none;
}

.article-title {
  font-size: var(--fs-3xl);
  font-weight: 800;
  line-height: var(--lh-heading);
  margin-bottom: var(--sp-3);
  color: var(--c-text);
}

.article-meta {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  font-size: var(--fs-xs);
  color: var(--c-text-muted);
  margin-bottom: var(--sp-3);
}

.article-meta time {
  display: flex;
  align-items: center;
  gap: var(--sp-1);
}

/* Article Thumbnail */
.article-thumbnail {
  margin-bottom: var(--sp-8);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

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

/* Article Body */
.article-body {
  font-size: var(--fs-base);
  line-height: var(--lh-body);
}

.article-body p {
  margin-bottom: var(--sp-6);
}

.article-body h2 {
  font-size: var(--fs-2xl);
  font-weight: 700;
  line-height: var(--lh-heading);
  margin-top: var(--sp-12);
  margin-bottom: var(--sp-6);
  padding: var(--sp-4) var(--sp-5);
  border-left: 4px solid var(--c-primary);
  background: var(--c-primary-50);
  border-radius: 0 var(--radius) var(--radius) 0;
}

.article-body h3 {
  font-size: var(--fs-xl);
  font-weight: 700;
  line-height: var(--lh-heading);
  margin-top: var(--sp-10);
  margin-bottom: var(--sp-4);
  padding-bottom: var(--sp-2);
  border-bottom: 2px solid var(--c-border);
}

.article-body h4 {
  font-size: var(--fs-lg);
  font-weight: 600;
  line-height: var(--lh-heading);
  margin-top: var(--sp-8);
  margin-bottom: var(--sp-3);
}

.article-body ul,
.article-body ol {
  margin-bottom: var(--sp-6);
  padding-left: var(--sp-6);
}

.article-body ul {
  list-style: disc;
}

.article-body ol {
  list-style: decimal;
}

.article-body li {
  margin-bottom: var(--sp-2);
}

.article-body blockquote {
  border-left: 4px solid var(--c-border);
  padding: var(--sp-4) var(--sp-5);
  margin-bottom: var(--sp-6);
  background: var(--c-bg-gray);
  border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--c-text-secondary);
}

.article-body table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: var(--sp-6);
}

.article-body table th,
.article-body table td {
  padding: var(--sp-3) var(--sp-4);
  border: 1px solid var(--c-border);
  text-align: left;
}

.article-body table th {
  background: var(--c-bg-gray);
  font-weight: 600;
}

.article-body img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius);
  margin-bottom: var(--sp-6);
}

.article-body a {
  color: var(--c-primary);
  text-decoration: none;
}

.article-body a:hover {
  text-decoration: underline;
}

/* ==========================================================================
   6. Compare Table (Most Important!)
   ========================================================================== */

.compare-table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--c-border);
  margin-bottom: var(--sp-8);
  position: relative;
  -webkit-overflow-scrolling: touch;
}

.compare-table {
  width: 100%;
  border-collapse: collapse;
}

.compare-table thead {
  background: var(--c-primary-50);
}

.compare-table thead th {
  position: sticky;
  top: 0;
  background: var(--c-primary-50);
  z-index: 1;
}

.compare-table th,
.compare-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--c-border);
  text-align: center;
  font-size: var(--fs-sm);
  white-space: nowrap;
}

.compare-table th {
  font-weight: 600;
  color: var(--c-text);
}

.compare-table tbody tr {
  transition: background 0.15s;
}

.compare-table tbody tr:hover {
  background: var(--c-bg-gray);
}

.compare-table tbody tr:last-child td {
  border-bottom: none;
}

/* Recommend column highlight */
.compare-recommend {
  background: #fffbeb;
  border-left: 3px solid var(--c-accent);
}

/* Yes / No / Partial marks */
.compare-yes {
  color: var(--c-success);
  font-weight: 700;
}

.compare-no {
  color: var(--c-error);
}

.compare-partial {
  color: var(--c-warning);
}

/* Scroll hint for mobile */
.compare-table-wrap::after {
  content: "\2190 \30B9\30AF\30ED\30FC\30EB \2192";
  display: none;
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  font-size: var(--fs-xs);
  color: var(--c-text-muted);
  background: rgba(255, 255, 255, 0.9);
  padding: var(--sp-1) var(--sp-3);
  border-radius: 999px;
  box-shadow: var(--shadow-sm);
  pointer-events: none;
}

@media (max-width: 768px) {
  .compare-table {
    min-width: 600px;
  }

  .compare-table-wrap::after {
    display: block;
  }
}

/* ==========================================================================
   7. Software Card
   ========================================================================== */

.software-card {
  border: 1px solid var(--c-border);
  border-radius: var(--radius-lg);
  padding: var(--sp-6);
  background: var(--c-bg);
  margin-bottom: var(--sp-6);
  transition: box-shadow 0.2s, transform 0.2s;
}

.software-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.software-card-header {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  margin-bottom: var(--sp-4);
}

.software-card-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius);
  flex-shrink: 0;
  object-fit: cover;
}

.software-card-name {
  font-size: var(--fs-xl);
  font-weight: 700;
  color: var(--c-text);
  flex: 1;
}

.software-card-badge {
  display: inline-block;
  font-size: var(--fs-xs);
  font-weight: 600;
  padding: var(--sp-1) var(--sp-3);
  border-radius: 999px;
  white-space: nowrap;
}

.software-card-badge--free {
  background: var(--c-success-light);
  color: #059669;
}

.software-card-badge--freemium {
  background: var(--c-primary-100);
  color: var(--c-primary-dark);
}

.software-card-badge--paid {
  background: var(--c-bg-dark);
  color: var(--c-text-secondary);
}

.software-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
  margin-bottom: var(--sp-4);
}

.software-card-meta-tag {
  font-size: var(--fs-xs);
  color: var(--c-text-secondary);
  background: var(--c-bg-gray);
  padding: var(--sp-1) var(--sp-2);
  border-radius: var(--radius);
}

.software-card-rating {
  color: var(--c-accent);
  margin-bottom: var(--sp-3);
  font-size: var(--fs-sm);
}

.software-card-body {
  margin-bottom: var(--sp-4);
  color: var(--c-text-secondary);
  font-size: var(--fs-sm);
  line-height: var(--lh-body);
}

.software-card-footer {
  text-align: right;
}

.software-card-link {
  display: inline-block;
  padding: var(--sp-2) var(--sp-4);
  background: var(--c-primary);
  color: #fff;
  border-radius: var(--radius);
  font-size: var(--fs-sm);
  font-weight: 600;
  text-decoration: none;
  transition: background 0.2s;
}

.software-card-link:hover {
  background: var(--c-primary-dark);
  color: #fff;
  text-decoration: none;
}

/* ==========================================================================
   8. CTA Button (Affiliate)
   ========================================================================== */

.cta-box {
  text-align: center;
  margin: var(--sp-8) 0;
}

.cta-button {
  display: inline-block;
  padding: 14px 32px;
  background: var(--c-primary);
  color: #fff;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: var(--fs-base);
  text-decoration: none;
  transition: background 0.2s, transform 0.2s, box-shadow 0.2s;
  border: none;
  cursor: pointer;
}

.cta-button:hover {
  background: var(--c-primary-dark);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
  color: #fff;
  text-decoration: none;
}

.cta-button--orange {
  background: #ea580c;
}

.cta-button--orange:hover {
  background: #c2410c;
}

.cta-subtext {
  font-size: var(--fs-xs);
  color: var(--c-text-muted);
  margin-top: var(--sp-2);
}

/* ==========================================================================
   9. Table of Contents
   ========================================================================== */

.toc-box {
  border: 1px solid var(--c-border);
  border-radius: var(--radius-lg);
  padding: var(--sp-6);
  background: var(--c-bg-gray);
  margin-bottom: var(--sp-8);
}

.toc-title {
  font-weight: 700;
  font-size: var(--fs-lg);
  margin-bottom: var(--sp-3);
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

.toc-title::before {
  content: "\2261";
  font-size: var(--fs-xl);
  color: var(--c-primary);
  font-weight: 700;
}

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

.toc-list li {
  counter-increment: toc-counter;
  padding: 6px 0;
}

.toc-list li::before {
  content: counter(toc-counter) ".";
  color: var(--c-primary);
  font-weight: 600;
  margin-right: var(--sp-2);
}

.toc-list a {
  color: var(--c-text);
  text-decoration: none;
  font-size: var(--fs-sm);
  transition: color 0.2s;
}

.toc-list a:hover {
  color: var(--c-primary);
}

/* ==========================================================================
   10. FAQ Section
   ========================================================================== */

.faq-item {
  border-bottom: 1px solid var(--c-border);
  padding: var(--sp-4) 0;
}

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

.faq-question {
  font-weight: 600;
  font-size: var(--fs-lg);
  position: relative;
  padding-left: 32px;
  color: var(--c-text);
}

.faq-question::before {
  content: "Q";
  position: absolute;
  left: 0;
  top: 0;
  width: 24px;
  height: 24px;
  background: var(--c-primary-50);
  color: var(--c-primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--fs-sm);
  font-weight: 700;
}

.faq-answer {
  padding-left: 32px;
  margin-top: var(--sp-2);
  color: var(--c-text-secondary);
  position: relative;
  line-height: var(--lh-body);
}

.faq-answer::before {
  content: "A";
  position: absolute;
  left: 0;
  top: 0;
  width: 24px;
  height: 24px;
  background: var(--c-error-light);
  color: var(--c-error);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--fs-sm);
  font-weight: 700;
}

/* ==========================================================================
   11. Step (Migration Guide)
   ========================================================================== */

.step-item {
  display: flex;
  gap: var(--sp-4);
  padding: var(--sp-5) 0;
  border-bottom: 1px solid var(--c-border);
}

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

.step-number {
  width: 40px;
  height: 40px;
  background: var(--c-primary);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  flex-shrink: 0;
  font-size: var(--fs-base);
}

.step-body {
  flex: 1;
}

.step-title {
  font-weight: 600;
  font-size: var(--fs-lg);
  margin-bottom: var(--sp-1);
  color: var(--c-text);
}

.step-content {
  color: var(--c-text-secondary);
  line-height: var(--lh-body);
}

/* ==========================================================================
   12. Pros & Cons Box
   ========================================================================== */

.pros-box {
  border-left: 4px solid var(--c-success);
  background: var(--c-success-light);
  border-radius: var(--radius-lg);
  padding: var(--sp-5);
  margin: var(--sp-6) 0;
}

.pros-box-title {
  font-weight: 700;
  color: #059669;
  margin-bottom: var(--sp-3);
  font-size: var(--fs-base);
}

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

.pros-box li {
  padding: var(--sp-1) 0;
  padding-left: var(--sp-5);
  position: relative;
}

.pros-box li::before {
  content: "\2713";
  position: absolute;
  left: 0;
  color: var(--c-success);
  font-weight: 700;
}

.cons-box {
  border-left: 4px solid var(--c-error);
  background: var(--c-error-light);
  border-radius: var(--radius-lg);
  padding: var(--sp-5);
  margin: var(--sp-6) 0;
}

.cons-box-title {
  font-weight: 700;
  color: #dc2626;
  margin-bottom: var(--sp-3);
  font-size: var(--fs-base);
}

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

.cons-box li {
  padding: var(--sp-1) 0;
  padding-left: var(--sp-5);
  position: relative;
}

.cons-box li::before {
  content: "\2717";
  position: absolute;
  left: 0;
  color: var(--c-error);
  font-weight: 700;
}

/* ==========================================================================
   13. VS Compare Header
   ========================================================================== */

.vs-header {
  text-align: center;
  padding: var(--sp-8);
  background: var(--c-bg-gray);
  border-radius: var(--radius-lg);
  margin-bottom: var(--sp-8);
}

.vs-header-title {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-4);
  font-size: var(--fs-2xl);
  font-weight: 700;
}

.vs-header-title .vs-label {
  font-size: var(--fs-3xl);
  font-weight: 800;
  color: var(--c-primary);
}

.vs-verdict {
  margin-top: var(--sp-4);
  display: flex;
  gap: var(--sp-4);
  justify-content: center;
}

.vs-verdict-box {
  flex: 1;
  max-width: 280px;
  padding: var(--sp-4);
  background: var(--c-bg);
  border-radius: var(--radius);
  border: 1px solid var(--c-border);
}

.vs-verdict-box-title {
  font-weight: 600;
  font-size: var(--fs-sm);
  margin-bottom: var(--sp-2);
  color: var(--c-primary);
}

/* ==========================================================================
   14. Star Rating
   ========================================================================== */

.star-rating {
  color: var(--c-accent);
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
}

.star-score {
  color: var(--c-text-secondary);
  font-size: var(--fs-sm);
  margin-left: var(--sp-1);
}

/* ==========================================================================
   15. Balloon (Speech Bubble)
   ========================================================================== */

.balloon {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
  margin-bottom: var(--sp-6);
}

.balloon--right {
  flex-direction: row-reverse;
}

.balloon-icon {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  flex-shrink: 0;
  overflow: hidden;
}

.balloon-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.balloon-icon-name {
  text-align: center;
  font-size: var(--fs-xs);
  color: var(--c-text-muted);
  margin-top: var(--sp-1);
}

.balloon-text {
  position: relative;
  background: var(--c-bg-gray);
  border-radius: var(--radius-lg);
  padding: var(--sp-4);
  max-width: 80%;
  line-height: var(--lh-body);
  font-size: var(--fs-sm);
}

.balloon-text::before {
  content: "";
  position: absolute;
  top: 16px;
  left: -8px;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 6px 8px 6px 0;
  border-color: transparent var(--c-bg-gray) transparent transparent;
}

.balloon--right .balloon-text::before {
  left: auto;
  right: -8px;
  border-width: 6px 0 6px 8px;
  border-color: transparent transparent transparent var(--c-bg-gray);
}

/* ==========================================================================
   16. Share Buttons
   ========================================================================== */

.share-buttons {
  display: flex;
  gap: var(--sp-2);
  justify-content: center;
  margin: var(--sp-8) 0;
}

.share-btn {
  padding: var(--sp-2) var(--sp-4);
  border-radius: var(--radius);
  font-size: var(--fs-sm);
  font-weight: 500;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  transition: opacity 0.2s;
  border: none;
  cursor: pointer;
}

.share-btn:hover {
  opacity: 0.85;
  text-decoration: none;
}

.share-x {
  background: #0f1419;
  color: #fff;
}

.share-x:hover {
  color: #fff;
}

.share-line {
  background: #06c755;
  color: #fff;
}

.share-line:hover {
  color: #fff;
}

.share-copy {
  background: var(--c-bg-dark);
  color: var(--c-text);
}

/* ==========================================================================
   17. Author Box
   ========================================================================== */

.author-box {
  display: flex;
  gap: var(--sp-5);
  padding: var(--sp-6);
  background: var(--c-bg-gray);
  border-radius: var(--radius-lg);
  margin: var(--sp-8) 0;
}

.author-box-icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  flex-shrink: 0;
  overflow: hidden;
}

.author-box-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.author-box-info {
  flex: 1;
}

.author-box-name {
  font-weight: 700;
  font-size: var(--fs-lg);
  margin-bottom: var(--sp-1);
}

.author-box-title {
  font-size: var(--fs-xs);
  color: var(--c-text-muted);
  margin-bottom: var(--sp-2);
}

.author-box-desc {
  font-size: var(--fs-sm);
  color: var(--c-text-secondary);
  line-height: var(--lh-body);
}

/* ==========================================================================
   18. Related Section
   ========================================================================== */

.related-section {
  margin-top: var(--sp-12);
}

.related-section-title {
  font-size: var(--fs-xl);
  font-weight: 700;
  margin-bottom: var(--sp-4);
  padding-bottom: var(--sp-2);
  border-bottom: 2px solid var(--c-primary);
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--sp-4);
}

/* ==========================================================================
   19. Post Card
   ========================================================================== */

.post-card {
  display: flex;
  gap: var(--sp-4);
  border-bottom: 1px solid var(--c-border);
  padding: var(--sp-4) 0;
}

.post-card:last-child {
  border-bottom: none;
}

.post-card-thumbnail {
  width: 200px;
  flex-shrink: 0;
  border-radius: var(--radius);
  overflow: hidden;
}

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

.post-card-body {
  flex: 1;
}

.post-card-category {
  font-size: var(--fs-xs);
  color: var(--c-primary);
  font-weight: 500;
  margin-bottom: var(--sp-1);
}

.post-card-title {
  margin-bottom: var(--sp-2);
}

.post-card-title a {
  color: var(--c-text);
  text-decoration: none;
  font-weight: 600;
  font-size: var(--fs-base);
  line-height: var(--lh-heading);
  transition: color 0.2s;
}

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

.post-card-meta {
  font-size: var(--fs-xs);
  color: var(--c-text-muted);
}

/* ==========================================================================
   20. Pagination
   ========================================================================== */

.pagination {
  display: flex;
  justify-content: center;
  gap: 4px;
  margin: var(--sp-8) 0;
}

.pagination a,
.pagination span {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  font-size: var(--fs-sm);
  font-weight: 500;
  text-decoration: none;
  color: var(--c-text-secondary);
  transition: background 0.2s, color 0.2s;
}

.pagination a:hover {
  background: var(--c-bg-gray);
  color: var(--c-primary);
  text-decoration: none;
}

.pagination .current {
  background: var(--c-primary);
  color: #fff;
}

/* ==========================================================================
   21. Sidebar
   ========================================================================== */

.sidebar-widget {
  margin-bottom: var(--sp-8);
}

.sidebar-widget-title {
  font-weight: 700;
  font-size: var(--fs-lg);
  padding-bottom: var(--sp-2);
  border-bottom: 2px solid var(--c-primary);
  margin-bottom: var(--sp-4);
  color: var(--c-text);
}

/* ==========================================================================
   22. Front Page (Top Page)
   ========================================================================== */

.hero {
  padding: 4rem 0 3rem;
  text-align: center;
}

.hero-title {
  font-size: var(--fs-4xl);
  font-weight: 800;
  line-height: var(--lh-heading);
  color: var(--c-text);
}

.hero-subtitle {
  font-size: var(--fs-lg);
  color: var(--c-text-secondary);
  margin-top: var(--sp-2);
}

.hero-search {
  max-width: 540px;
  margin: var(--sp-8) auto 0;
  position: relative;
}

.hero-search form {
  position: relative;
}

.hero-search-input {
  width: 100%;
  padding: 16px 52px 16px 24px;
  border-radius: 999px;
  border: 2px solid var(--c-primary);
  font-size: var(--fs-lg);
  font-family: var(--font-sans);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.1);
}

.hero-search-btn {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: var(--c-primary);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s;
}

.hero-search-btn:hover {
  background: var(--c-primary-dark);
}

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

.hero-search-input:focus {
  border-color: var(--c-primary);
  box-shadow: 0 0 0 4px var(--c-primary-100);
}

/* Category Navigation */
.category-nav {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: var(--sp-4);
  margin: var(--sp-8) 0;
}

.category-nav-item {
  text-align: center;
  padding: var(--sp-5) var(--sp-3);
  border-radius: var(--radius-lg);
  border: 1px solid var(--c-border);
  background: var(--c-bg-gray);
  min-height: 120px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: var(--c-text);
  font-weight: 600;
  font-size: var(--fs-sm);
  transition: box-shadow 0.2s, border-color 0.2s;
}

.category-nav-item:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  border-color: var(--c-primary-200);
  color: var(--c-primary);
  text-decoration: none;
  transform: translateY(-3px);
}

.category-nav-icon {
  width: 48px;
  height: 48px;
  object-fit: contain;
  margin-bottom: var(--sp-3);
}
.category-nav-item-icon {
  font-size: var(--fs-2xl);
  display: block;
  margin-bottom: var(--sp-2);
}

/* Front Sections */
.front-section {
  margin-top: 3.5rem;
}

.front-section-title {
  font-size: var(--fs-xl);
  font-weight: 700;
  border-bottom: 2px solid var(--c-primary);
  padding-bottom: var(--sp-2);
  margin-bottom: var(--sp-4);
}

/* ==========================================================================
   23. 404 Page
   ========================================================================== */

.error-page {
  text-align: center;
  padding: var(--sp-16) 0;
}

.error-page-title {
  font-size: var(--fs-4xl);
  font-weight: 800;
  color: var(--c-text-muted);
  margin-bottom: var(--sp-4);
}

.error-page-text {
  font-size: var(--fs-lg);
  color: var(--c-text-secondary);
  margin-bottom: var(--sp-8);
}

/* ==========================================================================
   24. Search Results
   ========================================================================== */

.search-header {
  margin-bottom: var(--sp-8);
}

.search-header-title {
  font-size: var(--fs-2xl);
  font-weight: 700;
}

.search-header-count {
  font-size: var(--fs-sm);
  color: var(--c-text-muted);
  margin-top: var(--sp-1);
}

/* ==========================================================================
   25. PR Label
   ========================================================================== */

.pr-label {
  font-size: var(--fs-xs);
  color: var(--c-text-muted);
  background: var(--c-bg-gray);
  padding: 4px 12px;
  border-radius: var(--radius);
  display: inline-block;
}

/* ==========================================================================
   26. Footer
   ========================================================================== */

.site-footer {
  background: var(--c-bg-dark);
  padding: var(--sp-12) 0;
  margin-top: var(--sp-16);
}

.footer-inner {
  max-width: var(--site-width);
  margin: 0 auto;
  padding: 0 var(--sp-4);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-8);
}

.footer-heading {
  font-weight: 700;
  font-size: var(--fs-sm);
  margin-bottom: var(--sp-3);
  color: var(--c-text);
}

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

.footer-nav li {
  margin-bottom: var(--sp-2);
}

.footer-nav a {
  color: var(--c-text-secondary);
  font-size: var(--fs-sm);
  text-decoration: none;
  transition: color 0.2s;
}

.footer-nav a:hover {
  color: var(--c-primary);
}

.footer-bottom {
  max-width: var(--site-width);
  margin: 0 auto;
  padding: var(--sp-8) var(--sp-4) 0;
  text-align: center;
  border-top: 1px solid var(--c-border);
  font-size: var(--fs-xs);
  color: var(--c-text-muted);
}

/* ==========================================================================
   28. Mobile Menu (Drawer)
   ========================================================================== */

.mobile-menu-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 999;
  display: none;
}

.mobile-menu-overlay.is-open {
  display: block;
}

.mobile-menu {
  position: fixed;
  top: 0;
  right: 0;
  width: 280px;
  height: 100vh;
  background: var(--c-bg);
  transform: translateX(100%);
  transition: transform 0.3s ease;
  z-index: 1000;
  padding: var(--sp-5);
  overflow-y: auto;
}

.mobile-menu.is-open {
  transform: translateX(0);
}

.mobile-menu-close {
  display: flex;
  justify-content: flex-end;
  margin-bottom: var(--sp-4);
}

.mobile-menu-close button {
  background: none;
  border: none;
  font-size: var(--fs-xl);
  cursor: pointer;
  color: var(--c-text);
  padding: var(--sp-2);
}

.mobile-menu-nav {
  list-style: none;
  padding: 0;
}

.mobile-menu-nav li {
  border-bottom: 1px solid var(--c-border-light);
}

.mobile-menu-nav a {
  display: block;
  padding: var(--sp-3) 0;
  color: var(--c-text);
  font-weight: 500;
  text-decoration: none;
}

.mobile-menu-nav a:hover {
  color: var(--c-primary);
}

.mobile-menu-search {
  margin-top: var(--sp-4);
}

.mobile-menu-search input {
  width: 100%;
  padding: var(--sp-3);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  font-family: var(--font-sans);
  font-size: var(--fs-base);
}

/* ==========================================================================
   29-a. Scroll to Top
   ========================================================================== */

.scroll-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 44px;
  height: 44px;
  background: var(--c-primary);
  color: #fff;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
  z-index: 100;
  transition: opacity 0.3s, transform 0.3s;
}
.scroll-to-top.visible {
  display: flex;
}
.scroll-to-top:hover {
  background: var(--c-primary-dark);
  transform: translateY(-2px);
}

/* ==========================================================================
   29-b. Post Card Excerpt
   ========================================================================== */

.post-card-excerpt {
  font-size: var(--fs-sm);
  color: var(--c-text-secondary);
  margin-top: var(--sp-1);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ==========================================================================
   29-c. Category Header & Description
   ========================================================================== */

.category-header {
  margin-bottom: var(--sp-8);
}
.category-header h1 {
  font-size: var(--fs-3xl);
  font-weight: 700;
  line-height: var(--lh-heading);
}
.category-desc {
  color: var(--c-text-secondary);
  margin-top: var(--sp-2);
}

/* ==========================================================================
   29-d. Sort Buttons
   ========================================================================== */

.sort-buttons {
  display: flex;
  gap: var(--sp-2);
  margin-bottom: var(--sp-6);
}
.sort-btn {
  padding: var(--sp-2) var(--sp-4);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  background: var(--c-bg);
  color: var(--c-text-secondary);
  font-size: var(--fs-sm);
  text-decoration: none;
  transition: all 0.2s;
}
.sort-btn:hover {
  border-color: var(--c-primary);
  color: var(--c-primary);
}
.sort-btn--active {
  background: var(--c-primary);
  color: #fff;
  border-color: var(--c-primary);
}

/* ==========================================================================
   29-e. No Posts
   ========================================================================== */

.no-posts {
  text-align: center;
  padding: var(--sp-8) 0;
  color: var(--c-text-muted);
  font-size: var(--fs-sm);
}
.sidebar-no-posts {
  color: var(--c-text-muted);
  font-size: var(--fs-sm);
}

/* ==========================================================================
   29-f. Category Nav Name & Count
   ========================================================================== */

.category-nav-name {
  font-weight: 700;
  font-size: 0.8125rem;
  color: #1a1a1a;
  letter-spacing: 0.01em;
  line-height: 1.5;
}
.category-nav-count {
  font-size: var(--fs-xs);
  color: var(--c-text-muted);
  margin-top: var(--sp-1);
}

/* ==========================================================================
   29-g. Sidebar Inner & Related
   ========================================================================== */

.sidebar-inner {
  position: sticky;
  top: 80px;
}
/* Search Form (sidebar & everywhere) */
.search-form-inner {
  position: relative;
  display: flex;
  align-items: center;
}
.search-form-input {
  width: 100%;
  padding: 10px 44px 10px 14px;
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  font-size: var(--fs-sm);
  font-family: var(--font-sans);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  background: var(--c-bg);
}
.search-form-input::placeholder {
  color: var(--c-text-muted);
}
.search-form-input:focus {
  border-color: var(--c-primary);
  box-shadow: 0 0 0 3px var(--c-primary-100);
}
.search-form-btn {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  background: var(--c-primary);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s;
}
.search-form-btn:hover {
  background: var(--c-primary-dark);
}

.sidebar-category-list {
  list-style: none;
  padding: 0;
}
.sidebar-category-list li {
  padding: var(--sp-2) 0;
  border-bottom: 1px solid var(--c-border-light);
}
.sidebar-category-list a {
  color: var(--c-text);
  text-decoration: none;
  font-size: var(--fs-sm);
}
.sidebar-category-list a:hover {
  color: var(--c-primary);
}
.sidebar-post {
  margin-bottom: var(--sp-3);
}
.sidebar-post a {
  display: flex;
  gap: var(--sp-3);
  text-decoration: none;
  color: var(--c-text);
}
.sidebar-post a:hover .sidebar-post-title {
  color: var(--c-primary);
}
.sidebar-post-thumb {
  width: 80px;
  height: 54px;
  flex-shrink: 0;
  border-radius: var(--radius);
  overflow: hidden;
}
.sidebar-post-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.sidebar-post-title {
  font-size: var(--fs-sm);
  font-weight: 500;
  line-height: 1.5;
  transition: color 0.2s;
}

/* ==========================================================================
   29-h. Share Label & Icons
   ========================================================================== */

.share-label {
  font-size: var(--fs-sm);
  color: var(--c-text-muted);
  margin-right: var(--sp-3);
}
.share-icons {
  display: flex;
  gap: var(--sp-2);
  align-items: center;
}

/* ==========================================================================
   29-i. Article Footer & Tags
   ========================================================================== */

.article-footer {
  margin-top: var(--sp-8);
  padding: var(--sp-6);
  background: var(--c-bg-gray);
  border-radius: var(--radius-lg);
}
.article-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
}
.article-tag {
  display: inline-block;
  padding: 4px 12px;
  background: var(--c-bg-dark);
  border-radius: 4px;
  font-size: var(--fs-xs);
  color: var(--c-text-secondary);
  text-decoration: none;
}
.article-tag:hover {
  background: var(--c-primary-100);
  color: var(--c-primary);
}

/* ==========================================================================
   29-j. Footer Logo & Description
   ========================================================================== */

.footer-logo {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  text-decoration: none;
  color: var(--c-text);
  font-weight: 700;
  font-size: var(--fs-base);
  margin-bottom: var(--sp-3);
}
.footer-logo:hover {
  text-decoration: none;
  color: var(--c-primary);
}
.footer-logo-icon {
  width: 28px;
  height: 28px;
  background: var(--c-primary);
  color: #fff;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.875rem;
  flex-shrink: 0;
}
.footer-desc {
  font-size: var(--fs-sm);
  color: var(--c-text-secondary);
  line-height: var(--lh-body);
}

/* ==========================================================================
   29-k. Software Card Badge Default & Meta Label
   ========================================================================== */

.software-card-badge--default {
  background: var(--c-bg-dark);
  color: var(--c-text-secondary);
}
.software-card-meta-label {
  font-weight: 600;
  margin-right: var(--sp-1);
}

/* ==========================================================================
   29-l. VS Name & Verdict Text
   ========================================================================== */

.vs-name {
  font-weight: 700;
  color: var(--c-text);
}
.vs-verdict-text {
  font-size: var(--fs-sm);
  color: var(--c-text-secondary);
  line-height: var(--lh-body);
}

/* ==========================================================================
   29. Utility Classes
   ========================================================================== */

.mb-4 { margin-bottom: var(--sp-1); }
.mb-8 { margin-bottom: var(--sp-2); }
.mb-16 { margin-bottom: var(--sp-4); }
.mt-4 { margin-top: var(--sp-1); }
.mt-8 { margin-top: var(--sp-2); }
.mt-16 { margin-top: var(--sp-4); }
.text-center { text-align: center; }
.text-sm { font-size: var(--fs-sm); }
.text-muted { color: var(--c-text-muted); }

.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;
}

/* ==========================================================================
   27. Responsive
   ========================================================================== */

@media (max-width: 768px) {
  /* Layout */
  .content-area {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
  }

  /* Header */
  .header-nav {
    display: none;
  }

  .header-search {
    display: none;
  }

  .header-menu-btn {
    display: block;
    margin-left: auto;
  }

  .header-logo-catch {
    display: none;
  }

  /* Article */
  .article-title {
    font-size: var(--fs-2xl);
  }

  .article-body h2 {
    font-size: var(--fs-xl);
  }

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

  .post-card-thumbnail {
    width: 100%;
  }

  .post-card-thumbnail img {
    height: 180px;
  }

  /* Footer */
  .footer-inner {
    grid-template-columns: 1fr;
  }

  /* Hero */
  .hero {
    padding: var(--sp-8) 0;
  }

  .hero-title {
    font-size: 1.75rem;
  }

  /* Category Nav */
  .category-nav {
    grid-template-columns: repeat(3, 1fr);
  }

  /* Related */
  .related-grid {
    grid-template-columns: 1fr;
  }

  /* VS Header */
  .vs-header-title {
    font-size: var(--fs-xl);
    flex-wrap: wrap;
  }

  .vs-verdict {
    flex-direction: column;
    align-items: center;
  }

  .vs-verdict-box {
    max-width: 100%;
    width: 100%;
  }

  /* Balloon */
  .balloon-text {
    max-width: 70%;
  }

  /* Author Box */
  .author-box {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  /* Step */
  .step-item {
    gap: var(--sp-3);
  }

  .step-number {
    width: 32px;
    height: 32px;
    font-size: var(--fs-sm);
  }
}

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

  .share-buttons {
    flex-wrap: wrap;
  }

  .balloon-text {
    max-width: 65%;
  }

  .software-card-header {
    flex-wrap: wrap;
  }
}
