/* ==========================================================================
   Pillar page (pillar.html) — the redesign that replaced the Figma layout
   Concept: "the column". Every chapter has a left rail with its name and a
   thin vertical line (the pillar) that fills with the pillar colour as you
   read that chapter. Colour roles: the site primary (blue) for every action
   and link; the pillar colour only as its brand mark (hero number, module
   numbers). The rail line is a soft light blue. Surfaces: white and the faint
   --color-bg-board (Μαθήματα, Πώς ξεκινάτε, FAQ); course rows one step
   darker than it (--color-row-bg-tinted).
   Reuses: site-header, page-hero, page-tabs, video-feature, video-lightbox,
   course-table + course-list.js, faq (unchanged, .faq--band), newsletter,
   site-footer.
   Behaviour: js/pillar-page.js (sticky tabs, rail progress, course list).
   If approved, each block below moves to its own component file.
   ========================================================================== */

.page-pillar {
  --tabs-height: 64px;
  --chapter-space: 120px;
}

/* ---- Hero additions --------------------------------------------------------- */
/* One composition at the bottom: breadcrumb, then "02 | title + lead" held
   together by the divider, with the key facts on the right ending on the same
   line as the lead. The upper part is left to the photo. */
.page-pillar .page-hero__inner {
  min-height: 700px;
  padding-top: calc(var(--navbar-height) + 37px + 40px); /* overlay header + topbar + air */
  padding-bottom: 64px;
}

.page-pillar .page-hero .breadcrumb {
  margin-bottom: 32px;
}

/* Same treatment as the Δράσεις hero (.page-hero--simple): navy tint over the
   photo, rgba(4, 36, 74, .62), plus a little extra depth at the bottom where
   the text sits, and the blue glow in place of the logo watermark. */
.page-pillar .page-hero__media::after {
  background:
    linear-gradient(to top, rgb(4 36 74 / 50%) 0%, rgb(4 36 74 / 0%) 55%),
    rgb(4 36 74 / 62%);
}

.page-pillar .page-hero__inner::before {
  top: -1827.99px;
  left: -288.55px;
  width: 1885.99px;
  height: 3376.49px;
  opacity: 1;
  background-image: url("../../assets/images/hero-glow-blue.svg");
  transform: rotate(64.29deg);
}

.page-hero__row {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 80px;
}

.page-pillar .page-hero__heading {
  margin-bottom: 0;
}

/* Title and lead share the title's left edge */
.page-hero__text {
  order: 2;
}

/* The Figma divider now runs beside both title and lead */
.page-pillar .page-hero__heading::after {
  height: auto;
  align-self: stretch;
  margin-bottom: 4px;
}

.page-hero__lead {
  max-width: 540px;
  margin-top: 20px;
  color: rgb(255 255 255 / 85%);
  font-size: 17px;
  line-height: 26px;
}

/* Key facts: a small, quiet ruled list (value | label) */
.page-hero__facts {
  width: 300px;
  flex: none;
  margin-bottom: 2px;
  border-top: 1px solid rgb(255 255 255 / 16%);
}

.page-hero__facts div {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  align-items: baseline;
  gap: 12px;
  padding-block: 7px;
  border-bottom: 1px solid rgb(255 255 255 / 10%);
}

.page-hero__facts dt {
  color: var(--white);
  font-size: 15px;
  font-weight: var(--font-weight-medium);
  line-height: 22px;
}

.page-hero__facts dd {
  margin: 0;
  color: var(--color-breadcrumb);
  font-size: var(--font-size-sm);
  line-height: 22px;
}

/* ---- Sticky tabs with the current chapter -------------------------------- */
.page-pillar .page-tabs {
  position: sticky;
  z-index: 20;
  top: var(--navbar-height); /* right under the sticky header */
  transition: top var(--transition-fast);
  border-bottom: 1px solid var(--color-rule);
  background: var(--color-bg);
}

.page-pillar .page-tabs__list {
  gap: 48px;
}

.page-pillar .page-tabs__link {
  padding-block: 20px;
  color: var(--color-ink-soft);
  font-size: var(--font-size-base);
}

.page-pillar .page-tabs__link[aria-current="true"] {
  color: var(--color-heading);
  font-weight: var(--font-weight-medium);
}

.page-pillar .page-tabs__link::after {
  right: 0;
  left: 0;
  height: 3px;
  border-radius: 0;
}

/* Anchors land under the sticky header + sticky tabs */
.page-pillar .chapter {
  scroll-margin-top: calc(var(--navbar-height) + var(--tabs-height));
}

/* ---- Chapter: rail + body ------------------------------------------------- */
.chapter {
  padding-block: var(--chapter-space);
}

.chapter + .chapter {
  border-top: 1px solid var(--color-rule);
}

.chapter--tinted {
  border-top-color: transparent;
  background: var(--color-bg-board); /* same faint background as the FAQ band */
}

.chapter--tinted + .chapter {
  border-top-color: transparent;
}

.chapter__inner {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 9fr);
  column-gap: 64px;
}

/* The column: a 2px line on the rail's right edge, filled by --progress (0–1) */
.chapter__rail {
  position: relative;
  padding-right: 40px;
}

.chapter__rail::before,
.chapter__rail::after {
  position: absolute;
  top: 0;
  right: 0;
  width: 2px;
  content: "";
}

.chapter__rail::before {
  bottom: 0;
  background: var(--color-rule);
}

.chapter--tinted .chapter__rail::before {
  background: color-mix(in srgb, var(--color-primary) 10%, transparent);
}

.chapter__rail::after {
  z-index: 1;
  height: calc(var(--progress, 0) * 100%);
  background: var(--color-progress);
}

.chapter__rail-inner {
  position: sticky;
  top: calc(var(--tabs-height) + 40px);
}

.chapter__title {
  color: var(--color-heading);
  font-size: 40px;
  font-weight: var(--font-weight-medium);
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.chapter__note {
  max-width: 300px;
  margin-top: 16px;
  color: var(--color-ink-soft);
  font-size: var(--font-size-base);
  line-height: 26px;
}

.chapter__body {
  min-width: 0;
  max-width: 1000px;
}

.chapter__subtitle {
  margin-top: 72px;
  color: var(--color-heading);
  font-size: 20px;
  font-weight: var(--font-weight-medium);
  line-height: 28px;
}

/* ---- Overview --------------------------------------------------------------- */
.lead {
  color: var(--color-heading);
  font-size: 28px;
  letter-spacing: -0.01em;
  line-height: 40px;
}

.prose {
  max-width: 720px;
  margin-top: 28px;
  color: var(--color-ink-soft);
  font-size: 17px;
  line-height: 28px;
}

.overview__button {
  margin-top: 32px;
}

/* Photo in the pillar's duotone: greyscale over navy, so all photos match */
.duotone {
  overflow: hidden;
  background: var(--navy-900, #04244a);
}

.duotone img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(1) contrast(1.05);
  mix-blend-mode: luminosity;
  opacity: 0.9;
}

.overview__photo {
  aspect-ratio: 16 / 7;
  margin-top: 56px;
}

/* What the business gains: a ruled list, not cards */
.gain-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0 40px;
  margin-top: 24px;
}

.gain-list li {
  padding-top: 20px;
  border-top: 2px solid var(--color-heading);
}

.gain-list h4 {
  color: var(--color-heading);
  font-size: 18px;
  font-weight: var(--font-weight-medium);
  line-height: 26px;
}

.gain-list p {
  margin-top: 8px;
  color: var(--color-ink-soft);
  font-size: var(--font-size-base);
  line-height: 24px;
}

/* ---- Courses: module tabs (the course filter) ------------------------------ */
/* Equal bordered boxes so they read as choices; the selected one is blue. */
.module-tabs {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.module-tab {
  display: flex;
  height: 100%;
  width: 100%;
  min-height: 112px;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 16px 18px;
  border: 1px solid var(--color-rule);
  border-radius: 8px;
  background: var(--white);
  color: var(--color-heading);
  cursor: pointer;
  text-align: start;
  transition: border-color var(--transition-fast), background var(--transition-fast), box-shadow var(--transition-fast);
}

.module-tab:hover {
  border-color: color-mix(in srgb, var(--color-primary) 45%, transparent);
}

.module-tab[aria-pressed="true"] {
  border-color: var(--color-primary);
  background: color-mix(in srgb, var(--color-primary) 6%, var(--white));
  box-shadow: inset 0 0 0 1px var(--color-primary);
}

.module-tab:focus-visible {
  outline-offset: 3px;
}

.module-tab__number {
  color: var(--accent-ink, var(--color-primary));
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  font-variant-numeric: tabular-nums;
}

.module-tab__name {
  font-size: 16px;
  font-weight: var(--font-weight-medium);
  line-height: 22px;
}

/* "Όλες" has no number: its name lines up with the others' names */
.module-tab--all .module-tab__name {
  margin-top: 25px;
}

.module-tab[aria-pressed="true"] .module-tab__name {
  color: var(--color-primary);
}

/* Counts line up at the bottom of every box */
.module-tab__count {
  margin-top: auto;
  padding-top: 6px;
  color: var(--color-ink-soft);
  font-size: var(--font-size-sm);
}

/* What the selected module teaches (platform learning objectives) */
.module-note {
  max-width: 760px;
  margin-top: 28px;
  padding-left: 20px;
  border-left: 3px solid var(--accent, var(--color-primary));
  color: var(--color-ink-soft);
  font-size: 17px;
  line-height: 28px;
}

/* Course table, full-list skin: faint rows, no inner scroll box (first 8 + "show all") */
.course-list--full {
  margin-top: 40px;
}

.course-list--full .course-table {
  margin: -6px 0 0;
  border-spacing: 0 6px;
}

.course-list--full .course-table th {
  position: static;
  height: 44px;
  border-bottom: 0;
  background: transparent; /* sits on the tinted chapter */
  color: var(--color-ink-soft);
  font-size: var(--font-size-sm);
}

.course-list--full .course-table th:first-child,
.course-list--full .course-table td:first-child {
  padding-left: 20px;
}

/* Rows 6px apart (as in Figma), one step darker than the tinted chapter */
.course-list--full .course-table td {
  height: 64px;
  border-bottom: 0;
  background: var(--color-row-bg-tinted);
  transition: background var(--transition-fast);
}

.course-list--full .course-table tbody tr:hover td {
  background: var(--color-row-bg-tinted-hover);
}

.course-list--full .course-table__col-number { width: 76px; }
.course-list--full .course-table__col-module { width: 300px; }
.course-list--full .course-table__col-level { width: 150px; }

.course-list--full .course-table__number {
  width: auto;
  height: auto;
  background: none;
  color: var(--color-ink-soft);
  font-variant-numeric: tabular-nums;
  place-items: start;
}

.course-list--full .course-table__title {
  font-size: 17px;
}

.course-list--full .course-table__title a {
  color: var(--color-heading);
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 4px;
  transition: text-decoration-color var(--transition-fast), color var(--transition-fast);
}

.course-list--full .course-table__title a:hover {
  color: var(--color-primary);
  text-decoration-color: currentColor;
}

/* Modules are told apart by number, not by colour */
.course-list--full .course-table__module {
  color: var(--color-ink-soft);
  font-size: 15px;
}

.course-list--full .course-table__module::before {
  display: none;
}

.course-list--full .course-table__level {
  --bar-on: var(--color-table-head);

  color: var(--color-ink-soft);
  font-size: 15px;
}

/* First 8 courses; "Δείτε και τα 25" opens the rest (module tabs show all of theirs) */
.course-list--full .is-collapsed tbody tr:nth-child(n + 9) {
  display: none;
}

.course-list__more {
  margin-top: 28px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--color-primary);
  cursor: pointer;
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-medium);
  text-decoration: underline;
  text-underline-offset: 5px;
}

.course-list__more[hidden] {
  display: none;
}

/* ---- Video ------------------------------------------------------------------ */
.video-meta {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
  gap: 40px;
  margin-top: 28px;
}

.video-meta__speaker {
  color: var(--color-heading);
  font-size: 17px;
  font-weight: var(--font-weight-medium);
  line-height: 26px;
}

.video-meta__role {
  color: var(--color-ink-soft);
  font-size: var(--font-size-base);
  line-height: 24px;
}

.video-meta__text {
  color: var(--color-ink-soft);
  font-size: 17px;
  line-height: 28px;
}

.text-link {
  color: var(--color-primary);
  font-weight: var(--font-weight-medium);
  text-decoration: underline;
  text-underline-offset: 4px;
}

.text-link:hover {
  text-decoration-thickness: 2px;
}

/* ---- How to start: a real sequence, so numbered, joined by a line --------- */
.step-line {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 32px;
}

.step-line::before {
  position: absolute;
  top: 19px;
  right: 0;
  left: 0;
  height: 2px;
  background: color-mix(in srgb, var(--color-primary) 25%, transparent);
  content: "";
}

.step-line li {
  position: relative;
}

.step-line__number {
  display: grid;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--color-primary);
  color: var(--white);
  font-weight: var(--font-weight-medium);
  place-items: center;
}

.step-line h3 {
  margin-top: 20px;
  color: var(--color-heading);
  font-size: 18px;
  font-weight: var(--font-weight-medium);
  line-height: 26px;
}

.step-line p {
  margin-top: 6px;
  color: var(--color-ink-soft);
  font-size: var(--font-size-base);
  line-height: 24px;
}

/* Where the courses happen: the learning platform */
.platform-note {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 32px;
  margin-top: 64px;
  padding: 32px;
  background: var(--white);
}

.platform-note__text {
  max-width: 520px;
  color: var(--color-ink-soft);
  font-size: 17px;
  line-height: 28px;
}

.platform-note__text strong {
  color: var(--color-heading);
  font-weight: var(--font-weight-medium);
}

/* One row: the secondary link sits left of the button, both centred on it */
.platform-note__actions {
  display: flex;
  flex-direction: row-reverse;
  align-items: center;
  gap: 28px;
  white-space: nowrap;
}

/* Self-assessment: the shared banner (assessment-promo.css) on a white strip
   between «Πώς ξεκινάτε» and the FAQ (both tinted) */
.pillar-assessment {
  padding-block: 80px;
  background: var(--white);
}

/* ---- FAQ: the global component (faq.css, .faq--band) as on the homepage --- */
.page-pillar .faq {
  scroll-margin-top: calc(var(--navbar-height) + var(--tabs-height));
}

/* ---- Laptop ------------------------------------------------------------------ */
@media (max-width: 1500px) {
  .page-pillar {
    --chapter-space: 100px;
  }

  .chapter__inner {
    grid-template-columns: minmax(0, 1fr) minmax(0, 3fr);
    column-gap: 48px;
  }

  .chapter__rail {
    padding-right: 32px;
  }

  .chapter__title {
    font-size: 34px;
  }

  .module-tabs {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .course-list--full .course-table__col-module { width: 26%; }
}

/* ---- Tablet: rail above the body, no sticky rail ---------------------------- */
@media (max-width: 1280px) {
  .page-pillar .page-tabs {
    transition: top var(--transition-fast); /* follows the compact header */
  }

  .page-pillar .page-hero__inner {
    min-height: 560px;
    padding-top: 40px; /* the header is no longer laid over the hero */
    padding-bottom: 48px;
  }

}

@media (max-width: 1100px) {
  .page-pillar {
    --chapter-space: 80px;
  }

  .page-hero__row {
    flex-direction: column;
    align-items: flex-start;
    gap: 32px;
  }

  /* Facts start where the title text starts: fixed number width (68px)
     + divider margins (24 + 1 + 28) − the heading's −3px nudge */
  .page-pillar .page-hero__number {
    width: 68px;
    flex: none;
  }

  .page-hero__facts {
    width: calc(100% - 118px);
    max-width: 420px;
    margin-left: 118px;
  }

  .chapter__inner {
    grid-template-columns: minmax(0, 1fr);
  }

  .chapter__rail {
    margin-bottom: 40px;
    padding-right: 0;
  }

  .chapter__rail::before,
  .chapter__rail::after {
    display: none;
  }

  .chapter__rail-inner {
    position: static;
  }

  .chapter__note {
    max-width: 560px;
  }

  /* Module tabs scroll sideways */
  .module-tabs {
    display: flex;
    overflow-x: auto;
    margin-inline: calc(-1 * var(--page-padding));
    padding-inline: var(--page-padding);
    scrollbar-width: none;
  }

  .module-tabs::-webkit-scrollbar {
    display: none;
  }

  .module-tabs li {
    flex: 0 0 190px;
  }

  .gain-list {
    grid-template-columns: minmax(0, 1fr);
    gap: 28px;
  }

  .step-line {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    row-gap: 40px;
  }

  .step-line::before {
    display: none;
  }

  .platform-note {
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
  }

  .platform-note__actions {
    flex-direction: row;
    align-items: center;
    gap: 24px;
  }

  .video-meta {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
  }

  /* Course rows as ruled list items (course-list.css switches to cards here) */
  .course-list--full .course-table tbody {
    gap: 6px;
    padding-right: 0;
  }

  .course-list--full .course-table tr {
    grid-template-columns: 32px minmax(0, 1fr) auto;
    padding: 16px 18px;
    background: var(--color-row-bg-tinted);
  }

  .course-list--full .course-table td,
  .course-list--full .course-table td:first-child {
    background: none;
  }

  .course-list--full .course-table td {
    height: auto;
    border-bottom: 0;
  }
}

/* ---- Phone ------------------------------------------------------------------ */
@media (max-width: 700px) {
  .page-pillar {
    --chapter-space: 56px;
  }

  .page-pillar .page-hero__inner {
    min-height: 0;
    padding-top: 28px;
  }

  .page-pillar .page-hero .breadcrumb {
    margin-bottom: 72px;
  }


  .page-pillar .page-hero__number {
    width: auto;
  }

  .page-hero__facts {
    width: 100%;
    margin-left: 0;
  }

  .page-hero__lead {
    margin-top: 16px;
    font-size: var(--font-size-base);
    line-height: 25px;
  }


  /* Smaller sticky tabs on phones */
  .page-pillar {
    --tabs-height: 46px;
  }

  .page-pillar .page-tabs__list {
    gap: 22px;
  }

  .page-pillar .page-tabs__link {
    padding-block: 12px;
    font-size: var(--font-size-sm);
    line-height: 20px;
  }

  .page-pillar .page-tabs__link::after {
    height: 2px;
  }

  .chapter__rail {
    margin-bottom: 28px;
  }

  .chapter__title {
    font-size: 30px;
  }

  .lead {
    font-size: 22px;
    line-height: 32px;
  }

  .prose {
    font-size: var(--font-size-base);
    line-height: 26px;
  }

  .overview__button {
    width: 100%;
    line-height: 1.3;
  }

  .overview__photo {
    aspect-ratio: 4 / 3;
    margin-top: 40px;
  }

  .chapter__subtitle {
    margin-top: 48px;
  }

  .module-tabs li {
    flex-basis: 170px;
  }

  .step-line {
    grid-template-columns: minmax(0, 1fr);
    gap: 28px;
  }

  .platform-note {
    padding: 24px;
  }

  .platform-note__actions {
    grid-template-columns: minmax(0, 1fr);
    flex-direction: column;
    align-items: stretch;
  }

  .platform-note__actions .button {
    width: 100%;
  }

  .platform-note__actions .text-link {
    text-align: center;
  }

  .pillar-assessment {
    padding-block: 48px;
  }

  .pillar-assessment .assessment-promo__panel {
    margin-inline: calc(var(--page-padding) * -1);
    padding-inline: var(--page-padding);
  }


}

@media (prefers-reduced-motion: reduce) {
  .chapter__rail::after {
    transition: none;
  }
}
