@import url('https://fonts.googleapis.com/css2?family=Inter:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;1,400&display=swap');

/* ── Design Tokens ───────────────────────────────────────────────────────── */
:root {
  --primary:       #2f8bb0;
  --primary-light: #5bb5d5;
  --primary-dark:  #1f6a8a;
  --accent:        #b0c8d2;
  --warm:          #D97706;
  --warm-dark:     #B45309;
  --bg:            #F8FAFC;
  --surface:       #FFFFFF;
  --text:          #0F172A;
  --text-secondary:#475569;
  --text-muted:    #94A3B8;
  --border:        #E2E8F0;
  --shadow-sm:     0 1px 3px rgba(0,0,0,.07), 0 4px 12px rgba(0,0,0,.04);
  --shadow-md:     0 4px 8px rgba(0,0,0,.10), 0 12px 28px rgba(0,0,0,.07);
  --radius:        12px;
  --radius-lg:     16px;
}

/* ── Reset & Base ────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  color: var(--text);
  background: var(--bg);
  /* Subtle math-doodle watermark, visible on the open areas around content */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cg font-family='Georgia,serif' fill='%232f8bb0' fill-opacity='0.16'%3E%3Ctext x='28' y='64' font-size='34' transform='rotate(-12 28 64)'%3Eπ%3C/text%3E%3Ctext x='158' y='48' font-size='28' transform='rotate(8 158 48)'%3E∑%3C/text%3E%3Ctext x='224' y='132' font-size='30' transform='rotate(-6 224 132)'%3E√%3C/text%3E%3Ctext x='56' y='188' font-size='38' transform='rotate(10 56 188)'%3E∫%3C/text%3E%3Ctext x='176' y='228' font-size='26' transform='rotate(-10 176 228)'%3EΔ%3C/text%3E%3Ctext x='108' y='128' font-size='30'%3E∞%3C/text%3E%3Ctext x='248' y='250' font-size='24' transform='rotate(6 248 250)'%3Eθ%3C/text%3E%3Ctext x='24' y='272' font-size='24' transform='rotate(-8 24 272)'%3Eα%3C/text%3E%3C/g%3E%3C/svg%3E");
  background-attachment: fixed;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
/* Let the doodle watermark show through the grey listing sections */
section[style*="background:var(--bg)"],
main section[style*="background: var(--bg)"] { background-color: transparent !important; }
img { max-width: 100%; display: block; }
a { text-decoration: none; }

/* ── Scrollbar ───────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: #f1f5f9; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* ── Header ──────────────────────────────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, .95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  height: 64px;
  display: flex;
  align-items: center;
}
.site-header .inner {
  max-width: 1152px;
  margin: 0 auto;
  padding: 1rem 1.5rem;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.logo {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-weight: 800;
  font-size: 1.2rem;
  color: var(--primary);
  letter-spacing: -.02em;
}
.logo-img  { height: 34px; width: auto; display: block; }
.header-brand { display: flex; flex-direction: row; align-items: center; gap: 1.5rem; }

.header-author {
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: .02em;
  white-space: nowrap;
}

.nav-desktop { display: flex; align-items: center; gap: 1.75rem; }
.nav-link {
  font-size: .9375rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: color .15s;
  position: relative;
  white-space: nowrap;
}
.nav-link:hover, .nav-link.active { color: var(--primary); }
.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: -4px; left: 0; right: 0;
  height: 2px;
  background: var(--primary);
  border-radius: 2px;
}

/* Dropdown */
.nav-dropdown { position: relative; }
.nav-dropdown-trigger {
  display: flex; align-items: center; gap: 4px;
  font-size: .9375rem; font-weight: 500; color: var(--text-secondary);
  background: none; border: none; cursor: pointer;
  padding: 0; transition: color .15s;
}
.nav-dropdown-trigger:hover { color: var(--primary); }
.nav-dropdown-panel {
  position: absolute; top: calc(100% + 8px); left: 50%;
  transform: translateX(-50%);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: .5rem;
  min-width: 200px;
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity .15s, transform .15s;
  transform: translateX(-50%) translateY(-4px);
}
.nav-dropdown-panel::before {
  content: '';
  position: absolute;
  top: -16px;
  left: -8px; right: -8px;
  height: 16px;
}
.nav-dropdown:hover .nav-dropdown-panel {
  opacity: 1; visibility: visible; pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}
.nav-dropdown-item {
  display: block; padding: .5rem .875rem;
  border-radius: 8px; font-size: .875rem; font-weight: 500;
  color: var(--text-secondary); transition: all .12s;
}
.nav-dropdown-item:hover { background: #e8f4f8; color: var(--primary); }
.nav-class-link,
.mobile-nav-link.nav-class-link { display: flex; align-items: center; justify-content: space-between; gap: .875rem; }
.nav-class-count {
  flex-shrink: 0; min-width: 1.75rem; padding: .1rem .45rem; border-radius: 99px;
  font-size: .75rem; font-weight: 700; text-align: center; font-variant-numeric: tabular-nums;
  color: var(--cls); background: rgba(100,116,139,.12);
  background: color-mix(in srgb, var(--cls) 14%, transparent);
}
[data-theme="dark"] .nav-class-count { color: color-mix(in srgb, var(--cls) 60%, #fff); background: color-mix(in srgb, var(--cls) 25%, transparent); }

.btn-nav {
  padding: .5rem 1.125rem;
  background: var(--warm);
  color: #fff;
  border-radius: 8px;
  font-size: .875rem;
  font-weight: 600;
  transition: background .15s, transform .1s;
  white-space: nowrap;
}
.btn-nav:hover { background: var(--warm-dark); }

/* Mobile menu button */
.btn-hamburger {
  display: none;
  padding: .5rem; border: none; background: none; cursor: pointer;
  color: var(--text-secondary); border-radius: 8px;
}
.btn-hamburger:hover { background: var(--bg); }

/* Mobile menu */
.mobile-menu {
  display: none;
  position: fixed;
  top: 64px; left: 0; right: 0;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 8px 24px rgba(0,0,0,.10);
  z-index: 99;
  padding: 1rem;
  max-height: calc(100vh - 64px);
  overflow-y: auto;
}
.mobile-menu.open { display: block; }
.mobile-nav-link {
  display: block; padding: .625rem 1rem;
  border-radius: 8px; font-weight: 500; color: var(--text-secondary);
  transition: all .12s;
}
.mobile-nav-link:hover { background: #e8f4f8; color: var(--primary); }
.mobile-nav-label {
  padding: .25rem 1rem;
  font-size: .6875rem; font-weight: 700; letter-spacing: .08em;
  color: var(--text-muted); text-transform: uppercase; margin-top: .5rem;
}

/* ── Hero ─────────────────────────────────────────────────────────────────── */
.hero {
  position: relative;
  background-color: #1a3d52;
  background-size: cover;
  background-position: center 40%;
  overflow: hidden;
  padding: 6rem 1.5rem;
  text-align: center;
  color: #fff;
}
.hero-pattern {
  position: absolute; inset: 0;
  background:
    linear-gradient(to bottom,
      rgba(12, 32, 46, 0.72) 0%,
      rgba(15, 38, 55, 0.78) 60%,
      rgba(10, 28, 42, 0.88) 100%);
}
.math-float {
  position: absolute;
  font-size: 3.5rem; font-weight: 800;
  color: rgba(255,255,255,.22);
  user-select: none; pointer-events: none;
  animation: float 6s ease-in-out infinite;
  text-shadow: 0 0 32px rgba(255,255,255,.15);
  line-height: 1;
}
@keyframes float {
  0%   { transform: translateY(0)     rotate(0deg);  }
  30%  { transform: translateY(-22px) rotate(3deg);  }
  60%  { transform: translateY(-10px) rotate(-2deg); }
  100% { transform: translateY(0)     rotate(0deg);  }
}
.hero-badge {
  display: inline-flex; align-items: center; gap: .375rem;
  background: rgba(255,255,255,.15); border: 1px solid rgba(255,255,255,.25);
  border-radius: 999px; padding: .375rem .875rem;
  font-size: .8125rem; font-weight: 600; letter-spacing: .04em;
  color: rgba(255,255,255,.9); margin-bottom: 1.5rem;
}
.hero-title {
  font-size: clamp(2rem, 5vw, 3.25rem);
  font-weight: 800; letter-spacing: -.03em;
  line-height: 1.15; margin-bottom: 1.25rem;
}
.hero-subtitle {
  font-size: clamp(1rem, 2vw, 1.2rem);
  color: rgba(255,255,255,.80); max-width: 560px;
  margin: 0 auto 2.25rem; line-height: 1.65;
}
.hero-badge--motto { text-transform: uppercase; letter-spacing: .16em; font-size: .75rem; font-weight: 700; padding: .45rem 1rem; }
.hero-badge--motto span { color: var(--warm-light, #fbbf24); }
.hero-subtitle--tight { margin-bottom: .875rem; font-weight: 500; color: rgba(255,255,255,.88); }
.hero-counter {
  display: inline-block; margin: 0 auto 2.25rem;
  font-size: clamp(.9375rem, 1.8vw, 1.0625rem); color: rgba(255,255,255,.8);
}
.hero-counter strong {
  color: #fbbf24; font-weight: 800; font-size: 1.35em;
  font-variant-numeric: tabular-nums;
}
.hero-ctas { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

/* Tags ασκήσεων */
.article-tags {
  display: flex; flex-wrap: wrap; gap: .4rem .5rem; margin-top: 1.5rem;
  padding: .875rem 1rem; border-radius: 12px; background: var(--primary-dark, #1f6a8a);
}
.tag-chip {
  display: inline-flex; align-items: center; gap: .3rem; padding: .25rem .65rem; border-radius: 99px;
  background: rgba(255,255,255,.14); color: #fff; font-size: .75rem; font-weight: 600; letter-spacing: .02em;
  text-decoration: none; transition: background .15s;
}
.tag-chip::before { content: '#'; opacity: .6; }
.tag-chip:hover { background: rgba(255,255,255,.28); color: #fff; }
.tag-active {
  display: inline-flex; align-items: center; gap: .5rem; margin-top: 1.25rem; padding: .4rem .5rem .4rem .9rem;
  border-radius: 99px; background: #fff; color: var(--primary-dark, #1f6a8a); font-size: .8125rem; font-weight: 700;
}
.tag-active button {
  border: 0; cursor: pointer; width: 1.5rem; height: 1.5rem; border-radius: 50%;
  background: rgba(31,106,138,.12); color: inherit; font-size: .9rem; line-height: 1;
}

/* Κεφάλαια τάξης στη σελίδα ασκήσεων */
.ch-chips { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1.25rem; }
.ch-chip {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .45rem .55rem .45rem .9rem; border-radius: 999px; cursor: pointer;
  background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.28);
  color: #fff; font: inherit; font-size: .8125rem; font-weight: 600; text-align: left;
  transition: background .15s, border-color .15s;
}
.ch-chip:hover { background: rgba(255,255,255,.22); }
.ch-chip.active { background: #fff; border-color: #fff; color: var(--primary-dark, #1f6a8a); }
.ch-chip-n {
  min-width: 1.5rem; padding: .05rem .4rem; border-radius: 99px; text-align: center;
  background: rgba(255,255,255,.2); font-size: .75rem; font-variant-numeric: tabular-nums;
}
.ch-chip.active .ch-chip-n { background: rgba(31,106,138,.12); }
.btn-hero-primary {
  padding: .875rem 1.75rem;
  background: var(--warm); color: #fff;
  border-radius: 10px; font-weight: 700; font-size: 1rem;
  transition: background .15s, transform .15s, box-shadow .15s;
  box-shadow: 0 4px 16px rgba(217,119,6,.35);
}
.btn-hero-primary:hover { background: var(--warm-dark); transform: translateY(-2px); box-shadow: 0 6px 20px rgba(217,119,6,.45); }
.btn-hero-secondary {
  padding: .875rem 1.75rem;
  background: rgba(255,255,255,.15); color: #fff;
  border: 2px solid rgba(255,255,255,.4);
  border-radius: 10px; font-weight: 700; font-size: 1rem;
  transition: background .15s;
}
.btn-hero-secondary:hover { background: rgba(255,255,255,.25); }
.hero-stats {
  display: flex; gap: 2.5rem; justify-content: center; flex-wrap: wrap;
  margin-top: 3rem; padding-top: 2rem;
  border-top: 1px solid rgba(255,255,255,.2);
}
.hero-stat-num  { font-size: 1.75rem; font-weight: 800; }
.hero-stat-label{ font-size: .8125rem; color: rgba(255,255,255,.65); margin-top: .125rem; }

/* Class hero */
.class-hero {
  padding: 3.5rem 1.5rem;
  color: #fff; position: relative; overflow: hidden;
}
.class-hero-pattern {
  position: absolute; inset: 0;
  background: radial-gradient(circle at 80% 50%, rgba(255,255,255,.1) 0%, transparent 60%);
}

/* ── Cards ────────────────────────────────────────────────────────────────── */
.article-card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  overflow: hidden;
  display: flex; flex-direction: column;
  transition: transform .2s ease, box-shadow .2s ease;
}
.article-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}
.card-body { padding: 1.5rem; flex: 1; display: flex; flex-direction: column; }
.card-meta { display: flex; align-items: center; gap: .5rem; margin-bottom: .75rem; flex-wrap: wrap; }
.card-title {
  font-size: 1rem; font-weight: 700;
  color: var(--text); line-height: 1.4;
  margin-bottom: .5rem; transition: color .15s;
}
.article-card:hover .card-title { color: var(--primary); }
.card-excerpt {
  font-size: .875rem; color: var(--text-secondary);
  line-height: 1.65; margin-bottom: 1rem; flex: 1;
}
/* Full statement inside card */
.card-statement {
  font-size: .875rem; color: var(--text-secondary);
  line-height: 1.7; margin-bottom: 1rem; flex: 1;
  background: var(--bg); border-left: 3px solid var(--border);
  border-radius: 0 8px 8px 0; padding: .75rem 1rem;
  overflow-x: auto;
}
.card-statement p { margin-bottom: .5rem; }
.card-statement p:last-child { margin-bottom: 0; }
.card-statement-label {
  display: block; font-size: .6875rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .06em;
  color: var(--text-muted); margin-bottom: .375rem;
}
.card-footer {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: auto;
}
.card-category { font-size: .75rem; color: var(--text-muted); font-weight: 500; }
.card-link {
  font-size: .875rem; font-weight: 600; color: var(--warm);
  transition: color .15s;
}
.card-link:hover { color: var(--warm-dark); text-decoration: underline; }

/* Class card */
.class-card {
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  overflow: hidden;
  transition: transform .18s, box-shadow .18s, border-color .18s;
  display: flex; flex-direction: column;
  background: var(--surface); color: var(--text);
  text-decoration: none;
}
.class-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary-light);
}
.class-card--featured {
  border-color: var(--primary);
  border-width: 1.5px;
}
.class-card-bar { height: 5px; flex-shrink: 0; }
.class-card-body { padding: 1.25rem 1.25rem .75rem; flex: 1; }
.class-card-icon-wrap {
  width: 38px; height: 38px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: .875rem; flex-shrink: 0;
}
.class-card-header { display: flex; align-items: center; gap: .5rem; margin-bottom: .5rem; flex-wrap: wrap; }
.class-card-name { font-size: 1.0625rem; font-weight: 700; }
.class-card-badge {
  font-size: .6875rem; font-weight: 600;
  background: #e4f2f8; color: var(--primary-dark);
  padding: .15rem .5rem; border-radius: 999px; letter-spacing: .03em;
}
.class-card-desc { font-size: .875rem; color: var(--text-secondary); line-height: 1.6; }
.class-card-footer {
  display: flex; align-items: center; justify-content: space-between;
  padding: .875rem 1.25rem;
  border-top: 1px solid var(--border);
}
.class-card-count { font-size: .8125rem; color: var(--text-muted); }
.class-card-arrow {
  font-size: .8125rem; font-weight: 600;
  display: flex; align-items: center; gap: .25rem;
}

/* ── Badge / Chip ─────────────────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center;
  padding: .2rem .625rem; border-radius: 999px;
  font-size: .6875rem; font-weight: 700; letter-spacing: .04em;
  white-space: nowrap;
}
.badge-blue   { background: #d4edf5; color: #1f6a8a; }
.badge-indigo { background: #cde6ef; color: #1a5a76; }
.badge-green  { background: #DCFCE7; color: #166534; }
.read-time { font-size: .75rem; color: var(--text-muted); }

/* ── Filter chips ─────────────────────────────────────────────────────────── */
.filter-chips { display: flex; gap: .5rem; flex-wrap: wrap; }
.chip {
  padding: .375rem .875rem;
  border-radius: 999px; font-size: .875rem; font-weight: 500;
  cursor: pointer; border: 2px solid var(--border);
  background: var(--surface); color: var(--text-secondary);
  transition: all .15s; white-space: nowrap;
  font-family: inherit;
}
.chip:hover { border-color: var(--primary-light); color: var(--primary); background: #e8f4f8; }
.chip.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ── Search ───────────────────────────────────────────────────────────────── */
.search-wrap { position: relative; }
.search-icon {
  position: absolute; left: .875rem; top: 50%;
  transform: translateY(-50%); color: var(--text-muted); pointer-events: none;
}
.search-input {
  width: 100%; padding: .75rem 1rem .75rem 2.75rem;
  border-radius: 999px; border: 2px solid var(--border);
  font-size: .9375rem; font-family: inherit;
  background: var(--surface); color: var(--text);
  outline: none; transition: border-color .15s, box-shadow .15s;
}
.search-input:focus {
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(59,130,246,.15);
}
.search-input::placeholder { color: var(--text-muted); }

/* ── Breadcrumbs ──────────────────────────────────────────────────────────── */
.breadcrumb { display: flex; align-items: center; gap: .375rem; flex-wrap: wrap; }
.breadcrumb-item { font-size: .8125rem; color: var(--text-muted); }
.breadcrumb-item a { color: var(--text-muted); transition: color .12s; }
.breadcrumb-item a:hover { color: var(--primary); }
.breadcrumb-item.current { color: var(--primary); font-weight: 600; }
.breadcrumb-sep { color: #CBD5E1; font-size: .75rem; }

/* Breadcrumbs on dark/gradient hero backgrounds */
section[style*="linear-gradient"] .breadcrumb-item,
section[style*="linear-gradient"] .breadcrumb-item a { color: rgba(255,255,255,.7); }
section[style*="linear-gradient"] .breadcrumb-item a:hover { color: #fff; }
section[style*="linear-gradient"] .breadcrumb-item.current { color: rgba(255,255,255,.95); font-weight: 600; }
section[style*="linear-gradient"] .breadcrumb-sep { color: rgba(255,255,255,.35); }

/* ── Grids ────────────────────────────────────────────────────────────────── */
.articles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}
.classes-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1.25rem;
}
/* ── Sections ─────────────────────────────────────────────────────────────── */
.section { padding: 4rem 1.5rem; }
.section-sm { padding: 2.5rem 1.5rem; }
.container { max-width: 1152px; margin: 0 auto; }
.container-article { max-width: 780px; margin: 0 auto; }
.section-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 2rem; gap: 1rem;
}
.section-title { font-size: 1.5rem; font-weight: 800; letter-spacing: -.02em; color: var(--text); }
.section-link { font-size: .875rem; font-weight: 600; color: var(--warm); white-space: nowrap; }
.section-link:hover { color: var(--warm-dark); text-decoration: underline; }

/* ── Article content ──────────────────────────────────────────────────────── */
.content-block {
  background: var(--surface); border-radius: var(--radius);
  border: 1px solid var(--border); padding: 1.75rem;
  margin-bottom: 1.5rem;
}
.content-block-header {
  display: flex; align-items: center; gap: .75rem;
  margin-bottom: 1.25rem; padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}
.content-block-icon {
  width: 36px; height: 36px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: .9375rem; font-weight: 700; flex-shrink: 0;
}
.content-block-icon.statement { background: #F1F5F9; color: #475569; }
.content-block-icon.solution  { background: #d4edf5; color: var(--primary); }
.content-block-label { font-weight: 700; font-size: 1rem; }
.content-prose {
  font-size: 1.0625rem; line-height: 1.85; color: var(--text);
}
.content-prose p { margin-bottom: .875rem; }
.content-prose p:last-child { margin-bottom: 0; }
.content-prose strong { font-weight: 700; color: var(--primary-dark); }
.theory-block { border-left: 4px solid #e09a30; background: #FFFBF3; }
/* Εκφώνηση: το «packet» πλαίσιο του πελάτη από το QuickLaTeX
   (rounded corners=1mm, draw, drop shadow, top color=color1!20, bottom color=color2!30,
    color1 = RGB 189,228,233, color2 = RGB 66,202,219) */
.statement-block {
  background: linear-gradient(180deg, #F2FAFB 0%, #C6EFF4 100%);
  border: 1px solid #3f4a52; border-radius: 4px;
  box-shadow: 4px 4px 0 rgba(0, 0, 0, .28);
}
.statement-block .content-block-header { border-bottom-color: rgba(66, 202, 219, .45); }
.statement-block .content-block-icon.statement { background: rgba(255, 255, 255, .7); }
.statement-block .content-prose strong { color: inherit; }
/* Χωρίς πλαίσιο στο WordPress → λευκό μπλοκ */
.theory-plain, .statement-plain { border-left: 4px solid #94A3B8; }
/* [frame color="ciel"] του WordPress: powderblue, χωρίς περίγραμμα, κεντραρισμένο κείμενο */
.content-block.frame-ciel { background: #B0E0E6; border: 0; border-radius: 0; box-shadow: none; }
.frame-ciel .content-block-header { border-bottom-color: rgba(43, 43, 43, .15); }
.frame-ciel .content-block-icon.theory { background: rgba(255, 255, 255, .6); }
.frame-ciel .content-prose { text-align: center; color: #2b2b2b; }
.frame-ciel .content-prose strong { color: inherit; }
/* Κάρτες: ίδια πλαίσια με τη σελίδα της άσκησης */
.card-statement.frame-ciel { background: #B0E0E6; border-left: 0; border-radius: 0; text-align: center; color: #2b2b2b; }
.card-statement.card-packet {
  background: linear-gradient(180deg, #F2FAFB 0%, #C6EFF4 100%); color: var(--text);
  border: 1px solid #3f4a52; border-radius: 4px; box-shadow: 3px 3px 0 rgba(0, 0, 0, .28);
}
/* τα χρωματιστά πλαίσια έχουν το ύψος του κειμένου τους, όπως στο WordPress (όχι όλη την κάρτα) */
.card-statement.frame-ciel, .card-statement.card-packet { flex: 0 0 auto; margin-bottom: 1.25rem; }
.card-statement.frame-ciel .card-statement-label, .card-statement.card-packet .card-statement-label { text-align: left; color: rgba(15, 23, 42, .55); }
.card-statement.frame-ciel strong, .card-statement.card-packet strong { color: inherit; }
.content-block-icon.theory { background: #FCEBD0; color: #92600f; }
.theory-list { margin: .5rem 0 0; padding-left: 1.25rem; list-style: disc; }
.theory-list li { margin-bottom: .5rem; }
.theory-list li::marker { color: #e09a30; }
.solution-pages { display: grid; gap: 1rem; max-width: 720px; margin: 0 auto; }
.solution-pages img {
  display: block; width: 100%; height: auto; aspect-ratio: 1200 / 1697;
  border: 1px solid var(--border); border-radius: 8px; background: #fff;
}
.draft-banner {
  margin-bottom: 1.25rem; padding: .75rem 1rem; border-radius: 8px;
  background: #FEF3C7; color: #92400E; font-weight: 600; font-size: .9375rem;
}
.article-source {
  margin: 1.25rem 0 0; font-size: .875rem; line-height: 1.7; color: var(--text-muted);
}
.article-source p { margin: 0 0 .75rem; }
.article-source a { color: var(--primary); text-decoration: underline; }
.article-source img { display: inline-block; margin-bottom: .25rem; }
.enum-list { margin: .75rem 0 0; padding-left: 1.5rem; list-style: decimal; }
.enum-list li { margin-bottom: .5rem; }
/* λίστες με δικές τους ετικέτες (enumerate [α)], \item[…], tasks) */
.enum-custom { list-style: none; padding-left: 0; }
.enum-custom > li { position: relative; padding-left: 2.4em; }
.enum-custom > li::before { content: attr(data-l); position: absolute; left: 0; font-weight: 600; }
.tasks-cols { display: grid; grid-template-columns: repeat(var(--cols, 2), minmax(0, 1fr)); gap: .25rem 1.5rem; }
@media (max-width: 640px) { .tasks-cols { grid-template-columns: repeat(min(var(--cols, 2), 2), minmax(0, 1fr)); } }

/* Math overflow: κύλιση μόνο στις εξισώσεις που έχουν δική τους γραμμή.
   Οι τύποι μέσα στο κείμενο ΔΕΝ πρέπει να έχουν overflow, αλλιώς ο browser τους στοιχίζει
   με την κάτω άκρη τους και «ανεβαίνουν» πάνω από τη γραμμή του κειμένου. */
mjx-container[display="true"] { overflow-x: auto; overflow-y: hidden; max-width: 100%; padding: 2px 0; }

/* ── FAQ ──────────────────────────────────────────────────────────────────── */
.faq-item { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; margin-bottom: .75rem; }
.faq-trigger {
  width: 100%; padding: 1rem 1.25rem;
  display: flex; justify-content: space-between; align-items: center;
  background: var(--surface); border: none; cursor: pointer;
  font-family: inherit; font-size: .9375rem; font-weight: 600;
  color: var(--text); text-align: left; transition: background .12s;
}
.faq-trigger:hover { background: #F8FAFC; }
.faq-icon { flex-shrink: 0; color: var(--primary); font-size: 1.25rem; line-height: 1; transition: transform .2s; }
.faq-trigger.open .faq-icon { transform: rotate(45deg); }
.faq-body {
  max-height: 0; overflow: hidden;
  transition: max-height .3s ease, padding .3s ease;
  background: #F8FAFC; font-size: .9375rem; color: var(--text-secondary); line-height: 1.7;
}
.faq-body.open { max-height: 300px; padding: .875rem 1.25rem 1rem; }

/* ── Features section ─────────────────────────────────────────────────────── */
.features-section {
  background: var(--bg);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.features-header { text-align: center; margin-bottom: 3rem; }
.features-sub { color: var(--text-secondary); margin-top: .375rem; font-size: .9375rem; }
.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.feature-card {
  padding: 2rem;
  background: var(--bg);
}
.feature-icon-wrap {
  width: 40px; height: 40px; border-radius: 10px;
  background: #e4f2f8;
  display: flex; align-items: center; justify-content: center;
  color: var(--primary); margin-bottom: 1rem; flex-shrink: 0;
}
.feature-title { font-size: 1rem; font-weight: 700; margin-bottom: .375rem; color: var(--text); }
.feature-desc  { font-size: .875rem; color: var(--text-secondary); line-height: 1.7; }

@media (max-width: 768px) {
  .features-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
  .features-grid { grid-template-columns: 1fr; }
}

/* ── CTA banner (full-width animated) ────────────────────────────────────── */
.cta-full {
  position: relative;
  overflow: hidden;
  padding: 5.5rem 1.5rem;
  text-align: center;
  background: linear-gradient(135deg, #0a1f33 0%, #0f3550 25%, #1a5c82 50%, #0f3550 75%, #0a1f33 100%);
  background-size: 300% 300%;
  animation: ctaGrad 10s ease infinite;
}
@keyframes ctaGrad {
  0%,100% { background-position: 0% 50%; }
  50%      { background-position: 100% 50%; }
}

/* Floating math symbols */
.cta-syms { position: absolute; inset: 0; pointer-events: none; }
.cta-sym {
  position: absolute;
  bottom: -3rem;
  color: rgba(255,255,255,.07);
  font-family: Georgia, serif;
  font-weight: 400;
  line-height: 1;
  user-select: none;
  animation: ctaFloat linear infinite;
}
@keyframes ctaFloat {
  0%   { transform: translateY(0) rotate(-5deg);   opacity: 0; }
  8%   { opacity: 1; }
  92%  { opacity: 1; }
  100% { transform: translateY(-110vh) rotate(15deg); opacity: 0; }
}

/* Content */
.cta-full-content { position: relative; z-index: 1; max-width: 600px; margin: 0 auto; }
.cta-full-title {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 800; color: #fff;
  letter-spacing: -.03em; margin-bottom: .875rem;
}
.cta-full-sub {
  color: rgba(255,255,255,.75);
  font-size: 1.0625rem; line-height: 1.7;
  margin-bottom: 2.25rem;
}
/* Share button on gradient heroes (class / chapter / paragraph) */
.btn-share-hero {
  display: inline-flex; align-items: center; gap: .45rem;
  padding: .45rem 1.05rem; border-radius: 999px;
  background: rgba(255,255,255,.15); border: 1px solid rgba(255,255,255,.35);
  color: #fff; font-size: .8125rem; font-weight: 600;
  cursor: pointer; font-family: inherit;
  transition: background .15s, border-color .15s;
}
.btn-share-hero:hover { background: rgba(255,255,255,.28); }
.btn-share-hero.copied { background: #dcfce7; border-color: #86efac; color: #166534; }

.btn-cta-white {
  display: inline-block; padding: .875rem 2rem;
  background: #fff; color: var(--primary);
  border-radius: 10px; font-weight: 700; font-size: 1rem;
  transition: transform .15s, box-shadow .15s;
}
.btn-cta-white:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0,0,0,.2); }

/* ── Empty / loading states ───────────────────────────────────────────────── */
.empty-state { text-align: center; padding: 4rem 2rem; color: var(--text-muted); }
.empty-state-icon { font-size: 3rem; margin-bottom: 1rem; }
.empty-state-msg { font-size: 1rem; }

/* ── Footer ───────────────────────────────────────────────────────────────── */
.site-footer { background: #0d3d52; color: #94A3B8; }
.footer-inner { max-width: 1152px; margin: 0 auto; padding: 3.5rem 1.5rem 2rem; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 3rem; margin-bottom: 2.5rem; }
.footer-brand-name { color: #fff; font-weight: 800; font-size: 1.1rem; margin-bottom: .625rem; display: flex; align-items: center; gap: .375rem; }
.footer-brand-desc { font-size: .875rem; color: #64748B; line-height: 1.65; max-width: 280px; }
.footer-col-title  { color: #fff; font-weight: 700; font-size: .9375rem; margin-bottom: 1rem; }
.footer-link { display: block; font-size: .875rem; color: #64748B; margin-bottom: .5rem; transition: color .12s; }
.footer-link:hover { color: #94A3B8; }
.footer-social {
  display: flex; gap: .625rem; flex-wrap: wrap; margin-top: 1.25rem;
}
.footer-social-link {
  display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 8px;
  background: rgba(255,255,255,.08); color: #94A3B8;
  transition: background .15s, color .15s;
}
.footer-social-link:hover { background: rgba(255,255,255,.18); color: #fff; }

.footer-bottom {
  border-top: 1px solid #1a5068; padding-top: 1.5rem;
  display: flex; align-items: center; justify-content: center;
  gap: 1.5rem; flex-wrap: wrap;
  font-size: .8125rem; color: #94a3b8;
}

/* ── Header search ────────────────────────────────────────────────────────── */
.header-search-wrap { position: relative; display: flex; align-items: center; }
.header-search-btn {
  display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 8px; border: none;
  background: none; cursor: pointer; color: var(--text-secondary);
  transition: background .15s, color .15s;
}
.header-search-btn:hover { background: var(--bg); color: var(--primary); }
.header-search-panel {
  position: absolute; top: calc(100% + 10px); right: 0;
  background: var(--surface); border: 1.5px solid var(--border);
  border-radius: 12px; box-shadow: var(--shadow-md);
  width: 300px; padding: .5rem;
  opacity: 0; visibility: hidden; pointer-events: none;
  transform: translateY(-6px);
  transition: opacity .18s, transform .18s, visibility .18s;
  z-index: 200;
}
.header-search-panel.open {
  opacity: 1; visibility: visible; pointer-events: auto; transform: translateY(0);
}
.header-search-panel form {
  display: flex; align-items: center; gap: .375rem;
}
.header-search-input {
  flex: 1; padding: .625rem .875rem;
  border: 1.5px solid var(--border); border-radius: 8px;
  font-size: .9375rem; font-family: inherit; outline: none;
  background: var(--bg); color: var(--text);
  transition: border-color .15s;
}
.header-search-input:focus { border-color: var(--primary); }
.header-search-submit {
  display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 8px; border: none;
  background: var(--warm); color: #fff; cursor: pointer; flex-shrink: 0;
  transition: background .15s;
}
.header-search-submit:hover { background: var(--warm-dark); }
.header-search-panel:has(.header-search-results:not(:empty)) { width: 380px; }
.header-search-results:not(:empty) {
  margin: .5rem -.5rem -.5rem; border-top: 1px solid var(--border);
  border-radius: 0 0 11px 11px; overflow-y: auto; max-height: min(420px, 70vh);
}
.header-search-results .hero-search-result { padding: .65rem .875rem; }

@media (max-width: 480px) {
  .header-search-panel,
  .header-search-panel:has(.header-search-results:not(:empty)) { width: calc(100vw - 2rem); right: -1rem; }
}

/* ── Comments ──────────────────────────────────────────────────────────────── */
.comments-section {
  margin-top: 3rem; padding-top: 2.5rem;
  border-top: 1px solid var(--border);
}
.comments-count {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 24px; height: 24px; border-radius: 999px;
  background: var(--warm); color: #fff;
  font-size: .75rem; font-weight: 700;
  padding: 0 .4rem; margin-left: .5rem; vertical-align: middle;
}
.comments-list { margin-bottom: 2rem; display: flex; flex-direction: column; gap: 1.25rem; }
.comments-empty { color: var(--text-muted); font-size: .9375rem; }

.comment-item {
  display: flex; gap: 1rem; align-items: flex-start;
}
.comment-item--new { animation: commentIn .35s ease; }
@keyframes commentIn { from { opacity:0; transform:translateY(8px); } to { opacity:1; transform:none; } }

.comment-avatar {
  width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, var(--primary-light), var(--primary));
  color: #fff; font-size: .875rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.comment-body { flex: 1; min-width: 0; }
.comment-meta { display: flex; align-items: center; gap: .75rem; margin-bottom: .375rem; flex-wrap: wrap; }
.comment-name { font-weight: 700; font-size: .9375rem; color: var(--text); }
.comment-date { font-size: .8125rem; color: var(--text-muted); }
.comment-text { font-size: .9375rem; color: var(--text-secondary); line-height: 1.7; word-break: break-word; }

/* Comment form */
.comment-form-wrap {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.75rem; margin-top: .5rem;
}
.comment-form-title { font-size: 1.0625rem; font-weight: 700; margin-bottom: 1.25rem; }
.comment-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-group { display: flex; flex-direction: column; gap: .375rem; }
.form-label { font-size: .875rem; font-weight: 600; color: var(--text); }
.req { color: var(--warm); }
.form-hint { font-weight: 400; color: var(--text-muted); font-size: .8125rem; }
.form-input {
  padding: .625rem .875rem; border-radius: 8px;
  border: 1.5px solid var(--border); font-size: .9375rem;
  font-family: inherit; background: var(--surface); color: var(--text);
  outline: none; transition: border-color .15s, box-shadow .15s;
}
.form-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(47,139,176,.12); }
.form-textarea {
  padding: .625rem .875rem; border-radius: 8px;
  border: 1.5px solid var(--border); font-size: .9375rem;
  font-family: inherit; background: var(--surface); color: var(--text);
  outline: none; resize: vertical; min-height: 110px;
  transition: border-color .15s, box-shadow .15s; width: 100%;
}
.form-textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(47,139,176,.12); }
.char-count { font-size: .75rem; color: var(--text-muted); text-align: right; margin-top: .25rem; }

.captcha-wrap {
  display: flex; align-items: center; gap: .625rem; flex-wrap: wrap;
  margin-top: 1rem; padding: .875rem 1rem;
  background: var(--surface); border: 1.5px solid var(--border); border-radius: 8px;
}
.captcha-label { font-size: .875rem; font-weight: 600; color: var(--text-muted); }
.captcha-eq { font-size: .9375rem; color: var(--text); }
.captcha-input {
  width: 64px; padding: .5rem .625rem; border-radius: 6px;
  border: 1.5px solid var(--border); font-size: 1rem; font-family: inherit;
  text-align: center; outline: none; transition: border-color .15s;
  background: var(--surface); color: var(--text);
}
.captcha-input:focus { border-color: var(--primary); }

.form-msg { margin-top: .875rem; font-size: .9rem; font-weight: 500; min-height: 1.25rem; border-radius: 6px; padding: .5rem .875rem; display: none; }
.form-msg--error   { display: block; background: #FEF2F2; color: #991B1B; border: 1px solid #FCA5A5; }
.form-msg--success { display: block; background: #ECFDF5; color: #065F46; border: 1px solid #6EE7B7; }

.btn-comment-submit {
  display: inline-flex; align-items: center; gap: .5rem;
  margin-top: 1.25rem; padding: .75rem 1.5rem;
  background: var(--warm); color: #fff; border: none;
  border-radius: 9px; font-size: .9375rem; font-weight: 700;
  font-family: inherit; cursor: pointer;
  transition: background .15s, transform .1s;
  box-shadow: 0 3px 10px rgba(217,119,6,.25);
}
.btn-comment-submit:hover { background: var(--warm-dark); transform: translateY(-1px); }

@media (max-width: 640px) {
  .comment-form-grid { grid-template-columns: 1fr; }
  .captcha-wrap { flex-direction: column; align-items: flex-start; }
}

/* ── Archive page filter bar ──────────────────────────────────────────────── */
.archive-filter-bar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 1.25rem 1.5rem;
  position: fixed;
  top: 64px;
  left: 0;
  right: 0;
  z-index: 99;
}
.archive-filter-bar .archive-toolbar { margin-bottom: 0; }
/* Push main content below fixed filter bar */
.archive-filter-bar ~ main { padding-top: 6rem; }

.archive-toolbar {
  display: flex; gap: 1rem; flex-wrap: wrap;
  align-items: center; margin-bottom: 2.5rem;
}
.archive-search { flex: 1; min-width: 220px; }

/* ── Article header ───────────────────────────────────────────────────────── */
.article-header { margin-bottom: 2rem; }
.article-title { font-size: clamp(1.5rem, 3.5vw, 2.25rem); font-weight: 800; letter-spacing: -.02em; line-height: 1.2; margin-bottom: 1rem; }
.article-meta { display: flex; align-items: center; gap: .875rem; flex-wrap: wrap; }

/* ── Related posts ────────────────────────────────────────────────────────── */
.related-section { margin-top: 3.5rem; padding-top: 2.5rem; border-top: 1px solid var(--border); }

/* ── Utilities ────────────────────────────────────────────────────────────── */
.divider { border: none; border-top: 1px solid var(--border); margin: 2rem 0; }
.text-muted { color: var(--text-muted); }
.text-sm { font-size: .875rem; }
.mt-2 { margin-top: .5rem; }

/* ── Responsive ───────────────────────────────────────────────────────────── */

/* Tablet landscape & small desktop (≤900px) */
@media (max-width: 900px) {
  .nav-desktop, .btn-nav { display: none; }
  .btn-hamburger { display: flex; }
  .header-author { display: none; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

/* Tablet portrait (≤768px) */
@media (max-width: 768px) {
  .classes-grid  { grid-template-columns: repeat(3, 1fr); }
  .articles-grid { grid-template-columns: repeat(2, 1fr); }
  .container-article { padding: 0 1.25rem; }
}

/* Mobile (≤640px) */
@media (max-width: 640px) {
  .articles-grid { grid-template-columns: 1fr; }
  .classes-grid { grid-template-columns: repeat(2, 1fr); }

  /* Article blocks: more width for display math */
  .container-article { padding: 0 1rem; }
  .content-block { padding: 1.25rem 1rem; }
  .content-prose mjx-container[display="true"] { font-size: 90% !important; }

  /* Toolbar: stack vertically on mobile */
  .archive-toolbar { flex-direction: column; }
  .archive-search { width: 100%; min-width: 0; }
  .filter-chips { flex-wrap: wrap; }

  /* Toolbar not sticky on mobile — too tall */
  .archive-filter-bar { position: static !important; }

  /* Article content: prevent math/code overflow */
  .content-prose { overflow-x: auto; word-break: break-word; }
  .content-block { overflow-x: hidden; }

  /* Author name below logo on mobile */
  .header-brand { flex-direction: column; align-items: flex-start; gap: 1px; }
  .header-author { display: block; font-size: .75rem; }

  .hero { padding: 3.5rem 1.25rem; }
  .hero-stats { gap: 1.5rem; }
  .hero-stat-num { font-size: 1.375rem; }
  .footer-grid { grid-template-columns: 1fr; gap: 2rem; }
  .section { padding: 3rem 1.25rem; }
  .section-sm { padding: 2rem 1.25rem; }
  .section-header { flex-direction: column; align-items: flex-start; gap: .5rem; }
}

/* iPhone: με γράμματα κάτω από 16px το Safari κάνει zoom όταν πατάς σε πεδίο */
@media (max-width: 900px) {
  input, textarea, select { font-size: 16px !important; }
}

/* Πολύ μικρά κινητά (iPhone SE 1ης γενιάς): πιο σφιχτή κεφαλίδα για να χωράει */
@media (max-width: 360px) {
  .site-header .inner { padding-left: .875rem; padding-right: .875rem; gap: .375rem; }
}

/* Small mobile (≤420px) */
@media (max-width: 420px) {
  .classes-grid { grid-template-columns: 1fr; }
  .hero-ctas { flex-direction: column; align-items: stretch; }
  .btn-hero-primary, .btn-hero-secondary { text-align: center; }
  .hero-stats { gap: 3rem; justify-content: center; }
  .comment-form-grid { grid-template-columns: 1fr; }
}

/* ── Pagination ───────────────────────────────────────────────────────────── */
.pagination { display: flex; justify-content: center; align-items: center; gap: .375rem; flex-wrap: wrap; }
.pg-btn {
  min-width: 2.25rem; height: 2.25rem; padding: 0 .625rem;
  border: 1.5px solid var(--border); border-radius: 8px;
  background: #fff; color: var(--text); font-size: .875rem; font-weight: 500;
  cursor: pointer; font-family: inherit; transition: all .15s;
}
.pg-btn:hover:not(:disabled) { border-color: var(--primary); color: var(--primary); }
.pg-btn.pg-active { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 700; }
.pg-btn:disabled { opacity: .35; cursor: default; }
.pg-arrow { font-size: 1rem; }

/* ── Ad banner ────────────────────────────────────────────────────────────── */
.ad-banner-wrap {
  background: var(--bg);
  border-top: 1px solid var(--border);
  padding: 1.25rem 1.5rem;
  text-align: center;
}
.ad-banner {
  display: inline-block; position: relative;
  text-decoration: none; border-radius: 8px; overflow: hidden;
}
.ad-label {
  position: absolute; top: 4px; left: 6px;
  font-size: .625rem; font-weight: 600; letter-spacing: .06em;
  color: var(--text-muted); text-transform: uppercase; z-index: 1;
}
.ad-banner img {
  display: block; max-width: 100%; height: auto; border-radius: 8px;
}

/* ── Terms page ───────────────────────────────────────────────────────────── */
.terms-body { padding: 0.5rem 0 3rem; }
.terms-intro {
  font-size: 1rem; color: var(--text-secondary); line-height: 1.8;
  padding: 1.25rem 1.5rem; background: var(--bg);
  border-left: 4px solid var(--primary-light); border-radius: 0 8px 8px 0;
  margin-bottom: 2.5rem;
}
.terms-heading {
  font-size: 1.125rem; font-weight: 700; color: var(--text);
  margin: 2.25rem 0 .75rem; padding-bottom: .5rem;
  border-bottom: 1px solid var(--border);
}
.terms-body p { font-size: .9375rem; color: var(--text-secondary); line-height: 1.8; margin-bottom: 1rem; }
.terms-list {
  list-style: none; padding: 0; margin: 0 0 1rem 0;
  display: flex; flex-direction: column; gap: .5rem;
}
.terms-list li {
  font-size: .9375rem; color: var(--text-secondary); line-height: 1.7;
  padding-left: 1.25rem; position: relative;
}
.terms-list li::before {
  content: ''; position: absolute; left: 0; top: .65em;
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--primary-light);
}
.terms-license-badge {
  display: inline-flex; align-items: center; gap: .5rem; flex-wrap: wrap;
  margin-top: 2.5rem; padding: .875rem 1.25rem;
  background: #e4f2f8; border-radius: 10px;
  font-size: .875rem; color: var(--primary-dark);
}
.terms-license-badge a { color: var(--primary); font-weight: 600; }

/* ── Print ────────────────────────────────────────────────────────────────── */
@media print {
  .site-header, .site-footer, .related-section, .mobile-menu { display: none !important; }
  .content-block { box-shadow: none; border: 1px solid #ccc; }
  .article-title { font-size: 1.5rem; }
}

/* ── Difficulty badge ─────────────────────────────────────────────────────── */
.diff-badge {
  display: inline-flex; align-items: center; gap: .3rem;
  padding: .2rem .6rem; border-radius: 999px;
  font-size: .75rem; font-weight: 700; letter-spacing: .02em;
  flex-shrink: 0;
}
.diff-badge::before {
  content: ''; width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0;
}
.diff-easy  { background: #dcfce7; color: #166534; }
.diff-easy::before  { background: #22c55e; }
.diff-medium { background: #fef9c3; color: #854d0e; }
.diff-medium::before { background: #eab308; }
.diff-hard  { background: #fee2e2; color: #991b1b; }
.diff-hard::before  { background: #ef4444; }

/* ── Expanded article cards (paragraph page) ──────────────────────────────── */
.articles-list-expanded {
  display: flex; flex-direction: column; gap: 1.5rem;
  max-width: 860px; margin: 0 auto;
}
.article-card--expanded .card-body { padding: 2rem 2.25rem; }
.card-title--lg { font-size: 1.375rem; line-height: 1.35; margin-bottom: .875rem; }
.card-statement--lg {
  font-size: 1rem; line-height: 1.8;
  padding: 1.25rem 1.5rem; margin-bottom: 1.25rem;
}
.card-statement--lg .card-statement-label { font-size: .75rem; margin-bottom: .625rem; }
.btn-card-open {
  display: inline-block; padding: .625rem 1.375rem;
  background: var(--warm); color: #fff; border-radius: 8px;
  font-size: .9375rem; font-weight: 700;
  transition: background .15s, transform .1s;
}
.btn-card-open:hover { background: var(--warm-dark); transform: translateY(-1px); }
@media (max-width: 640px) {
  .article-card--expanded .card-body { padding: 1.375rem 1.25rem; }
  .card-title--lg { font-size: 1.125rem; }
  .card-statement--lg { padding: 1rem 1.125rem; font-size: .9375rem; }
}

/* ── Chapter / Paragraph cards ────────────────────────────────────────────── */
.chapters-list { display: flex; flex-direction: column; gap: .875rem; }
.chapter-card {
  display: flex; align-items: center; gap: 1.125rem;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 1.125rem 1.375rem;
  text-decoration: none; color: var(--text);
  transition: transform .15s, box-shadow .15s, border-color .15s;
}
.chapter-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary-light);
}
.chapter-card-num {
  width: 46px; height: 46px; border-radius: 12px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.25rem; font-weight: 800;
}
.chapter-card-num--par { font-size: .9375rem; }
.chapter-card-body { min-width: 0; flex: 1; }
.chapter-card-title { font-size: 1.0625rem; font-weight: 700; margin-bottom: .2rem; }
.chapter-card:hover .chapter-card-title { color: var(--primary); }
.chapter-card-meta { font-size: .8125rem; color: var(--text-muted); }
.chapter-card-arrow { flex-shrink: 0; color: var(--text-muted); transition: color .15s, transform .15s; }
.chapter-card:hover .chapter-card-arrow { color: var(--primary); transform: translateX(3px); }

/* ── Dark mode ────────────────────────────────────────────────────────────── */
[data-theme="dark"] {
  --bg:            #0f172a;
  --surface:       #1e293b;
  --text:          #f1f5f9;
  --text-secondary:#94a3b8;
  --text-muted:    #64748b;
  --border:        #334155;
  --shadow-sm:     0 1px 3px rgba(0,0,0,.4), 0 4px 12px rgba(0,0,0,.25);
  --shadow-md:     0 4px 8px rgba(0,0,0,.5), 0 12px 28px rgba(0,0,0,.3);
}
[data-theme="dark"] body {
  background: var(--bg);
  color: var(--text);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cg font-family='Georgia,serif' fill='%23ffffff' fill-opacity='0.08'%3E%3Ctext x='28' y='64' font-size='34' transform='rotate(-12 28 64)'%3Eπ%3C/text%3E%3Ctext x='158' y='48' font-size='28' transform='rotate(8 158 48)'%3E∑%3C/text%3E%3Ctext x='224' y='132' font-size='30' transform='rotate(-6 224 132)'%3E√%3C/text%3E%3Ctext x='56' y='188' font-size='38' transform='rotate(10 56 188)'%3E∫%3C/text%3E%3Ctext x='176' y='228' font-size='26' transform='rotate(-10 176 228)'%3EΔ%3C/text%3E%3Ctext x='108' y='128' font-size='30'%3E∞%3C/text%3E%3Ctext x='248' y='250' font-size='24' transform='rotate(6 248 250)'%3Eθ%3C/text%3E%3Ctext x='24' y='272' font-size='24' transform='rotate(-8 24 272)'%3Eα%3C/text%3E%3C/g%3E%3C/svg%3E");
  background-attachment: fixed;
}
[data-theme="dark"] .site-header { background: rgba(15,23,42,.97); border-bottom-color: #1e3a52; }
/* Header text elements */
[data-theme="dark"] .header-author { color: #e2e8f0; }
[data-theme="dark"] .nav-link { color: #cbd5e1; }
[data-theme="dark"] .nav-link:hover,
[data-theme="dark"] .nav-link.active { color: var(--primary-light); }
[data-theme="dark"] .nav-dropdown-trigger { color: #cbd5e1; }
[data-theme="dark"] .nav-dropdown-trigger:hover { color: var(--primary-light); }
[data-theme="dark"] .header-search-btn { color: #94a3b8; }
[data-theme="dark"] .header-search-btn:hover { background: #1e293b; color: #e2e8f0; }
[data-theme="dark"] .btn-theme-toggle { color: #94a3b8; }
[data-theme="dark"] .btn-theme-toggle:hover { background: #1e293b; color: #e2e8f0; }
/* Mobile & nav dropdown */
[data-theme="dark"] .mobile-menu { background: #1e293b; border-color: #334155; }
[data-theme="dark"] .mobile-nav-link { color: #cbd5e1; }
[data-theme="dark"] .mobile-nav-link:hover { background: #334155; }
[data-theme="dark"] .mobile-nav-label { color: #64748b; }
[data-theme="dark"] .nav-dropdown-panel { background: #1e293b; border-color: #334155; box-shadow: 0 8px 24px rgba(0,0,0,.4); }
[data-theme="dark"] .nav-dropdown-item { color: #cbd5e1; }
[data-theme="dark"] .nav-dropdown-item:hover { background: #334155; color: #e2e8f0; }
[data-theme="dark"] .header-search-panel { background: #1e293b; border-color: #334155; }
[data-theme="dark"] .header-search-input { background: #0f172a; color: var(--text); border-color: #334155; }
[data-theme="dark"] .faq-trigger:hover { background: #334155; }
[data-theme="dark"] .faq-body { background: #0f172a; }
[data-theme="dark"] .content-block-icon.statement { background: #334155; color: var(--text-muted); }
[data-theme="dark"] .content-block-icon.solution { background: #1a3a4a; }
[data-theme="dark"] .theory-block { background: var(--surface); }
[data-theme="dark"] .statement-block { background: linear-gradient(180deg, #16323a 0%, #0f4650 100%); border-color: #5fb8c6; box-shadow: 4px 4px 0 rgba(0, 0, 0, .5); }
[data-theme="dark"] .statement-block .content-block-icon.statement { background: rgba(255, 255, 255, .12); }
[data-theme="dark"] .content-block.frame-ciel, [data-theme="dark"] .card-statement.frame-ciel { background: #1d4a52; color: #e2f3f5; }
[data-theme="dark"] .frame-ciel .content-prose { color: #e2f3f5; }
[data-theme="dark"] .card-statement.card-packet { background: linear-gradient(180deg, #16323a 0%, #0f4650 100%); border-color: #5fb8c6; color: #e2f3f5; }
[data-theme="dark"] .content-block-icon.theory { background: #3d2c10; color: #f0b960; }
[data-theme="dark"] .feature-icon-wrap { background: #1a3a4a; }
[data-theme="dark"] .pg-btn { background: var(--surface); color: var(--text); border-color: var(--border); }
[data-theme="dark"] .article-nav-btn { background: var(--surface); border-color: var(--border); }
[data-theme="dark"] .chip { background: var(--surface); border-color: var(--border); color: var(--text-secondary); }
[data-theme="dark"] .chip.active { background: var(--primary); color: #fff; border-color: var(--primary); }
[data-theme="dark"] .search-input { background: var(--surface); color: var(--text); border-color: var(--border); }
[data-theme="dark"] ::-webkit-scrollbar-track { background: #1e293b; }
[data-theme="dark"] ::-webkit-scrollbar-thumb { background: #334155; }
/* Catch all inline background:#fff sections */
[data-theme="dark"] [style*="background:#fff"] { background: var(--surface) !important; }
[data-theme="dark"] [style*="background: #fff"] { background: var(--surface) !important; }
[data-theme="dark"] [style*="background:white"] { background: var(--surface) !important; }
/* Logo swap in dark mode */
/* Στο σκούρο θέμα: λευκά γράμματα, το «4» μένει χρωματιστό */
.logo-img-dark { display: none; }
[data-theme="dark"] .logo-img-light { display: none; }
[data-theme="dark"] .logo-img-dark { display: block; }

/* Hero search dark — visible against dark hero bg */
[data-theme="dark"] .hero-search-box {
  background: rgba(255,255,255,.13);
  border: 1.5px solid rgba(255,255,255,.25);
  box-shadow: 0 4px 32px rgba(0,0,0,.4);
  backdrop-filter: blur(8px);
}
[data-theme="dark"] .hero-search-input { color: #fff; }
[data-theme="dark"] .hero-search-input::placeholder { color: rgba(255,255,255,.5); }
[data-theme="dark"] .hero-search-icon { color: rgba(255,255,255,.6); }
[data-theme="dark"] .hero-search-kbd { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.2); color: rgba(255,255,255,.6); }
[data-theme="dark"] .hero-search-dropdown { background: #1e293b; box-shadow: 0 8px 40px rgba(0,0,0,.5); }
[data-theme="dark"] .hero-search-result { border-bottom-color: #334155; }
[data-theme="dark"] .hero-search-result:hover,
[data-theme="dark"] .hero-search-result.selected { background: #334155; }
[data-theme="dark"] .hero-search-result-title { color: var(--text); }
[data-theme="dark"] .hero-search-all { background: #0f172a; color: var(--primary-light); }
[data-theme="dark"] .hero-search-all:hover { background: #334155; }

/* Captcha dark */
[data-theme="dark"] .captcha-wrap { background: #0f172a; border-color: #334155; }
[data-theme="dark"] .captcha-input { background: #1e293b; border-color: #334155; }

/* Chapter/paragraph cards dark */
[data-theme="dark"] .chapter-card { background: #1e2d40; border-color: #2d4057; }
[data-theme="dark"] .chapter-card:hover { border-color: var(--primary-light); background: #243347; }
[data-theme="dark"] .card-statement { background: #0f172a; border-left-color: #334155; }

/* Class cards dark — better contrast */
[data-theme="dark"] .class-card { background: #1e2d40; border-color: #2d4057; }
[data-theme="dark"] .class-card:hover { border-color: var(--primary-light); background: #243347; }
[data-theme="dark"] .class-card-name { color: #e2e8f0 !important; }
[data-theme="dark"] .class-card-icon-wrap { background: rgba(255,255,255,.1) !important; color: #e2e8f0 !important; }
[data-theme="dark"] .class-card-badge { background: #1a3a4a; color: var(--primary-light); }
[data-theme="dark"] .class-card-footer { border-top-color: #2d4057; }

/* ── Theme toggle switch ───────────────────────────────────────────────────── */
.theme-toggle {
  display: flex; align-items: center; gap: .4rem;
  background: none; border: none; cursor: pointer; padding: 0;
  flex-shrink: 0; color: var(--text-muted);
  transition: color .15s;
}
.theme-toggle:hover { color: var(--text); }
.theme-toggle-track {
  position: relative; width: 2.25rem; height: 1.25rem;
  background: #cbd5e1; border-radius: 999px;
  transition: background .25s;
  flex-shrink: 0;
}
.theme-toggle-thumb {
  position: absolute; top: 2px; left: 2px;
  width: 1rem; height: 1rem; border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,.25);
  transition: transform .25s, background .25s;
}
/* Dark state */
[data-theme="dark"] .theme-toggle-track { background: var(--primary); }
[data-theme="dark"] .theme-toggle-thumb { transform: translateX(1rem); }
[data-theme="dark"] .theme-toggle { color: #94a3b8; }
[data-theme="dark"] .theme-toggle:hover { color: #e2e8f0; }
.theme-toggle-sun  { color: #f59e0b; flex-shrink: 0; }
.theme-toggle-moon { color: #94a3b8; flex-shrink: 0; }
[data-theme="dark"] .theme-toggle-moon { color: var(--primary-light); }
[data-theme="dark"] .theme-toggle-sun  { color: #64748b; }

/* ── Hero search ──────────────────────────────────────────────────────────── */
.hero-search-wrap {
  position: relative;
  margin-bottom: 1.75rem;
}
.hero-search-box {
  display: flex; align-items: center;
  background: rgba(255,255,255,.96);
  border-radius: 14px;
  box-shadow: 0 4px 32px rgba(0,0,0,.18), 0 1px 4px rgba(0,0,0,.08);
  padding: 0 1rem 0 1.125rem;
  gap: .625rem;
  transition: box-shadow .2s;
}
.hero-search-box:focus-within {
  box-shadow: 0 4px 32px rgba(0,0,0,.22), 0 0 0 3px rgba(255,255,255,.35);
}
.hero-search-icon { color: #94a3b8; flex-shrink: 0; }
.hero-search-input {
  flex: 1; border: none; outline: none; background: transparent;
  font-size: 1rem; font-family: inherit; color: #1e293b;
  padding: .9rem 0; min-width: 0;
}
.hero-search-input::placeholder { color: #94a3b8; }
.hero-search-kbd {
  flex-shrink: 0; font-size: .6875rem; font-family: inherit; font-weight: 600;
  color: #94a3b8; background: #f1f5f9; border: 1px solid #e2e8f0;
  border-radius: 5px; padding: .2rem .45rem; letter-spacing: .02em;
  display: none;
}
@media (min-width: 640px) { .hero-search-kbd { display: inline; } }

.hero-search-dropdown {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 200;
  background: #fff; border-radius: 14px;
  box-shadow: 0 8px 40px rgba(0,0,0,.16), 0 1px 4px rgba(0,0,0,.06);
  overflow: hidden;
  max-height: 0; opacity: 0; pointer-events: none;
  transition: max-height .2s ease, opacity .15s;
}
.hero-search-dropdown.open {
  max-height: 420px; opacity: 1; pointer-events: auto;
}
.hero-search-result {
  display: flex; align-items: center; gap: .75rem;
  padding: .75rem 1.125rem; text-decoration: none;
  border-bottom: 1px solid #f1f5f9; transition: background .1s;
}
.hero-search-result:hover, .hero-search-result.selected { background: #f8fafc; }
.hero-search-result-main { flex: 1; min-width: 0; }
.hero-search-result-title {
  display: block; font-size: .9rem; font-weight: 600; color: #1e293b;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  margin-bottom: .2rem;
}
.hero-search-result-meta { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; }
.hero-search-result-class {
  font-size: .7rem; font-weight: 600; color: #64748b; text-transform: uppercase; letter-spacing: .04em;
}
.hero-search-all {
  display: block; padding: .75rem 1.125rem;
  font-size: .875rem; font-weight: 600; color: var(--primary);
  text-decoration: none; background: #f8fafc;
  transition: background .1s;
}
.hero-search-all:hover { background: #f1f5f9; }
.hero-search-empty {
  padding: 1rem 1.125rem; font-size: .9rem; color: #94a3b8; font-style: italic;
}

/* ── Back to top button ───────────────────────────────────────────────────── */
.back-to-top {
  position: fixed; bottom: 1.75rem; right: 1.75rem; z-index: 999;
  width: 2.75rem; height: 2.75rem; border-radius: 50%;
  background: var(--primary); color: #fff; border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 16px rgba(0,0,0,.18);
  opacity: 0; transform: translateY(10px);
  transition: opacity .25s, transform .25s, background .15s;
  pointer-events: none;
}
.back-to-top--visible { opacity: 1; transform: translateY(0); pointer-events: auto; }
.back-to-top:hover { background: var(--primary-dark); }
