/* ═══════════════════════════════════════════
   TemizBlog v2 — Design System
   ═══════════════════════════════════════════ */

/* ── Variables ─────────────────────────── */
:root {
  --font: 'Inter', 'Segoe UI', system-ui, sans-serif;

  /* Light Theme */
  --bg: #FAFAFB;
  --surface: #FFFFFF;
  --surface-hover: #F4F4F7;
  --text: #0F1115;
  --text-secondary: #5B6170;
  --text-muted: #98A0B0;
  --border: #E7E8EC;
  --border-light: #F2F2F5;

  --primary: #6366F1;
  --primary-hover: #4F46E5;
  --primary-light: #818CF8;
  --accent: #8B5CF6;
  --accent-light: #A78BFA;
  --success: #10B981;
  --error: #EF4444;

  --nav-bg: rgba(255, 255, 255, 0.85);
  --nav-border: rgba(15, 17, 21, 0.06);

  --shadow-sm: 0 1px 2px rgba(15, 17, 21, 0.05);
  --shadow: 0 1px 3px rgba(15, 17, 21, 0.08), 0 1px 2px rgba(15, 17, 21, 0.04);
  --shadow-md: 0 4px 14px rgba(15, 17, 21, 0.08), 0 2px 4px rgba(15, 17, 21, 0.04);
  --shadow-lg: 0 12px 44px rgba(99, 102, 241, 0.12), 0 4px 12px rgba(15, 17, 21, 0.06);
  --shadow-xl: 0 24px 68px rgba(99, 102, 241, 0.18), 0 8px 20px rgba(15, 17, 21, 0.08);

  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;

  --transition: 0.22s cubic-bezier(0.22, 1, 0.36, 1);
  --transition-slow: 0.4s cubic-bezier(0.22, 1, 0.36, 1);

  --gradient-brand: linear-gradient(135deg, #6366F1 0%, #8B5CF6 100%);
  --focus-ring: rgba(99, 102, 241, 0.18);
}

[data-theme="dark"] {
  --bg: #0B0F1F;
  --surface: #161B2E;
  --surface-hover: #1F2540;
  --text: #F1F3F9;
  --text-secondary: #98A0B8;
  --text-muted: #6B7390;
  --border: #2A3150;
  --border-light: #1F2540;

  --primary: #818CF8;
  --primary-hover: #A5B4FC;
  --primary-light: #C7D2FE;
  --accent: #A78BFA;
  --accent-light: #C4B5FD;

  --nav-bg: rgba(11, 15, 31, 0.88);
  --nav-border: rgba(255, 255, 255, 0.06);

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.4), 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 14px rgba(0, 0, 0, 0.4), 0 2px 4px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 14px 44px rgba(0, 0, 0, 0.5), 0 4px 12px rgba(99, 102, 241, 0.08);
  --shadow-xl: 0 26px 68px rgba(0, 0, 0, 0.6), 0 8px 20px rgba(99, 102, 241, 0.1);

  --gradient-brand: linear-gradient(135deg, #818CF8 0%, #A78BFA 100%);
  --focus-ring: rgba(129, 140, 248, 0.25);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background-color: var(--bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "ss01", "cv11";
  transition: background-color var(--transition-slow), color var(--transition-slow);
}

a { text-decoration: none; color: inherit; }
img { max-width: 100%; height: auto; display: block; }

::selection {
  background: rgba(99, 102, 241, 0.22);
  color: inherit;
}

/* ── Site Header ───────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--nav-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--nav-border);
  transition: all var(--transition);
}

.site-header img {
  width: 100%;
  height: auto;
  display: block;
}

.navbar-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.nav-logo {
  font-size: 21px;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: -0.5px;
  transition: color var(--transition);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.nav-logo::before {
  content: 'T';
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: var(--gradient-brand);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #FFFFFF;
  font-size: 15px;
  font-weight: 800;
  flex-shrink: 0;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35);
  letter-spacing: 0;
  transition: transform var(--transition), box-shadow var(--transition);
}

.nav-logo:hover {
  color: var(--primary-light);
}

.nav-logo:hover::before {
  transform: rotate(-4deg) scale(1.05);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.45);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.admin-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 22px;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: -0.5px;
  padding: 12px 0;
  transition: color var(--transition);
}

.admin-logo::before {
  content: 'T';
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: var(--gradient-brand);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #FFFFFF;
  font-size: 15px;
  font-weight: 800;
  flex-shrink: 0;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.3);
  letter-spacing: 0;
}

.admin-logo:hover {
  color: var(--primary-light);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-links a {
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: color var(--transition);
  position: relative;
}

.nav-links a::after {
  content: '';
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 2px;
  height: 2px;
  background: var(--gradient-brand);
  border-radius: 2px;
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--primary);
  background: transparent;
}

.nav-links a:hover::after,
.nav-links a.active::after {
  transform: scaleX(1);
}

.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  color: var(--text-secondary);
  transition: all var(--transition);
  margin-left: 12px;
  font-size: 18px;
}

.theme-toggle:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--surface-hover);
  transform: rotate(-12deg);
}

.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 8px;
  border-radius: var(--radius-sm);
  background: none;
  border: 1px solid var(--border);
}

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

/* ── Main Content ──────────────────────── */
.main {
  flex: 1;
  width: 100%;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ── Hero Carousel ─────────────────────── */
.hero {
  position: relative;
  width: 100%;
  height: 520px;
  overflow: hidden;
  background: var(--surface);
}

.hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.8s ease-in-out;
  cursor: pointer;
}

.hero-slide.active {
  opacity: 1;
}

.hero-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.75) 0%,
    rgba(0, 0, 0, 0.2) 50%,
    rgba(0, 0, 0, 0.1) 100%
  );
}

.hero-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 60px 48px 48px;
  max-width: 800px;
  color: #FFFFFF;
}

.hero-caption .hero-date {
  display: inline-block;
  font-size: 13px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  opacity: 0.85;
  margin-bottom: 12px;
}

.hero-caption h2 {
  font-size: 36px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.5px;
  margin: 0;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.hero-dots {
  position: absolute;
  bottom: 24px;
  right: 48px;
  display: flex;
  gap: 8px;
  z-index: 10;
}

.hero-dots span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.4);
  cursor: pointer;
  transition: all var(--transition);
}

.hero-dots span.active {
  background: #FFFFFF;
  transform: scale(1.3);
}

/* ── Editorial Hero (new) ───────────────── */
.editorial-hero {
  position: relative;
  padding: 56px 0 64px;
  background:
    radial-gradient(60% 80% at 18% 20%, rgba(99, 102, 241, 0.10), transparent 70%),
    radial-gradient(50% 60% at 92% 30%, rgba(139, 92, 246, 0.08), transparent 70%);
}

[data-theme="dark"] .editorial-hero {
  background:
    radial-gradient(60% 80% at 18% 20%, rgba(129, 140, 248, 0.10), transparent 70%),
    radial-gradient(50% 60% at 92% 30%, rgba(167, 139, 250, 0.08), transparent 70%);
}

.hero-container {
  display: flex;
  flex-direction: column;
  gap: 40px;
}

.hero-main {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 48px;
  align-items: center;
  transition: opacity 0.24s ease;
}

.hero-main.fading {
  opacity: 0;
}

.hero-main-text {
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-width: 0;
}

.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.hero-tag .hero-tag-label {
  background: var(--gradient-brand);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: var(--primary);
}

.hero-tag .dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--text-muted);
}

.hero-headline {
  font-size: 44px;
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -1.2px;
  color: var(--text);
  font-feature-settings: "ss01", "cv11";
}

.hero-excerpt {
  font-size: 17px;
  line-height: 1.65;
  color: var(--text-secondary);
  max-width: 520px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  align-self: flex-start;
  font-size: 14px;
  font-weight: 600;
  color: #FFFFFF;
  background: var(--primary);
  padding: 13px 24px;
  border-radius: var(--radius);
  transition: background var(--transition), gap var(--transition), transform var(--transition), box-shadow var(--transition);
  margin-top: 8px;
  box-shadow: 0 6px 18px rgba(99, 102, 241, 0.22);
}

.hero-cta:hover {
  background: var(--primary-hover);
  gap: 14px;
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(99, 102, 241, 0.32);
}

.hero-cta .arrow {
  transition: transform var(--transition);
}

.hero-cta:hover .arrow {
  transform: translateX(2px);
}

.hero-main-image {
  display: block;
  position: relative;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius-xl);
  overflow: hidden;
  background: var(--border-light);
  box-shadow:
    0 24px 60px rgba(99, 102, 241, 0.18),
    0 10px 24px rgba(15, 17, 21, 0.08);
  transition: transform var(--transition-slow), box-shadow var(--transition-slow);
}

.hero-main-image::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0) 0%, rgba(139, 92, 246, 0.22) 100%);
  opacity: 0;
  transition: opacity var(--transition-slow);
  pointer-events: none;
}

.hero-main-image:hover {
  transform: translateY(-4px);
  box-shadow:
    0 32px 72px rgba(99, 102, 241, 0.26),
    0 14px 28px rgba(15, 17, 21, 0.1);
}

.hero-main-image:hover::after {
  opacity: 1;
}

.hero-main-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.hero-main-image:hover img {
  transform: scale(1.05);
}

.hero-img-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gradient-brand);
  color: rgba(255, 255, 255, 0.42);
  font-size: 84px;
  font-weight: 800;
  letter-spacing: -2px;
}

/* ── Hero Thumbnails ────────────────────── */
.hero-thumbs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
}

.hero-thumb {
  position: relative;
  display: flex;
  gap: 16px;
  padding: 18px;
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: background var(--transition), box-shadow var(--transition), transform var(--transition);
  border: 1px solid transparent;
}

.hero-thumb::before {
  content: '';
  position: absolute;
  top: -1px;
  left: 18px;
  right: 18px;
  height: 2px;
  background: var(--gradient-brand);
  border-radius: 2px;
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.hero-thumb.active::before,
.hero-thumb:hover::before {
  transform: scaleX(1);
}

.hero-thumb:hover {
  background: var(--surface-hover);
  transform: translateY(-2px);
}

.hero-thumb.active {
  background: var(--surface);
  box-shadow: var(--shadow);
  border-color: var(--border);
}

.hero-thumb-image {
  flex: 0 0 84px;
  width: 84px;
  height: 84px;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--border-light);
}

.hero-thumb-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-thumb-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gradient-brand);
  color: rgba(255, 255, 255, 0.55);
  font-weight: 700;
  font-size: 26px;
}

.hero-thumb-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  justify-content: center;
}

.hero-thumb-date {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--text-muted);
}

.hero-thumb-title {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 0;
  transition: color var(--transition);
}

.hero-thumb.active .hero-thumb-title,
.hero-thumb:hover .hero-thumb-title {
  color: var(--primary);
}

/* ── Section ───────────────────────────── */
.section {
  padding: 64px 0;
}

.section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 40px;
  gap: 16px;
}

.section-header-text {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.section-title {
  font-size: 28px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.6px;
  line-height: 1.15;
}

.section-subtitle {
  font-size: 14px;
  color: var(--text-secondary);
  font-weight: 500;
}

.section-link {
  font-size: 14px;
  font-weight: 600;
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: color var(--transition), gap var(--transition);
  white-space: nowrap;
  flex-shrink: 0;
}

.section-link:hover {
  color: var(--primary-light);
  gap: 10px;
}

/* ── Post Grid ─────────────────────────── */
.post-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

/* ── Post Card ─────────────────────────── */
.post-card {
  background: var(--surface);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform var(--transition-slow), box-shadow var(--transition-slow), border-color var(--transition-slow);
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
}

.post-card:hover {
  transform: translateY(-6px);
  box-shadow:
    0 20px 50px rgba(99, 102, 241, 0.16),
    0 8px 18px rgba(15, 17, 21, 0.08);
  border-color: rgba(99, 102, 241, 0.25);
}

[data-theme="dark"] .post-card:hover {
  box-shadow:
    0 22px 52px rgba(0, 0, 0, 0.55),
    0 8px 18px rgba(129, 140, 248, 0.12);
  border-color: rgba(129, 140, 248, 0.35);
}

.post-card-image {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 10;
  background: var(--border-light);
}

.post-card-image::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0) 0%, rgba(139, 92, 246, 0.18) 100%);
  opacity: 0;
  transition: opacity var(--transition-slow);
  pointer-events: none;
}

.post-card:hover .post-card-image::after {
  opacity: 1;
}

.post-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.post-card:hover .post-card-image img {
  transform: scale(1.08);
}

.post-card-image .placeholder-img {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gradient-brand);
  color: #FFFFFF;
  font-size: 44px;
  font-weight: 800;
  letter-spacing: -1px;
}

.post-card-body {
  padding: 22px 24px 24px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.post-card-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
  letter-spacing: 0.3px;
}

.post-card-meta .dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--text-muted);
}

.post-card-title {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.35;
  color: var(--text);
  margin-bottom: 10px;
  letter-spacing: -0.3px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color var(--transition);
}

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

.post-card-excerpt {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 18px;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-card-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
  transition: color var(--transition), gap var(--transition);
}

.post-card-link:hover {
  color: var(--primary-light);
  gap: 10px;
}

/* ── Sentry (infinite scroll trigger) ──── */
.sentry {
  height: 1px;
  width: 100%;
}

/* ── Load More Button ──────────────────── */
.load-more-wrap {
  text-align: center;
  padding: 32px 0;
  display: none;
}

.load-more-btn {
  padding: 12px 40px;
  border: 2px solid var(--primary);
  background: transparent;
  color: var(--primary);
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
}

.load-more-btn:hover {
  background: var(--primary);
  color: #FFFFFF;
}

.load-more-btn:disabled {
  border-color: var(--border);
  color: var(--text-muted);
  background: transparent;
  cursor: wait;
}

/* ── Single Post ───────────────────────── */
.progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: var(--primary);
  z-index: 200;
  transition: width 0.1s linear;
}

.post-hero {
  width: 100%;
  max-width: 1024px;
  height: 420px;
  margin: 32px auto 0;
  overflow: hidden;
  background: var(--surface);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
}

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

.post-hero .placeholder-hero {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 72px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.3);
}

.post-article {
  max-width: 768px;
  margin: 0 auto;
  padding: 48px 24px 0;
}

.post-header {
  margin-bottom: 40px;
  text-align: center;
}

.post-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
  margin-bottom: 16px;
}

.post-meta .dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--text-muted);
}

.post-title {
  font-size: 36px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.5px;
  color: var(--text);
  margin-bottom: 0;
}

.post-content {
  font-size: 17px;
  line-height: 1.85;
  color: var(--text);
  padding-bottom: 64px;
}

.post-content p {
  margin-bottom: 1.5em;
}

.related-section {
  padding: 0 0 80px;
}

.related-section .container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

.related-title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 24px;
  color: var(--text);
}

.back-to-top {
  position: fixed;
  bottom: 32px;
  right: 32px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--primary);
  color: #FFFFFF;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  box-shadow: var(--shadow-lg);
  transition: all var(--transition);
  opacity: 0;
  visibility: hidden;
  z-index: 50;
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
}

.back-to-top:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-xl);
}

/* ── Contact Page ──────────────────────── */
.contact-section {
  padding: 64px 0;
  max-width: 680px;
  margin: 0 auto;
}

.contact-card {
  background: var(--surface);
  border-radius: var(--radius-xl);
  padding: 48px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  text-align: center;
}

.contact-icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px;
  font-size: 32px;
  color: #FFFFFF;
}

.contact-card h2 {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text);
}

.contact-card .contact-subtitle {
  font-size: 15px;
  color: var(--text-secondary);
  margin-bottom: 32px;
}

.contact-card .email-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 18px;
  font-weight: 600;
  color: var(--primary);
  padding: 12px 28px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  transition: all var(--transition);
  margin-bottom: 40px;
}

.contact-card .email-link:hover {
  border-color: var(--primary);
  background: var(--surface-hover);
}

.contact-form {
  text-align: left;
  margin-top: 8px;
}

.contact-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.contact-form .form-group {
  margin-bottom: 16px;
}

.contact-form .form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}

.contact-form .form-group input,
.contact-form .form-group textarea {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 14px;
  color: var(--text);
  background: var(--surface);
  transition: all var(--transition);
}

.contact-form .form-group input:focus,
.contact-form .form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--focus-ring);
}

.contact-form .form-group textarea {
  min-height: 120px;
  resize: vertical;
}

.contact-form .btn-submit {
  width: 100%;
  padding: 14px;
  background: var(--primary);
  color: #FFFFFF;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}

.contact-form .btn-submit:hover {
  background: var(--primary-hover);
}

.contact-form .btn-submit:disabled,
.contact-form .btn-submit.loading {
  opacity: 0.6;
  cursor: not-allowed;
}

.contact-feedback {
  margin-top: 14px;
  padding: 0;
  font-size: 14px;
  line-height: 1.5;
  border-radius: var(--radius-sm);
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: all var(--transition);
}

.contact-feedback:not(:empty) {
  padding: 12px 16px;
  max-height: 120px;
  opacity: 1;
}

.contact-feedback.success {
  background: rgba(16, 185, 129, 0.1);
  color: var(--success);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.contact-feedback.error {
  background: rgba(239, 68, 68, 0.1);
  color: var(--error);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

/* ── Footer ────────────────────────────── */
.footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 48px 0 0;
  margin-top: auto;
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

.footer-brand {
  text-align: center;
  padding-bottom: 32px;
  margin-bottom: 32px;
  border-bottom: 1px solid var(--border);
}

.footer-logo {
  font-size: 22px;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: -0.5px;
  transition: color var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.footer-logo::before {
  content: 'T';
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: var(--gradient-brand);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #FFFFFF;
  font-size: 15px;
  font-weight: 800;
  flex-shrink: 0;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.3);
  letter-spacing: 0;
}

.footer-logo:hover {
  color: var(--primary-light);
}

.footer-cols {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px;
  max-width: 720px;
  margin: 0 auto;
}

.footer-col h4 {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text);
  margin-bottom: 16px;
}

.footer-col a {
  display: block;
  font-size: 14px;
  color: var(--text-secondary);
  padding: 4px 0;
  transition: all var(--transition);
}

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

.footer-bottom {
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.footer-ai-note {
  font-size: 11px;
  text-align: right;
}

/* ── Legal / Article Content (shared) ─────── */
.legal-article {
  max-width: 768px;
  margin: 0 auto;
  padding: 48px 24px 0;
}

.legal-header {
  text-align: center;
  margin-bottom: 40px;
}

.legal-title {
  font-size: 36px;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: var(--text);
  margin: 0 0 8px;
}

.legal-updated {
  font-size: 14px;
  color: var(--text-muted);
  margin: 0;
}

.legal-content,
.post-content {
  font-size: 17px;
  line-height: 1.85;
  color: var(--text);
}

.legal-content {
  padding-bottom: 64px;
}

.legal-content p,
.post-content p {
  margin: 0 0 1.5em;
}

.legal-content h1,
.post-content h1 {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.4px;
  color: var(--text);
  margin: 2em 0 0.6em;
}

.legal-content h2,
.post-content h2 {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.3px;
  color: var(--text);
  margin: 2em 0 0.6em;
}

.legal-content h3,
.post-content h3 {
  font-size: 19px;
  font-weight: 600;
  color: var(--text);
  margin: 1.6em 0 0.5em;
}

.legal-content h4,
.post-content h4 {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  margin: 1.4em 0 0.5em;
}

.legal-content ul,
.legal-content ol,
.post-content ul,
.post-content ol {
  margin: 0 0 1.5em;
  padding-left: 1.5em;
}

.legal-content li,
.post-content li {
  margin-bottom: 0.5em;
}

.legal-content a,
.post-content a {
  color: var(--primary);
  text-decoration: none;
  transition: color var(--transition);
}

.legal-content a:hover,
.post-content a:hover {
  color: var(--primary-hover);
  text-decoration: underline;
}

.legal-content strong,
.post-content strong {
  font-weight: 700;
  color: var(--text);
}

.legal-content em,
.post-content em {
  font-style: italic;
}

.legal-content code,
.post-content code {
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', monospace;
  font-size: 0.92em;
  background: var(--surface-hover);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.legal-content pre,
.post-content pre {
  margin: 0 0 1.5em;
  padding: 18px 20px;
  background: var(--surface-hover);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow-x: auto;
  line-height: 1.6;
}

.legal-content pre code,
.post-content pre code {
  font-size: 0.88em;
  background: transparent;
  padding: 0;
  border: none;
  border-radius: 0;
}

.legal-content blockquote,
.post-content blockquote {
  margin: 0 0 1.5em;
  padding: 8px 0 8px 20px;
  border-left: 4px solid var(--primary-light);
  color: var(--text-secondary);
  font-style: italic;
}

.legal-content hr,
.post-content hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2.5em 0;
}

.legal-content img,
.post-content img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius);
  margin: 0 0 1.5em;
}

/* ── Scroll Animations ─────────────────── */
.fade-up {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-up.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── Admin: Login ──────────────────────── */
.admin-login {
  max-width: 420px;
  margin: 80px auto;
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 48px 40px;
  border: 1px solid var(--border);
}

.admin-login h2 {
  text-align: center;
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 32px;
}

/* ── Admin: Panel ──────────────────────── */
.admin-header {
  background: var(--primary);
  color: #FFFFFF;
  padding: 14px 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.admin-header h2 {
  font-size: 18px;
  font-weight: 600;
}

.admin-container {
  max-width: 1200px;
  margin: 32px auto;
  padding: 0 24px;
}

.admin-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.admin-table {
  width: 100%;
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

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

.admin-table th {
  background: var(--primary);
  color: #FFFFFF;
  padding: 14px 18px;
  text-align: left;
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.admin-table td {
  padding: 12px 18px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  color: var(--text);
}

.admin-table tr:last-child td { border-bottom: none; }
.admin-table tbody tr:hover td { background: var(--surface-hover); }

.admin-table .actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.admin-table .post-image-thumb {
  width: 60px;
  height: 40px;
  object-fit: cover;
  border-radius: 4px;
}

/* ── Admin: Modal ──────────────────────── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  z-index: 1000;
  justify-content: center;
  align-items: center;
}

.modal-overlay.show { display: flex; }

.modal {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 32px;
  width: 90%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--border);
}

.modal h3 {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 24px;
}

.modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 24px;
  justify-content: flex-end;
}

.image-preview {
  margin-top: 10px;
  max-width: 200px;
  border-radius: var(--radius-sm);
}

/* ── Forms ─────────────────────────────── */
.form-group {
  margin-bottom: 18px;
}

.form-group label {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
  color: var(--text);
  font-size: 13px;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 10px 14px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: var(--font);
  color: var(--text);
  background: var(--surface);
  transition: all var(--transition);
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--focus-ring);
}

.form-group textarea {
  min-height: 200px;
  resize: vertical;
}

.md-hint {
  font-weight: 400;
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0;
}

.editor-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 8px;
}

.editor-tab {
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  transition: all var(--transition);
}

.editor-tab.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.content-preview {
  min-height: 200px;
  padding: 12px 14px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 15px;
  line-height: 1.7;
  color: var(--text);
  background: var(--surface-hover);
  overflow-y: auto;
  max-height: 420px;
}

.content-preview p:first-child { margin-top: 0; }
.content-preview h1, .content-preview h2, .content-preview h3 { margin-top: 1.2em; }
.content-preview h1 { font-size: 22px; font-weight: 700; }
.content-preview h2 { font-size: 19px; font-weight: 700; }
.content-preview h3 { font-size: 16px; font-weight: 600; }
.content-preview ul, .content-preview ol { padding-left: 1.4em; margin: 0 0 1em; }
.content-preview li { margin-bottom: 0.3em; }
.content-preview a { color: var(--primary); }
.content-preview code { font-family: Consolas, monospace; font-size: 0.9em; background: var(--surface); padding: 1px 4px; border-radius: 4px; }
.content-preview blockquote { margin: 0 0 1em; padding-left: 14px; border-left: 3px solid var(--primary-light); color: var(--text-secondary); }

/* ── Buttons ───────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 22px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  transition: all var(--transition);
  line-height: 1;
}

.btn-primary {
  background: var(--primary);
  color: #FFFFFF;
  width: 100%;
}

.btn-primary:hover { background: var(--primary-hover); }

.btn-success { background: var(--success); color: #FFFFFF; }
.btn-success:hover { background: #0DA271; }

.btn-danger { background: var(--error); color: #FFFFFF; }
.btn-danger:hover { background: #DC2626; }

.btn-outline {
  background: transparent;
  border: 2px solid var(--border);
  color: var(--text);
}

.btn-outline:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.btn-sm {
  padding: 6px 14px;
  font-size: 12px;
  border-radius: var(--radius-sm);
}

.btn-load-more {
  padding: 12px 32px;
  font-size: 14px;
  font-weight: 600;
  min-width: 200px;
}

.btn-load-more:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.load-more-wrap {
  display: flex;
  justify-content: center;
  margin-top: 32px;
}

/* ── Error ─────────────────────────────── */
.error-msg {
  color: var(--error);
  font-size: 13px;
  font-weight: 500;
  margin-top: 4px;
}

/* ── Loading / Not Found ───────────────── */
.loading,
.not-found {
  text-align: center;
  padding: 80px 20px;
  color: var(--text-muted);
  font-size: 16px;
}

/* ── Responsive ────────────────────────── */
@media (max-width: 1024px) {
  .post-grid { grid-template-columns: repeat(2, 1fr); }

  .hero-main {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .hero-main-image {
    aspect-ratio: 16 / 10;
    order: -1;
  }

  .hero-headline { font-size: 36px; }

  .hero-thumbs { grid-template-columns: repeat(3, 1fr); }
}

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

  .hamburger { display: flex; }

  .nav-links {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    padding: 12px 24px;
    gap: 2px;
    box-shadow: var(--shadow-md);
  }

  .nav-links.open { display: flex; }

  .nav-links a {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    width: 100%;
  }

  .nav-links a::after { display: none; }

  .editorial-hero { padding: 32px 0 40px; }

  .hero-container { gap: 28px; }

  .hero-headline {
    font-size: 30px;
    letter-spacing: -0.8px;
  }

  .hero-excerpt { font-size: 15px; }

  .hero-main-image { aspect-ratio: 16 / 10; }

  .hero-thumbs {
    grid-template-columns: 1fr;
    gap: 10px;
    padding-top: 24px;
  }

  .hero-thumb {
    padding: 12px;
    gap: 12px;
  }

  .hero-thumb-image {
    flex-basis: 64px;
    width: 64px;
    height: 64px;
  }

  .hero-thumb-title { font-size: 14px; }

  .section-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .section-title { font-size: 24px; }

  .hero {
    height: 360px;
  }

  .hero-caption {
    padding: 40px 24px 32px;
  }

  .hero-caption h2 {
    font-size: 24px;
  }

  .hero-dots {
    right: 24px;
    bottom: 16px;
  }

  .post-hero {
    height: 280px;
  }

  .post-title {
    font-size: 26px;
  }

  .post-content {
    font-size: 16px;
  }

  .contact-card {
    padding: 32px 24px;
  }

  .contact-form-row {
    grid-template-columns: 1fr;
  }

  .footer-cols {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .back-to-top {
    right: 16px;
    bottom: 16px;
    width: 40px;
    height: 40px;
    font-size: 16px;
  }
}
