/* =============================================================
   ITI Design System — Single project
   Loaded only on project posts. Replaces css/single-project.css.

   Loaded alongside css/iti-projects.css, which carries the styling for
   the [projects_menu] rail this page shares with the listing.

   Three blocks on this page are shortcode output whose markup cannot be
   changed from the template — [project_content], [contact_template] and
   the two person shortcodes — so they are styled by the classes those
   shortcodes emit.
   ============================================================= */

.pj { font-family: var(--iti-font-sans); }

/* =========================================================
   Masthead additions
   ========================================================= */

/* Acronyms are short, uppercase and often carry digits or hyphens; the
   28ch cap the shared masthead sets for sentence-length titles is not
   needed and would wrap "ISS-EWATUS" oddly at narrow widths. */
.pj .project-acronym {
  max-width: none;
  letter-spacing: -.01em;
}

/* The link sits under the full title now, on the headline plate, rather than
   over the photograph. It was a white-on-dark chip and had to be redrawn:
   white at 6% and --iti-line-dark are both invisible on a white surface. */
.pj .website { margin: var(--iti-s-4) 0 0; }
.pj .website-link {
  display: inline-flex;
  align-items: center;
  gap: var(--iti-s-2);
  max-width: 100%;
  padding: .5rem .9rem;
  font-size: .88rem;
  font-weight: 500;
  color: var(--iti-blue);
  text-decoration: none;
  overflow-wrap: anywhere;
  background: var(--iti-paper);
  border: 1px solid var(--iti-line-strong);
  clip-path: var(--iti-clip-sm);
  transition: background var(--iti-dur) var(--iti-ease),
              border-color var(--iti-dur) var(--iti-ease),
              color var(--iti-dur) var(--iti-ease);
}
.pj .website-link svg { flex: none; color: var(--iti-electric); }
.pj .website-link:hover,
.pj .website-link:focus-visible {
  color: var(--iti-blue-700);
  background: var(--iti-surface);
  border-color: var(--iti-electric);
}

/* =========================================================
   Project name and full title, opening the body
   =========================================================
   The same component as .project-spec below it — white surface, hairline
   border, 3px electric rail, the same notch — so the two read as one family
   rather than as a decoration sitting on top of a table. A dark version of
   this looked striking on its own and wrong on the page: the body is paper,
   and an ink slab in the middle of it belonged to a different site.

   On a light ground the feel comes from line work rather than bloom, because
   glow does not exist over paper. What is left doing that work is the rail,
   the notch, a corner tick answering it, and one solid accent rule. */

.pj .pj-headline {
  position: relative;
  margin: 0 0 var(--iti-s-6);
  padding: var(--iti-s-5) var(--iti-s-6);
  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);
  overflow: hidden;
}

/* A corner tick at the top right — the drawing-board detail that the notch at
   the opposite corner answers. */
.pj .pj-headline::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 18px;
  height: 18px;
  border-top: 2px solid var(--iti-electric);
  border-right: 2px solid var(--iti-electric);
  opacity: .55;
}

.pj .pj-headline__title {
  margin: 0;
  /* The masthead's face and tracking, so the name is the same word set the
     same way in both places, only smaller here. It was in the mono face to
     separate the two; matching them reads as one identity instead. */
  font-family: var(--iti-font-sans);
  font-size: clamp(1.4rem, 1.05rem + 1.5vw, 2.2rem);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -.01em;
  color: var(--iti-ink-800);
  text-wrap: balance;
}

/* The one moving part: a charged rule that draws itself once between the name
   and the full title. Solid, not glowing — over paper a bloom reads as blur. */
.pj .pj-headline__title::after {
  content: "";
  display: block;
  width: min(100%, 11rem);
  height: 2px;
  margin-top: var(--iti-s-3);
  background: linear-gradient(to right, var(--iti-electric), rgba(var(--iti-electric-rgb), 0));
  transform-origin: left center;
  animation: iti-pj-charge .9s var(--iti-ease) both;
}

@keyframes iti-pj-charge {
  from { transform: scaleX(0); opacity: 0; }
  to   { transform: scaleX(1); opacity: 1; }
}

.pj .pj-headline__sub {
  max-width: 62ch;
  margin: var(--iti-s-4) 0 0;
  font-size: var(--iti-fs-lead);
  line-height: var(--iti-lh-body);
  /* A shade deeper than --iti-text-muted, which keeps the full title legible
     at a glance without competing with the name. */
  color: var(--iti-ink-600);
  text-wrap: pretty;
}

@media (prefers-reduced-motion: reduce) {
  .pj .pj-headline__title::after { animation: none; }
}

/* =========================================================
   Ταυτότητα Έργου — the specification table
   ========================================================= */

.pj .info-frame { margin-bottom: var(--iti-s-7); }

/* Ταυτότητα Έργου, and Επικοινωνία with it. One selector rather than two
   matching declarations, so the two section headings on this page cannot
   drift apart again. */
.pj .info-frame-title,
.pj .contact-heading {
  display: flex;
  align-items: center;
  gap: var(--iti-s-3);
  margin: 0 0 var(--iti-s-4);
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: .01em;
  text-transform: none;
  color: var(--iti-text);
}
.pj .info-frame-title::before,
.pj .contact-heading::before {
  content: "";
  width: 22px; height: 2px;
  background: var(--iti-electric);
  box-shadow: var(--iti-electric-glow);
  flex: none;
}

.pj .project-spec {
  margin: 0;
  padding: 0;
  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);
}
/* .row is the old name for these, but it is also bootstrap's, which is
   loaded site-wide and brings `display: flex` and -15px side margins. The
   grid below replaces the display; the margins have to be said too. */
.pj .project-spec .row {
  margin: 0;
  display: grid;
  grid-template-columns: minmax(0, 16rem) minmax(0, 1fr);
  gap: 0 var(--iti-s-4);
  padding: .75rem 1.1rem;
  border-bottom: 1px solid var(--iti-line);
}
.pj .project-spec .row:last-child { border-bottom: 0; }
/* Banded, as the old table was (`.gray` on alternate rows). */
.pj .project-spec .row:nth-child(odd) { background: var(--iti-paper); }

.pj .spec-key {
  margin: 0;
  font-size: .88rem;
  font-weight: 600;
  line-height: 1.5;
  color: var(--iti-text);
}
.pj .spec-value {
  margin: 0;
  font-size: .95rem;
  line-height: 1.5;
  color: var(--iti-text);
  overflow-wrap: anywhere;
}
/* Figures line up when they are the same width. The currency beside them
   is Latin here, but keep the face on the sans stack for the label-like
   part by scoping the mono to the row, not the word. */
.pj .spec-value--num {
  font-variant-numeric: tabular-nums;
  letter-spacing: .01em;
}

/* No rule under these, at rest or on hover. The underline was a border-bottom
   that turned from transparent to currentColor on hover, which is why it did
   not show up as a text-decoration. Colour alone carries the link now; the
   focus ring still marks it for anyone arriving by keyboard. */
.pj .spec-value a {
  color: var(--iti-blue);
  text-decoration: none;
  border-bottom: 0;
  transition: color var(--iti-dur) var(--iti-ease);
}
.pj .spec-value a:hover,
.pj .spec-value a:focus-visible {
  color: var(--iti-blue-700);
  text-decoration: none;
}

/* =========================================================
   Innovation logos
   ========================================================= */

.pj .innovation-logo {
  margin: 0 0 var(--iti-s-7);
  padding: var(--iti-s-5);
  background: var(--iti-surface);
  border: 1px solid var(--iti-line);
  clip-path: var(--iti-clip-sm);
  text-align: center;
}
.pj .innovation-logo img {
  max-width: 100%;
  height: auto;
  display: inline-block;
}

/* =========================================================
   Body — output of [project_content]:
     <img class="img-project-right"> + <div class="project-content">
   ========================================================= */

.pj .content-text {
  margin-bottom: var(--iti-s-7);
  padding: clamp(1.25rem, .8rem + 1.6vw, 2.25rem);
  background: var(--iti-surface);
  border: 1px solid var(--iti-line);
  clip-path: var(--iti-clip);
  /* The project logo floats right inside; without this the card collapses
     behind it when the copy is shorter than the image. */
  overflow: hidden;
}

.pj .content-text .img-project-right {
  float: right;
  max-width: 45%;
  height: auto;
  margin: 0 0 var(--iti-s-4) var(--iti-s-5);
}

.pj .content-text .project-content,
.pj .content-text > span {
  font-size: 1rem;
  line-height: 1.75;
  color: var(--iti-text);
}
.pj .content-text p { margin: 0 0 1.05em; }
.pj .content-text > span > p:last-child,
.pj .content-text .project-content > *:last-child { margin-bottom: 0; }
.pj .content-text strong, .pj .content-text b { font-weight: 600; color: var(--iti-text); }
.pj .content-text a {
  color: var(--iti-blue);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.pj .content-text a:hover { color: var(--iti-blue-700); }

.pj .content-text h2, .pj .content-text h3, .pj .content-text h4, .pj .content-text h5, .pj .content-text h6 {
  margin: 1.6em 0 .55em;
  font-weight: 600;
  line-height: 1.25;
  color: var(--iti-text);
}
.pj .content-text h2 { font-size: 1.3rem; }
.pj .content-text h3 { font-size: 1.15rem; }
.pj .content-text h4, .pj .content-text h5, .pj .content-text h6 { font-size: 1.05rem; }
.pj .content-text > span > *:first-child,
.pj .content-text .project-content > *:first-child { margin-top: 0; }

.pj .content-text ul, .pj .content-text ol { margin: 0 0 1.05em; padding-left: 1.4em; }
.pj .content-text ul li { list-style: disc; margin-bottom: .4em; }
.pj .content-text ol li { list-style: decimal; margin-bottom: .4em; }
.pj .content-text img { max-width: 100%; height: auto; }
.pj .content-text table { width: 100%; border-collapse: collapse; margin: 0 0 1.05em; }
.pj .content-text th, .pj .content-text td {
  border: 1px solid var(--iti-line);
  padding: .5rem .7rem;
  text-align: left;
}

/* =========================================================
   Contact — set to match the block on a single announcement:
   a cyan eyebrow heading over a paper panel inside a white card.

   [contact_template] emits, for this post type:
     <span class="contact">Επικοινωνία</span><br>
     <div class="people-contact"><h5>…</h5><p class="address">…</p></div>
   ========================================================= */

.pj .responsible {
  margin-bottom: var(--iti-s-6);
  padding: clamp(1.25rem, .8rem + 1.6vw, 2.25rem);
  background: var(--iti-surface);
  border: 1px solid var(--iti-line);
  clip-path: var(--iti-clip);
}

/* Same panel as .ann-contact. */
.pj .people-contact-panel {
  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;
}
.pj .people-contact-panel a { color: var(--iti-blue); }
.pj .people-contact-panel a:hover { color: var(--iti-blue-700); }

/* The shortcode's own label and the break after it. The heading above says
   the same word, so showing both would print it twice.

   On this post type it comes through as an <h2>, not the <span class="contact">
   the rule was written for, which is why "Επικοινωνία" was appearing twice —
   once as the eyebrow and once as a heading inside the panel. */
.pj .people-contact-panel > .contact,
.pj .people-contact-panel > .contact + br,
.pj .people-contact-panel > h2 { display: none; }

/* One contact from the next. A project can carry three scientific
   responsibles, and each one is a name, a room and an address block with
   nothing between them — the second name used to sit directly under the first
   one's e-mail, so the three read as one long address. */
.pj .people-contact-panel h5:not(:first-of-type) {
  margin-top: var(--iti-s-5);
  padding-top: var(--iti-s-5);
  border-top: 1px solid var(--iti-line-strong);
}

/* css/style.css gives .people-contact a 20px top margin, which pushed the
   name a line clear of the panel's own padding. */
.pj .people-contact-panel .people-contact { margin: 0; }

.pj .people-contact-panel .people-contact h5,
.pj .people-contact-panel h5 {
  margin: 0 0 var(--iti-s-2);
  font-size: 1.02rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--iti-text);
}
.pj .people-contact-panel .contact-title { display: inline; font-weight: 700; }
.pj .people-contact-panel .building-office { margin-bottom: .2rem; }
.pj .people-contact-panel .address,
.pj .people-contact-panel p {
  margin: 0;
  font-size: .95rem;
  line-height: 1.7;
  color: var(--iti-text);
}

/* =========================================================
   Back link
   ========================================================= */

.pj .project-back { margin: 0; }
.pj .iti-link-arrow {
  display: inline-flex;
  align-items: center;
  gap: var(--iti-s-2);
  font-size: .9rem;
  font-weight: 500;
  color: var(--iti-blue);
  text-decoration: none;
}
.pj .iti-link-arrow svg { transition: transform var(--iti-dur) var(--iti-ease); }
.pj .iti-link-arrow:hover { color: var(--iti-blue-700); }
.pj .iti-link-arrow:hover svg { transform: translateX(-3px); }

/* =========================================================
   Narrow screens
   ========================================================= */

@media (max-width: 700px) {
  .pj .project-spec .row {
    grid-template-columns: minmax(0, 1fr);
    gap: .15rem;
    padding: .7rem .9rem;
  }
  .pj .content-text .img-project-right {
    float: none;
    display: block;
    max-width: 100%;
    margin: 0 0 var(--iti-s-4);
  }
}
