/* ========================================
   宅食ナビ - Main Stylesheet
   ======================================== */

:root {
  --primary: #16a34a;
  --primary-dark: #15803d;
  --primary-light: #dcfce7;
  --accent: #ea580c;
  --accent-light: #fff7ed;
  --bg: #f9fafb;
  --surface: #ffffff;
  --text: #111827;
  --text-medium: #374151;
  --text-muted: #6b7280;
  --border: #e5e7eb;
  --border-light: #f3f4f6;
  --radius-sm: 4px;
  --radius: 8px;
  --radius-lg: 12px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1);
  --container: 1100px;
  --sidebar: 280px;
  --gap: 24px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Hiragino Kaku Gothic ProN', 'Hiragino Sans', Meiryo, sans-serif;
  font-size: 16px;
  line-height: 1.8;
  color: var(--text);
  background: var(--bg);
}

img { max-width: 100%; height: auto; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

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

.layout-with-sidebar {
  display: grid;
  grid-template-columns: 1fr var(--sidebar);
  gap: var(--gap);
  align-items: start;
}

/* ---- Header ---- */
.site-header {
  background: var(--surface);
  border-bottom: 3px solid var(--primary);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  gap: 16px;
}

.site-logo {
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--primary);
  text-decoration: none;
  white-space: nowrap;
  letter-spacing: -0.5px;
}

.site-logo span { color: var(--accent); }

.site-nav { display: flex; gap: 4px; }

.site-nav a {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-medium);
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  transition: background 0.2s, color 0.2s;
}

.site-nav a:hover {
  background: var(--primary-light);
  color: var(--primary);
  text-decoration: none;
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  color: var(--text);
  align-items: center;
}

.menu-toggle svg { width: 24px; height: 24px; }

/* ---- Hero ---- */
.hero {
  background: linear-gradient(135deg, #15803d 0%, #0d9488 100%);
  color: white;
  padding: 64px 0;
  text-align: center;
}

.hero-badge {
  display: inline-block;
  background: rgba(255,255,255,0.2);
  border: 1px solid rgba(255,255,255,0.4);
  color: white;
  padding: 4px 14px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 20px;
}

.hero h1 {
  font-size: clamp(1.5rem, 4vw, 2.5rem);
  font-weight: 800;
  line-height: 1.4;
  margin-bottom: 16px;
}

.hero p {
  font-size: 1rem;
  opacity: 0.9;
  max-width: 580px;
  margin: 0 auto 28px;
  line-height: 1.8;
}

/* ---- Section ---- */
.section { padding: 56px 0; }
.section-alt { background: var(--surface); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }

.section-title {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 28px;
  padding-left: 14px;
  border-left: 4px solid var(--primary);
}

/* ---- Cards ---- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--gap);
}

.card-grid-2 { grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); }

.card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.2s, box-shadow 0.2s;
  display: flex;
  flex-direction: column;
}

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

.card-thumb {
  aspect-ratio: 16/9;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 5rem;
}

.card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s;
}

.card:hover .card-thumb img { transform: scale(1.04); }

.article-hero-img {
  width: 100%;
  max-height: 380px;
  object-fit: cover;
  border-radius: var(--radius-lg);
  margin-bottom: 28px;
  display: block;
}

.article-body .inline-img {
  width: 100%;
  border-radius: var(--radius);
  margin: 24px 0;
  display: block;
  object-fit: cover;
  max-height: 320px;
}

.card-body { padding: 18px; flex: 1; display: flex; flex-direction: column; }

.card-tag {
  display: inline-block;
  background: var(--primary-light);
  color: var(--primary);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  margin-bottom: 10px;
}

.card-tag-orange { background: var(--accent-light); color: var(--accent); }

.card-title {
  font-size: 0.975rem;
  font-weight: 700;
  line-height: 1.55;
  margin-bottom: 10px;
  color: var(--text);
  flex: 1;
}

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

.card-excerpt {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 12px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-meta { font-size: 0.78rem; color: var(--text-muted); display: flex; gap: 12px; flex-wrap: wrap; }

/* ---- Comparison Table ---- */
.comparison-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

.comparison-table { width: 100%; border-collapse: collapse; background: var(--surface); font-size: 0.9rem; min-width: 640px; }

.comparison-table th {
  background: var(--primary);
  color: white;
  padding: 13px 16px;
  text-align: left;
  font-weight: 700;
  white-space: nowrap;
}

.comparison-table th:first-child { border-radius: 0; }

.comparison-table td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.comparison-table tr:last-child td { border-bottom: none; }
.comparison-table tr:nth-child(even) td { background: #fafafa; }
.comparison-table tr:hover td { background: var(--primary-light); }

.rank-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-weight: 800;
  font-size: 0.85rem;
}

.rank-1 { background: #fbbf24; color: #78350f; }
.rank-2 { background: #9ca3af; color: white; }
.rank-3 { background: #c97b3a; color: white; }
.rank-other { background: var(--border); color: var(--text-muted); }

/* Stars */
.stars { color: #fbbf24; font-size: 1rem; letter-spacing: 1px; }
.rating-text { font-size: 0.8rem; color: var(--text-muted); margin-left: 4px; }

/* ---- Buttons ---- */
.btn {
  display: inline-block;
  padding: 11px 22px;
  border-radius: var(--radius);
  font-weight: 700;
  font-size: 0.9rem;
  text-align: center;
  transition: all 0.2s;
  cursor: pointer;
  border: none;
  text-decoration: none;
  line-height: 1.4;
}

.btn-primary { background: var(--accent); color: white; }
.btn-primary:hover { background: #c2410c; text-decoration: none; color: white; }
.btn-outline { background: transparent; color: var(--primary); border: 2px solid var(--primary); }
.btn-outline:hover { background: var(--primary); color: white; text-decoration: none; }
.btn-sm { padding: 6px 14px; font-size: 0.8rem; }
.btn-lg { padding: 15px 40px; font-size: 1.05rem; }

/* ---- CTA Box ---- */
.cta-box {
  background: linear-gradient(135deg, #fff7ed, #fef3c7);
  border: 2px solid #fed7aa;
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  text-align: center;
  margin: 36px 0;
}

.cta-box-label {
  display: inline-block;
  background: var(--accent);
  color: white;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 4px;
  margin-bottom: 12px;
}

.cta-box-title { font-size: 1.1rem; font-weight: 800; margin-bottom: 8px; }
.cta-box-desc { font-size: 0.875rem; color: var(--text-medium); margin-bottom: 18px; }
.cta-note { font-size: 0.75rem; color: var(--text-muted); margin-top: 10px; }

/* ---- Article Page ---- */
.breadcrumb { font-size: 0.8rem; color: var(--text-muted); padding: 14px 0; }
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb span + span::before { content: ' › '; margin: 0 4px; }

.article-header { margin-bottom: 32px; }

.article-title {
  font-size: clamp(1.25rem, 3vw, 1.75rem);
  font-weight: 800;
  line-height: 1.45;
  margin: 14px 0;
  color: var(--text);
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  font-size: 0.8rem;
  color: var(--text-muted);
  align-items: center;
  padding: 12px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.article-body { font-size: 1rem; line-height: 1.9; color: var(--text-medium); }

.article-body h2 {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text);
  margin: 48px 0 18px;
  padding: 13px 18px;
  background: var(--primary-light);
  border-left: 5px solid var(--primary);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.article-body h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  margin: 32px 0 14px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--border);
}

.article-body p { margin-bottom: 18px; }

.article-body ul, .article-body ol { margin: 16px 0 18px 24px; }
.article-body li { margin-bottom: 8px; }

.article-body table { width: 100%; border-collapse: collapse; margin: 24px 0; font-size: 0.875rem; overflow-x: auto; display: block; }
.article-body th { background: var(--primary); color: white; padding: 10px 14px; text-align: left; white-space: nowrap; }
.article-body td { padding: 10px 14px; border-bottom: 1px solid var(--border); }
.article-body tr:nth-child(even) td { background: var(--border-light); }

/* Pros/Cons */
.pros-cons { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 24px 0; }

.pros { background: #f0fdf4; border: 1px solid #86efac; border-radius: var(--radius); padding: 18px; }
.cons { background: #fef2f2; border: 1px solid #fca5a5; border-radius: var(--radius); padding: 18px; }

.pros h4 { font-size: 0.95rem; font-weight: 700; margin-bottom: 12px; color: #15803d; }
.cons h4 { font-size: 0.95rem; font-weight: 700; margin-bottom: 12px; color: #dc2626; }

.pros ul, .cons ul { margin: 0; padding: 0; list-style: none; }
.pros li, .cons li { font-size: 0.875rem; margin-bottom: 8px; padding-left: 20px; position: relative; }
.pros li::before { content: '✓'; color: #16a34a; font-weight: 700; position: absolute; left: 0; }
.cons li::before { content: '✗'; color: #dc2626; font-weight: 700; position: absolute; left: 0; }

/* Rating Box */
.rating-box {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin: 28px 0;
  text-align: center;
  box-shadow: var(--shadow-sm);
}

.rating-box-title { font-size: 1rem; font-weight: 700; margin-bottom: 12px; color: var(--text); }
.rating-score { font-size: 3.5rem; font-weight: 900; color: var(--primary); line-height: 1; }
.rating-score span { font-size: 1.2rem; color: var(--text-muted); font-weight: 400; }
.rating-stars-lg { font-size: 1.6rem; color: #fbbf24; margin: 8px 0 4px; letter-spacing: 2px; }
.rating-label { font-size: 0.85rem; color: var(--text-muted); }

/* TOC */
.toc {
  background: var(--border-light);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin: 28px 0;
}

.toc-title { font-size: 0.95rem; font-weight: 700; margin-bottom: 12px; color: var(--text); }
.toc ol { margin: 0; padding-left: 20px; }
.toc li { font-size: 0.875rem; margin-bottom: 6px; }
.toc a { color: var(--text-medium); }
.toc a:hover { color: var(--primary); }

/* Info / Warning box */
.info-box { background: #eff6ff; border: 1px solid #bfdbfe; border-radius: var(--radius); padding: 16px 20px; margin: 20px 0; }
.info-box p { margin: 0; font-size: 0.9rem; color: #1e40af; }

.warning-box { background: #fffbeb; border: 1px solid #fde68a; border-radius: var(--radius); padding: 16px 20px; margin: 20px 0; }
.warning-box p { margin: 0; font-size: 0.9rem; color: #92400e; }

/* ---- Sidebar ---- */
.sidebar { display: flex; flex-direction: column; gap: 24px; }

.sidebar-widget {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow);
}

.sidebar-widget-title {
  font-size: 0.9rem;
  font-weight: 700;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--primary);
  color: var(--text);
}

.sidebar-list { list-style: none; padding: 0; margin: 0; }
.sidebar-list li { border-bottom: 1px solid var(--border); padding: 9px 0; }
.sidebar-list li:last-child { border-bottom: none; padding-bottom: 0; }
.sidebar-list a { font-size: 0.85rem; color: var(--text-medium); display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.sidebar-list a:hover { color: var(--primary); text-decoration: none; }

.sidebar-rank { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.sidebar-rank:last-child { border-bottom: none; padding-bottom: 0; }
.sidebar-rank-num { font-size: 0.8rem; font-weight: 800; color: var(--text-muted); min-width: 20px; }
.sidebar-rank-title { font-size: 0.82rem; color: var(--text-medium); line-height: 1.45; }
.sidebar-rank-title a { color: inherit; }
.sidebar-rank-title a:hover { color: var(--primary); }

/* ---- Pagination ---- */
.pagination { display: flex; justify-content: center; gap: 8px; margin-top: 40px; }

.pagination a, .pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
}

.pagination a { background: var(--surface); color: var(--text-medium); border: 1px solid var(--border); }
.pagination a:hover { background: var(--primary-light); color: var(--primary); }
.pagination span.current { background: var(--primary); color: white; }

/* ---- Footer ---- */
.site-footer {
  background: #111827;
  color: #9ca3af;
  padding: 56px 0 28px;
  margin-top: 80px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 48px;
  margin-bottom: 48px;
}

.footer-brand-name { font-size: 1.3rem; font-weight: 900; color: white; margin-bottom: 14px; letter-spacing: -0.5px; }
.footer-brand-name span { color: #fb923c; }
.footer-desc { font-size: 0.85rem; line-height: 1.8; }

.footer-heading { font-size: 0.875rem; font-weight: 700; color: white; margin-bottom: 16px; }

.footer-links { list-style: none; padding: 0; margin: 0; }
.footer-links li { margin-bottom: 10px; }
.footer-links a { font-size: 0.84rem; color: #9ca3af; transition: color 0.2s; }
.footer-links a:hover { color: white; text-decoration: none; }

.footer-bottom {
  border-top: 1px solid #1f2937;
  padding-top: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.footer-copyright { font-size: 0.8rem; }

.footer-legal { display: flex; gap: 20px; }
.footer-legal a { font-size: 0.8rem; color: #9ca3af; }
.footer-legal a:hover { color: white; text-decoration: none; }

/* ---- Back to Top ---- */
.back-to-top {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.3s, transform 0.3s;
  z-index: 50;
}

.back-to-top.visible { opacity: 1; transform: translateY(0); }
.back-to-top:hover { background: var(--primary-dark); }

/* Thumb color themes */
.thumb-green { background: linear-gradient(135deg, #15803d, #0d9488); }
.thumb-orange { background: linear-gradient(135deg, #ea580c, #dc2626); }
.thumb-blue { background: linear-gradient(135deg, #2563eb, #7c3aed); }
.thumb-teal { background: linear-gradient(135deg, #0d9488, #0891b2); }
.thumb-amber { background: linear-gradient(135deg, #d97706, #16a34a); }

/* ---- Service Media Block (image left + text right) ---- */
.service-media {
  display: flex;
  gap: 24px;
  align-items: flex-start;
  margin: 20px 0 28px;
}

.service-img {
  width: 200px;
  min-width: 200px;
  border-radius: var(--radius);
  object-fit: cover;
  box-shadow: var(--shadow);
  flex-shrink: 0;
}

.service-content { flex: 1; min-width: 0; }

.service-content table { margin-top: 0; }

/* Inline float image (image left, text wraps right) */
.float-img-left {
  float: left;
  width: 220px;
  margin: 4px 20px 16px 0;
  border-radius: var(--radius);
  object-fit: cover;
  box-shadow: var(--shadow);
}

.clearfix::after { content: ''; display: block; clear: both; }

@media (max-width: 640px) {
  .service-media { flex-direction: column; }
  .service-img { width: 100%; min-width: unset; max-height: 200px; }
  .float-img-left { float: none; width: 100%; margin: 0 0 16px 0; }
}

/* ---- SNS Share Buttons ---- */
.share-section {
  background: var(--border-light);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin: 40px 0;
  text-align: center;
  border: 1px solid var(--border);
}

.share-title {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--text);
}

.share-buttons {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 24px;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 700;
  text-decoration: none;
  transition: opacity 0.2s, transform 0.2s;
}

.share-btn:hover { opacity: 0.85; text-decoration: none; transform: translateY(-2px); }
.share-x { background: #000; color: white; }
.share-line { background: #06c755; color: white; }
.share-copy { background: var(--surface); color: var(--text); border: 2px solid var(--border); cursor: pointer; font-family: inherit; }
.share-copy:hover { border-color: var(--primary); color: var(--primary); }

/* ---- Author Box ---- */
.author-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  margin: 40px 0;
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.author-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), #0d9488);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}

.author-info { flex: 1; }
.author-name { font-size: 0.95rem; font-weight: 700; margin-bottom: 4px; }
.author-desc { font-size: 0.85rem; color: var(--text-medium); line-height: 1.7; margin: 0; }

/* ---- Policy Pages ---- */
.policy-content h2 { font-size: 1.1rem; font-weight: 700; margin: 32px 0 12px; border-bottom: 2px solid var(--border); padding-bottom: 8px; }
.policy-content p, .policy-content li { font-size: 0.9rem; line-height: 1.9; color: var(--text-medium); }
.policy-content ul { margin: 12px 0 12px 24px; }

/* ---- Responsive ---- */
@media (max-width: 768px) {
  .site-nav {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--surface);
    flex-direction: column;
    padding: 16px;
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-md);
    z-index: 99;
  }

  .site-nav.open { display: flex; }
  .menu-toggle { display: flex; }

  .layout-with-sidebar { grid-template-columns: 1fr; }
  .sidebar { order: -1; }

  .footer-grid { grid-template-columns: 1fr; gap: 28px; }
  .pros-cons { grid-template-columns: 1fr; }

  .hero { padding: 44px 0; }
  .section { padding: 36px 0; }

  .comparison-table th, .comparison-table td { padding: 10px 12px; font-size: 0.83rem; }
  .back-to-top { bottom: 16px; right: 16px; }
}

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