:root{
  /* Editorial / Minimal (light-first) */
  --bg: #f7f6f3;
  --surface: #ffffff;
  --surface2: rgba(255,255,255,.72);
  --text: #0b1220;
  --muted: rgba(11,18,32,.62);
  --border: rgba(11,18,32,.10);
  --border2: rgba(11,18,32,.16);
  --shadow: 0 10px 30px rgba(11,18,32,.06);
  --shadow2: 0 18px 60px rgba(11,18,32,.10);
  --radius: 18px;
  --radius-sm: 14px;
  --focus: 0 0 0 .25rem rgba(11,18,32,.10);

  --font-ui: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  --font-display: Newsreader, ui-serif, Georgia, serif;

  /* Layout tokens */
  --header-offset: 0px;
  --grid-gap: 16px;

  /* Back-compat aliases used in older selectors */
  --sp-line: var(--border);
  --sp-muted: var(--muted);
  --sp-font-ui: var(--font-ui);
}

/* Optional dark mode hook (kept for future toggle) */
html[data-theme="dark"]{
  --bg:#0b0f17;
  --surface: rgba(255,255,255,.06);
  --surface2: rgba(255,255,255,.08);
  --text: rgba(255,255,255,.92);
  --muted: rgba(255,255,255,.64);
  --border: rgba(255,255,255,.12);
  --border2: rgba(255,255,255,.18);
  --shadow: 0 10px 30px rgba(0,0,0,.28);
  --shadow2: 0 18px 60px rgba(0,0,0,.40);
  --focus: 0 0 0 .25rem rgba(255,255,255,.12);

  /* Back-compat aliases used in older selectors */
  --sp-line: var(--border);
  --sp-muted: var(--muted);
  --sp-font-ui: var(--font-ui);
}

body.sp-body{
  min-height:100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Type scale */
.sp-h1{font-family:var(--font-display); font-weight:650; letter-spacing:-.01em; margin:0;}
.sp-h2{font-family:var(--font-display); font-weight:650; letter-spacing:-.01em; margin:0;}
.sp-muted{color:var(--muted);} 

/* We use a single sticky navbar (filters + tools). Keep header offset token for future variants. */

.sp-brand{
  color: var(--text);
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -.01em;
}
.sp-brand:hover{color: var(--text);}
.sp-brand-sub{font-family:var(--font-ui); font-weight:600; color: var(--muted); margin-left:.6rem; font-size:.92rem;}

/* Publication tools (inside navbar collapse) */
.sp-search{min-width: 260px;}
.sp-search-form{margin:0;}

.sp-nav-tools{flex-wrap: wrap;}

@media (max-width: 991px){
  .sp-nav-tools{
    width: 100%;
    padding-top: .75rem;
    border-top: 1px solid var(--border);
    margin-top: .75rem;
    flex-direction: column;
    align-items: stretch !important;
    gap: .75rem !important;
  }
  .sp-search{min-width: 0; width: 100%;}
  .sp-count-pill{justify-content: space-between;}
}

.sp-density{
  display:inline-flex;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: transparent;
  overflow: hidden;
}
.sp-density-btn{
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--text);
  font-weight: 650;
  font-size: .86rem;
  padding: .42rem .7rem;
  line-height: 1;
  opacity: .78;
}
.sp-density-btn:hover{opacity: 1;}
.sp-density-btn:focus{outline: none; box-shadow: var(--focus);}
.sp-density-btn.is-active{
  background: rgba(11,18,32,.06);
  opacity: 1;
}
html[data-theme="dark"] .sp-density-btn.is-active{background: rgba(255,255,255,.10);}

/* Theme toggle (light/dark) */
.sp-theme-btn{
  appearance: none;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  border-radius: 999px;
  font-weight: 650;
  font-size: .86rem;
  padding: .42rem .75rem;
  line-height: 1;
  opacity: .82;
}
.sp-theme-btn:hover{opacity: 1;}
.sp-theme-btn:focus{outline: none; box-shadow: var(--focus);}
.sp-theme-btn.is-active{
  background: rgba(11,18,32,.06);
  opacity: 1;
}
html[data-theme="dark"] .sp-theme-btn.is-active{background: rgba(255,255,255,.10);}

/* Main surface container */
.sp-surface{
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}
html[data-theme="dark"] .sp-surface{background: var(--surface);}

.sp-hr{
  height:1px;
  border:0;
  margin: 18px 0;
  background: var(--border);
}

/* Filters bar (top) */
.sp-glass-nav{
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: .55rem .85rem;
  box-shadow: none;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

/* Sticky stacked navigation (topbar + subbar) */
.sp-sticky-stack{
  position: sticky;
  top: 0;
  z-index: 1030;
  will-change: auto;
}

/* Hide-on-scroll behavior: collapse only the topbar, keep subbar/search visible */
.sp-topbar{
  transition: transform .22s ease, margin-bottom .22s ease, opacity .18s ease;
  will-change: transform, margin-bottom;
}
.sp-sticky-stack.is-hidden .sp-topbar{
  transform: translateY(calc(-1 * var(--sp-topbar-h, 72px)));
  margin-bottom: calc(-1 * var(--sp-topbar-h, 72px));
  opacity: 0;
  pointer-events: none;
}

/* Full-width, nearly flush to the left for long category menus */
.sp-nav-fluid{
  padding-left: .75rem;
  padding-right: .75rem;
}

@media (min-width: 992px){
  .sp-nav-fluid{
    padding-left: .35rem;
    padding-right: .75rem;
  }
}

/* Make the topbar full-width and flush (not pill) */
.sp-topbar.sp-glass-nav{
  border-radius: 0;
  border-left: 0;
  border-right: 0;
  border-top: 0;
  padding: .55rem 0;
  background: rgba(255,255,255,.92);
}

.sp-topbar{border-bottom: 1px solid var(--sp-line);}

/* Ensure category dropdowns appear above the subbar */
.sp-topbar{position: relative; z-index: 1032;}
.sp-subbar{position: relative; z-index: 1031;}
.sp-topbar .dropdown-menu{z-index: 1040;}

.sp-brand{
  display: inline-flex;
  align-items: center;
  gap: .6rem;
}

.sp-logo{
  height: 52px;
  width: auto;
  max-width: 220px;
  display: block;
  object-fit: cover;
  border-radius: 12px;
}

.sp-brand-text{
  display: inline-flex;
  flex-direction: column;
  line-height: 1.05;
}

.sp-brand-title{
  font-family: var(--sp-font-ui);
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: -0.015em;
}

.sp-brand-sub{
  font-size: .78rem;
  color: var(--sp-muted);
  font-weight: 500;
  margin-top: .08rem;
}

/* Center categories in the topbar */
.sp-topbar .navbar-collapse{
  justify-content: center;
}

.sp-nav-links{
  margin-left: auto;
  margin-right: auto;
  gap: .25rem;
  justify-content: center;
  flex-wrap: wrap;
}

.sp-subbar{
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--sp-line);
}

html[data-theme="dark"] .sp-subbar{
  /* Dark glass: slightly darker, more transparent, with clear separation */
  background: rgba(12,14,16,.66);
  backdrop-filter: blur(14px) saturate(1.15);
  -webkit-backdrop-filter: blur(14px) saturate(1.15);
  border-bottom: 1px solid rgba(255,255,255,.08);
}
html[data-theme="dark"] .sp-subbar .sp-input.form-control,
html[data-theme="dark"] .sp-subbar .sp-input.form-select{
  background: rgba(255,255,255,.04);
}
html[data-theme="dark"] .sp-subbar .sp-search::placeholder{
  color: rgba(255,255,255,.62);
  opacity: 1;
}
html[data-theme="dark"] .sp-subbar .sp-count-pill{
  background: rgba(255,255,255,.06);
}


.sp-subbar-inner{
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .8rem;
  padding: .5rem 0;
}

/* Active filters (chips) */
.sp-active{display:flex; align-items:center; gap:.45rem; flex-wrap:wrap;}
.sp-active-label{font-size:.85rem; opacity:.72; font-weight:600;}
.sp-chip{
  appearance:none;
  border: 1px solid var(--sp-line);
  background: rgba(255,255,255,.70);
  backdrop-filter: blur(8px);
  border-radius: 999px;
  padding: .18rem .6rem;
  font-size: .85rem;
  font-weight: 600;
  line-height: 1.6;
  color: var(--text);
}
html[data-theme="dark"] .sp-chip{background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.10);}
.sp-chip:hover{filter: brightness(.98);}
.sp-chip:focus{outline: 2px solid rgba(59,130,246,.45); outline-offset: 2px;}

/* Ghost (secondary) button */
.sp-ghost-btn{
  appearance:none;
  border: 1px solid var(--sp-line);
  background: transparent;
  border-radius: 999px;
  padding: .34rem .8rem;
  font-weight: 700;
  font-size: .9rem;
  color: var(--text);
  opacity: .86;
}
.sp-ghost-btn:hover{opacity: 1;}
.sp-ghost-btn:focus{outline: 2px solid rgba(59,130,246,.45); outline-offset: 2px;}

.sp-mobile-filters-toggle{
  display: none;
  appearance: none;
  border: 1px solid var(--sp-line);
  background: transparent;
  border-radius: 999px;
  padding: .32rem .72rem;
  font-weight: 700;
  font-size: .86rem;
  color: var(--text);
}
.sp-mobile-filters-toggle:focus{outline: 2px solid rgba(59,130,246,.45); outline-offset: 2px;}

.sp-subbar .sp-search{width: 280px;}

/* Search wrap + clear button */
.sp-search-wrap{position: relative; display:flex; align-items:center; width:100%;}
.sp-search-wrap .sp-search{padding-right: 4.4rem;}
.sp-clear-btn{
  position:absolute;
  right: .5rem;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 1px solid var(--sp-line);
  background: rgba(255,255,255,.75);
  color: var(--text);
  font-weight: 800;
  line-height: 1;
  display:flex;
  align-items:center;
  justify-content:center;
  padding: 0;
}
html[data-theme="dark"] .sp-clear-btn{
  background: rgba(255,255,255,.10);
  border-color: rgba(255,255,255,.16);
  color: rgba(255,255,255,.88);
}
html[data-theme="dark"] .sp-clear-btn:hover{background: rgba(255,255,255,.14);} 
.sp-clear-btn:hover{filter: brightness(.98);}
.sp-clear-btn:focus{outline: 2px solid rgba(59,130,246,.45); outline-offset: 2px;}

.sp-search-wrap .sp-search-spinner{
  position: absolute;
  right: 2.55rem;
  top: 50%;
  transform: translateY(-50%) rotate(0deg);
  margin-left: 0;
}

@media (max-width: 991px){
  .sp-subbar-inner{
    flex-wrap: nowrap;
    justify-content: space-between;
    gap: .45rem;
    padding: .35rem 0;
  }

  .sp-active,
  .sp-ghost-btn,
  .sp-theme-btn,
  .sp-density{
    display: none !important;
  }

  .sp-search-form{
    order: 0;
    flex: 1 1 auto;
    min-width: 0;
    margin: 0;
  }

  .sp-subbar .sp-search{width: 100%;}

  .sp-count-pill{
    order: 1;
    flex: 0 0 auto;
    padding: .3rem .55rem;
    font-size: .82rem;
  }

  .sp-mobile-filters-toggle{
    display: inline-flex;
    align-items: center;
    justify-content: center;
    order: 2;
    flex: 0 0 auto;
  }

  .sp-subbar.is-expanded .sp-subbar-inner{
    flex-wrap: wrap;
    justify-content: center;
    gap: .6rem;
    padding: .45rem 0;
  }

  .sp-subbar.is-expanded .sp-search-form{
    order: 0;
    width: 100%;
    flex: 1 0 100%;
  }

  .sp-subbar.is-expanded .sp-count-pill{order: 1;}
  .sp-subbar.is-expanded .sp-mobile-filters-toggle{order: 2;}

  .sp-subbar.is-expanded .sp-active{
    display: flex !important;
    order: 3;
    width: 100%;
    justify-content: center;
  }
  .sp-subbar.is-expanded .sp-ghost-btn{display: inline-flex !important; order: 4;}
  .sp-subbar.is-expanded .sp-theme-btn{display: inline-flex !important; order: 5;}
  .sp-subbar.is-expanded .sp-density{display: inline-flex !important; order: 6;}
}

/* Full-width sticky navbar (publication style) */
.sp-nav-full{
  width: 100%;
  border-radius: 0;
  border-left: 0;
  border-right: 0;
  padding: .65rem 0;
}

@media (min-width: 992px){
  .sp-nav-full{padding: .7rem 0;}
}

/* Main wrapper (nav is full-width; content uses inner .container) */
.sp-main{min-height: 60vh;}

/* Single sticky navbar at the top */
.sticky-top.sp-glass-nav{top: 0;}
html[data-theme="dark"] .sp-glass-nav{background: rgba(255,255,255,.06);} 

.sp-glass-nav .navbar-nav .nav-link,
.sp-glass-nav .navbar-nav .dropdown-toggle{
  color: var(--text) !important;
  opacity: .82;
  font-weight: 600;
}
.sp-glass-nav .navbar-nav .nav-link:hover,
.sp-glass-nav .navbar-nav .nav-link.active,
.sp-glass-nav .navbar-nav .dropdown-toggle:hover,
.sp-glass-nav .navbar-nav .dropdown-toggle.active{
  opacity: 1;
}

.navbar-toggler{
  border: 1px solid var(--border);
  background: transparent;
  border-radius: 999px;
  padding: .35rem .55rem;
}
.navbar-toggler:focus{box-shadow: var(--focus);} 
.navbar-toggler-icon{filter: none; opacity:.85;}
html[data-theme="dark"] .navbar-toggler-icon{filter: invert(1);}

.sp-dropdown{
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: .45rem;
  box-shadow: var(--shadow);
}
html[data-theme="dark"] .sp-dropdown{background: rgba(18,24,36,.98);} 

.sp-dropdown .dropdown-item{
  border-radius: 12px;
  display:flex;
  align-items:center;
  gap:.55rem;
  padding: .55rem .7rem;
  color: var(--text) !important;
}
.sp-dropdown .dropdown-item:hover{background: rgba(11,18,32,.06);} 
html[data-theme="dark"] .sp-dropdown .dropdown-item:hover{background: rgba(255,255,255,.06);} 

/* Inputs */
.sp-input.form-select,
.sp-input.form-control{
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text);
}
.sp-input:focus{
  border-color: var(--border2);
  box-shadow: var(--focus);
}

.sp-count-pill{
  gap:.45rem;
  padding:.35rem .65rem;
  border-radius:999px;
  border:1px solid var(--border);
  background: transparent;
  color: var(--text);
  font-size:.9rem;
}
.sp-count-label{opacity:.65;}
.sp-count-value{font-weight:700;}

/* Grid (Comfort / Compact)
   - Comfort: πιο άνετο reading, λιγότερες στήλες
   - Compact: περισσότερες στήλες, μικρότερα gaps/padding
*/
.sp-grid{
  display: grid;
  gap: var(--grid-gap);
  grid-template-columns: 1fr;
}

@media (min-width: 768px){
  .sp-grid{grid-template-columns: repeat(2, minmax(0,1fr));}
}

@media (min-width: 1200px){
  .sp-grid{grid-template-columns: repeat(3, minmax(0,1fr));}
}

html[data-density="compact"]{--grid-gap: 12px;}

@media (min-width: 992px){
  html[data-density="compact"] .sp-grid{grid-template-columns: repeat(3, minmax(0,1fr));}
}

@media (min-width: 1200px){
  html[data-density="compact"] .sp-grid{grid-template-columns: repeat(4, minmax(0,1fr));}
}

html[data-density="compact"] .sp-thumb-wrap{height: 170px;}
html[data-density="compact"] .sp-card-body{padding: 14px 14px 12px;}
html[data-density="compact"] .sp-desc{-webkit-line-clamp: 2; line-clamp: 2;}

/* Cards */
.sp-card{
  position: relative; /* Contain Bootstrap .stretched-link so it doesn't overlay adjacent cards */
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: none;
  overflow: hidden;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.sp-card:hover{
  transform: translateY(-2px);
  border-color: var(--border2);
  box-shadow: var(--shadow2);
}

.sp-thumb-wrap{position:relative; height: 210px; background: rgba(11,18,32,.04);} 
.sp-thumb{width:100%; height:100%; object-fit:cover; display:block;}

.sp-thumb-placeholder{
  width:100%; height:100%;
  background:
    radial-gradient(500px 220px at 30% 30%, rgba(11,18,32,.10), transparent 60%),
    linear-gradient(135deg, rgba(11,18,32,.06), rgba(11,18,32,.02));
}

/* Keep the overlay subtle (editorial) */
.sp-thumb-gradient{position:absolute; inset:0; background: linear-gradient(180deg, rgba(0,0,0,0) 55%, rgba(0,0,0,.40) 100%);} 
html[data-theme="dark"] .sp-thumb-gradient{background: linear-gradient(180deg, rgba(0,0,0,0) 55%, rgba(0,0,0,.55) 100%);} 

.sp-thumb-meta{
  position:absolute;
  left: 12px;
  right: 12px;
  bottom: 10px;
  display:flex;
  flex-wrap:wrap;
  gap: 8px;
  align-items:center;
}

.sp-favicon{
  width: 22px;
  height: 22px;
  border-radius: 7px;
  border: 1px solid rgba(255,255,255,.25);
  background: rgba(255,255,255,.72);
}
html[data-theme="dark"] .sp-favicon{background: rgba(255,255,255,.16);} 

.sp-badge{
  font-weight: 600;
  letter-spacing: .01em;
  border-radius: 999px;
  background: rgba(255,255,255,.84);
  border: 1px solid rgba(255,255,255,.38);
  color: rgba(0,0,0,.78);
}
html[data-theme="dark"] .sp-badge{background: rgba(255,255,255,.14); color: rgba(255,255,255,.92);} 

.sp-date{margin-left:auto; font-size:.78rem; color: rgba(255,255,255,.86);} 
.sp-date{text-shadow: 0 1px 2px rgba(0,0,0,.4);} 

.sp-card-body{padding: 16px 16px 14px;}

.sp-title{
  font-family: var(--font-display);
  font-weight: 650;
  line-height: 1.18;
  font-size: 1.12rem;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: calc(1.18em * 2);
}
.sp-title a{color: var(--text);} 
.sp-title a:hover{text-decoration: underline; color: var(--text);} 

.sp-desc{
  color: var(--muted);
  font-size: .95rem;
  line-height: 1.5;
  display:-webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow:hidden;
  margin: 0;
}

.sp-source{
  color: var(--muted);
  font-size: .86rem;
}
.sp-meta-dot{color: var(--muted);} 
.sp-meta-right{max-width: 40%; text-align:right;} 

/* Lazy images */
.sp-lazy{opacity:0; transition: opacity .22s ease;}
.sp-lazy.is-loaded{opacity:1;}

/* Footer */
.sp-footer{
  border-top: 1px solid var(--border);
  background: transparent;
}

/* Mobile */
@media (max-width: 767.98px){
  .container.py-4{padding-left: .35rem !important; padding-right: .35rem !important;}
  .row.g-4{--bs-gutter-x: .35rem; --bs-gutter-y: .75rem;}
  .sp-surface.p-4{padding: 0 !important;}
  .sp-surface{
    border: 0 !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    background: transparent !important;
  }
  .sp-hr{margin: 0 !important;}
  .sp-grid{gap: .5rem;}
  .sp-card-body{padding: 10px 10px 9px;}
  .sp-glass-nav{border-radius: 18px;}
  .sp-glass-nav.sp-nav-full{border-radius: 0;}
  .sp-thumb-wrap{height: 220px;}
}

/* Dropdown scrolling improvements (keep your existing behavior) */
.sp-dropdown{max-height: 400px; overflow-y:auto; overscroll-behavior: contain;}
.sp-dropdown .dropdown-item{
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-height: 44px;
}
.sp-dropdown .dropdown-item .sp-favicon{flex-shrink:0; width:20px; height:20px;}
.sp-dropdown .dropdown-item span{flex-grow:1; overflow:hidden; text-overflow: ellipsis;}


/* Search loading indicator */
.sp-search-spinner{
  width: 14px;
  height: 14px;
  margin-left: .5rem;
  vertical-align: middle;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spSpin .7s linear infinite;
  opacity: .75;
}
html[data-theme="dark"] .sp-search-spinner{
  color: rgba(255,255,255,.78);
}
@keyframes spSpin{
  from { transform: translateY(-50%) rotate(0deg); }
  to { transform: translateY(-50%) rotate(360deg); }
}

/* Bottom page-load spinner (infinite scroll) */
.sp-page-loader{
  display: none;
  align-items: center;
  justify-content: center;
  padding: 2rem 0 1.5rem;
}
.sp-page-loader.is-loading{
  display: flex;
}
.sp-page-loader__ring{
  width: 40px;
  height: 40px;
  border: 3.5px solid var(--sp-accent, #3b82f6);
  border-top-color: transparent;
  border-radius: 50%;
  animation: spPageSpin .8s linear infinite;
}
html[data-theme="dark"] .sp-page-loader__ring{
  border-color: rgba(255,255,255,.35);
  border-top-color: transparent;
}
@keyframes spPageSpin{
  to { transform: rotate(360deg); }
}
/* ── Viber share button (per-card) ─────────────────────────── */
.sp-viber-btn{
  position: relative;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #b0b0b0;
  color: #fff;
  flex-shrink: 0;
  text-decoration: none;
  transition: background .18s, transform .15s;
}
.sp-card:hover .sp-viber-btn,
.sp-card:focus-within .sp-viber-btn{
  background: #7360f2;
}
.sp-viber-btn:hover,
.sp-viber-btn:focus-visible{
  background: #5b4bcf;
  color: #fff;
  transform: scale(1.1);
}
html[data-theme="dark"] .sp-viber-btn{ background: #555; }
html[data-theme="dark"] .sp-card:hover .sp-viber-btn,
html[data-theme="dark"] .sp-card:focus-within .sp-viber-btn{ background: #7360f2; }
html[data-theme="dark"] .sp-viber-btn:hover{ background: #5b4bcf; }
