/*
 * Cassiopeia Tsiskari — child template styles.
 * Colours come from the template style settings as CSS variables (--ts-dark, --ts-nav, …).
 * Desktop menu: hover dropdowns from 992px; below that the menu collapses behind the ☰ button.
 */

:root {
  --ts-max: 82.5rem;   /* same width as Cassiopeia's content grid */
  --ts-pad: 1rem;
  --ts-header-h: 76px;
  --ts-pale: #ebf0f6;
}
.wrapper-fluid { --ts-max: 100%; }

body.ts-template { background: #fff; }
.ts-wrap { max-width: calc(var(--ts-max) + 2 * var(--ts-pad)); margin: 0 auto; padding: 0 var(--ts-pad); }

/* ------------------------------------------------------------------ top bar */
.ts-topbar { background: var(--ts-deep); color: #c0d0e2; font-size: .82rem; }
.ts-topbar .ts-wrap { display: flex; justify-content: space-between; align-items: center; min-height: 38px; gap: 1rem; }
.ts-template .ts-topbar a { color: #c0d0e2; text-decoration: none; }
.ts-template .ts-topbar a:hover { color: #fff; }
.ts-topbar p { margin: 0; }
.ts-topbar-right a + a { margin-left: 1rem; }
.ts-topbar [class^="icon-"], .ts-topbar [class*=" icon-"] { margin-right: .35em; opacity: .85; }
.ts-topbar .ts-topbar-item + .ts-topbar-item { margin-left: 1.4rem; }

/* ------------------------------------------------------------------ header */
.container-header.ts-header {
  background: var(--ts-nav);
  background-image: none;
  box-shadow: 0 2px 8px rgba(40, 61, 86, .22);
  position: relative;
  z-index: 100;
}
.container-header.ts-header.ts-sticky { position: sticky !important; top: 0; }
.ts-header-gradient.container-header { background: linear-gradient(90deg, var(--ts-dark) 0%, var(--ts-dark) 22%, var(--ts-nav) 60%, var(--ts-nav) 100%); }

/* the dark "facet" behind the logo, with a slanted edge */
.ts-facet {
  position: absolute; top: 0; bottom: 0; left: 0;
  width: calc(max(0px, (100% - var(--ts-max)) / 2) + var(--ts-facet));
  background: var(--ts-dark);
  clip-path: polygon(0 0, 100% 0, calc(100% - 46px) 100%, 0 100%);
  pointer-events: none;
}
.wrapper-fluid .ts-facet { width: calc(var(--ts-pad) + var(--ts-facet)); }

.ts-header-row { position: relative; display: flex; align-items: center; justify-content: space-between; min-height: var(--ts-header-h); gap: 1rem; }
.container-header .ts-brand { margin: 0; padding: .4rem 2.2rem .4rem 0; font-size: 1.75rem; font-weight: 800; letter-spacing: .06em; line-height: 1.1; }
.container-header .ts-brand a { color: #fff; text-decoration: none; }
.container-header .ts-brand img { max-height: 56px; width: auto; }
.container-header .ts-brand .site-description { font-size: .8rem; font-weight: 500; letter-spacing: .02em; color: #d2deeb; margin-top: .15rem; }

.container-header .ts-nav { display: flex; align-items: stretch; align-self: stretch; padding: 0; flex-wrap: nowrap; }
.container-header .ts-nav nav { margin: 0; }
.container-header .ts-nav .container-search { margin: 0 0 0 1rem; display: flex; align-items: center; }

/* menu toggler (☰) */
.container-header.ts-header .navbar-toggler { color: #fff; border: 1px solid rgba(255, 255, 255, .6); border-radius: 6px; padding: .35rem .6rem; }
.container-header.ts-header .navbar-toggler .icon-menu { font-size: 1.3rem; }

/* ---------- desktop menu */
@media (min-width: 992px) {
  .container-header .ts-nav .navbar, .container-header .ts-nav .navbar-collapse { height: 100%; align-items: stretch; }
  .ts-header .metismenu.mod-menu { display: flex; align-items: stretch; height: 100%; }
  .ts-header .metismenu.mod-menu > li.metismenu-item {
    padding: 0; margin: 0; font-size: .84rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em;
    flex-wrap: nowrap; position: relative;
  }
  .ts-header .metismenu.mod-menu > li.metismenu-item > a,
  .ts-header .metismenu.mod-menu > li.metismenu-item > span {
    display: flex; align-items: center; height: 100%; padding: 0 1.05rem; color: #fff; text-decoration: none;
    border-bottom: 3px solid transparent; border-top: 3px solid transparent;
  }
  .ts-header .metismenu.mod-menu > li.metismenu-item.parent > a { padding-right: .3rem; }
  .ts-header .metismenu.mod-menu > li.metismenu-item > button.mm-toggler { color: #fff; padding: 0 .9rem 0 0; border-bottom: 3px solid transparent; border-top: 3px solid transparent; }
  .ts-header .metismenu.mod-menu > li.metismenu-item > button.mm-toggler:after { border-top-width: .35em; border-left-width: .3em; border-right-width: .3em; margin-inline-start: 0; }
  .ts-header .metismenu > li > a:after, .ts-header .metismenu > li > button:before { display: none !important; }
  .ts-header .metismenu.mod-menu > li.metismenu-item.active > a,
  .ts-header .metismenu.mod-menu > li.metismenu-item.active > button,
  .ts-header .metismenu.mod-menu > li.metismenu-item:hover > a,
  .ts-header .metismenu.mod-menu > li.metismenu-item:hover > button { border-bottom-color: var(--ts-pale); color: var(--ts-pale); text-decoration: none; }

  /* dropdowns: open on hover / keyboard focus, as well as on click (metismenu) */
  .ts-header .metismenu.mod-menu li.parent:hover > ul.mm-collapse,
  .ts-header .metismenu.mod-menu li.parent:focus-within > ul.mm-collapse { display: block; height: auto !important; }
  .ts-header .metismenu.mod-menu ul.mm-collapse {
    position: absolute; top: 100%; left: 0; min-width: 230px; padding: .5rem 0; margin: 0;
    background: #fff; border-top: 3px solid var(--ts-dark); border-radius: 0 0 8px 8px;
    box-shadow: 0 12px 28px rgba(40, 61, 86, .2); text-transform: none; letter-spacing: 0; font-weight: 500;
  }
  .ts-header .metismenu.mod-menu ul.mm-collapse li.metismenu-item {
    display: flex; flex-wrap: nowrap; justify-content: space-between; padding: 0; font-size: .95rem; position: relative;
  }
  .ts-header .metismenu.mod-menu ul.mm-collapse li.metismenu-item > a,
  .ts-header .metismenu.mod-menu ul.mm-collapse li.metismenu-item > span {
    flex: 1; padding: .55rem 1.1rem; color: #2c3e55; text-decoration: none; white-space: nowrap;
  }
  .ts-header .metismenu.mod-menu ul.mm-collapse li.metismenu-item:hover,
  .ts-header .metismenu.mod-menu ul.mm-collapse li.metismenu-item.active > a { background: var(--ts-pale); }
  .ts-header .metismenu.mod-menu ul.mm-collapse li.metismenu-item:hover > a,
  .ts-header .metismenu.mod-menu ul.mm-collapse li.metismenu-item.active > a { color: var(--ts-dark); }
  .ts-header .metismenu.mod-menu ul.mm-collapse li.parent > button.mm-toggler { color: #7899c1; padding: 0 .9rem; }
  .ts-header .metismenu.mod-menu ul.mm-collapse li.parent > button.mm-toggler:after { transform: rotate(-90deg); border-top-width: .35em; border-left-width: .3em; border-right-width: .3em; }
  /* near the right edge: open to the left (class set by tsiskari.js) */
  .ts-header .metismenu.mod-menu > li.ts-flip > ul.mm-collapse { left: auto; right: 0; }
  .ts-header .metismenu.mod-menu ul.mm-collapse li.ts-flip > ul.mm-collapse {
    left: auto !important; right: 100%; border-left: 0; border-right: 3px solid var(--ts-dark); border-radius: 8px 0 8px 8px;
  }
  .ts-header .metismenu.mod-menu > li.ts-flip ul.mm-collapse li.parent > ul.mm-collapse {
    left: auto; right: 100%; border-left: 0; border-right: 3px solid var(--ts-dark); border-radius: 8px 0 8px 8px;
  }
  /* third level and deeper: opens to the side */
  .ts-header .metismenu.mod-menu ul.mm-collapse ul.mm-collapse {
    position: absolute; top: -.5rem; left: 100%; margin: 0; flex-basis: auto;
    border-top: 0; border-left: 3px solid var(--ts-dark); border-radius: 0 8px 8px 8px;
    background: #fff; box-shadow: 0 12px 28px rgba(40, 61, 86, .2);
  }
}

/* ---------- phone / tablet menu */
@media (max-width: 991.98px) {
  .ts-header-row { flex-wrap: nowrap; min-height: 64px; }
  .container-header .ts-brand { font-size: 1.35rem; padding-right: 1rem; }
  .container-header .ts-brand { flex: 1 1 auto; min-width: 0; }
  .container-header .ts-brand img { max-height: 44px; max-width: min(100%, calc(var(--ts-facet-m) - 40px)); height: auto; }
  .ts-facet { width: var(--ts-facet-m); }
  .container-header .ts-nav { flex: 0 0 auto; align-self: center; }
  .container-header .ts-nav .navbar { position: static; }
  .container-header .ts-nav .navbar-collapse {
    position: absolute; left: 0; right: 0; top: 100%; background: var(--ts-nav);
    box-shadow: 0 10px 20px rgba(40, 61, 86, .25); max-height: 75vh; overflow-y: auto;
  }
  .ts-header-row { position: static; }
  .container-header.ts-header { position: relative; }
  .ts-header .metismenu.mod-menu { display: block; padding: .25rem 0 .75rem; }
  .ts-header .metismenu.mod-menu li.metismenu-item {
    display: flex; flex-wrap: wrap; padding: 0; font-size: 1rem; border-bottom: 1px solid rgba(255, 255, 255, .15);
  }
  .ts-header .metismenu.mod-menu li.metismenu-item > a,
  .ts-header .metismenu.mod-menu li.metismenu-item > span { flex: 1; padding: .75rem 1.25rem; color: #fff; font-weight: 600; text-decoration: none; }
  .ts-header .metismenu.mod-menu li.metismenu-item.active > a { text-decoration: underline; }
  .ts-header .metismenu.mod-menu li.metismenu-item > button.mm-toggler { color: #fff; padding: 0 1.25rem; }
  .ts-header .metismenu.mod-menu ul.mm-collapse {
    position: static; flex-basis: 100%; margin: 0; padding: 0; box-shadow: none; border: 0;
    background: rgba(255, 255, 255, .09);
  }
  .ts-header .metismenu.mod-menu ul.mm-collapse li.metismenu-item { border-bottom-color: rgba(255, 255, 255, .1); }
  .ts-header .metismenu.mod-menu ul.mm-collapse li.metismenu-item > a { padding-left: 2.4rem; font-weight: 500; color: #eef3f9; }
  .ts-header .metismenu.mod-menu ul.mm-collapse ul.mm-collapse { background: rgba(255, 255, 255, .08); }
  .ts-header .metismenu.mod-menu ul.mm-collapse ul.mm-collapse li.metismenu-item > a { padding-left: 3.6rem; font-weight: 400; }
  .ts-topbar-right { display: none; }
}

/* ---------- phone: logo on top, menu row below (option "Phone header: logo on top") */
@media (max-width: 991.98px) {
  .ts-phone-stacked .ts-facet { display: none; }
  .ts-phone-stacked .ts-header-row { flex-direction: column; align-items: stretch; gap: 0; min-height: 0; }
  .ts-phone-stacked.container-header .ts-brand {
    display: flex; flex-direction: column; align-items: center; padding: .6rem 0; margin: 0;
    background: var(--ts-dark); box-shadow: 0 0 0 100vmax var(--ts-dark); clip-path: inset(0 -100vmax);
  }
  .ts-phone-stacked.container-header .ts-brand img { max-width: min(100%, 320px); max-height: 50px; }
  .ts-phone-stacked.container-header .ts-nav { display: block; align-self: stretch; }
  .ts-phone-stacked.container-header .ts-nav .container-search { margin: 0 0 .5rem; justify-content: center; }
  .ts-phone-stacked .navbar-toggler { display: none !important; }
  .ts-phone-stacked.container-header .ts-nav .navbar-collapse {
    display: block !important; height: auto !important; position: static; background: none; box-shadow: none; max-height: none; overflow: visible;
  }
  .ts-phone-stacked .metismenu.mod-menu { display: flex; flex-direction: row; flex-wrap: wrap; justify-content: center; padding: .15rem 0; position: relative; }
  .ts-phone-stacked .metismenu.mod-menu > li.metismenu-item { position: static; flex-wrap: nowrap; width: auto; flex: 0 0 auto; border: 0; font-size: .93rem; }
  .ts-phone-stacked .metismenu.mod-menu > li.metismenu-item > a,
  .ts-phone-stacked .metismenu.mod-menu > li.metismenu-item > span { flex: 0 0 auto; padding: .6rem .6rem .5rem; border-bottom: 2px solid transparent; }
  .ts-phone-stacked .metismenu.mod-menu > li.metismenu-item.active > a { text-decoration: none; border-bottom-color: var(--ts-pale); }
  .ts-phone-stacked .metismenu.mod-menu > li.metismenu-item > button.mm-toggler { padding: 0 .55rem 0 0; }
  /* submenus: white panel under the menu row */
  .ts-phone-stacked .metismenu.mod-menu > li > ul.mm-collapse {
    position: absolute; left: 0; right: 0; top: 100%; z-index: 60; padding: .3rem 0;
    background: #fff; border-top: 3px solid var(--ts-dark); border-radius: 0 0 8px 8px; box-shadow: 0 12px 28px rgba(40, 61, 86, .25);
  }
  .ts-phone-stacked .metismenu.mod-menu ul.mm-collapse li.metismenu-item { border-bottom: 1px solid #edf1f6; }
  .ts-phone-stacked .metismenu.mod-menu ul.mm-collapse li.metismenu-item:last-child { border-bottom: 0; }
  .ts-phone-stacked .metismenu.mod-menu ul.mm-collapse li.metismenu-item > a,
  .ts-phone-stacked .metismenu.mod-menu ul.mm-collapse li.metismenu-item > span { color: #2c3e55; padding-left: 1.25rem; }
  .ts-phone-stacked .metismenu.mod-menu ul.mm-collapse li.metismenu-item.active > a { color: var(--ts-dark); font-weight: 700; text-decoration: none; }
  .ts-phone-stacked .metismenu.mod-menu ul.mm-collapse button.mm-toggler { color: #7899c1; }
  .ts-phone-stacked .metismenu.mod-menu ul.mm-collapse ul.mm-collapse { background: #f4f7fb; }
  .ts-phone-stacked .metismenu.mod-menu ul.mm-collapse ul.mm-collapse li.metismenu-item > a { padding-left: 2.4rem; }
}

/* ------------------------------------------------------------------ page title band */
.ts-pagetitle { background: var(--ts-title-bg); color: var(--ts-title-text); padding: 2.1rem 0 1.8rem; }
.ts-pagetitle .ts-pagetitle-heading { margin: 0; color: var(--ts-title-text); font-size: 2.1rem; font-weight: 700; line-height: 1.2; }
.ts-pagetitle .mod-breadcrumbs__wrapper, .ts-pagetitle nav { margin: .45rem 0 0; }
.ts-pagetitle .breadcrumb { background: none; padding: 0 !important; margin: 0; font-size: .85rem; }
.ts-template .ts-pagetitle .breadcrumb a { color: var(--ts-link); text-decoration: none; }
.ts-template .ts-pagetitle .breadcrumb a:hover { text-decoration: underline; }
.ts-pagetitle .breadcrumb .active, .ts-pagetitle .breadcrumb-item + .breadcrumb-item::before { color: #6b7f99; }
.ts-pagetitle .mod-breadcrumbs__here { display: none; }   /* "You are here:" */
@media (max-width: 991.98px) { .ts-pagetitle { padding: 1.5rem 0 1.3rem; } .ts-pagetitle .ts-pagetitle-heading { font-size: 1.65rem; } }

/* slim band: location line only (title switched off) */
.ts-pagetitle.ts-pagetitle-slim { padding: .5rem 0; border-bottom: 1px solid #e3e6ea; }
.ts-pagetitle.ts-pagetitle-slim .mod-breadcrumbs__wrapper, .ts-pagetitle.ts-pagetitle-slim nav { margin: 0; }
@media (max-width: 991.98px) { .ts-pagetitle.ts-pagetitle-slim { padding: .45rem 0; } }
.ts-template .ts-pagetitle + .site-grid { padding-top: 1.25rem; }
/* location line placed inside the content (band switched off) */
.ts-template .site-grid .mod-breadcrumbs__wrapper { margin: 0 0 .75rem; }
.ts-template .site-grid .mod-breadcrumbs { padding: .35rem .75rem !important; margin: 0; background: var(--ts-title-bg); border-radius: 4px; font-size: .85rem; }
.ts-template .site-grid .mod-breadcrumbs__here { display: none; }
.ts-template .site-grid .mod-breadcrumbs a { text-decoration: none; }
.ts-template .site-grid .mod-breadcrumbs a:hover { text-decoration: underline; }

/* article title that would only repeat the band title */
.ts-hide-dup-title .com-content-article > .page-header:first-of-type,
.ts-hide-dup-title .item-page > .page-header:first-of-type { display: none; }

/* ------------------------------------------------------------------ content */
.ts-template .site-grid { padding-top: .75rem; padding-bottom: 2.6rem; }
.ts-template .site-grid a:not(.btn):not(.ts-btn), .ts-template .ts-pagetitle a { color: var(--ts-link); }
.ts-template .btn-primary {
  --btn-color: #fff; --btn-bg: var(--ts-dark); --btn-border-color: var(--ts-dark);
  --btn-hover-color: #fff; --btn-hover-bg: var(--ts-deep); --btn-hover-border-color: var(--ts-deep);
  --btn-active-color: #fff; --btn-active-bg: var(--ts-deep); --btn-active-border-color: var(--ts-deep);
  color: #fff; background-color: var(--ts-dark); border-color: var(--ts-dark);
}
.ts-template .btn-primary:hover, .ts-template .btn-primary:focus { color: #fff; background-color: var(--ts-deep); border-color: var(--ts-deep); }
.ts-template .btn-outline-primary {
  --btn-color: var(--ts-dark); --btn-border-color: var(--ts-dark);
  --btn-hover-color: #fff; --btn-hover-bg: var(--ts-dark); --btn-hover-border-color: var(--ts-dark);
  color: var(--ts-dark); border-color: var(--ts-dark);
}
.ts-template .btn-outline-primary:hover, .ts-template .btn-outline-primary:focus { color: #fff; background-color: var(--ts-dark); }
.ts-template .lead { font-size: 1.18rem; color: #4b5563; }

/* sidebar / module cards */
.ts-template .site-grid .card { background: var(--ts-pale); border: 0; border-top: 3px solid var(--ts-link); border-radius: 10px; box-shadow: none; }
.ts-template .site-grid .card-header { background: none; border: 0; padding: 1.1rem 1.25rem 0; font-size: 1rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: #2c3e55; }
.ts-template .site-grid .card-body { padding: .6rem 1.25rem 1.1rem; }
.ts-template .site-grid .card-body > :last-child { margin-bottom: 0; }

/* helpers for articles (same names as in user.css, recoloured) */
.ts-btn { display: inline-block; padding: 10px 22px; border-radius: 6px; background: var(--ts-dark); color: #fff !important; font-weight: 600; text-decoration: none !important; }
.ts-btn:hover { background: var(--ts-deep); }
.ts-btn-light { background: #d2deeb; color: #2c3e55 !important; }
.ts-btn-light:hover { background: #c0d0e2; }
.ts-btn-outline { background: transparent; color: var(--ts-dark) !important; box-shadow: inset 0 0 0 2px var(--ts-dark); }
.ts-btn-outline:hover { background: var(--ts-dark); color: #fff !important; }
.ts-btn-big { padding: 14px 30px; font-size: 1.15rem; }
.ts-section { border-bottom: 2px solid var(--ts-link); padding-bottom: 6px; margin: 2rem 0 1rem; }
.ts-divider { display: flex; align-items: center; gap: 12px; margin: 2rem 0; color: #55657a; font-weight: 600; }
.ts-divider::before, .ts-divider::after { content: ""; flex: 1; border-top: 1px solid #c0d0e2; }

/* our modules in the template colours */
.ts-template .mod-uploadlist .ul-btn-primary { background: var(--ts-dark); }
.ts-template .mod-uploadlist .ul-btn-secondary { background: var(--ts-link); }
.ts-template .mod-uploadlist .ul-btn-cancel { background: #d2deeb; color: #2c3e55; }
.ts-template .mod-uploadlist .ul-dropzone.ul-over { border-color: var(--ts-dark); background: var(--ts-pale); }
.ts-template .mod-folderslideshow .fs-dot-active { background: var(--ts-dark); }

/* ------------------------------------------------------------------ footer */
.ts-footer { background: var(--ts-deep); color: #c0d0e2; font-size: .92rem; margin-top: 0; }
.ts-template .ts-footer a { color: #d2deeb; text-decoration: none; }
.ts-template .ts-footer a:hover { color: #fff; text-decoration: underline; }
.ts-footer-cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2rem; padding-top: 2.5rem; padding-bottom: 2rem; }
.ts-footer h4, .ts-footer .moduletable > h3 { color: #fff; font-size: .95rem; text-transform: uppercase; letter-spacing: .05em; margin: 0 0 .7rem; }
.ts-footer p { margin: 0 0 .4rem; }
.ts-footer-bottom { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; padding-top: .9rem; padding-bottom: .9rem; font-size: .82rem;
  background: linear-gradient(#3a597f, #3a597f) content-box top / 100% 1px no-repeat; }  /* line only as wide as the content */
.ts-footer-bottom p { margin: 0; }
@media (max-width: 767.98px) { .ts-footer-cols { grid-template-columns: 1fr; gap: 1.2rem; } }

/* back to top */
.ts-template .back-to-top-link { background: var(--ts-dark); }
.ts-build { flex-basis: 100%; text-align: right; font-size: .7rem; color: #7899c1; }
