@layer site {
/* eThesis shared components (spec/02): header + mega menu, phone menu, footer,
   CTA bands, cookie banner. Values are the design's inline styles. Link rules list
   :hover explicitly so the editorial theme's teal hover never leaks into them. */

/* ───────────── Header ───────────── */
.hd { position: relative; z-index: 40; display: flex; flex-wrap: wrap; align-items: stretch; padding: 0 max(24px, 50% - 696px); border-bottom: 1px solid var(--ink-15); background: var(--white); }
.hd-logo, .hd-logo:hover { display: flex; align-items: center; min-height: 76px; color: var(--ink); text-decoration: none; }
.hd-nav { display: flex; flex-wrap: wrap; flex: 1 1 auto; justify-content: flex-end; align-items: stretch; }

.nvl, .nvl:hover { display: flex; align-items: center; padding: 0 16px; min-height: 76px; box-sizing: border-box; font-weight: 500; font-size: 16px; text-decoration: none; color: var(--ink); border-bottom: 3px solid transparent; }
.nvl[aria-current="page"] { font-weight: 700; border-bottom-color: var(--ink); }
.nvpill-wrap { display: flex; align-items: center; padding: 0 0 0 14px; }
.nvpill, .nvpill:hover { display: inline-flex; align-items: center; padding: 12px 22px; border-radius: 999px; background: var(--ink); color: var(--white); font-weight: 700; font-size: 16px; text-decoration: none; }
.nvpill[aria-current="page"] { box-shadow: 0 0 0 3px var(--teal); }
/* Language switcher: the other language's code, after Log in. */
.nvlang, .nvlang:hover { padding: 0 12px; font-weight: 700; font-size: 15px; letter-spacing: .06em; }
.nvlang:hover { border-bottom-color: var(--ink-15); }

/* Mega menu (Solutions). Opens on hover, keyboard focus, or click/tap (.open).
   .shut suppresses hover/focus opening after Escape or a closing click. */
.dd { display: flex; }
.ddbtn { display: flex; align-items: center; gap: 8px; padding: 0 16px; min-height: 76px; box-sizing: border-box; border: 0; border-bottom: 3px solid transparent; background: transparent; font-weight: 500; font-size: 16px; cursor: pointer; color: var(--ink); }
.ddbtn[data-on="1"] { font-weight: 700; border-bottom-color: var(--ink); }
.ddcaret { font-size: 12px; }
.ddpanel { display: none; position: absolute; left: 0; right: 0; top: 100%; z-index: 50; background: var(--white); border-top: 1px solid var(--ink-15); box-shadow: 0 24px 48px rgba(7,58,67,.14); }
.dd:not(.shut):hover .ddpanel, .dd:not(.shut):focus-within .ddpanel, .dd.open .ddpanel { display: block; }
.dd:not(.shut):hover .ddbtn, .dd:not(.shut):focus-within .ddbtn, .dd.open .ddbtn { border-bottom-color: var(--teal); }
.ddrow { max-width: 1440px; margin: 0 auto; padding: 28px 24px 32px; display: flex; gap: 40px; align-items: stretch; }
.ddcol { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.ddcol-2 { flex: 2 1 0%; }
.ddcol-1 { flex: 1 1 0%; }
.ddgroup { font-size: 14px; font-weight: 600; color: var(--ink-2); }
.ddgrid { display: grid; gap: 28px; }
.ddgrid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ddgrid-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
.ddsub { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.ddsubt { font-size: 15px; font-weight: 800; padding-bottom: 8px; border-bottom: 1px solid var(--ink-20); color: var(--ink); }
.ddlist { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; }
.ddlink, .ddlink:hover { display: block; padding: 7px 10px; margin: 0 -10px; font-size: 15.5px; font-weight: 500; text-decoration: none; color: var(--ink); }
.ddlink:hover { background: var(--sand-2); }
.ddlink[aria-current="page"], .ddlink[aria-current="page"]:hover { font-weight: 700; color: var(--teal); }
.ddpromo, .ddpromo:hover { flex: 0 0 250px; display: flex; flex-direction: column; justify-content: space-between; gap: 18px; padding: 24px; border-radius: 14px; background: var(--ink); color: var(--white); text-decoration: none; }
.ddpromo-text { display: flex; flex-direction: column; gap: 8px; }
.ddpromo-title { font-size: 24px; line-height: 1.15; }
.ddpromo-sub { font-size: 15px; line-height: 1.5; color: var(--sand); }
.ddpromo-cta { font-weight: 700; font-size: 16px; }

/* ───────────── Phone header (spec/05 fix #1) ───────────── */
.hd-menubtn { display: none; }
.mnav { display: none; }

@media (max-width: 759.98px) {
  .hd { flex-wrap: nowrap; justify-content: space-between; align-items: center; }
  .hd-nav { display: none; }
  .hd-menubtn { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 16px; margin: 16px 0; border: 1.5px solid var(--ink); border-radius: 999px; background: var(--white); color: var(--ink); font: inherit; font-size: 16px; font-weight: 700; cursor: pointer; }
  .hd-menubtn-icon { display: inline-flex; flex-direction: column; justify-content: space-between; width: 18px; height: 12px; }
  .hd-menubtn-icon span { display: block; height: 2px; background: currentColor; transition: transform .2s ease, opacity .2s ease; }
  .hd-menubtn[aria-expanded="true"] .hd-menubtn-icon span:nth-child(1) { transform: translateY(5px) rotate(45deg); }
  .hd-menubtn[aria-expanded="true"] .hd-menubtn-icon span:nth-child(2) { opacity: 0; }
  .hd-menubtn[aria-expanded="true"] .hd-menubtn-icon span:nth-child(3) { transform: translateY(-5px) rotate(-45deg); }

  .mnav:not([hidden]) { display: block; position: absolute; left: 0; right: 0; top: 100%; z-index: 50; max-height: calc(100vh - 77px); overflow-y: auto; background: var(--white); border-top: 1px solid var(--ink-15); box-shadow: 0 24px 48px rgba(7,58,67,.14); }
  .mnav-in { padding: 8px 24px 28px; display: flex; flex-direction: column; }
  .mnav-row, .mnav-row:hover, .mnav-acc { display: flex; align-items: center; justify-content: space-between; width: 100%; min-height: 56px; padding: 0; box-sizing: border-box; border: 0; border-bottom: 1px solid var(--ink-15); background: none; font: inherit; font-size: 18px; font-weight: 600; color: var(--ink); text-decoration: none; text-align: left; cursor: pointer; }
  .mnav-row[aria-current="page"], .mnav-acc[data-on="1"] { font-weight: 800; }
  .mnav-acc .ddcaret { transition: transform .2s ease; }
  .mnav-acc[aria-expanded="true"] .ddcaret { transform: rotate(180deg); }
  .mnav-sol[hidden] { display: none; }
  .mnav-sol { padding: 16px 0 8px; border-bottom: 1px solid var(--ink-15); display: flex; flex-direction: column; gap: 22px; }
  .mnav-sol .ddlink { padding: 11px 10px; }
  .mnav-lang { font-size: 14px; font-weight: 700; letter-spacing: .06em; opacity: .7; }
  .mnav-pill, .mnav-pill:hover { margin-top: 24px; display: flex; justify-content: center; align-items: center; min-height: 52px; border-radius: 999px; background: var(--ink); color: var(--white); font-weight: 700; font-size: 17px; text-decoration: none; }
}

/* ───────────── Footer ───────────── */
.ft { background: var(--ink); color: var(--sand); font-family: var(--font-sans); }
.ft-top { max-width: 1240px; margin: 0 auto; padding: 56px 24px 40px; display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 36px 40px; }
.ft-col { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.ft-logo, .ft-logo:hover { color: var(--white); text-decoration: none; }
.ft-tag { margin: 0; font-size: 18px; line-height: 1.35; color: var(--white); }
.ft-desc { margin: 0; font-size: 14.5px; line-height: 1.55; max-width: 260px; }
.ft-h { margin: 0; padding-bottom: 10px; border-bottom: 1px solid var(--ink-2); font-size: 15px; font-weight: 700; letter-spacing: 0; color: var(--white); }
.ft-list { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 9px; font-size: 15px; line-height: 1.4; }
.ft-list a, .ft-list a:hover { color: var(--sand); text-decoration: none; }
.ft-co { max-width: 1240px; margin: 0 auto; padding: 20px 24px; border-top: 1px solid var(--ink-2); display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 16px 32px; }
.ft-addr { font-style: normal; font-size: 13px; line-height: 1.7; color: var(--footer-text); max-width: 860px; }
.ft-addr strong { color: var(--white); font-weight: 700; }
.ft-addr a, .ft-addr a:hover, .ft-bottom a, .ft-bottom a:hover { color: var(--footer-text); }
.ft-social { display: flex; gap: 8px; }
.ft-social a, .ft-social a:hover { display: inline-flex; align-items: center; justify-content: center; height: 36px; padding: 0 12px; border: 1px solid var(--footer-line); color: var(--white); font-size: 14px; font-weight: 600; text-decoration: none; }
.ft-bottom { max-width: 1240px; margin: 0 auto; padding: 14px 24px 22px; border-top: 1px solid var(--ink-2); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; font-size: 13px; color: var(--footer-text); }
.ft-legal { display: flex; gap: 20px; }
.ft-linkbtn { padding: 0; border: 0; background: none; font: inherit; color: var(--footer-text); text-decoration: underline; cursor: pointer; }
@media (max-width: 759.98px) {
  /* Touch targets ≥ 44px for the footer's small links (spec/05 checks) */
  .ft-list a, .ft-addr a, .ft-legal a, .ft-linkbtn, .ft-social a { display: inline-flex; align-items: center; min-height: 44px; }
  .ft-list { gap: 0; }
}

/* ───────────── CTA bands (closing section of each page) ─────────────
   Four layouts appear in the design:
   .cta-split   kicker + headline left, pill right            (Institutions, AnalyticsQA, Grading, …)
   .cta-giant   dark band, headline, giant underlined link     (Administration, Businesses, MyThesis)
   .cta-center  centered headline + pill (+ underlined link)   (ThesisManagement, BusinessCollaboration, Internships)
   .cta-compact headline + square button with white shadow     (TopicSelection, News, Company, legal) */
.cta-teal { background: var(--teal); color: var(--white); }
/* On teal, headline and body are white; the small kicker and underlined links stay ink (design note). */
.cta-teal .cta-kicker, .cta-teal .cta-kick-span { color: var(--ink); }
.cta-sand { background: var(--sand); color: var(--ink); }
.cta-ink { background: var(--ink); color: var(--white); }

.cta-kicker { margin: 0 0 18px; font-size: 18px; font-weight: 700; }
.cta-ink .cta-kicker { color: var(--sand); }
.cta-h { margin: 0; }
.cta-h-serif { font-family: var(--font-serif); font-weight: 400; line-height: 1.02; letter-spacing: -0.02em; }

.cta-pill, .cta-pill:hover { display: inline-flex; align-items: center; padding: 16px 26px; min-height: 54px; box-sizing: border-box; background: var(--ink); color: var(--white); font-weight: 700; font-size: 17px; text-decoration: none; border-radius: 999px; }
.cta-pill-light, .cta-pill-light:hover { background: var(--white); color: var(--ink); }
.cta-square, .cta-square:hover { display: inline-flex; align-items: center; padding: 18px 30px; min-height: 60px; box-sizing: border-box; background: var(--ink); color: var(--white); font-weight: 700; font-size: 18px; text-decoration: none; box-shadow: 6px 6px 0 var(--white); }
.cta-ulink, .cta-ulink:hover { display: inline-flex; align-items: center; gap: 10px; font-size: 18px; font-weight: 700; color: var(--ink); text-decoration: none; padding-bottom: 4px; border-bottom: 2px solid var(--ink); }
.cta-ink .cta-ulink, .cta-ink .cta-ulink:hover { color: var(--white); border-bottom-color: var(--white); }

.cta-split .cta-in { max-width: 1240px; margin: 0 auto; padding: 112px 24px; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 40px; }
.cta-split .cta-text { flex: 1 1 560px; min-width: 0; }
.cta-split .cta-h { font-size: clamp(44px, 5vw, 76px); }
.cta-actions { display: flex; flex-wrap: wrap; gap: 20px; align-items: center; }

.cta-giant .cta-in { max-width: 1240px; margin: 0 auto; padding: 120px 24px 112px; }
.cta-giant .cta-h { max-width: 1000px; font-weight: 700; font-size: clamp(32px, 3.4vw, 48px); line-height: 1.06; letter-spacing: -0.03em; }
.cta-giant .giant, .cta-giant .giant:hover { margin-top: 56px; display: flex; justify-content: space-between; align-items: baseline; gap: 24px; padding: 28px 0; border-top: 2px solid; border-bottom: 2px solid; color: inherit; text-decoration: none; font-size: clamp(44px, 6vw, 96px); }
.giant-cond { font-family: var(--font-display); font-weight: 800; text-transform: uppercase; line-height: .9; letter-spacing: -0.01em; }
.giant-serif { font-family: var(--font-serif); font-weight: 400; line-height: 1.02; letter-spacing: -0.02em; }

.cta-center { text-align: center; }
.cta-center .cta-in { max-width: 900px; margin: 0 auto; padding: 136px 24px; }
.cta-center .cta-kicker { margin: 0 0 20px; }
.cta-center.cta-teal .cta-kicker { color: var(--ink); }
.cta-center .cta-h { margin: 0 auto; font-size: clamp(40px, 4.6vw, 68px); }
.cta-center .cta-h-bold { font-weight: 700; line-height: 1.06; letter-spacing: -0.03em; }
.cta-center .cta-actions { margin-top: 44px; justify-content: center; gap: 24px; }

.cta-compact .cta-in { max-width: 1240px; margin: 0 auto; padding: 72px 24px; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 28px; }
.cta-compact .cta-h { font-weight: 800; letter-spacing: -0.03em; max-width: 720px; }
.cta-compact .cta-text { display: flex; flex-direction: column; gap: 10px; max-width: 720px; }
.cta-compact .cta-sub { font-size: 18px; font-weight: 500; }
.cta-compact .cta-kick-span { font-size: 19px; font-weight: 700; }

/* ───────────── Cookie banner ───────────── */
.ck { position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; background: var(--ink); color: var(--sand); border-top: 1px solid var(--footer-line); font-family: var(--font-sans); }
.ck[hidden] { display: none; }
.ck-in { max-width: 1240px; margin: 0 auto; padding: 16px 24px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 32px; }
.ck-text { margin: 0; flex: 1 1 420px; font-size: 15px; line-height: 1.55; }
.ck-ok { min-height: 44px; padding: 0 28px; border: 0; border-radius: 999px; background: var(--white); color: var(--ink); font: inherit; font-size: 16px; font-weight: 700; cursor: pointer; }
.ck-ok:focus-visible { outline-color: var(--white); }

/* Announcement banner (admin-managed) in the new layout: in the page flow, not fixed. */
.site-ann .ethesis-announcement-bar { position: relative !important; top: auto; font-family: var(--font-sans) !important; background: var(--teal) !important; color: var(--ink) !important; box-shadow: none !important; }
.site-ann .ethesis-announcement__text, .site-ann .ethesis-announcement__link, .site-ann .ethesis-announcement__link:hover { color: var(--ink) !important; }
body.has-ethesis-banner .site main { padding-top: 0 !important; }

/* ───────────── Thesis process stage bar (Topic Selection variant) ───────────── */
.stg { opacity: .6; border-bottom: 3px solid transparent; }
.stg[aria-current="page"] { opacity: 1; border-bottom-color: #073A43; }

/* ───────────── Very narrow phones (spec/09: no clipped text at 320px) ─────────────
   A few design headlines have a clamp() minimum whose longest word is wider than a 320px
   screen (the design clips them too). Below 360px they scale to their column; 360px and
   wider are untouched. */
@media (max-width: 359.98px) {
  :has(> .fit-320) { container-type: inline-size; }
  .fit-320 { font-size: min(36px, calc(100cqw / 7.8)) !important; }      /* "Communications," */
  .fit-320.fit-320-xl { font-size: min(60px, calc(100cqw / 5.4)) !important; } /* "Internships" (Literata) */
}

/* ───────────── Greek (/el) ─────────────
   Greek words run longer than the English the design was drawn with. Words are never
   hyphenated: where one is wider than its box, the text is sized down to fit (rules near
   each page's styles). break-word stays only as a last-resort guard against clipping. */
:lang(el) .site :is(h1, h2, h3, h4, p, li, label, dt, dd) {
  overflow-wrap: break-word;
  hyphens: manual;
}

/* Card grids use repeat(auto-fit, minmax(200–300px, 1fr)); below 360px the minimum is wider
   than the column, so they overflow. One column there (they are one column anyway). */
@media (max-width: 359.98px) {
  .site :is(.cols-300, [class*="gtc-fit-"], [style*="repeat(auto-fit, minmax("]) { grid-template-columns: minmax(0, 1fr) !important; }
}
/* Thesis & Research Management "What's inside MyThesis": two columns leave no room for the
   text next to the 96px number on phones. */
@media (max-width: 599.98px) {
  .tm-feat { grid-template-columns: minmax(0, 1fr) !important; }
}
:lang(el) .site [data-toc] > span:last-child { overflow-wrap: break-word; hyphens: manual; }
/* Inbox mock rows (Thesis Management, Administration): a long file name in the flexible
   middle span pushed the day label off narrow screens. Let that span shrink and break. */
@media (max-width: 479.98px) {
  .site span:is(.f-1-1-0pc, .step-line, [style*="flex: 1 1 0%"]) { min-width: 0; overflow-wrap: anywhere; }
  /* Greek: subjects end in "…" like a real inbox instead of breaking words. */
  :lang(el) .site span:is(.f-1-1-0pc, [style*="flex: 1 1 0%"]) { overflow-wrap: normal; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  /* Greek: before/after inbox mocks had 48px side padding, leaving ~160px rows on phones. */
  :lang(el) .split > [data-split-top], :lang(el) .split > [data-split-bottom] { padding-left: 20px !important; padding-right: 20px !important; }
  /* Greek: numbered lists (01 / 02 …) put the number above the text, so the title gets the
     full width instead of a ~140px column. */
  :lang(el) .irow { grid-template-columns: minmax(0, 1fr) !important; gap: 10px !important; }
}
/* Home quality report: the Faculty/Department/Institution switch is 6px too wide at 320px. */
@media (max-width: 359.98px) {
  .qa-scope > button { padding-left: 8px !important; padding-right: 8px !important; }
}
/* Administration before/after list: let the date | status note drop under the text on phones. */
@media (max-width: 479.98px) {
  .site :is(.log-row, [style*="justify-content: space-between; gap: 12px; padding: 15px 0px"]) { flex-wrap: wrap; }
}

/* Breadcrumbs: Solutions and the group are links; they keep the crumb's color. */
.bc a { color: inherit; text-decoration: none; }
.bc a:hover { text-decoration: underline; text-underline-offset: 3px; }

}
