/* maistrelis.com — static, simplified single-column version
   Reproduces the look of the home page (left/main column only). */

:root {
  --orange: #e8830c;
  --orange-dark: #c96f08;
  --text: #3b3b3b;
  --muted: #8a8a8a;
  --link: #0071b3;
  --rule: #e3e3e3;
  --page-bg: #f4f4f4;
  --content-bg: #ffffff;
  --frame: 1155px;   /* outer width: main content + book aside, aligned */
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: "Lucida Grande", "Lucida Sans Unicode", Tahoma, Verdana, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
  background: var(--page-bg);
}

a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; height: auto; }

/* ---------- Header ---------- */

#header {
  background: #111;
  border-bottom: 4px solid var(--orange);
}

.header-inner {
  max-width: var(--frame);
  margin: 0 auto;
  padding: 12px 20px 6px;
  display: flex;
  align-items: flex-end;   /* name sits on the logo's baseline */
  gap: 18px;
  flex-wrap: wrap;
}

/* Header language switcher (EL·EN) on the black header. Flows in right after the site title and
   sits at the TOP of the header row (align-self), so it reads "top-right, near the end of the
   title" rather than pinned to the far frame edge. Permanent nav control (the contextual,
   dismissible nudge lives in .lang-avail-bar). Monospace catalog codes; the current language is
   the orange active code, the other links to the translation or is dimmed when none. */
.lang-switch {
  align-self: flex-start;   /* top of the row, next to the title (row is otherwise flex-end) */
  margin-top: 2px;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-family: "DejaVu Sans Mono", "Courier New", monospace;
  font-size: 12px;
  letter-spacing: 0.06em;
}
.lang-switch > * + *::before {
  content: "·";
  margin-right: 0.45rem;
  color: #6a6a6a;              /* separator on the dark header */
}
.lang-switch-on { color: var(--orange); font-weight: 700; }        /* current language */
.lang-switch-link { color: #cfc6b8; text-decoration: none; }       /* other language, translated */
.lang-switch-link:hover { color: var(--orange); text-decoration: underline; }
.lang-switch-off { color: #6a6a6a; cursor: default; }              /* other language, no translation */

#logo img { display: block; max-height: 58px; }

/* ASCII animation used as the logo in the header (figures only, standing on the
   header's orange bottom-border, which plays the role of the ground) */
.header-anim {
  cursor: pointer;
  overflow: hidden;
  max-width: 100%;               /* cap to container; JS scales the pre to fit */
  min-width: 0;
  display: flex;
  align-items: flex-end;         /* feet sit at the bottom, near the orange line */
  height: 5em;                   /* 4 lines (tallest pose) × 1.25 line-height */
  font-size: 14px;               /* JS transform-scales the pre down to fit narrow screens */
  align-self: flex-end;
}
.header-anim pre {
  margin: 0;
  flex: 0 0 auto;                /* keep natural width; JS transform-scales to fit */
  font-family: "DejaVu Sans Mono", "Courier New", monospace;
  line-height: 1.25;
  white-space: pre;
  color: #ffd9a6;
}

/* Name + slogan sit right next to the ASCII-art logo (no longer pushed to the
   far right — that left an awkward gap once the logo became the wide animation). */
#name-and-slogan {
  line-height: 1.2;
  margin-left: 8px;
  text-align: left;
}

#site-name {
  margin: 0;
  font-size: 30px;
  font-weight: 700;
}
#site-name a { color: #fff; }
#site-name a:hover { text-decoration: none; color: var(--orange); }

#site-slogan {
  color: var(--orange);
  font-size: 13px;
  letter-spacing: 2px;
  text-transform: uppercase;
}

/* ---------- Menu (simplified, links to live site) ---------- */

#main-menu {
  background: #111;
}
#main-menu ul {
  max-width: var(--frame);
  margin: 0 auto;
  padding: 10px 20px 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
#main-menu a {
  display: block;
  padding: 8px 14px;
  color: #fff;
  font-size: 13px;
  border-radius: 4px 4px 0 0;
  background: #2a2a2a;
}
#main-menu a:hover,
#main-menu a.active {
  background: var(--orange);
  color: #fff;
  text-decoration: none;
}

/* ---------- Main column + book aside ---------- */

.main-row {
  max-width: var(--frame);
  margin: 0 auto;
  padding: 0 20px 40px;
  display: flex;
  align-items: flex-start;
  gap: 28px;
}

#main {
  flex: 1 1 0;
  min-width: 0;        /* allow the column to shrink instead of overflowing */
}

#content {
  background: var(--content-bg);
  padding: 26px 30px;
  border: 1px solid var(--rule);
  border-top: none;
}

/* book promo aside (right on desktop, stacks on mobile) */
.book-aside {
  flex: 0 0 210px;
  position: sticky;
  top: 18px;
  margin-top: 16px;
}
.book-promo {
  background: var(--content-bg);
  border: 1px solid var(--rule);
  border-top: 3px solid var(--orange);
  padding: 14px;
  text-align: center;
}
.book-promo-label {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted);
  margin-bottom: 8px;
}
.book-promo .book-cover,
.book-promo .book-cover-ph {
  display: block;
  width: 140px;
  max-width: 100%;
  margin: 0 auto 10px;
  border: 1px solid var(--rule);
}
.book-promo .book-cover-ph {
  height: 200px;
  line-height: 200px;
  font-size: 56px;
  background: #f0f0f0;
  color: #bbb;
}
.book-promo-title {
  display: block;
  font-weight: 700;
  color: var(--orange-dark);
  line-height: 1.3;
}
.book-promo-title:hover { color: var(--orange); text-decoration: none; }
.book-promo-blurb { font-size: 12px; color: var(--muted); margin: 8px 0 10px; }
.book-promo-cta {
  display: inline-block;
  padding: 5px 16px;
  background: var(--orange);
  color: #fff;
  font-size: 12px;
  border-radius: 4px;
}
.book-promo-cta:hover { background: var(--orange-dark); text-decoration: none; }

/* lesson: contents/TOC thumbnail floating top-right of the intro */
.lesson-contents {
  float: right;
  width: 230px;
  max-width: 42%;
  margin: 4px 0 14px 20px;
  border: 1px solid var(--rule);
  border-radius: 4px;
}

/* bordered, clickable preview screenshot with a header bar on top */
.preview-shot {
  display: inline-block;
  max-width: 100%;
  border: 2px solid var(--orange);
  border-radius: 4px;
  overflow: hidden;
  text-decoration: none;
  transition: box-shadow .15s ease, transform .15s ease;
}
.preview-shot, .preview-shot:hover { text-decoration: none; }
.preview-shot img {
  display: block;
  max-width: 100%;
  height: auto;
  transition: transform .25s ease;
}
.preview-shot:hover {
  box-shadow: 0 8px 22px rgba(0, 0, 0, .18);
  transform: translateY(-2px);
}
.preview-shot:hover img { transform: scale(1.03); }
.preview-header {
  display: block;
  background: var(--orange);
  color: #fff;
  font-size: 17px;
  font-weight: 600;
  padding: 10px 16px;
}
.preview-shot:hover .preview-header { background: var(--orange-dark); }

/* digital-garden graph widget (per-note, in the aside, desktop only) */
.graph-panel {
  background: var(--content-bg);
  border: 1px solid var(--rule);
  border-top: 3px solid var(--orange);
  padding: 10px;
}
.graph-head {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted);
  margin-bottom: 6px;
}
.graph-head a { color: var(--muted); }
.graph-head a:hover { color: var(--orange); text-decoration: none; }
.graph-canvas { display: block; width: 100%; }
.graph-hint { font-size: 10px; color: var(--muted); text-align: center; margin-top: 4px; }

/* dedicated /graph/ page (whole-site graph) */
.graph-full {
  border: 1px solid var(--rule);
  /* very subtle warm beige — harmonises with the orange accent; the force-graph
     canvas is transparent, so this shows through as the graph backdrop.
     NOTE: keep in sync with the label backdrop in static/js/graph-full.js */
  background: #faf7f1;
  margin-top: 10px;
}
/* force-graph builds its own canvas inside .graph-full */
.graph-full canvas { display: block; }
.graph-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  font-size: 12px;
  color: var(--muted);
  margin-top: 12px;
}
.graph-legend .gl::before {
  content: "";
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 5px;
  vertical-align: middle;
}
.graph-legend .gl-seed::before { background: #b5cf7a; }
.graph-legend .gl-seedling::before { background: #8bc34a; }
.graph-legend .gl-budding::before { background: #43a047; }
.graph-legend .gl-evergreen::before { background: #1b5e20; }
.graph-legend .gl-item::before { background: #d2691e; }
.graph-legend .gl-authority::before { background: #7e57c2; }
.graph-legend .gl-page::before { background: #5b7fa6; }

/* Reset-view button — sits at the far right of the legend row */
.graph-reset {
  margin-left: auto;        /* push to the far right of the flex legend row */
  font-size: 12px;
  color: var(--muted);
  background: var(--content-bg);
  border: 1px solid var(--rule);
  padding: 4px 12px;
  cursor: pointer;
}
.graph-reset:hover { color: var(--orange); border-color: var(--orange); }

/* book page */
.book-page-cover { float: right; width: 200px; margin: 0 0 16px 24px; border: 1px solid var(--rule); }
.book-page .lead { font-size: 17px; color: var(--text); }

@media (max-width: 860px) {
  /* stack; stretch so #main fills the screen width instead of shrinking to its
     content (flex-start on the cross-axis would otherwise cause horizontal overflow) */
  .main-row { flex-direction: column; align-items: stretch; }
  .book-aside { flex-basis: auto; width: 100%; max-width: 340px; position: static; align-self: center; }
  /* graph widget is desktop-only — pointless on a phone (graph.js also bails here) */
  .graph-panel { display: none; }
  /* menu entries flagged hideMobile (e.g. the graph tab) are desktop-only too */
  #main-menu li.hide-mobile { display: none; }
}

/* ASCII banner (animated "dancing man") */
#banner {
  margin: 0 0 24px;
  padding: 14px 16px;
  background: #111;
  color: #ffd9a6;
  overflow-x: auto;
}
#banner .anim {
  cursor: pointer;
  overflow: hidden;
}
#banner pre {
  margin: 0;
  /* Every animation frame is 6 lines tall (6 × 1.25 line-height = 7.5em).
     Lock the box to that height so it never grows/shrinks while playing. */
  height: 7.5em;
  font-family: "DejaVu Sans Mono", "Courier New", monospace;
  font-size: 12px;
  line-height: 1.25;
  white-space: pre;
}

/* ---------- Posts (teasers) ---------- */

.node {
  padding: 22px 0;
  border-bottom: 1px solid var(--rule);
  overflow: hidden;                 /* contain the float-right teaser thumbnail */
}
.node:first-of-type { padding-top: 4px; }
.node:last-child { border-bottom: none; }
.teaser-thumb { float: right; width: 180px; max-width: 38%; margin: 4px 0 8px 18px; }
.teaser-thumb img { display: block; width: 100%; border: 1px solid var(--rule); border-radius: 4px; }

.node h2 {
  margin: 0 0 4px;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.25;
}
.node h2 a { color: var(--orange-dark); }
.node h2 a:hover { color: var(--orange); text-decoration: none; }

.submitted {
  margin-bottom: 10px;
  font-size: 12px;
  font-style: italic;
  color: var(--muted);
}

.post-body { overflow: hidden; }
.post-body p { margin: 0 0 12px; }

/* opt-in hyphenation (front matter: hyphenate: true) — justified text so the
   hyphenated line-breaks are visible. Hyphenator injects the soft hyphens. */
.post-body.hyphenate { text-align: justify; }

/* {{< hyphenation-toggle >}} switch */
.hyph-toggle {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font: inherit;
  font-size: 0.85rem;
  padding: 5px 12px;
  border: 1px solid var(--rule);
  border-radius: 5px;
  background: #f7f7f7;
  color: var(--text);
  cursor: pointer;
}
.hyph-toggle:hover { background: #efefef; }
.hyph-toggle .hyph-toggle-knob {
  position: relative;
  width: 28px;
  height: 15px;
  border-radius: 9px;
  background: var(--orange);
  flex: 0 0 auto;
  transition: background .15s;
}
.hyph-toggle .hyph-toggle-knob::after {
  content: "";
  position: absolute;
  top: 1px;
  left: 14px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: #fff;
  transition: left .15s;
}
.hyph-toggle.off .hyph-toggle-knob { background: #bbb; }
.hyph-toggle.off .hyph-toggle-knob::after { left: 1px; }

/* footnote tooltips (footnotes.js) + smooth-nav highlight */
.fn-tooltip {
  position: absolute;
  z-index: 60;
  max-width: 320px;
  padding: 8px 11px;
  background: #fff;
  border: 1px solid var(--rule);
  border-radius: 5px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .14);
  font-size: 0.85rem;
  line-height: 1.45;
  color: var(--text);
}
.fn-tooltip[hidden] { display: none; }
.fn-tooltip p { margin: 0; }
.footnote-ref { cursor: help; }
.fn-flash { animation: fn-flash 1.4s ease-out; border-radius: 3px; }
@keyframes fn-flash {
  0%   { background: var(--orange); }
  100% { background: transparent; }
}

.img-right {
  float: right;
  margin: 4px 0 12px 18px;
  text-align: center;
}
.img-right .caption {
  margin: 4px 0 0;
  font-size: 11px;
  color: var(--muted);
}

/* Float μια φωτό αριστερά/δεξιά ώστε το κείμενο να τυλίγεται γύρω της.
   Βάλε class="photo-left" / "photo-right" σε <a> ή <img> μέσα στο body ή summary. */
.post-body .photo-left  { float: left;  clear: left;  max-width: 200px; margin: 5px 20px 12px 0; }
.post-body .photo-right { float: right; clear: right; max-width: 200px; margin: 5px 0 12px 20px; }
.post-body .photo-left img,
.post-body .photo-right img { display: block; max-width: 100%; height: auto; }

/* Editor's note: η φωνή του σήμερα πάνω σ' ένα αρχειακό (π.χ. 2012) κείμενο.
   Το monospace eyebrow δένει με το ASCII banner του header· η πορτοκαλί γραμμή
   (signature του site) γίνεται αριστερό rule. Reusable σε κάθε παλιό άρθρο. */
.post-body .disclaimer {
  clear: both;
  margin: 0 0 30px;
  padding: 18px 22px;
  border-left: 3px solid var(--orange);
  background: #faf6ef;
  color: #565656;
  font-size: 13.5px;
  line-height: 1.7;
}
/* Το label γράφεται μέσα στο .disclaimer ως <div class="disclaimer-head">,
   ώστε ο συγγραφέας να το αλλάζει ανά άρθρο (π.χ. «Σημείωμα από το 2026»).
   text-transform: uppercase → eyebrow look ανεξάρτητα από το πώς γράφεται. */
.post-body .disclaimer-head {
  margin-bottom: 10px;
  font-family: "DejaVu Sans Mono", "Courier New", monospace;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--orange-dark);
}
/* top-margin (not bottom): δουλεύει και για τη 1η γυμνή παράγραφο που ο goldmark
   αφήνει χωρίς <p> μέσα στο raw-HTML block */
.post-body .disclaimer p { margin: 12px 0 0; }

/* Tags */
.tags {
  margin: 12px 0 0;
  font-size: 12px;
  color: var(--muted);
}
.tags .label { font-weight: 700; margin-right: 6px; }
.tags a {
  display: inline-block;
  padding: 1px 8px;
  margin: 0 4px 4px 0;
  background: #f0f0f0;
  border-radius: 3px;
  color: var(--link);
}

/* Subject cloud (/subjects/) — replaces the Hugo tag cloud */
.subject-cloud {
  list-style: none;
  margin: 16px 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 14px;
}
.subject-cloud li { white-space: nowrap; }
.subject-cloud .count {
  font-size: 11px;
  color: var(--muted);
  vertical-align: super;
  margin-left: 2px;
}

/* Read more */
.read-more {
  margin-top: 12px;
}
.read-more a {
  display: inline-block;
  padding: 5px 14px;
  background: var(--orange);
  color: #fff;
  font-size: 12px;
  border-radius: 4px;
}
.read-more a:hover { background: var(--orange-dark); text-decoration: none; }

.feed {
  margin-top: 20px;
}

/* ---------- Footer ---------- */

#footer {
  max-width: var(--frame);
  margin: 0 auto;
  padding: 18px 20px 40px;
  font-size: 12px;
  color: var(--muted);
  text-align: center;
}
.footer-links { margin-bottom: 8px; }
.footer-links-label { font-weight: 700; margin-right: 8px; }
.footer-links a { margin: 0 6px; }
.footer-links a:not(:last-child)::after {
  content: "·";
  margin-left: 12px;
  color: var(--rule);
}
.footer-copy { color: var(--muted); }
.footer-rss {
  display: inline-block;
  margin-left: 10px;
  vertical-align: middle;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .5px;
  color: #fff;
  background: var(--orange);
  padding: 2px 8px;
  border-radius: 3px;
}
.footer-rss:hover { background: var(--orange-dark); text-decoration: none; color: #fff; }

/* ---------- Archive items ---------- */

.item h2 { color: var(--orange-dark); margin: 0 0 16px; }

/* key-value metadata (RDFa definition list) */
.item-fields {
  margin: 0 0 22px;
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 4px 16px;
}
.item-fields dt {
  font-weight: 700;
  color: var(--muted);
  grid-column: 1;
}
.item-fields dd {
  margin: 0;
  grid-column: 2;
  word-break: break-word;
}

/* archived files table */
.item-files {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.item-files th {
  text-align: left;
  background: #f0f0f0;
  color: var(--muted);
  font-weight: 700;
  padding: 6px 8px;
  border-bottom: 2px solid var(--orange);
}
.item-files td {
  padding: 8px;
  border-bottom: 1px solid var(--rule);
  vertical-align: middle;
}
.item-files td.thumb { width: 96px; }
.item-files td.thumb img { display: block; max-width: 88px; max-height: 264px; height: auto; }
.item-files th.thsize { text-align: right; }
.item-files td.fsize { text-align: right; white-space: nowrap; color: var(--muted); }
.item-files td.fdl { text-align: center; width: 40px; }
.item-files .ftype { color: var(--muted); }
.item-files .finfo { display: block; font-size: 12px; color: var(--muted); font-style: italic; margin-top: 2px; }
.item-files .fsource { display: block; font-size: 12px; margin-top: 2px; }

/* geoUrl location map (OpenStreetMap embed) */
.item-geo { margin: 0 0 22px; }
.item-geo-map {
  display: block;
  width: 100%;
  height: 320px;
  border: 1px solid var(--rule);
  border-radius: 2px;
}
.item-geo-cap { font-size: 12px; color: var(--muted); margin-top: 4px; }

/* related items (bidirectional) — shown before the "Διαθέσιμα τεκμήρια" table */
.item-related { margin: 0 0 22px; }
.item-related-head {
  margin: 0 0 6px;
  padding: 6px 8px;
  background: #f0f0f0;
  color: var(--muted);
  font-weight: 700;
  font-size: 13px;
  border-bottom: 2px solid var(--orange);
}

/* note backlinks (reverseStyle: line) — one plain line per backlink, no thumbnail */
.note-backlinks { margin: 0 0 22px; }
.note-backlinks .backlink-list { margin: 6px 0 0; padding-left: 20px; }
.note-backlinks .backlink-list li { margin: 2px 0; }

/* archive sub-navigation (items | collections) */
.archive-nav {
  display: flex;
  gap: 6px;
  margin: 0 0 20px;
  border-bottom: 2px solid var(--orange);
}
.archive-nav a {
  padding: 8px 18px;
  font-weight: 700;
  font-size: 14px;
  color: var(--muted);
  background: #f0f0f0;
  border-radius: 4px 4px 0 0;
}
.archive-nav a:hover { color: var(--orange-dark); text-decoration: none; }
.archive-nav a.active {
  background: var(--orange);
  color: #fff;
}

/* archive: φίλτρο ανά τύπο τεκμηρίου (client-side, /archive/) */
.itemtype-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 18px;
}
.itemtype-filter-btn {
  font: inherit;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  padding: 2px 9px;
  color: var(--muted);
  background: #f0f0f0;
  border: 1px solid var(--rule);
  border-radius: 999px;
}
.itemtype-filter-btn:hover { color: var(--orange-dark); border-color: var(--orange); }
.itemtype-filter-btn.active {
  color: #fff;
  background: var(--orange);
  border-color: var(--orange);
}
.itemtype-filter-btn .count {
  font-size: 10px;
  font-weight: 400;
  opacity: 0.7;
}

/* item-level thumbnail (single page) */
.item-thumb {
  float: right;
  margin: 2px 0 14px 18px;
}
.item-thumb img {
  display: block;
  max-width: 160px;
  height: auto;
  border: 1px solid var(--rule);
  padding: 3px;
  background: #fff;
}
/* sections that may sit beside the right-floated thumb: establish a BFC so their
   background/border stops before the thumb instead of running full-width behind it
   (the float only narrows inline content, not the block box). */
.item-related, .item-fields, .item-collections { display: flow-root; }
.item-files { clear: right; }   /* wide table: drop below the thumb, don't squeeze */

/* items list (/items/) */
/* item type badge */
.item-type-line { margin: -8px 0 16px; font-size: 12px; color: var(--muted); }
.item-date { font-size: 12px; color: var(--muted); }
.item-type {
  display: inline-block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: #f0f0f0;
  color: var(--muted);
  padding: 1px 8px;
  border-radius: 3px;
}
.item-row .item-type { padding: 0 6px; }
.item-type-section { background: var(--orange); color: #fff; }

.item-desc, .collection-desc { margin: 0 0 22px; }

.clearfix { clear: both; }   /* {{< clear >}} shortcode — break floats */

/* item → article back-link (OPAC record, partials/article-link.html) */
.article-ref {
  display: flow-root;           /* BFC: background/border stop before a floated thumb */
  margin: 2px 0 18px;
  padding: 8px 12px;
  background: #fff7ee;
  border-left: 3px solid var(--orange);
  border-radius: 4px;
  font-size: 0.95em;
}
.article-ref-label { color: var(--muted); margin-right: 6px; }
.article-ref-link { font-weight: bold; }

/* dead/unreachable source link marker (sourceStatus) */
.dead-link { color: #b00; font-weight: bold; text-decoration: none; cursor: help; border: 0; }
.fsource-dead a { color: var(--muted); }
.archived-link { text-decoration: none; }   /* 🏛 link to Wayback Machine */

/* {{< item-link >}} box — link from an article/post to its archive item */
.item-ref-wrap { clear: both; text-align: center; }   /* drop below floated photos → centered box at the end */
.item-ref-box {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: 18px 0;
  padding: 5px 11px;
  border: 1px solid var(--orange);
  border-left: 3px solid var(--orange);
  border-radius: 4px;
  background: #fff7ee;
  color: var(--text);
  text-decoration: none;
  font-size: 0.9em;
}
.item-ref-box:hover { background: var(--orange); color: #fff; }
.item-ref-box .item-ref-icon { font-size: 1em; line-height: 1; }
.item-ref-box::after { content: "→"; margin-left: 4px; }

/* ── download slip ─────────────────────────────────────────────────────────
   "Availability card" for an item's downloadable document. Leans into the
   site's library-catalog identity (items = authority records): a monospace
   availability stamp in the site's DejaVu Mono utility face over a hairline-
   ruled cream card, pointing down to the real file links. No alert bar, no
   emoji. `.slip-*` selectors are (0,2,0) so they beat `.item-desc p` cleanly. */
.download-slip {
  margin: 22px 0;
  padding: 13px 18px 15px;
  background: #fff7ee;
  border: 1px solid #efd3ac;          /* warm hairline = a card edge, not an alert accent */
  border-radius: 3px;
}
.download-slip .slip-stamp {          /* the catalog "availability stamp" */
  margin: 0 0 10px;
  padding-bottom: 9px;
  border-bottom: 1px solid #efd3ac;   /* the rule under the stamp, like a catalog card */
  font-family: "DejaVu Sans Mono", "Courier New", monospace;
  font-size: 11px;
  font-weight: bold;
  letter-spacing: 0.16em;
  color: var(--orange-dark);
}
.download-slip .slip-lead { margin: 0; font-size: 15px; line-height: 1.55; color: var(--text); }
.download-slip .slip-note { margin: 7px 0 0; font-size: 12.5px; color: var(--muted); }
.download-slip .slip-arrow { color: var(--orange); font-weight: bold; }   /* points to the files below */
.download-slip .slip-mark { color: var(--orange); vertical-align: -2px; margin-right: 8px; }  /* download line-icon, tuned to the stamp cap-height */

.item-desc p, .collection-desc p { margin: 0 0 12px; }
.collection h2 { color: var(--orange-dark); margin: 0 0 16px; }
/* collection_type: series → badge + numbered rows (CSS counter, since .item-list is list-style:none) */
.collection-type {
  display: inline-block;
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--orange-dark);
  border: 1px solid var(--rule);
  border-radius: 3px;
  padding: 1px 8px;
  margin: 0 4px 0 0;
  vertical-align: middle;
}
.item-series-of, .item-field-inline { margin: 8px 0; }
.item-series-of .label, .item-field-inline .label { font-weight: 700; color: var(--muted); margin-right: 4px; }
.collection-series { counter-reset: series; }
.collection-series > .item-row { counter-increment: series; }
.collection-series > .item-row::before {
  content: counter(series);
  flex: 0 0 1.6em;
  text-align: center;
  font-weight: 700;
  color: var(--orange-dark);
}

/* contact form */
.contact-intro { margin: 0 0 18px; color: var(--muted); }
.contact-form { max-width: 560px; }
.contact-form label {
  display: block;
  margin-bottom: 14px;
  font-weight: 700;
  font-size: 13px;
  color: var(--muted);
}
.contact-form input[type=text],
.contact-form input[type=email],
.contact-form textarea {
  display: block;
  width: 100%;
  box-sizing: border-box;
  margin-top: 4px;
  padding: 9px 12px;
  font: inherit;
  font-weight: 400;
  color: var(--text);
  border: 1px solid var(--rule);
  border-radius: 4px;
}
.contact-form input:focus,
.contact-form textarea:focus { outline: none; border-color: var(--orange); }
.contact-form button[type=submit] {
  padding: 9px 22px;
  background: var(--orange);
  color: #fff;
  border: none;
  border-radius: 4px;
  font-size: 14px;
  cursor: pointer;
}
.contact-form button[type=submit]:hover { background: var(--orange-dark); }
.contact-form button[disabled] { opacity: 0.6; cursor: default; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.contact-status { margin: 12px 0 0; font-size: 14px; }
.contact-status.ok  { color: #2e7d32; font-weight: 700; }
.contact-status.err { color: #c0392b; font-weight: 700; }

.empty-state { color: var(--muted); font-style: italic; }

/* search */
.search-input {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 14px;
  font-size: 15px;
  border: 1px solid var(--rule);
  border-radius: 4px;
  margin-bottom: 10px;
}
.search-input:focus { outline: none; border-color: var(--orange); }
.search-status { color: var(--muted); font-size: 13px; margin: 0 0 12px; }
.search-snippet { margin: 4px 0 0; font-size: 13px; color: #555; }

/* "Σχετικό περιεχόμενο" (reverse subjects): frame the whole block so the grouped
   content reads as belonging to it, and demote the per-type subheadings below the
   section title. */
.item-subject-of {
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 0 14px 8px;
}
.item-subject-of .item-related-head {
  margin: 0 -14px 4px;          /* flush to the frame edges, like a card header */
  border-radius: 4px 4px 0 0;
}
.item-subject-of .term-group {
  margin: 14px 0 6px;
  font-size: 12px;
  border-bottom: 1px solid var(--orange); /* thinner than the title's 2px rule */
  text-transform: none;                   /* sentence case, not all-caps */
  letter-spacing: 0;
}

/* taxonomy term page: per-type group headings */
.term-group {
  margin: 22px 0 8px;
  padding-bottom: 4px;
  border-bottom: 2px solid var(--orange);
  font-size: 15px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.item-list { list-style: none; padding: 0; margin: 0; }
.item-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 0;
  border-bottom: 1px solid var(--rule);
}
.item-row-thumb {
  flex: 0 0 56px;
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.item-row-thumb img { max-width: 56px; max-height: 56px; height: auto; }
.item-row-thumb .noimg {
  width: 56px; height: 56px;
  background: #f0f0f0;
  border: 1px solid var(--rule);
  display: block;
}
.item-row-meta { display: flex; flex-direction: column; }
.item-row-title { font-weight: 700; color: var(--orange-dark); }
.item-row-title:hover { color: var(--orange); text-decoration: none; }
.item-row-meta .submitted { margin: 0; }
/* Curator's note on an annotated collection item ({item, note} form). */
.item-row-note { margin: 2px 0 0; color: var(--text); font-size: 14px; line-height: 1.45; }
.item-row-note p { margin: 0; }
.item-row-note p + p { margin-top: 0.4em; }

/* ---------- Responsive ---------- */

@media (max-width: 600px) {
  .header-inner { justify-content: center; text-align: center; }
  #main-menu ul { justify-content: center; }
  #content { padding: 20px 16px; }
  .img-right { float: none; margin: 0 auto 12px; display: block; }
  .post-body .photo-left,
  .post-body .photo-right { float: none; clear: none; max-width: 100%; margin: 0 auto 12px; text-align: center; }
  .post-body .photo-left img,
  .post-body .photo-right img { margin: 0 auto; }
  .item-fields { grid-template-columns: 1fr; gap: 0 0; }
  .item-fields dd { margin-bottom: 8px; }
}

/* ---------- Lightbox (replaces Drupal colorbox) ---------- */

body.lb-locked { overflow: hidden; }

.lb-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.88);
  align-items: center;
  justify-content: center;
}
.lb-overlay.is-open { display: flex; }

.lb-figure {
  margin: 0;
  max-width: 92vw;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.lb-img {
  max-width: 92vw;
  max-height: 86vh;
  width: auto;
  height: auto;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.5);
  border: 3px solid #fff;
}
.lb-caption {
  color: #eee;
  font-size: 13px;
  margin-top: 8px;
  text-align: center;
}

.lb-close, .lb-prev, .lb-next {
  position: absolute;
  background: none;
  border: 0;
  color: #fff;
  cursor: pointer;
  line-height: 1;
  opacity: 0.8;
  transition: opacity 0.15s;
}
.lb-close:hover, .lb-prev:hover, .lb-next:hover { opacity: 1; color: var(--orange); }

.lb-close { top: 14px; right: 20px; font-size: 40px; }
.lb-prev, .lb-next { top: 50%; transform: translateY(-50%); font-size: 56px; padding: 0 18px; }
.lb-prev { left: 8px; }
.lb-next { right: 8px; }

@media (max-width: 600px) {
  .lb-prev, .lb-next { font-size: 40px; padding: 0 8px; }
  .lb-close { font-size: 32px; top: 8px; right: 12px; }
}

/* Optional per-tag description shown on a tag's term page. */
.term-desc {
  margin: 0 0 18px;
  padding: 10px 14px;
  background: #faf6ef;
  border-left: 3px solid var(--orange);
  color: var(--text);
  font-size: 14px;
}
.term-desc p { margin: 0; }

/* ---------- Photo gallery (gallery shortcode + lightbox) ---------- */

.ik-gallery { margin-left: 0; }
.ik-gallery .frame {
  border: 1px solid #c0c0c0;
  background-color: #000033;
  float: left;
  margin: 6px;
  padding: 0;
}
.ik-gallery .shot {
  min-height: 180px;
  padding: 0;
  margin: 0;
  display: table-cell;
  vertical-align: bottom;
}
.ik-gallery .shot .caption {
  margin: 0;
  padding: 3px 4px;
  background-color: var(--orange);
  color: #fff;
  font-size: 12px;
  text-align: left;
}
.ik-gallery .shot .caption a { color: #fff; text-decoration: none; }
.ik-gallery .shot .caption .cap-info { margin-top: 2px; }
.ik-gallery .shot, .ik-gallery img, .ik-gallery a { margin: 0; padding: 0; }
.ik-gallery .shot img { vertical-align: bottom; display: block; }
.ik-gallery .spacer { clear: both; }

/* ---- Display modes (front-matter `galleryStyle`) ----
   classic = above (float, varying heights). grid/overlay = uniform square tiles. */
.ik-gallery--grid,
.ik-gallery--overlay {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
  margin: 0;
}
.ik-gallery--grid .spacer,
.ik-gallery--overlay .spacer { display: none; }
.ik-gallery--grid .frame,
.ik-gallery--overlay .frame { float: none; margin: 0; }
.ik-gallery--grid .shot,
.ik-gallery--overlay .shot { display: block; min-height: 0; }
.ik-gallery--grid .shot img,
.ik-gallery--overlay .shot img { width: 100%; height: 150px; object-fit: cover; }

/* overlay: caption sits translucent over the bottom of each tile */
.ik-gallery--overlay .shot { position: relative; }
.ik-gallery--overlay .shot img { height: 170px; }
.ik-gallery--overlay .caption {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  background: rgba(232, 131, 12, 0.85);
}

/* ---- Legacy article bodies on phones ----
   Migrated Drupal posts use inline float:right + fixed widths (divs/tables) that
   overflow narrow screens. Linearize them on phones. Scoped to .post-body and to
   INLINE-styled floats, so the gallery (floats via .frame class) is untouched. */
@media (max-width: 600px) {
  #content .post-body [style*="float"] {
    float: none !important;
    width: auto !important;
    max-width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }
  #content .post-body .kbox { width: auto !important; }
  #content .post-body table { width: 100% !important; }
  #content .post-body table img,
  #content .post-body [style*="float"] img {
    max-width: 100% !important;
    height: auto !important;
  }
}

/* ── Digital garden ──────────────────────────────────────────── */
.garden-stage {
  display: inline-block;
  font-size: 0.75em;
  font-weight: 600;
  padding: 0.1em 0.55em;
  border-radius: 999px;
  border: 1px solid #cdd6c4;
  background: #f2f6ec;
  color: #4a5a3a;
  vertical-align: middle;
  white-space: nowrap;
}
/* «EN» badge: marks an English-original page shown inside a Greek listing (see
   partials/teaser.html) so the reader knows the article is in English before clicking. */
.lang-badge {
  display: inline-block;
  font-size: 0.68em;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 0.05em 0.5em;
  border-radius: 999px;
  border: 1px solid var(--link);
  color: var(--link);
  vertical-align: middle;
  white-space: nowrap;
}

.garden-stage-seed      { background: #f8faf0; border-color: #e0e9c8; }
.garden-stage-seedling  { background: #f3f8ec; border-color: #d6e4c2; }
.garden-stage-budding   { background: #e9f3df; border-color: #bcd7a0; }
.garden-stage-evergreen { background: #dff0e6; border-color: #9fcdb0; }
.garden-intro { margin: 0 0 1.5em; color: #555; }
.garden-list { list-style: none; padding: 0; margin: 0; }
.garden-list li { padding: 0.25em 0; border-bottom: 1px dotted #ddd; }
/* Stage shown as a bare emoji icon at the start of each row; fixed width keeps
   the titles aligned. No pill background here (overrides .garden-stage-*). */
.garden-stage-icon {
  display: inline-block;
  width: 1.5em;
  text-align: center;
  margin-right: 0.3em;
  background: none;
  border: none;
  cursor: help;
}
.garden-tended { color: #999; font-size: 0.8em; margin-left: 0.6em; }

/* ── Changelog / Ιστορικό (page history) ─────────────────────── */
.changelog { margin: 2.2em 0 0; border-top: 1px solid var(--rule); padding-top: 1em; }
.changelog-head { font-size: 1.05em; margin: 0 0 0.6em; }
.changelog-list { list-style: none; padding: 0; margin: 0; }
.changelog-entry { padding: 0.3em 0; border-bottom: 1px dotted #ddd; }
.changelog-date { font-family: monospace; color: var(--muted); margin-right: 0.6em; }
.changelog-commit { font-family: monospace; font-size: 0.78em; color: var(--muted); background: #f0f0f0; padding: 0 0.35em; border-radius: 3px; margin-right: 0.6em; }
.changelog-snap { margin: 0; }
.changelog-snap > summary { cursor: pointer; list-style: none; }
.changelog-snap > summary::-webkit-details-marker { display: none; }
.changelog-toggle { color: var(--link); font-size: 0.85em; margin-left: 0.4em; white-space: nowrap; }
.changelog-toggle::before { content: "▸ "; }
.changelog-snap[open] .changelog-toggle::before { content: "▾ "; }
/* no note → the disclosure triangle leads the whole line instead of the toggle text */
.changelog-snap.lead-marker > summary::before { content: "▸ "; color: var(--link); }
.changelog-snap.lead-marker[open] > summary::before { content: "▾ "; }
.changelog-snap.lead-marker .changelog-toggle::before { content: none; }
.changelog-imgnote { font-size: 0.78em; color: #999; font-style: italic; margin: 0.5em 0; }
.changelog-snap-body {
  border-left: 3px solid var(--rule);
  padding: 0.2em 0 0.2em 1em;
  margin-top: 0.5em;
  background: #fafafa;
}

/* Featured collection promo, pinned at the top of the home page (layouts/index.html).
   Configured centrally via [params.featured] in hugo.toml. Text on the left, optional
   item thumbnails on the right. */
.home-featured {
  display: flex;
  align-items: stretch;
  gap: 16px;
  margin: 0 0 28px;
  padding: 13px 16px;
  border: 1px solid var(--rule);
  border-radius: 3px;
  background: #fffaf3;
  text-decoration: none;
}
.home-featured:hover {
  background: #fff4e6;
  text-decoration: none;
}
.home-featured .home-featured-body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  flex: 1 1 auto;
  min-width: 0;
}
/* Title pinned top-left; message vertically centred in the space below it (margin:auto). */
.home-featured .home-featured-kicker {
  font-size: 12px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--orange-dark);
}
.home-featured .home-featured-text {
  margin: auto 0;
  font-size: 17px;
  color: var(--text);
}
.home-featured .home-featured-thumbs {
  display: flex;
  gap: 8px;
  flex: 0 0 auto;
  align-self: center;
}
.home-featured .home-featured-thumb {
  width: 76px;
  height: 76px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid var(--rule);
  display: block;
}
@media (max-width: 520px) {
  .home-featured .home-featured-thumbs { display: none; }
}

/* Pager (homepage/list pagination — Hugo's _internal/pagination.html) */
.pagination {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px;
  padding: 0;
  margin: 1.5rem 0 0.5rem;
}
.pagination .page-item .page-link {
  display: block;
  min-width: 2.1em;
  padding: 0.35em 0.6em;
  text-align: center;
  border: 1px solid var(--rule);
  border-radius: 4px;
  color: var(--link);
  background: var(--content-bg);
}
.pagination .page-item .page-link:hover { border-color: var(--orange); text-decoration: none; }
.pagination .page-item.active .page-link {
  background: var(--orange);
  border-color: var(--orange);
  color: #fff;
}
.pagination .page-item.disabled .page-link {
  color: var(--muted);
  border-color: var(--rule);
  opacity: 0.5;
  pointer-events: none;
}

/* Language-availability bar — a dismissible notice at the top of the content (above the page's
   own content) offering the parallel-language edition, dressed in the site's own catalog/editor's-
   note vocabulary (monospace language code + the orange signature left-rule + warm surface), NOT a
   browser language toast. Hidden by default (inline display:none); js/lang-avail.js reveals it only
   when the reader's browser accepts the linked language and hasn't dismissed it this session. Links
   to the other-language host (absolute URL). */
.lang-avail-bar {
  display: flex;                     /* revealed state; JS clears the inline display:none */
  align-items: center;
  gap: 0.6rem;
  /* Break out of #content's padding (26px top, 30px sides) → a full-width band flush to the
     content box's top and side edges (no white gap); re-inset the text by 30px so the chip
     aligns with the page title below. */
  margin: -26px -30px 22px;
  padding: 0.5rem 30px;
  background: #faf6ef;               /* warm surface of the in-body editor's note */
  border-bottom: 1px solid #f0d6ad;  /* the orange signature hairline, separating it from content */
}
.lang-avail-link {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  color: var(--text);
  text-decoration: none;
  font-size: 13px;
  line-height: 1.4;
}
/* the language code = the one accent: a catalog tag in the site's monospace face */
.lang-avail-code {
  flex: none;
  font-family: "DejaVu Sans Mono", "Courier New", monospace;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--orange-dark);
  border: 1px solid var(--orange);
  border-radius: 3px;
  padding: 1px 6px;
  transition: background-color 150ms ease, color 150ms ease;
}
.lang-avail-msg { color: #565656; }
.lang-avail-go {
  color: var(--orange-dark);
  font-weight: 700;
  transition: transform 150ms ease;
}
.lang-avail-link:hover .lang-avail-code { background: var(--orange); color: #fff; }
.lang-avail-link:hover .lang-avail-msg  { color: var(--text); }
.lang-avail-link:hover .lang-avail-go   { transform: translateX(3px); }
.lang-avail-link:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }
/* dismiss (×): a small square box (pairs with the language-code chip at the other end), sized to
   the existing row height so the bar doesn't grow; fills orange on hover. Not nested in the link. */
.lang-avail-close {
  flex: none;
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  padding: 0;
  background: none;
  border: 1px solid var(--orange);
  border-radius: 3px;
  cursor: pointer;
  color: var(--orange-dark);
  font-size: 14px;
  line-height: 1;
  transition: color 150ms ease, background-color 150ms ease;
}
.lang-avail-close:hover { background: var(--orange); color: #fff; }
.lang-avail-close:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }
@media (max-width: 860px) {
  /* match #content's mobile padding (20px 16px) so the band stays flush */
  .lang-avail-bar { margin: -20px -16px 18px; padding: 0.45rem 16px; }
}
@media (max-width: 640px) {
  .lang-avail-link { font-size: 12.5px; gap: 0.55rem; }
}
@media (prefers-reduced-motion: reduce) {
  .lang-avail-code, .lang-avail-go, .lang-avail-close { transition: none; }
  .lang-avail-link:hover .lang-avail-go { transform: none; }
}

/* External-link marker (Wikipedia-style ↗): appended by the render-link hook to markdown
   links that leave the site (class="external-link"). Rendered via CSS mask so the stroked
   SVG (static/external_ref.svg) takes the link's currentColor. Raw <a> in body.html includes
   are not touched (they never get the class). */
a.external-link::after {
  content: "";
  display: inline-block;
  width: 0.72em;
  height: 0.72em;
  margin-left: 0.12em;
  vertical-align: 0.08em;
  background-color: currentColor;
  -webkit-mask: url(/external_ref.svg) no-repeat center / contain;
          mask: url(/external_ref.svg) no-repeat center / contain;
}
