/* =============================================================
   ITI Design System — Single announcement
   Loaded only on single announcement pages. Replaces
   css/single-announcements.css.

   Carries the same language as the home page's announcement log: the
   record opens on a dark masthead, the body is a chamfered article beside
   a category rail, and attachments are slates.
   ============================================================= */

/* =========================================================
   Masthead
   ========================================================= */

.ann-head {
  position: relative;
  overflow: hidden;
  background: var(--iti-ink-900);
  color: var(--iti-on-dark);
}
.ann-head__bg {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: center;
}
.ann-head__scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg,
    rgba(4, 18, 31, .96) 0%,
    rgba(4, 18, 31, .88) 38%,
    rgba(4, 18, 31, .5) 70%,
    rgba(4, 18, 31, .25) 100%);
}
.ann-head__grid {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    repeating-linear-gradient(to right, var(--iti-grid-line) 0 1px, transparent 1px 72px),
    repeating-linear-gradient(to bottom, var(--iti-grid-line) 0 1px, transparent 1px 72px);
  mask-image: linear-gradient(105deg, transparent 0%, #000 45%, #000 100%);
}
.ann-head__inner {
  position: relative;
  padding-block: clamp(2.25rem, 1.4rem + 3.2vw, 4rem);
}

/* breadcrumb trail */
.ann-crumbs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--iti-s-2);
  margin-bottom: var(--iti-s-5);
  font-size: var(--iti-fs-xs);
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--iti-on-dark-faint);
}
.ann-crumbs a { color: var(--iti-on-dark-muted); text-decoration: none; }
.ann-crumbs a:hover { color: var(--iti-electric); }
.ann-crumbs__sep { opacity: .5; }

.ann-head__meta {
  display: flex;
  align-items: center;
  gap: var(--iti-s-4);
  flex-wrap: wrap;
  margin-bottom: var(--iti-s-4);
}
.ann-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: var(--iti-track-label);
  text-transform: uppercase;
  color: var(--iti-ember-lit);
}
.ann-tag::before { content: "["; opacity: .6; }
.ann-tag::after  { content: "]"; opacity: .6; }

.ann-stamp {
  font-family: var(--iti-font-mono);
  font-variant-numeric: tabular-nums;
  font-size: .8rem;
  letter-spacing: .08em;
  color: var(--iti-electric);
}

.ann-head__title {
  max-width: 34ch;
  font-size: clamp(1.6rem, 1.1rem + 2.1vw, 2.8rem);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -.02em;
  color: var(--iti-on-dark);
  text-wrap: balance;
}

/* =========================================================
   Body
   ========================================================= */

.ann-body { padding-block: clamp(2.5rem, 1.6rem + 3vw, 4.5rem); background: var(--iti-paper); }
.ann-body__grid {
  display: grid;
  grid-template-columns: minmax(0, 260px) minmax(0, 1fr);
  gap: clamp(1.75rem, 1rem + 3vw, 3.5rem);
  align-items: start;
}

/* ---- category rail (output of the [announcements_menu] shortcode,
        so this styles markup the shortcode produces) ---- */
.ann-rail { position: sticky; top: 100px; }
.ann-rail__title {
  display: flex;
  align-items: center;
  gap: var(--iti-s-3);
  margin: 0 0 var(--iti-s-4);
  font-size: var(--iti-fs-xs);
  font-weight: 600;
  letter-spacing: var(--iti-track-label);
  text-transform: uppercase;
  color: var(--iti-electric-ink);
}
.ann-rail__title::before {
  content: "";
  width: 24px; height: 1px;
  background: var(--iti-electric);
  box-shadow: var(--iti-electric-glow);
  flex: none;
}
/* css/loops-pages.css styles this shortcode's markup for the old design:
   `.main-menu { border-left: 4px solid #0071bb !important; padding: 15px;
   box-shadow: ... }` plus a 15px grey link style. The !important border is
   the blue stripe; it has to be matched to be removed. */
.ann-rail .main-menu {
  border-left: 0 !important;
  padding: 0 !important;
  box-shadow: none !important;
  color: inherit !important;
}
.ann-rail .menu-list {
  display: grid;
  margin: 0 !important;
  padding: 0 !important;
  background: var(--iti-surface);
  border: 1px solid var(--iti-line);
  border-left: 3px solid var(--iti-rail-accent);
  box-shadow: var(--iti-electric-glow-edge);
  clip-path: var(--iti-clip-sm);
}
.ann-rail .menu-style { margin: 0; border-bottom: 1px solid var(--iti-line); }
.ann-rail .menu-style:last-child { border-bottom: 0; }

/* Every category is a sibling, so they all get the same treatment. The
   shortcode tags two of the four with `inner-menu`, which used to make them
   smaller and greyer than the others for no reason the reader can see. */
.ann-rail .menu-style a,
.ann-rail .inner-menu a {
  display: block;
  padding: .72rem 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);
}
.ann-rail .menu-style a:hover,
.ann-rail .inner-menu a:hover {
  background: var(--iti-paper);
  border-left-color: var(--iti-electric-dim);
  color: var(--iti-blue);
}
.ann-rail .highlight a,
.ann-rail .inner-menu.highlight a {
  background: var(--iti-ink-700);
  border-left-color: var(--iti-electric);
  color: var(--iti-on-dark);
  font-weight: 600;
}
.ann-rail .highlight a:hover,
.ann-rail .inner-menu.highlight a:hover { background: var(--iti-ink-600); color: var(--iti-on-dark); }

/* ---- article ---- */
.ann .single-post-container {
  padding: clamp(1.25rem, .8rem + 1.6vw, 2.25rem);
  background: var(--iti-surface);
  border: 1px solid var(--iti-line);
  clip-path: var(--iti-clip);
}

.ann .image-display {
  position: relative;
  margin: 0 0 var(--iti-s-6);
  overflow: hidden;
  background: var(--iti-ink-900);
  clip-path: var(--iti-clip-sm);
}
.ann .image-display img { width: 100%; height: auto; display: block; }
.ann .image-display::after {
  content: "";
  position: absolute;
  left: 12px; top: 12px;
  width: 18px; height: 18px;
  border-left: 1px solid var(--iti-electric);
  border-top: 1px solid var(--iti-electric);
  opacity: .9;
}

/* rich text from the editor */
.ann .content-text { color: var(--iti-text); font-size: 1rem; line-height: 1.75; }
.ann .content-text > *:first-child { margin-top: 0; }
.ann .content-text > *:last-child { margin-bottom: 0; }
.ann .content-text p { margin: 0 0 1.05em; }
.ann .content-text strong, .ann .content-text b { font-weight: 600; color: var(--iti-text); }
.ann .content-text a { color: var(--iti-blue); text-decoration: underline; text-underline-offset: 2px; }
.ann .content-text a:hover { color: var(--iti-blue-700); }
.ann .content-text h1, .ann .content-text h2, .ann .content-text h3, .ann .content-text h4 {
  margin: 1.8em 0 .6em;
  font-weight: 600;
  line-height: 1.3;
  color: var(--iti-text);
}
.ann .content-text h2 { font-size: 1.3rem; }
.ann .content-text h3 { font-size: 1.12rem; }
.ann .content-text ul, .ann .content-text ol { margin: 0 0 1.05em; padding-left: 1.4em; }
.ann .content-text ul li { list-style: disc; margin-bottom: .4em; }
.ann .content-text ol li { list-style: decimal; margin-bottom: .4em; }
.ann .content-text img { max-width: 100%; height: auto; }
.ann .content-text table { width: 100%; border-collapse: collapse; margin: 0 0 1.05em; }
.ann .content-text th, .ann .content-text td { border: 1px solid var(--iti-line); padding: .5rem .7rem; text-align: left; }

/* ---- section heading inside the article ---- */
.ann .head-attachments {
  margin-top: var(--iti-s-7);
  padding-top: var(--iti-s-5);
  border-top: 1px solid var(--iti-line);
}
.ann .attachment-title {
  display: flex;
  align-items: center;
  gap: var(--iti-s-3);
  margin: 0 0 var(--iti-s-4);
  font-size: var(--iti-fs-xs);
  font-weight: 600;
  letter-spacing: var(--iti-track-label);
  text-transform: uppercase;
  color: var(--iti-electric-ink);
}
.ann .attachment-title::before {
  content: "";
  width: 24px; height: 1px;
  background: var(--iti-electric);
  box-shadow: var(--iti-electric-glow);
  flex: none;
}

/* ---- attachments ---- */
.ann .attachment-files { display: grid; gap: var(--iti-s-3); }
.ann .load-attachment-link {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: var(--iti-s-4);
  align-items: center;
  padding: var(--iti-s-4);
  background: var(--iti-ink-700);
  border: 1px solid var(--iti-line-dark);
  color: var(--iti-on-dark);
  text-decoration: none;
  clip-path: var(--iti-clip-sm);
  transition: border-color var(--iti-dur) var(--iti-ease),
              transform var(--iti-dur) var(--iti-ease);
}
.ann .load-attachment-link:hover {
  border-color: var(--iti-electric);
  transform: translateX(3px);
  color: var(--iti-on-dark);
}
.ann .load-attachment {
  display: grid;
  place-items: center;
  width: 42px; height: 42px;
  border: 1px solid rgba(var(--iti-electric-rgb), .45);
  color: var(--iti-electric);
}
.ann .attachment-title-text {
  font-size: .95rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--iti-on-dark);
}
.ann .attachment-subtitle-text {
  margin-top: 2px;
  font-size: var(--iti-fs-sm);
  color: var(--iti-on-dark-muted);
}
.ann .file-size {
  font-family: var(--iti-font-mono);
  font-variant-numeric: tabular-nums;
  font-size: .78rem;
  letter-spacing: .04em;
  color: var(--iti-electric);
  white-space: nowrap;
}
.ann .rest-attachment-title {
  display: inline-flex;
  align-items: center;
  gap: var(--iti-s-2);
  font-size: var(--iti-fs-xs);
  font-weight: 600;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--iti-electric);
  white-space: nowrap;
}
.ann .rest-attachment-title svg { transition: transform var(--iti-dur) var(--iti-ease); }
.ann .load-attachment-link:hover .ann .rest-attachment-title svg { transform: translateX(4px); }

/* ---- contact ---- */
.ann .internship_contact {
  padding: var(--iti-s-5);
  background: var(--iti-paper);
  border: 1px solid var(--iti-line);
  clip-path: var(--iti-clip-sm);
  color: var(--iti-text);
  line-height: 1.7;
}
.ann .internship_contact a { color: var(--iti-blue); }

/* ---- back link ---- */
.ann .announcement-back { margin-top: var(--iti-s-6); }

@media (max-width: 900px) {
  .ann-body__grid { grid-template-columns: 1fr; }
  .ann-rail { position: static; }
}
@media (max-width: 560px) {
  .ann .load-attachment-link { grid-template-columns: 36px minmax(0, 1fr); }
  .ann .rest-attachment-title { display: none; }
}

/* =========================================================
   Listing (template-announcements-list.php)
   Same slate language as the home page's announcement log.

   Accessibility: the card is NOT one big link. The heading carries the
   only link, so its accessible name is the announcement title rather than
   the ~435 characters of tag + date + title + excerpt that a whole-card
   anchor produced; the link is then stretched over the slate so the card
   still behaves as one target. Hover and focus are driven from the card
   via :hover / :focus-within.
   ========================================================= */

.annlist { display: grid; gap: var(--iti-s-4); }

.annlist__entry {
  position: relative;
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr) 20px;
  gap: var(--iti-s-5);
  align-items: center;
  overflow: hidden;
  padding: var(--iti-s-4) var(--iti-s-5) var(--iti-s-4) calc(var(--iti-s-5) + 4px);
  background: var(--iti-surface);
  border: 1px solid var(--iti-line);
  color: var(--iti-text);
  clip-path: var(--iti-clip);
  transition: border-color var(--iti-dur) var(--iti-ease),
              transform var(--iti-dur) var(--iti-ease),
              box-shadow var(--iti-dur) var(--iti-ease);
}
/* A listing with no thumbnails: the media column goes with the picture, or
   the text would sit in the middle of the card with 132px of nothing beside
   it. */
.annlist__entry--no-media { grid-template-columns: minmax(0, 1fr) 20px; }

.annlist__entry:hover,
.annlist__entry:focus-within {
  border-color: var(--iti-electric-dim);
  transform: translateX(4px);
  box-shadow: 0 12px 28px rgba(6, 25, 44, .13);
}

/* the stretched link: one target, named by the heading */
.annlist__link { color: inherit; text-decoration: none; }
.annlist__link::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
}
/* keyboard focus has to be visible on the card, not on the inline text.
   :focus-within was the obvious way to lift the ring from the link to the
   card around it, and it has no -visible counterpart: it answers "is focus
   inside me", which a mouse click satisfies just as well as a Tab. So
   clicking a card left it ringed until focus moved elsewhere. :has() asks the
   narrower question — is the link inside me focused THE WAY A KEYBOARD
   focuses — and that is the one worth drawing. */
.annlist__link:focus-visible { outline: none; }
.annlist__entry:has(.annlist__link:focus-visible) {
  outline: 2px solid var(--iti-electric);
  outline-offset: 2px;
}

/* lit edge */
.annlist__rail {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--iti-electric-dim);
  opacity: .6;
  transform: scaleY(.35);
  transform-origin: top;
  transition: transform .45s var(--iti-ease), opacity .45s var(--iti-ease);
}
.annlist__entry:hover .annlist__rail,
.annlist__entry:focus-within .annlist__rail {
  transform: scaleY(1);
  opacity: 1;
}

.annlist__media {
  position: relative;
  display: block;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--iti-paper-2);
  border: 1px solid var(--iti-line);
}
.annlist__media img {
  position: relative;   /* sits above the placeholder */
  z-index: 1;
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .5s var(--iti-ease);
}
.annlist__entry:hover .annlist__media img { transform: scale(1.05); }
/* js/iti-announcement.js sets this when a thumbnail fails to load */
.annlist__media img[data-failed="true"] { opacity: 0; }
.annlist__media-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--iti-text-decor);
}

.annlist__body { min-width: 0; }

.annlist__meta {
  display: flex;
  align-items: center;
  gap: var(--iti-s-4);
  flex-wrap: wrap;
  margin: 0 0 var(--iti-s-2);
}
.annlist__tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: .64rem;
  font-weight: 600;
  letter-spacing: var(--iti-track-label);
  text-transform: uppercase;
  color: var(--iti-ember-ink);
}
.annlist__tag::before { content: "["; opacity: .6; }
.annlist__tag::after  { content: "]"; opacity: .6; }
/* The date reads as running text, not a code stamp, so it stays in the
   body face — it also carries a Greek month name, which the mono face
   has no glyphs for. */
.annlist__stamp {
  font-size: .78rem;
  font-weight: 500;
  letter-spacing: .01em;
  color: var(--iti-text-muted);
}

.annlist__title {
  margin: 0;
  font-size: clamp(1rem, .92rem + .35vw, 1.2rem);
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -.01em;
  color: var(--iti-text);
}
.annlist__title a { color: var(--iti-text); transition: color var(--iti-dur) var(--iti-ease); }
.annlist__entry:hover .annlist__title a,
.annlist__entry:focus-within .annlist__title a { color: var(--iti-blue); }

.annlist__excerpt {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: var(--iti-s-2) 0 0;
  font-size: var(--iti-fs-sm);
  line-height: 1.6;
  color: var(--iti-text-muted);
}

.annlist__go {
  align-self: center;
  color: var(--iti-text-decor);
  transition: transform var(--iti-dur) var(--iti-ease);
}
.annlist__entry:hover .annlist__go { transform: translateX(4px); }

.annlist__empty {
  padding: var(--iti-s-6);
  background: var(--iti-surface);
  border: 1px solid var(--iti-line);
  color: var(--iti-text-muted);
  clip-path: var(--iti-clip-sm);
  line-height: var(--iti-lh-body);
}
/* This panel can carry a link now — the English internships page points at
   the Greek listing rather than saying it is empty. */
.annlist__empty a {
  color: var(--iti-blue);
  font-weight: 600;
  text-decoration: none;
  /* No rule under it, as on the project table: colour and weight carry the
     link, and the focus ring still marks it for keyboard users. */
  border-bottom: 0;
}
.annlist__empty a:hover,
.annlist__empty a:focus-visible { color: var(--iti-blue-700); }

/* ---- pagination ---- */
.annpager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--iti-s-4);
  flex-wrap: wrap;
  margin-top: var(--iti-s-6);
  padding-top: var(--iti-s-5);
  border-top: 1px solid var(--iti-line-strong);
}
.annpager__status {
  margin: 0;
  font-family: var(--iti-font-mono);
  font-variant-numeric: tabular-nums;
  font-size: .78rem;
  letter-spacing: .05em;
  color: var(--iti-text-muted);
}
.annpager__links { display: flex; align-items: center; gap: var(--iti-s-2); flex-wrap: wrap; }
.annpager__links .page-numbers {
  display: inline-grid;
  place-items: center;
  min-width: 38px;
  height: 38px;
  padding: 0 .6rem;
  background: var(--iti-surface);
  border: 1px solid var(--iti-line);
  font-size: .85rem;
  font-weight: 600;
  color: var(--iti-text);
  text-decoration: none;
  clip-path: var(--iti-clip-sm);
  transition: border-color var(--iti-dur) var(--iti-ease),
              background var(--iti-dur) var(--iti-ease),
              color var(--iti-dur) var(--iti-ease);
}
.annpager__links a.page-numbers:hover {
  border-color: var(--iti-electric-dim);
  color: var(--iti-blue);
}
.annpager__links .page-numbers.current {
  background: var(--iti-ink-700);
  border-color: var(--iti-electric);
  color: var(--iti-on-dark);
}
.annpager__links .page-numbers.dots {
  border-color: transparent;
  background: transparent;
  color: var(--iti-text-faint);
}
.annpager__links .prev,
.annpager__links .next { font-size: .78rem; letter-spacing: .04em; text-transform: uppercase; }

@media (max-width: 640px) {
  .annlist__entry { grid-template-columns: 88px minmax(0, 1fr); padding: var(--iti-s-4); }
  .annlist__entry--no-media { grid-template-columns: minmax(0, 1fr); }
  .annlist__go { display: none; }
  .annpager { flex-direction: column; align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  .annlist__rail { transition: none; }
}
