/* =============================================================
   ITI Design System — Publications listing
   Loaded only on the two publications pages (EL + EN).

   All of this page's content comes from shortcodes, so everything below
   styles markup those shortcodes emit:

     [publications_counters]  .pstats-wrap .pstats-list .pstats-item
                              .pstats-num .pstats-label
     [publications_single_counters]
                              the same, under .pstats-single-* names —
                              used by the per-person publications page,
                              which shares this sheet
     [publications_menu]      #publications_menu,
                              #publications_menu_container,
                              #publications_menu_item
     [publications_loop]      #publication_years_bar, .publication_year,
                              #publications_loop h3, ol, li.publication,
                              .publication_authors, .publication_title,
                              .publication_info
   ============================================================= */

.pub { font-family: var(--iti-font-sans); }

/* =========================================================
   Masthead: title and counters on one line
   ========================================================= */

/* The counters used to sit under the title, which made the band much
   deeper than it needed to be. They share the line with it now and the
   band keeps the same height as every other page's. */
.pub .pstats-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--iti-s-4) var(--iti-s-6);
}
.pub .pstats-row .iti-mast__title { margin: 0; }

.pub .publications-year {
  margin-left: .3em;
  font-family: var(--iti-font-mono);
  font-variant-numeric: tabular-nums;
  font-weight: 400;
  color: var(--iti-electric);
}

/* The counters shipped with no stylesheet of their own — they rendered as
   plain stacked numbers. Set as chips: figure over unit, each in its own
   box, with the Font Awesome watermark css/style.css draws behind it.

   That sheet sizes them for the old full-width band — min-width 170px,
   min-height 85px, 18px/26px padding, an 86px watermark — which made each
   chip 110px tall and forced the band far deeper than the rest of the
   site's. Every one of those is restated here; the chip is about 70px, so
   it sits on the title's line. */
.pub .pstats-right { flex: none; }
.pub .pstats-right .pstats-list,
.pub .pstats-right .pstats-single-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--iti-s-3);
}
.pub .pstats-right .pstats-item,
.pub .pstats-right .pstats-single-item {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .15rem;
  min-width: 8.75rem;
  min-height: 0;
  padding: 1.05rem 1.6rem;
  text-align: center;
  background: rgba(255, 255, 255, .06);
  border: 1px solid var(--iti-electric);
  box-shadow: 0 0 14px rgba(var(--iti-electric-rgb), .35);
  clip-path: var(--iti-clip-sm);
}

/* A sheen that crosses the chip every few seconds. The chips are already
   clipped, so the band is hidden until it enters. Each one starts a little
   after the one before it so the three read as a sequence rather than a
   flash. */
.pub .pstats-right .pstats-item::after,
.pub .pstats-right .pstats-single-item::after {
  content: "";
  position: absolute;
  top: -20%;
  bottom: -20%;
  left: -70%;
  width: 40%;
  z-index: 0;
  pointer-events: none;
  transform: skewX(-18deg);
  background: linear-gradient(105deg,
    rgba(var(--iti-electric-rgb), 0) 0%,
    rgba(var(--iti-electric-rgb), .38) 50%,
    rgba(var(--iti-electric-rgb), 0) 100%);
  animation: iti-chip-shine 4.2s var(--iti-ease) infinite;
}
.pub .pstats-right .pstats-item:nth-child(2)::after,
.pub .pstats-right .pstats-single-item:nth-child(2)::after { animation-delay: .35s; }
.pub .pstats-right .pstats-item:nth-child(3)::after,
.pub .pstats-right .pstats-single-item:nth-child(3)::after { animation-delay: .7s; }

@keyframes iti-chip-shine {
  0%        { left: -70%; }
  45%, 100% { left: 130%; }
}

@media (prefers-reduced-motion: reduce) {
  .pub .pstats-right .pstats-item::after,
  .pub .pstats-right .pstats-single-item::after { animation: none; display: none; }
}

/* The watermark, scaled to the chip. The glyph itself is left alone — it is
   chosen per category in css/style.css. */
.pub .pstats-right .pstats-item::before,
.pub .pstats-right .pstats-single-item::before {
  font-size: 56px;
  opacity: .34;
  color: var(--iti-on-dark);
  z-index: 0;
}
/* The shortcode emits an empty div for the icon; the watermark above is
   what actually draws it. */
.pub .pstats-right .pstats-icon { display: none; }

.pub .pstats-right .pstats-num,
.pub .pstats-right .pstats-label,
.pub .pstats-right .pstats-single-num,
.pub .pstats-right .pstats-single-label { position: relative; z-index: 1; }

.pub .pstats-right .pstats-num,
.pub .pstats-right .pstats-single-num {
  font-family: var(--iti-font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 2.1rem;
  font-weight: 500;
  line-height: 1.05;
  color: var(--iti-on-dark);
}
/* IBM Plex Mono carries no Greek, so the unit has to take the sans face. */
.pub .pstats-right .pstats-label,
.pub .pstats-right .pstats-single-label {
  margin-top: 0;
  white-space: nowrap;
  font-family: var(--iti-font-sans);
  font-size: .74rem;
  font-weight: 600;
  letter-spacing: var(--iti-track-label);
  text-transform: uppercase;
  color: var(--iti-on-dark);
}

@media (max-width: 720px) {
  .pub .pstats-row { gap: var(--iti-s-4); }
  .pub .pstats-right .pstats-list,
  .pub .pstats-right .pstats-single-list { width: 100%; }
}

/* =========================================================
   Rail — output of [publications_menu]

   The shortcode repeats the same id on every row
   (#publications_menu_container, #publications_menu_item), which is
   invalid but is what it emits; selectors here have to match it.
   ========================================================= */

/* #publications_menu also carries .table_of_contents_widget, which
   css/style.css gives `border-left: 4px solid #0071bb !important`. That is
   the one rail on the site that was a different colour and width from the
   rest; the !important has to be answered in kind. */
.iti-rail #publications_menu {
  padding: 0;
  background: var(--iti-surface);
  border: 1px solid var(--iti-line);
  border-left: 3px solid var(--iti-rail-accent) !important;
  box-shadow: var(--iti-electric-glow-edge);
  clip-path: var(--iti-clip-sm);
}
.iti-rail #publications_menu_container { border-bottom: 1px solid var(--iti-line); }
.iti-rail #publications_menu_container:last-child { border-bottom: 0; }
.iti-rail #publications_menu_item {
  display: block;
  padding: .7rem 1rem;
  font-size: .88rem;
  font-weight: 500;
  line-height: 1.35;
  color: var(--iti-text);
  text-decoration: none;
  border-left: 3px solid transparent;
  transition: background var(--iti-dur) var(--iti-ease),
              border-color var(--iti-dur) var(--iti-ease),
              color var(--iti-dur) var(--iti-ease);
}
.iti-rail #publications_menu_item:hover {
  background: var(--iti-paper);
  border-left-color: var(--iti-electric-dim);
  color: var(--iti-blue);
}

/* =========================================================
   Year bar — output of [publications_loop]
   ========================================================= */

.pub .publications-body #publication_years_bar {
  display: flex;
  flex-wrap: wrap;
  gap: var(--iti-s-2);
  margin-bottom: var(--iti-s-6);
  padding-bottom: var(--iti-s-4);
  border-bottom: 1px solid var(--iti-line-strong);
}
.pub .publications-body .publication_year { margin: 0; }
.pub .publications-body .publication_year a {
  display: block;
  padding: .35rem .8rem;
  font-family: var(--iti-font-mono);
  font-variant-numeric: tabular-nums;
  font-size: .85rem;
  font-weight: 500;
  color: var(--iti-text-muted);
  text-decoration: none;
  background: var(--iti-surface);
  border: 1px solid var(--iti-line);
  transition: border-color var(--iti-dur) var(--iti-ease),
              color var(--iti-dur) var(--iti-ease);
}
.pub .publications-body .publication_year a:hover {
  border-color: var(--iti-electric-dim);
  color: var(--iti-blue);
}
.pub .publications-body .publication_year.selected a {
  background: var(--iti-ink-700);
  border-color: var(--iti-ink-700);
  color: var(--iti-on-dark);
}

/* =========================================================
   The list itself
   ========================================================= */

/* The rail links to .elementor-menu-anchor — empty inline spans the loop
   prints just before each heading. A scroll margin on the heading does
   nothing for them: the browser scrolls the span, which has none, so the
   heading landed behind the sticky header. The margin has to go on the
   span itself. */
.pub .publications-body .elementor-menu-anchor {
  display: block;
  scroll-margin-top: var(--iti-anchor-offset);
}

/* Section headings — "Δημοσιεύσεις Σε Περιοδικά" and the rest. */
.pub .publications-body #publications_loop h3 {
  display: flex;
  align-items: center;
  gap: var(--iti-s-3);
  margin: var(--iti-s-7) 0 var(--iti-s-4);
  scroll-margin-top: var(--iti-anchor-offset);
  font-size: clamp(1.1rem, 1rem + .5vw, 1.35rem);
  font-weight: 600;
  line-height: 1.25;
  color: var(--iti-text);
}
.pub .publications-body #publications_loop h3:first-of-type { margin-top: 0; }
.pub .publications-body #publications_loop h3::before {
  content: "";
  width: 22px; height: 2px;
  background: var(--iti-electric);
  box-shadow: var(--iti-electric-glow);
  flex: none;
}

.pub .publications-body #publications_loop ol {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: pub;
  border-top: 1px solid var(--iti-line);
}
.pub .publications-body li.publication {
  position: relative;
  margin: 0;
  padding: .85rem 1rem .85rem 3rem;
  list-style: none;
  font-size: .95rem;
  line-height: 1.6;
  color: var(--iti-text);
  background: var(--iti-surface);
  border-bottom: 1px solid var(--iti-line);
  transition: background var(--iti-dur) var(--iti-ease);
}
/* One surface for every entry. Banding alternate rows white and grey read
   as half the list being highlighted rather than as a reading aid; the
   rules between rows already do that job. */
.pub .publications-body li.publication:hover { background: var(--iti-paper); }

/* The entries are numbered in the source as an <ol>; the marker is put
   back explicitly because the list style is removed above. */
.pub .publications-body li.publication::before {
  counter-increment: pub;
  content: counter(pub);
  position: absolute;
  left: 1rem;
  top: .95rem;
  font-family: var(--iti-font-mono);
  font-variant-numeric: tabular-nums;
  font-size: .78rem;
  color: var(--iti-text-muted);
}

.pub .publications-body .publication_authors b {
  font-weight: 600;
  color: var(--iti-text);
}
/* css/style.css sets `.publication a { color: #007bff !important }`. That
   blue is 3.98:1 on white and 3.64:1 on the banded rows — both under AA —
   and the !important means no amount of plain specificity displaces it, so
   the override has to carry !important as well. It is more specific than
   the rule it replaces, so it wins among the important declarations. */
.pub .publications-body #publications_loop .publication_title,
.pub .publications-body #publications_loop li.publication a {
  color: var(--iti-blue) !important;
  text-decoration: none;
}
.pub .publications-body #publications_loop .publication_title { font-style: italic; }
.pub .publications-body #publications_loop .publication_title:hover,
.pub .publications-body #publications_loop li.publication a:hover {
  color: var(--iti-blue-700) !important;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.pub .publications-body #publications_loop .publication_info { color: var(--iti-text-muted); }
/* DOI links run long and would otherwise push the row sideways. */
.pub .publications-body li.publication { overflow-wrap: anywhere; }

@media (max-width: 600px) {
  .pub .publications-body li.publication { padding-left: 1rem; padding-top: 1.9rem; }
  .pub .publications-body li.publication::before { top: .7rem; }
}
