/*
Theme Name: Susiperiod Theme
Description: Premium theme for susiperiod.rand3.com
Version: 1.0
*/

:root {
  --sp-navy: #1B2A4A;
  --sp-navy-light: #2A3D66;
  --sp-navy-dark: #111D35;
  --sp-orange: #F97316;
  --sp-orange-light: #FB923C;
  --sp-orange-hover: #EA580C;
  --sp-white: #FFFFFF;
  --sp-off-white: #F8FAFC;
  --sp-gray-50: #F9FAFB;
  --sp-gray-100: #F3F4F6;
  --sp-gray-200: #E5E7EB;
  --sp-gray-300: #D1D5DB;
  --sp-gray-400: #9CA3AF;
  --sp-gray-500: #6B7280;
  --sp-gray-600: #4B5563;
  --sp-gray-700: #374151;
  --sp-gray-800: #1F2937;
  --sp-radius-sm: 6px;
  --sp-radius-md: 12px;
  --sp-radius-lg: 16px;
  --sp-radius-xl: 24px;
  --sp-shadow-sm: 0 1px 3px rgba(27,42,74,0.08);
  --sp-shadow-md: 0 4px 16px rgba(27,42,74,0.10);
  --sp-shadow-lg: 0 8px 32px rgba(27,42,74,0.12);
  --sp-shadow-xl: 0 16px 48px rgba(27,42,74,0.15);
  --sp-transition: 200ms cubic-bezier(0.4,0,0.2,1);
  --sp-font-heading: "Pretendard", -apple-system, BlinkMacSystemFont, sans-serif;
  --sp-font-body: "Pretendard", -apple-system, BlinkMacSystemFont, sans-serif;
  --sp-content-width: 780px;
  --sp-wide-width: 1200px;
}

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

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

body {
  font-family: var(--sp-font-body);
  font-size: 17px;
  line-height: 1.75;
  color: var(--sp-gray-800);
  background: var(--sp-white);
  -webkit-font-smoothing: antialiased;
}

/* Header */
.sp-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--sp-gray-200);
  padding: 0 24px;
}
.sp-header-inner {
  max-width: var(--sp-wide-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}
.sp-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--sp-navy);
}
.sp-logo img {
  width: 40px;
  height: 40px;
  border-radius: var(--sp-radius-sm);
}
.sp-logo-text {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.sp-nav { display: flex; gap: 8px; align-items: center; }
.sp-nav a {
  color: var(--sp-gray-600);
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
  padding: 8px 16px;
  border-radius: var(--sp-radius-sm);
  transition: all var(--sp-transition);
}
.sp-nav a:hover {
  color: var(--sp-navy);
  background: var(--sp-gray-100);
}
.sp-mobile-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}
.sp-mobile-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--sp-navy);
  margin: 5px 0;
  transition: var(--sp-transition);
}

/* Single Post Styles */
.sp-single-hero {
  background: linear-gradient(135deg, var(--sp-navy) 0%, var(--sp-navy-light) 100%);
  padding: 80px 24px 60px;
  text-align: center;
}
.sp-single-hero h1 {
  font-family: var(--sp-font-heading);
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 800;
  color: var(--sp-white);
  line-height: 1.3;
  letter-spacing: -0.03em;
  max-width: var(--sp-content-width);
  margin: 0 auto 16px;
}
.sp-single-meta {
  color: rgba(255,255,255,0.7);
  font-size: 14px;
}
.sp-single-featured {
  max-width: var(--sp-content-width);
  margin: -40px auto 0;
  padding: 0 24px;
  position: relative;
  z-index: 2;
}
.sp-single-featured img {
  width: 100%;
  border-radius: var(--sp-radius-lg);
  box-shadow: var(--sp-shadow-xl);
  aspect-ratio: 16/9;
  object-fit: cover;
}

/* Post Content */
.sp-content {
  max-width: var(--sp-content-width);
  margin: 0 auto;
  padding: 48px 24px 80px;
}
.sp-content h2 {
  font-family: var(--sp-font-heading);
  font-size: 26px;
  font-weight: 800;
  color: var(--sp-navy);
  margin: 56px 0 20px;
  padding-bottom: 12px;
  border-bottom: 3px solid var(--sp-orange);
  letter-spacing: -0.02em;
  line-height: 1.4;
}
.sp-content h3 {
  font-family: var(--sp-font-heading);
  font-size: 21px;
  font-weight: 700;
  color: var(--sp-navy-light);
  margin: 40px 0 16px;
  line-height: 1.4;
}
.sp-content p {
  margin-bottom: 20px;
  color: var(--sp-gray-700);
  line-height: 1.8;
}
.sp-content ul, .sp-content ol {
  margin: 16px 0 24px 24px;
  color: var(--sp-gray-700);
}
.sp-content li {
  margin-bottom: 8px;
  line-height: 1.7;
}
.sp-content blockquote {
  border-left: 4px solid var(--sp-orange);
  background: var(--sp-gray-50);
  padding: 24px 28px;
  margin: 28px 0;
  border-radius: 0 var(--sp-radius-md) var(--sp-radius-md) 0;
  font-size: 16px;
  color: var(--sp-gray-700);
}
.sp-content table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin: 28px 0;
  border-radius: var(--sp-radius-md);
  overflow: hidden;
  box-shadow: var(--sp-shadow-sm);
  font-size: 15px;
}
.sp-content table thead th {
  background: var(--sp-navy);
  color: var(--sp-white);
  padding: 14px 18px;
  font-weight: 600;
  text-align: left;
  font-size: 14px;
  letter-spacing: 0.02em;
}
.sp-content table tbody td {
  padding: 12px 18px;
  border-bottom: 1px solid var(--sp-gray-200);
  color: var(--sp-gray-700);
}
.sp-content table tbody tr:last-child td { border-bottom: none; }
.sp-content table tbody tr:nth-child(even) { background: var(--sp-gray-50); }
.sp-content table tbody tr:hover { background: rgba(249,115,22,0.04); }

/* Table responsive wrapper */
.sp-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 28px 0;
}

/* Callout Box */
.sp-callout {
  background: linear-gradient(135deg, rgba(249,115,22,0.06), rgba(249,115,22,0.02));
  border: 1px solid rgba(249,115,22,0.2);
  border-radius: var(--sp-radius-md);
  padding: 24px 28px;
  margin: 28px 0;
}
.sp-callout-title {
  font-weight: 700;
  color: var(--sp-orange);
  margin-bottom: 8px;
  font-size: 15px;
}

/* Inline Chart */
.sp-bar-chart { margin: 24px 0; }
.sp-bar-item {
  display: flex;
  align-items: center;
  margin-bottom: 12px;
  font-size: 14px;
}
.sp-bar-label {
  width: 120px;
  flex-shrink: 0;
  font-weight: 600;
  color: var(--sp-navy);
}
.sp-bar-track {
  flex: 1;
  height: 28px;
  background: var(--sp-gray-100);
  border-radius: 14px;
  overflow: hidden;
  position: relative;
}
.sp-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--sp-navy), var(--sp-orange));
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 12px;
  color: white;
  font-size: 12px;
  font-weight: 600;
  min-width: 40px;
}

/* Timeline */
.sp-timeline {
  position: relative;
  padding: 24px 0;
  margin: 32px 0;
}
.sp-timeline::before {
  content: "";
  position: absolute;
  left: 20px;
  top: 0;
  bottom: 0;
  width: 3px;
  background: linear-gradient(to bottom, var(--sp-orange), var(--sp-navy));
  border-radius: 2px;
}
.sp-timeline-item {
  position: relative;
  padding-left: 56px;
  margin-bottom: 32px;
}
.sp-timeline-dot {
  position: absolute;
  left: 12px;
  top: 4px;
  width: 20px;
  height: 20px;
  background: var(--sp-orange);
  border-radius: 50%;
  border: 3px solid var(--sp-white);
  box-shadow: var(--sp-shadow-sm);
}
.sp-timeline-title {
  font-weight: 700;
  color: var(--sp-navy);
  margin-bottom: 4px;
}
.sp-timeline-desc {
  color: var(--sp-gray-600);
  font-size: 15px;
}

/* Related Posts */
.sp-related {
  max-width: var(--sp-content-width);
  margin: 0 auto 80px;
  padding: 0 24px;
}
.sp-related h2 {
  font-size: 24px;
  font-weight: 800;
  color: var(--sp-navy);
  margin-bottom: 32px;
  text-align: center;
}
.sp-related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 24px;
}
.sp-related-card {
  background: var(--sp-white);
  border-radius: var(--sp-radius-md);
  overflow: hidden;
  box-shadow: var(--sp-shadow-md);
  transition: all var(--sp-transition);
  text-decoration: none;
}
.sp-related-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--sp-shadow-lg);
}
.sp-related-card img {
  width: 100%;
  aspect-ratio: 16/10;
  object-fit: cover;
}
.sp-related-card-body {
  padding: 16px 20px;
}
.sp-related-card-title {
  font-weight: 700;
  color: var(--sp-navy);
  font-size: 15px;
  line-height: 1.4;
}

/* Footer */
.sp-footer {
  background: var(--sp-navy-dark);
  color: rgba(255,255,255,0.6);
  padding: 56px 24px 40px;
  font-size: 14px;
  line-height: 1.8;
}
.sp-footer-inner {
  max-width: var(--sp-wide-width);
  margin: 0 auto;
}
.sp-footer-brand {
  font-size: 18px;
  font-weight: 700;
  color: var(--sp-white);
  margin-bottom: 16px;
}
.sp-footer-links {
  display: flex;
  gap: 24px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.sp-footer-links a {
  color: rgba(255,255,255,0.7);
  text-decoration: none;
  font-size: 14px;
  transition: color var(--sp-transition);
}
.sp-footer-links a:hover { color: var(--sp-orange); }
.sp-footer-notice {
  color: rgba(255,255,255,0.4);
  font-size: 12px;
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid rgba(255,255,255,0.1);
}

/* TOC */
.sp-toc {
  background: var(--sp-gray-50);
  border: 1px solid var(--sp-gray-200);
  border-radius: var(--sp-radius-md);
  padding: 24px 28px;
  margin: 0 0 40px;
}
.sp-toc-title {
  font-weight: 700;
  color: var(--sp-navy);
  margin-bottom: 12px;
  font-size: 16px;
}
.sp-toc ol {
  margin: 0;
  padding-left: 20px;
}
.sp-toc li {
  margin-bottom: 6px;
  font-size: 15px;
}
.sp-toc a {
  color: var(--sp-gray-600);
  text-decoration: none;
  transition: color var(--sp-transition);
}
.sp-toc a:hover { color: var(--sp-orange); }

/* Notices */
.ai-notice {
  font-size: 0.85em !important;
  color: #888 !important;
  margin-top: 2em !important;
}

/* Responsive */
@media (max-width: 768px) {
  .sp-header-inner { height: 60px; }
  .sp-nav { display: none; }
  .sp-nav.active {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 60px;
    left: 0;
    right: 0;
    background: var(--sp-white);
    padding: 16px;
    border-bottom: 1px solid var(--sp-gray-200);
    box-shadow: var(--sp-shadow-lg);
  }
  .sp-mobile-toggle { display: block; }
  .sp-single-hero { padding: 60px 20px 40px; }
  .sp-content { padding: 32px 20px 60px; }
  .sp-content h2 { font-size: 22px; }
  .sp-bar-label { width: 80px; font-size: 13px; }
  .sp-timeline::before { left: 12px; }
  .sp-timeline-item { padding-left: 44px; }
  .sp-timeline-dot { left: 4px; }
  .sp-related-grid { grid-template-columns: 1fr; }
}

/* Scroll animations */
.sp-fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.sp-fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* WP overrides */
.wp-block-group, .entry-content, .post-content { max-width: 100% !important; }
#wpadminbar ~ .sp-header { top: 32px; }
@media (max-width: 782px) { #wpadminbar ~ .sp-header { top: 46px; } }
