/**
 * Scan Manga Main Stylesheet
 * 
 * Theme: Scan Manga (ScanManga.net)
 * Author: Scan Manga Engineering Team
 * Specification: WCAG 2.2 AA compliant, Light theme only, zero external font calls.
 */

:root {
  --sm-bg: #f8fafc;
  --sm-surface: #ffffff;
  --sm-surface-subtle: #f1f5f9;
  --sm-surface-elevated: #ffffff;
  --sm-border: #e2e8f0;
  --sm-border-hover: #cbd5e1;
  --sm-border-focus: #4f46e5;
  --sm-text: #0f172a;
  --sm-text-secondary: #334155;
  --sm-text-muted: #64748b;
  --sm-text-subtle: #94a3b8;
  --sm-primary: #4f46e5;
  --sm-primary-hover: #4338ca;
  --sm-primary-light: #eef2ff;
  --sm-secondary: #0ea5e9;
  --sm-secondary-hover: #0284c7;
  --sm-secondary-light: #f0f9ff;
  --sm-success: #10b981;
  --sm-success-light: #ecfdf5;
  --sm-warning: #f59e0b;
  --sm-warning-light: #fffbeb;
  --sm-error: #ef4444;
  --sm-error-light: #fef2f2;
  --sm-radius-sm: 6px;
  --sm-radius-md: 10px;
  --sm-radius-lg: 16px;
  --sm-radius-xl: 20px;
  --sm-shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --sm-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --sm-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
  --sm-container: 1200px;
  --sm-container-narrow: 840px;
  --sm-font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --sm-font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  --sm-transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

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

html {
  font-family: var(--sm-font-sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--sm-text);
  background-color: var(--sm-bg);
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  background-color: var(--sm-bg);
  color: var(--sm-text);
}

img, svg, video, canvas {
  max-width: 100%;
  height: auto;
  vertical-align: middle;
}

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

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

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
}

/* Accessible focus styles */
:focus-visible {
  outline: 2px solid var(--sm-primary);
  outline-offset: 2px;
}

/* Skip link */
.sm-skip-link {
  position: absolute;
  top: -100px;
  left: 1rem;
  background: var(--sm-primary);
  color: #ffffff;
  padding: 0.75rem 1.25rem;
  border-radius: var(--sm-radius-sm);
  font-weight: 600;
  z-index: 99999;
  transition: top 0.2s ease;
  box-shadow: var(--sm-shadow-md);
}

.sm-skip-link:focus {
  top: 1rem;
  color: #ffffff;
  text-decoration: none;
}

/* Layout Containers */
.sm-container {
  width: 100%;
  max-width: var(--sm-container);
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.25rem;
  padding-right: 1.25rem;
}

.sm-container-narrow {
  width: 100%;
  max-width: var(--sm-container-narrow);
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.25rem;
  padding-right: 1.25rem;
}

.sm-site-main {
  flex: 1 0 auto;
}

/* Screen reader only helper */
.screen-reader-text,
.sm-sr-only {
  border: 0;
  clip: rect(1px, 1px, 1px, 1px);
  clip-path: inset(50%);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  width: 1px;
  word-wrap: normal !important;
}

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

h1 { font-size: clamp(2rem, 4vw, 2.75rem); letter-spacing: -0.025em; }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); letter-spacing: -0.02em; }
h3 { font-size: clamp(1.2rem, 2vw, 1.45rem); }
h4 { font-size: 1.15rem; }

p {
  margin-bottom: 1.25rem;
  color: var(--sm-text-secondary);
}

.sm-lead {
  font-size: 1.15rem;
  line-height: 1.6;
  color: var(--sm-text-secondary);
  margin-bottom: 1.5rem;
}

code, pre {
  font-family: var(--sm-font-mono);
  font-size: 0.9em;
}

code {
  background-color: var(--sm-surface-subtle);
  padding: 0.15rem 0.35rem;
  border-radius: 4px;
  border: 1px solid var(--sm-border);
}

pre {
  background-color: #1e293b;
  color: #f8fafc;
  padding: 1.25rem;
  border-radius: var(--sm-radius-md);
  overflow-x: auto;
  margin-bottom: 1.5rem;
}

pre code {
  background: none;
  border: none;
  padding: 0;
  color: inherit;
}

/* ==========================================================================
   Announcement Bar
   ========================================================================== */
.sm-announcement-bar {
  background-color: #0f172a;
  color: #f8fafc;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  text-align: center;
  position: relative;
  z-index: 50;
}

.sm-announcement-bar a {
  color: #60a5fa;
  text-decoration: underline;
  margin-left: 0.5rem;
  font-weight: 500;
}

.sm-announcement-bar a:hover {
  color: #93c5fd;
}

/* ==========================================================================
   Site Header & Navigation
   ========================================================================== */
.sm-header {
  background-color: var(--sm-surface);
  border-bottom: 1px solid var(--sm-border);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.03);
}

.sm-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
  gap: 1.5rem;
}

.sm-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--sm-text);
  letter-spacing: -0.02em;
  text-decoration: none;
}

.sm-brand:hover {
  text-decoration: none;
  color: var(--sm-primary);
}

.sm-brand-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--sm-primary) 0%, var(--sm-secondary) 100%);
  color: #ffffff;
  border-radius: var(--sm-radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.1rem;
  box-shadow: var(--sm-shadow-sm);
}

.sm-desktop-nav {
  display: flex;
  align-items: center;
  gap: 1.75rem;
}

.sm-nav-list {
  display: flex;
  list-style: none;
  align-items: center;
  gap: 1.5rem;
}

.sm-nav-link {
  color: var(--sm-text-secondary);
  font-weight: 500;
  font-size: 0.95rem;
  text-decoration: none;
  padding: 0.4rem 0.2rem;
  border-bottom: 2px solid transparent;
  transition: var(--sm-transition);
}

.sm-nav-link:hover,
.sm-nav-link.current-menu-item,
.sm-nav-link.current-page-ancestor {
  color: var(--sm-primary);
  border-bottom-color: var(--sm-primary);
  text-decoration: none;
}

.sm-header-actions {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.sm-search-trigger {
  background: var(--sm-surface-subtle);
  border: 1px solid var(--sm-border);
  color: var(--sm-text-muted);
  width: 40px;
  height: 40px;
  border-radius: var(--sm-radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--sm-transition);
}

.sm-search-trigger:hover {
  background: var(--sm-border);
  color: var(--sm-text);
}

.sm-hamburger {
  display: none;
  background: transparent;
  border: 1px solid var(--sm-border);
  width: 42px;
  height: 42px;
  border-radius: var(--sm-radius-sm);
  padding: 0;
  cursor: pointer;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
}

.sm-hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background-color: var(--sm-text);
  border-radius: 2px;
  transition: var(--sm-transition);
}

/* ==========================================================================
   Buttons & Badges
   ========================================================================== */
.sm-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.25rem;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: var(--sm-radius-sm);
  cursor: pointer;
  text-decoration: none;
  border: 1px solid transparent;
  transition: var(--sm-transition);
  white-space: nowrap;
}

.sm-btn-primary {
  background-color: var(--sm-primary);
  color: #ffffff;
  box-shadow: 0 1px 2px rgba(79, 70, 229, 0.2);
}

.sm-btn-primary:hover {
  background-color: var(--sm-primary-hover);
  color: #ffffff;
  text-decoration: none;
  transform: translateY(-1px);
}

.sm-btn-secondary {
  background-color: var(--sm-surface);
  color: var(--sm-text);
  border-color: var(--sm-border);
}

.sm-btn-secondary:hover {
  background-color: var(--sm-surface-subtle);
  border-color: var(--sm-border-hover);
  color: var(--sm-text);
  text-decoration: none;
}

.sm-btn-sm {
  padding: 0.4rem 0.75rem;
  font-size: 0.85rem;
}

.sm-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.65rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.sm-badge-primary { background: var(--sm-primary-light); color: var(--sm-primary); }
.sm-badge-secondary { background: var(--sm-secondary-light); color: var(--sm-secondary-hover); }
.sm-badge-success { background: var(--sm-success-light); color: #047857; }
.sm-badge-warning { background: var(--sm-warning-light); color: #b45309; }

/* ==========================================================================
   Hero Section
   ========================================================================== */
.sm-hero {
  padding: 4.5rem 0 3.5rem;
  background: linear-gradient(180deg, var(--sm-surface) 0%, var(--sm-bg) 100%);
  border-bottom: 1px solid var(--sm-border);
}

.sm-hero-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 3.5rem;
  align-items: center;
}

.sm-hero-content {
  max-width: 620px;
}

.sm-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 2rem;
}

.sm-hero-workflow-card {
  background: var(--sm-surface);
  border: 1px solid var(--sm-border);
  border-radius: var(--sm-radius-lg);
  padding: 1.75rem;
  box-shadow: var(--sm-shadow-md);
  position: relative;
}

.sm-workflow-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--sm-border);
}

.sm-workflow-steps {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.sm-workflow-step {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 0.85rem;
  border-radius: var(--sm-radius-md);
  background: var(--sm-surface-subtle);
  border: 1px solid var(--sm-border);
}

.sm-step-number {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--sm-primary);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 700;
  flex-shrink: 0;
}

.sm-step-text strong {
  display: block;
  font-size: 0.95rem;
  color: var(--sm-text);
  margin-bottom: 0.2rem;
}

.sm-step-text p {
  font-size: 0.85rem;
  color: var(--sm-text-muted);
  margin: 0;
}

/* ==========================================================================
   Section Layouts
   ========================================================================== */
.sm-section {
  padding: 4.5rem 0;
  border-bottom: 1px solid var(--sm-border);
}

.sm-section-header {
  text-align: center;
  max-width: 720px;
  margin: 0 auto 3rem;
}

.sm-section-header p {
  font-size: 1.1rem;
  color: var(--sm-text-muted);
  margin-bottom: 0;
}

/* ==========================================================================
   Tools Grid & Cards
   ========================================================================== */
.sm-tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1.75rem;
}

.sm-tool-card {
  background: var(--sm-surface);
  border: 1px solid var(--sm-border);
  border-radius: var(--sm-radius-md);
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: var(--sm-transition);
  box-shadow: var(--sm-shadow-sm);
  position: relative;
}

.sm-tool-card:hover {
  transform: translateY(-3px);
  border-color: var(--sm-border-hover);
  box-shadow: var(--sm-shadow-md);
}

.sm-tool-card-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--sm-radius-md);
  background: var(--sm-primary-light);
  color: var(--sm-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.25rem;
}

.sm-tool-card h3 {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
}

.sm-tool-card h3 a {
  color: var(--sm-text);
  text-decoration: none;
}

.sm-tool-card h3 a:hover {
  color: var(--sm-primary);
}

.sm-tool-card p {
  color: var(--sm-text-muted);
  font-size: 0.95rem;
  margin-bottom: 1.25rem;
  flex-grow: 1;
}

.sm-tool-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 1rem;
  border-top: 1px solid var(--sm-border);
}

/* ==========================================================================
   Interactive Calculator & Tool UI
   ========================================================================== */
.sm-tool-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
  margin: 2.5rem 0;
}

.sm-tool-calculator {
  background: var(--sm-surface);
  border: 1px solid var(--sm-border);
  border-radius: var(--sm-radius-lg);
  padding: 2.25rem;
  box-shadow: var(--sm-shadow-md);
}

.sm-tool-grid-inputs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
  margin-bottom: 1.75rem;
}

.sm-form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.sm-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--sm-text);
}

.sm-helper-text {
  font-size: 0.8rem;
  color: var(--sm-text-muted);
}

.sm-input,
.sm-select {
  width: 100%;
  padding: 0.65rem 0.9rem;
  border: 1px solid var(--sm-border);
  border-radius: var(--sm-radius-sm);
  background-color: var(--sm-surface);
  color: var(--sm-text);
  font-size: 0.95rem;
  transition: var(--sm-transition);
}

.sm-input:focus,
.sm-select:focus {
  border-color: var(--sm-primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
  outline: none;
}

.sm-radio-pills {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.sm-radio-pill {
  flex: 1 1 auto;
  text-align: center;
}

.sm-radio-pill input[type="radio"] {
  display: none;
}

.sm-radio-pill label {
  display: block;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--sm-border);
  border-radius: var(--sm-radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  background: var(--sm-surface-subtle);
  color: var(--sm-text-secondary);
  transition: var(--sm-transition);
}

.sm-radio-pill input[type="radio"]:checked + label {
  background: var(--sm-primary);
  color: #ffffff;
  border-color: var(--sm-primary);
}

.sm-tool-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--sm-border);
  margin-bottom: 2rem;
}

/* Tool Results Card */
.sm-results-panel {
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border: 2px solid #cbd5e1;
  border-radius: var(--sm-radius-md);
  padding: 1.75rem;
  position: relative;
}

.sm-results-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.sm-results-header h3 {
  margin: 0;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.sm-results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.25rem;
  margin-bottom: 1.25rem;
}

.sm-result-metric {
  background: var(--sm-surface);
  border: 1px solid var(--sm-border);
  border-radius: var(--sm-radius-sm);
  padding: 1rem;
}

.sm-metric-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--sm-text-muted);
  letter-spacing: 0.05em;
  margin-bottom: 0.35rem;
}

.sm-metric-value {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--sm-text);
  font-family: var(--sm-font-mono);
}

.sm-metric-subtext {
  font-size: 0.8rem;
  color: var(--sm-text-muted);
  margin-top: 0.25rem;
}

.sm-results-summary {
  font-size: 0.95rem;
  color: var(--sm-text-secondary);
  line-height: 1.5;
  background: var(--sm-surface);
  border: 1px solid var(--sm-border);
  border-radius: var(--sm-radius-sm);
  padding: 1rem;
}

/* Image Upload Dropzone (Client Side) */
.sm-dropzone {
  border: 2px dashed var(--sm-border-hover);
  border-radius: var(--sm-radius-md);
  padding: 2.5rem 1.5rem;
  text-align: center;
  background: var(--sm-surface-subtle);
  cursor: pointer;
  transition: var(--sm-transition);
}

.sm-dropzone:hover,
.sm-dropzone.dragover {
  border-color: var(--sm-primary);
  background: var(--sm-primary-light);
}

.sm-dropzone input[type="file"] {
  display: none;
}

.sm-dropzone-icon {
  width: 52px;
  height: 52px;
  margin: 0 auto 1rem;
  color: var(--sm-primary);
}

/* ==========================================================================
   Tool Content & Explanatory Blocks
   ========================================================================== */
.sm-tool-guide-content {
  margin-top: 3.5rem;
}

.sm-callout {
  border-left: 4px solid var(--sm-primary);
  background: var(--sm-primary-light);
  padding: 1.25rem 1.5rem;
  border-radius: 0 var(--sm-radius-sm) var(--sm-radius-sm) 0;
  margin: 1.75rem 0;
}

.sm-callout-warning {
  border-left-color: var(--sm-warning);
  background: var(--sm-warning-light);
}

.sm-callout-success {
  border-left-color: var(--sm-success);
  background: var(--sm-success-light);
}

.sm-callout h4 {
  margin-bottom: 0.35rem;
  color: var(--sm-text);
}

.sm-callout p:last-child {
  margin-bottom: 0;
}

/* Tables */
.sm-table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 1.5rem 0 2rem;
  border: 1px solid var(--sm-border);
  border-radius: var(--sm-radius-md);
  background: var(--sm-surface);
}

.sm-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.95rem;
}

.sm-table th,
.sm-table td {
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid var(--sm-border);
}

.sm-table th {
  background-color: var(--sm-surface-subtle);
  font-weight: 700;
  color: var(--sm-text);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

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

.sm-table tr:hover td {
  background-color: #f8fafc;
}

/* ==========================================================================
   Accordion / FAQ Component
   ========================================================================== */
.sm-faq-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin: 2rem 0;
}

.sm-faq-item {
  background: var(--sm-surface);
  border: 1px solid var(--sm-border);
  border-radius: var(--sm-radius-md);
  overflow: hidden;
}

.sm-faq-trigger {
  width: 100%;
  text-align: left;
  padding: 1.25rem 1.5rem;
  background: transparent;
  border: none;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--sm-text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.sm-faq-trigger:hover {
  background: var(--sm-surface-subtle);
}

.sm-faq-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  transition: transform 0.2s ease;
  color: var(--sm-text-muted);
}

.sm-faq-trigger[aria-expanded="true"] .sm-faq-icon {
  transform: rotate(180deg);
}

.sm-faq-content {
  padding: 0 1.5rem 1.25rem;
  color: var(--sm-text-secondary);
}

.sm-faq-content[hidden] {
  display: none;
}

/* ==========================================================================
   Breadcrumbs
   ========================================================================== */
.sm-breadcrumbs {
  font-size: 0.85rem;
  color: var(--sm-text-muted);
  margin-bottom: 1.5rem;
}

.sm-breadcrumbs ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  list-style: none;
  gap: 0.5rem;
}

.sm-breadcrumbs li {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.sm-breadcrumbs a {
  color: var(--sm-text-muted);
}

.sm-breadcrumbs a:hover {
  color: var(--sm-primary);
}

.sm-breadcrumbs-sep {
  color: var(--sm-text-subtle);
}

/* ==========================================================================
   Blog & Articles
   ========================================================================== */
.sm-posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 2rem;
}

.sm-post-card {
  background: var(--sm-surface);
  border: 1px solid var(--sm-border);
  border-radius: var(--sm-radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--sm-shadow-sm);
  transition: var(--sm-transition);
}

.sm-post-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--sm-shadow-md);
  border-color: var(--sm-border-hover);
}

.sm-post-thumbnail {
  aspect-ratio: 16 / 9;
  background-color: var(--sm-surface-subtle);
  overflow: hidden;
  position: relative;
}

.sm-post-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.sm-post-card:hover .sm-post-thumbnail img {
  transform: scale(1.03);
}

.sm-post-body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.sm-post-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.8rem;
  color: var(--sm-text-muted);
  margin-bottom: 0.75rem;
}

.sm-post-card h3 {
  font-size: 1.25rem;
  margin-bottom: 0.75rem;
}

.sm-post-card h3 a {
  color: var(--sm-text);
  text-decoration: none;
}

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

.sm-post-excerpt {
  color: var(--sm-text-muted);
  font-size: 0.95rem;
  line-height: 1.5;
  margin-bottom: 1.25rem;
  flex-grow: 1;
}

/* Single Post Specifics */
.sm-article-header {
  margin-bottom: 2.5rem;
  text-align: left;
}

.sm-article-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.25rem;
  font-size: 0.9rem;
  color: var(--sm-text-muted);
  margin-top: 1rem;
}

.sm-article-content {
  font-size: 1.1rem;
  line-height: 1.75;
}

.sm-article-content h2 { margin-top: 2.5rem; margin-bottom: 1rem; }
.sm-article-content h3 { margin-top: 2rem; margin-bottom: 0.85rem; }
.sm-article-content ul, 
.sm-article-content ol {
  margin: 1.25rem 0 1.75rem 1.75rem;
  color: var(--sm-text-secondary);
}
.sm-article-content li { margin-bottom: 0.5rem; }

/* Table of Contents */
.sm-toc {
  background: var(--sm-surface-subtle);
  border: 1px solid var(--sm-border);
  border-radius: var(--sm-radius-md);
  padding: 1.5rem;
  margin: 2rem 0;
}

.sm-toc-title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  color: var(--sm-text);
}

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

.sm-toc-list li {
  margin-bottom: 0.4rem;
  font-size: 0.95rem;
}

/* Author Box */
.sm-author-box {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  background: var(--sm-surface);
  border: 1px solid var(--sm-border);
  border-radius: var(--sm-radius-md);
  padding: 1.5rem;
  margin: 3rem 0;
}

.sm-author-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

/* Pagination */
.sm-pagination {
  margin: 3rem 0;
  display: flex;
  justify-content: center;
}

.sm-pagination .nav-links {
  display: flex;
  gap: 0.4rem;
  align-items: center;
}

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

.sm-pagination span.current {
  background: var(--sm-primary);
  color: #ffffff;
  border-color: var(--sm-primary);
}

.sm-pagination a:hover {
  background: var(--sm-surface-subtle);
  border-color: var(--sm-border-hover);
}

/* ==========================================================================
   Resources Directory
   ========================================================================== */
.sm-resources-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
}

.sm-resource-card {
  background: var(--sm-surface);
  border: 1px solid var(--sm-border);
  border-radius: var(--sm-radius-md);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--sm-shadow-sm);
}

.sm-resource-card:hover {
  border-color: var(--sm-border-hover);
  box-shadow: var(--sm-shadow-md);
}

/* ==========================================================================
   Contact & Static Pages
   ========================================================================== */
.sm-contact-form {
  background: var(--sm-surface);
  border: 1px solid var(--sm-border);
  border-radius: var(--sm-radius-md);
  padding: 2.25rem;
  box-shadow: var(--sm-shadow-sm);
}

.sm-alert {
  padding: 1rem 1.25rem;
  border-radius: var(--sm-radius-sm);
  margin-bottom: 1.5rem;
  font-size: 0.95rem;
}

.sm-alert-success { background: var(--sm-success-light); color: #065f46; border: 1px solid #a7f3d0; }
.sm-alert-error { background: var(--sm-error-light); color: #991b1b; border: 1px solid #fecaca; }

/* ==========================================================================
   Site Footer
   ========================================================================== */
.sm-footer {
  background-color: var(--sm-surface);
  border-top: 1px solid var(--sm-border);
  padding: 4.5rem 0 2rem;
  margin-top: auto;
}

.sm-footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 3rem;
  margin-bottom: 3.5rem;
}

.sm-footer-brand h4 {
  font-size: 1.25rem;
  margin-bottom: 0.75rem;
}

.sm-footer-brand p {
  color: var(--sm-text-muted);
  font-size: 0.9rem;
  line-height: 1.6;
}

.sm-footer-col h5 {
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--sm-text);
  margin-bottom: 1.25rem;
}

.sm-footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.sm-footer-links a {
  color: var(--sm-text-muted);
  font-size: 0.9rem;
  text-decoration: none;
  transition: color 0.15s ease;
}

.sm-footer-links a:hover {
  color: var(--sm-primary);
  text-decoration: underline;
}

.sm-footer-bottom {
  padding-top: 2rem;
  border-top: 1px solid var(--sm-border);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.85rem;
  color: var(--sm-text-muted);
}

.sm-footer-disclaimer {
  max-width: 600px;
  font-size: 0.8rem;
  color: var(--sm-text-subtle);
  line-height: 1.5;
  margin: 0;
}

/* ==========================================================================
   Search Modal / Overlay
   ========================================================================== */
.sm-search-modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  z-index: 9999;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 5rem 1.25rem 2rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.sm-search-modal.is-active {
  opacity: 1;
  pointer-events: auto;
}

.sm-search-box {
  background: var(--sm-surface);
  border-radius: var(--sm-radius-lg);
  width: 100%;
  max-width: 600px;
  padding: 1.5rem;
  box-shadow: var(--sm-shadow-lg);
  border: 1px solid var(--sm-border);
}

.sm-search-form {
  display: flex;
  gap: 0.75rem;
}

/* ==========================================================================
   Mobile Drawer Menu
   ========================================================================== */
.sm-mobile-drawer {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  justify-content: flex-end;
  pointer-events: none;
  visibility: hidden;
  transition: visibility 0.3s ease;
}

.sm-mobile-drawer.is-active {
  pointer-events: auto;
  visibility: visible;
}

.sm-drawer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.4);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.sm-mobile-drawer.is-active .sm-drawer-backdrop {
  opacity: 1;
}

.sm-drawer-panel {
  position: relative;
  width: 100%;
  max-width: 320px;
  height: 100%;
  background: var(--sm-surface);
  box-shadow: var(--sm-shadow-lg);
  display: flex;
  flex-direction: column;
  padding: 1.5rem;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  overflow-y: auto;
}

.sm-mobile-drawer.is-active .sm-drawer-panel {
  transform: translateX(0);
}

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

.sm-drawer-nav .sm-nav-list {
  flex-direction: column;
  align-items: flex-start;
  gap: 1rem;
}

.sm-drawer-nav .sm-nav-link {
  font-size: 1.1rem;
  width: 100%;
  padding: 0.5rem 0;
  border-bottom: none;
}

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

@media (max-width: 860px) {
  .sm-desktop-nav,
  .sm-header-cta {
    display: none;
  }

  .sm-hamburger {
    display: flex;
  }

  .sm-hero-grid {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }
}

@media (max-width: 640px) {
  .sm-hero {
    padding: 3rem 0 2.5rem;
  }

  .sm-footer-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .sm-tools-grid,
  .sm-posts-grid,
  .sm-resources-grid {
    grid-template-columns: 1fr;
  }

  .sm-tool-calculator {
    padding: 1.5rem;
  }
}

/* ==========================================================================
   Print Styles
   ========================================================================== */
@media print {
  .sm-header,
  .sm-footer,
  .sm-announcement-bar,
  .sm-search-modal,
  .sm-mobile-drawer,
  .sm-tool-actions,
  .sm-btn,
  .sm-pagination {
    display: none !important;
  }

  body {
    background: #ffffff !important;
    color: #000000 !important;
  }

  .sm-container {
    max-width: 100% !important;
    padding: 0 !important;
  }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
