/* ========================================================
   SUMMRY BLOG THEME - DESIGN SYSTEM OVERRIDE FOR GHOST
   ======================================================== */

@import url('https://fonts.googleapis.com/css2?family=Onest:wght@300;400;500;600;700;800;900&display=swap');

/* Default / Light Theme */
:root,
html.theme-light {
  --font-family: 'Onest', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;

  /* Primary Accent */
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-light: rgba(37, 99, 235, 0.08);
  --primary-border: rgba(37, 99, 235, 0.2);
  --primary-gradient: linear-gradient(180deg, #3b82f6 0%, #2563eb 100%);
  --button-gradient: linear-gradient(97deg, #3b82f6 0%, #93c5fd 140.21%);

  /* Light Theme Colors */
  --bg: #f8fafc;
  --bg-secondary: #f1f5f9;
  --card-bg: #ffffff;
  --text: #0f172a;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.07);
  --shadow-float: 0 20px 25px -5px rgba(16, 24, 40, 0.08), 0 8px 10px -6px rgba(16, 24, 40, 0.04);
  --header-bg: rgba(248, 250, 252, 0.85);
}

/* Dark Theme */
html.theme-dark {
  --primary: #3b82f6;
  --primary-hover: #60a5fa;
  --primary-light: rgba(59, 130, 246, 0.12);
  --primary-border: rgba(59, 130, 246, 0.25);
  --primary-gradient: linear-gradient(180deg, #60a5fa 0%, #3b82f6 100%);
  --button-gradient: linear-gradient(97deg, #3b82f6 0%, #60a5fa 140.21%);

  /* Dark Theme Colors */
  --bg: #090d16;
  --bg-secondary: #0f172a;
  --card-bg: #131b2e;
  --text: #f8fafc;
  --text-muted: #94a3b8;
  --border: rgba(255, 255, 255, 0.09);
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.5);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
  --shadow-float: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
  --header-bg: rgba(9, 13, 22, 0.85);
}

@media (prefers-color-scheme: dark) {
  html:not(.theme-light):not(.theme-dark) {
    --primary: #3b82f6;
    --primary-hover: #60a5fa;
    --primary-light: rgba(59, 130, 246, 0.12);
    --primary-border: rgba(59, 130, 246, 0.25);
    --primary-gradient: linear-gradient(180deg, #60a5fa 0%, #3b82f6 100%);
    --button-gradient: linear-gradient(97deg, #3b82f6 0%, #60a5fa 140.21%);

    --bg: #090d16;
    --bg-secondary: #0f172a;
    --card-bg: #131b2e;
    --text: #f8fafc;
    --text-muted: #94a3b8;
    --border: rgba(255, 255, 255, 0.09);
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.5);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
    --shadow-float: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
    --header-bg: rgba(9, 13, 22, 0.85);
  }
}

/* ========================================================
   GLOBAL RESETS & ATTILA CLEANUP
   ======================================================== */
html {
  font-size: 16px !important;
  font-family: var(--font-family) !important;
  background-color: var(--bg) !important;
  color: var(--text) !important;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  margin: 0 !important;
  padding: 0 !important;
  font-size: 1rem !important;
  line-height: 1.6 !important;
  background-color: var(--bg) !important;
  color: var(--text) !important;
  font-family: var(--font-family) !important;
  display: flex !important;
  flex-direction: column !important;
  min-height: 100vh !important;
}

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

/* Clear legacy Attila floats and containers */
.viewport,
.page-wrapper,
#index,
.container,
.content {
  width: 100% !important;
  max-width: 100% !important;
  float: none !important;
  clear: both !important;
  margin: 0 !important;
  padding: 0 !important;
  background: transparent !important;
}

.page-wrapper {
  flex-grow: 1;
}

/* Hide legacy Attila header / menu / search modal artifacts */
.blog-header,
.menu-initial,
.site-wrapper > header,
.extra-pagination {
  display: none !important;
}

/* ========================================================
   HEADER / NAVBAR
   ======================================================== */
.summry-header {
  position: sticky;
  top: 0;
  z-index: 100;
  width: 100%;
  height: 64px;
  background: var(--header-bg) !important;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  transition: background 0.3s, border-color 0.3s;
}

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

.summry-logo-link {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.summry-logo-img {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  object-fit: contain;
}

.summry-logo-text {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.01em;
}

.summry-badge-tag {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--primary);
  background: var(--primary-light);
  border: 1px solid var(--primary-border);
  padding: 2px 8px;
  border-radius: 9999px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.summry-nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.summry-nav-links li a {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s;
}

.summry-nav-links li a:hover,
.summry-nav-links li.active a {
  color: var(--text);
}

.summry-nav-links li.active a {
  font-weight: 600;
}

.summry-header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.summry-theme-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--card-bg);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
  padding: 0;
}

.summry-theme-btn:hover {
  color: var(--text);
  border-color: var(--primary-border);
  background: var(--bg-secondary);
}

/* Theme toggle icon display logic */
.summry-theme-btn .sun-icon {
  display: none;
}
.summry-theme-btn .moon-icon {
  display: block;
}

html.theme-dark .summry-theme-btn .sun-icon {
  display: block !important;
}

html.theme-dark .summry-theme-btn .moon-icon {
  display: none !important;
}

html.theme-light .summry-theme-btn .sun-icon {
  display: none !important;
}

html.theme-light .summry-theme-btn .moon-icon {
  display: block !important;
}

.summry-btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 38px;
  padding: 0 18px;
  border-radius: 9999px;
  background: var(--button-gradient);
  color: #ffffff !important;
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none !important;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
  transition: all 0.25s ease;
  white-space: nowrap;
}

.summry-btn-primary:hover {
  opacity: 0.92;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
}

/* ========================================================
   SUMMRY HERO SECTION
   ======================================================== */
.summry-hero {
  position: relative;
  padding: 64px 24px 44px;
  text-align: center;
  overflow: hidden;
}

.summry-hero-glow {
  position: absolute;
  top: -100px;
  left: 50%;
  transform: translateX(-50%);
  width: 700px;
  height: 400px;
  background: radial-gradient(circle at center, rgba(59, 130, 246, 0.18) 0%, rgba(59, 130, 246, 0) 70%);
  pointer-events: none;
  z-index: 0;
}

.summry-hero-inner {
  position: relative;
  z-index: 1;
  max-width: 750px;
  margin: 0 auto;
}

.summry-pill-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 9999px;
  font-size: 0.825rem;
  font-weight: 600;
  color: var(--primary);
  background: var(--primary-light);
  border: 1px solid var(--primary-border);
  margin-bottom: 20px;
  text-decoration: none;
}

.summry-pill-tag svg {
  stroke: var(--primary);
}

.summry-hero-title {
  font-size: 3.25rem;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.03em;
  color: var(--text);
  margin: 0 0 16px;
}

.summry-hero-title .highlight {
  color: #3b82f6;
  background: linear-gradient(135deg, #3b82f6 0%, #60a5fa 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.summry-hero-desc {
  font-size: 1.15rem;
  color: var(--text-muted);
  line-height: 1.6;
  max-width: 600px;
  margin: 0 auto;
}

/* ========================================================
   BLOG CONTAINER & POSTS GRID
   ======================================================== */
.summry-blog-container {
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 0 24px 80px;
  box-sizing: border-box;
}

.post-list-grid {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)) !important;
  gap: 32px !important;
  width: 100% !important;
  margin: 0 0 48px !important;
}

/* Post Card */
.post.post-card {
  background: var(--card-bg) !important;
  border: 1px solid var(--border) !important;
  border-radius: 20px !important;
  overflow: hidden !important;
  display: flex !important;
  flex-direction: column !important;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1) !important;
  box-shadow: var(--shadow-sm) !important;
  margin: 0 !important;
  padding: 0 !important;
  position: relative !important;
  width: 100% !important;
}

.post.post-card:hover {
  transform: translateY(-4px) !important;
  border-color: rgba(59, 130, 246, 0.4) !important;
  box-shadow: var(--shadow-float) !important;
}

.post-card-image-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--bg-secondary);
}

.post-card-image-link {
  display: block;
  width: 100%;
  height: 100%;
}

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

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

.post-card-tag {
  position: absolute;
  top: 14px;
  left: 14px;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #ffffff !important;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 9999px;
  text-decoration: none !important;
  border: 1px solid rgba(255, 255, 255, 0.15);
  z-index: 2;
  transition: background 0.2s;
}

.post-card-tag:hover {
  background: rgba(37, 99, 235, 0.9);
}

.post-card-body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  flex-grow: 1;
}

.post-card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-bottom: 12px;
}

.meta-dot {
  opacity: 0.5;
}

.post-card-title {
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.35;
  color: var(--text);
  margin: 0 0 10px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-card-title a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s;
}

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

.post-card-excerpt {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin: 0 0 20px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-card-footer {
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.post-card-read-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--primary);
  text-decoration: none;
  transition: gap 0.2s ease;
}

.post.post-card:hover .post-card-read-link {
  gap: 10px;
}

/* ========================================================
   PAGINATION
   ======================================================== */
.pagination {
  width: 100% !important;
  float: none !important;
  clear: both !important;
  margin: 40px auto 20px !important;
  position: relative !important;
}

.pagination .pagination-box {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 16px !important;
  position: relative !important;
  padding: 0 !important;
}

.pagination a {
  position: relative !important;
  float: none !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  height: 40px !important;
  padding: 0 18px !important;
  border-radius: 9999px !important;
  border: 1px solid var(--border) !important;
  background: var(--card-bg) !important;
  color: var(--text) !important;
  font-size: 0.875rem !important;
  font-weight: 500 !important;
  text-decoration: none !important;
  transition: all 0.2s ease !important;
}

.pagination a:hover {
  border-color: var(--primary) !important;
  color: var(--primary) !important;
  box-shadow: 0 2px 10px rgba(37, 99, 235, 0.15) !important;
}

.pagination .pagination-info {
  position: static !important;
  width: auto !important;
  font-size: 0.875rem !important;
  color: var(--text-muted) !important;
  font-weight: 500 !important;
  line-height: normal !important;
  height: auto !important;
}

/* ========================================================
   SINGLE ARTICLE / POST VIEW
   ======================================================== */
.summry-progress-container {
  position: fixed;
  top: 64px;
  left: 0;
  width: 100%;
  height: 3px;
  background: transparent;
  z-index: 99;
}

.summry-progress-bar {
  display: block;
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #2563eb, #60a5fa);
  transition: width 0.1s;
}

.summry-post-article {
  width: 100%;
  padding-bottom: 80px;
}

.summry-post-header {
  padding: 48px 24px 32px;
}

.summry-post-header-inner {
  max-width: 820px;
  margin: 0 auto;
}

.summry-post-tag-wrap {
  margin-bottom: 16px;
}

.summry-post-title {
  font-size: 2.85rem !important;
  font-weight: 800 !important;
  line-height: 1.2 !important;
  letter-spacing: -0.025em !important;
  color: var(--text) !important;
  margin: 0 0 16px !important;
}

.summry-post-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 0.9rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-bottom: 32px;
}

.summry-post-author strong {
  color: var(--text);
  font-weight: 600;
}

.summry-post-cover {
  width: 100%;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border);
}

.summry-post-cover img {
  width: 100%;
  height: auto;
  display: block;
}

.summry-post-content-wrap {
  max-width: 820px;
  margin: 0 auto;
  padding: 0 24px;
  box-sizing: border-box;
}

.summry-post-content {
  font-size: 1.125rem !important;
  line-height: 1.8 !important;
  color: var(--text) !important;
  margin-bottom: 48px;
}

.summry-post-content p {
  margin: 0 0 24px !important;
  color: var(--text);
  font-size: 1.125rem !important;
  line-height: 1.8 !important;
}

.summry-post-content h2 {
  font-size: 1.85rem !important;
  font-weight: 800 !important;
  line-height: 1.3 !important;
  letter-spacing: -0.02em !important;
  color: var(--text) !important;
  margin: 48px 0 18px !important;
}

.summry-post-content h3 {
  font-size: 1.45rem !important;
  font-weight: 700 !important;
  line-height: 1.35 !important;
  color: var(--text) !important;
  margin: 36px 0 14px !important;
}

.summry-post-content ul,
.summry-post-content ol {
  margin: 0 0 24px !important;
  padding-left: 24px !important;
  color: var(--text);
}

.summry-post-content li {
  margin-bottom: 8px;
  line-height: 1.7;
}

.summry-post-content a {
  color: var(--primary) !important;
  text-decoration: underline !important;
  font-weight: 500 !important;
}

.summry-post-content blockquote {
  border-left: 4px solid var(--primary) !important;
  background: var(--bg-secondary) !important;
  padding: 18px 24px !important;
  border-radius: 0 16px 16px 0 !important;
  margin: 32px 0 !important;
  font-style: italic !important;
  color: var(--text) !important;
}

.summry-post-content blockquote p {
  margin: 0 !important;
  font-size: 1.05rem !important;
}

.summry-post-content img {
  border-radius: 16px;
  max-width: 100%;
  height: auto;
  margin: 32px 0;
  box-shadow: var(--shadow-sm);
}

.summry-post-content pre {
  background: #0f172a !important;
  color: #f8fafc !important;
  padding: 20px !important;
  border-radius: 14px !important;
  overflow-x: auto !important;
  font-size: 0.9rem !important;
  margin: 28px 0 !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
}

/* In-Article Summry CTA Box */
.summry-inarticle-cta {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.08) 0%, rgba(94, 0, 223, 0.05) 100%);
  border: 1.5px solid var(--primary-border);
  border-radius: 20px;
  padding: 32px;
  margin: 48px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  position: relative;
  overflow: hidden;
}

html.theme-dark .summry-inarticle-cta {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.15) 0%, rgba(94, 0, 223, 0.12) 100%) !important;
  border-color: rgba(59, 130, 246, 0.35) !important;
}

html.theme-light .summry-inarticle-cta {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.08) 0%, rgba(94, 0, 223, 0.05) 100%) !important;
  border-color: rgba(37, 99, 235, 0.2) !important;
}

.summry-cta-badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--primary);
  letter-spacing: 0.05em;
  margin-bottom: 6px;
}

.summry-inarticle-cta-text h3 {
  margin: 0 0 8px;
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text);
}

.summry-inarticle-cta-text p {
  margin: 0;
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.summry-cta-btn {
  padding: 12px 24px !important;
  font-size: 0.95rem !important;
  white-space: nowrap !important;
}

/* Post Tags Row */
.summry-post-tags-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 24px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin-bottom: 40px;
}

.tags-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
}

.tags-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* Navigation Cards */
.summry-post-navigation {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 24px;
}

.summry-nav-card {
  display: flex;
  flex-direction: column;
  padding: 20px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  text-decoration: none !important;
  transition: all 0.2s ease;
}

.summry-nav-card:hover {
  border-color: var(--primary-border);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.summry-nav-card .nav-sub {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--primary);
  text-transform: uppercase;
  margin-bottom: 6px;
}

.summry-nav-card .nav-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.4;
}

/* ========================================================
   FOOTER
   ======================================================== */
.summry-footer {
  border-top: 1px solid var(--border);
  background: var(--card-bg);
  padding: 64px 24px 32px;
  margin-top: auto;
}

.summry-footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 48px;
}

.summry-footer-brand p {
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.6;
  max-width: 320px;
  margin: 0 0 20px;
}

.summry-social-links {
  display: flex;
  align-items: center;
  gap: 10px;
}

.summry-social-links a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border);
  color: var(--text-muted);
  text-decoration: none;
  transition: all 0.2s;
}

.summry-social-links a:hover {
  color: var(--text);
  border-color: var(--primary);
  background: var(--bg-secondary);
}

.summry-footer-col h5 {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text);
  margin: 0 0 16px;
}

.summry-footer-col ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.summry-footer-col ul li a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.875rem;
  transition: color 0.2s;
}

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

.summry-footer-bottom {
  max-width: 1200px;
  margin: 48px auto 0;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ========================================================
   RESPONSIVE DESIGN
   ======================================================== */
@media (max-width: 992px) {
  .summry-nav-links {
    display: none;
  }
  .summry-footer-inner {
    grid-template-columns: 1fr 1fr;
    gap: 36px;
  }
}

@media (max-width: 768px) {
  .summry-hero-title {
    font-size: 2.35rem;
  }
  .post-list-grid {
    grid-template-columns: 1fr !important;
  }
  .summry-inarticle-cta {
    flex-direction: column;
    align-items: flex-start;
  }
  .summry-post-navigation {
    grid-template-columns: 1fr;
  }
  .summry-post-title {
    font-size: 2.15rem !important;
  }
}

@media (max-width: 540px) {
  .summry-footer-inner {
    grid-template-columns: 1fr;
  }
}
