/* ===============================
   FONTS
   =============================== */

@font-face {
  font-family: "Corteq";
  font-display: swap;
  src: url("../fonts/corteq.eot");
  src:
    url("../fonts/corteq.eot?#iefix") format("embedded-opentype"),
    url("../fonts/corteq.woff2") format("woff2"),
    url("../fonts/corteq.woff") format("woff"),
    url("../fonts/corteq.ttf") format("truetype"),
    url("../fonts/corteq.svg#Corteq") format("svg");
}

/* ===============================
   BASE & RESET
   =============================== */

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
  overflow: hidden;
}

body {
  font-size: 16px;
  font-family: "Lato", sans-serif;
  font-weight: 400;
  background: var(--bg-body);
  color: var(--text-body);
}

a,
a:hover,
a:focus {
  text-decoration: none;
  outline: 0;
}

/* Clear floats after Bootstrap rows */
.row:after {
  content: "";
  display: table;
  clear: both;
}

/* ===============================
   TYPOGRAPHY
   =============================== */

h1,
h2,
h3,
h5,
h6,
.h2,
.h3,
.h5,
.h6 {
  font-family: "Lato", Helvetica, Arial, sans-serif;
  font-weight: 300;
}

h4,
.h4 {
  font-family: "Lato", Helvetica, Arial, sans-serif;
  font-weight: 400;
  padding-top: 10px;
}

h2 {
  padding: 0 0 20px 0;
  border-bottom: 1px solid var(--border-section);
  overflow: hidden;
  font-size: 30px;
}

.logo-text {
  font-family: "Corteq", sans-serif;
  font-size: 47px;
  line-height: 1;
  display: inline-block;
  text-align: center;
  letter-spacing: 1px;
  text-shadow:
    0 1px 0 rgba(0, 0, 0, 0.25),
    0 -1px 0 rgba(0, 0, 0, 0.15);
}

/* ===============================
   LAYOUT — APPLICATION SHELL
   #wrapper contains everything. main sits to the right of #sidebar.
   .page panels slide in/out via JS; .home is the default visible panel.
   =============================== */

#wrapper {
  position: relative;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

main {
  position: absolute;
  left: 250px;
  right: 0;
  top: 0;
  bottom: 0;
  background: var(--bg-main);
  overflow: hidden;
}

.page {
  position: absolute;
  top: 0;
  left: 2000px;
  bottom: 0;
  width: 85%;
  background-color: var(--bg-page);
  overflow-y: auto;
  overflow-x: hidden;
  touch-action: pan-y;
}

.home {
  left: 0;
  z-index: 1;
  width: 100%;
}

#overlay {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  right: 0;
  background-color: #000;
  opacity: 0.25;
  display: none;
  z-index: 300;
  cursor: url(../img/pointer.png), auto;
}

.currentpage {
  box-shadow: -2px 0 4px -2px rgba(0, 0, 0, 0.25);
}

/* ===============================
   LAYOUT — SIDEBAR
   Sidebar is a fixed flex column: nav scrolls in the middle,
   profile sits above the footer, footer pins to the bottom.
   =============================== */

#sidebar {
  position: fixed;
  width: 250px;
  background: var(--bg-sidebar);
  top: 0;
  left: 0;
  height: 100vh;
  height: 100dvh;
  max-height: 100dvh;
  bottom: auto;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

#sidebar:before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  right: 0;
}

#sidebar-wrapper {
  position: relative;
  width: 100%;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 1;
}

#sidebar-inner {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#profile {
  text-align: center;
  padding: 30px 10px;
  position: relative;
}

#profile .portrate {
  width: 200px;
  margin: 0 auto;
  height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
}

#profile a,
#profile a:hover,
#profile a:focus,
#profile a:active {
  text-decoration: none;
}

footer {
  position: relative;
  bottom: auto;
  left: auto;
  width: 100%;
  flex: 0 0 auto;
  margin-top: auto;
  background: var(--bg-footer) !important;
  border-top: 1px solid rgba(43, 43, 43, 0.4) !important;
  text-align: center;
  overflow: hidden;
  z-index: 1;
}

#footer-cover {
  padding: 6px 0 12px;
  transition: transform 0.35s ease;
  position: relative;
  z-index: 1;
}

#btn-settings {
  display: block;
  width: 100%;
  padding: 8px 0 6px;
  border: none;
  background: transparent;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 24px;
  transition:
    color 0.15s ease,
    background 0.15s ease;
  text-align: center;
  line-height: 1;
}

#btn-settings:hover {
  color: var(--text-nav-hover);
  background: var(--bg-nav-hover);
}

#settings-tray {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  transform: translateY(100%);
  transition: transform 0.35s ease;
  background: var(--bg-footer);
}

footer.settings-open #footer-cover {
  transform: translateY(-100%);
}

footer.settings-open #settings-tray {
  transform: translateY(0);
}

#settings-colors {
  width: 44px;
  flex-shrink: 0;
  border-right: 1px solid rgba(43, 43, 43, 0.4);
}

#settings-controls {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 10px;
  padding: 0 14px 0 10px;
}

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.settings-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  line-height: 1;
}

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 36px;
  height: 20px;
  flex-shrink: 0;
  cursor: pointer;
  margin: 0;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.toggle-slider {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  transition: background 0.2s;
}

.toggle-slider::before {
  content: "";
  position: absolute;
  height: 14px;
  width: 14px;
  left: 3px;
  bottom: 3px;
  background: #888;
  border-radius: 50%;
  transition:
    transform 0.2s,
    background 0.2s;
}

.toggle-switch input:checked + .toggle-slider {
  background: var(--accent);
}

.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(16px);
  background: #fff;
}

#copyright {
  text-align: center;
  font-size: 0.7em;
  color: var(--text-muted);
  margin-bottom: 15px;
}

#copyright p {
  margin: 0;
}

/* ===============================
   NAVIGATION
   =============================== */

#nav {
  position: relative;
  text-align: left;
  width: 100%;
  padding-bottom: 0;
  flex: 1 1 0;
  min-height: 0;
  height: 0;
  overflow-y: auto;
  overflow-x: hidden;
}

ul#navigation {
  padding: 0;
  margin: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
}

ul#navigation > li {
  display: block;
  float: none;
  clear: both;
  font-size: 18px;
  background: var(--bg-nav-item) !important;
  border-top: 1px solid rgba(43, 43, 43, 0.4) !important;
  border-bottom: 1px solid rgba(43, 43, 43, 0.4) !important;
  cursor: pointer;
}

ul#navigation > li > a {
  color: var(--text-nav);
}

ul#navigation li:hover,
ul#navigation li:focus {
  background-color: var(--bg-nav-hover) !important;
}

ul#navigation li:hover a,
ul#navigation li:focus a {
  color: var(--text-nav-hover);
}

ul#navigation li.currentmenu {
  background: var(--bg-nav-current);
  border-top: 1px solid #3d3d3d;
  border-bottom: 1px solid #252525;
}

ul#navigation li .text {
  padding-left: 5%;
  margin-left: 50px;
  line-height: 45px;
  box-shadow: -3px 0 5px -4px #000;
}

ul#navigation li .fa {
  float: left;
  line-height: 45px;
  width: 50px;
  text-align: center;
  font-size: 27px;
}

/* ===============================
   MOBILE MENU
   =============================== */

.mobilemenu {
  position: fixed;
  top: 5px;
  left: 5px;
  right: 0;
  z-index: 1002;
  font-size: 30px;
  padding: 2px 10px;
  background: transparent;
  text-shadow: 2px 2px 2px #000000;
  width: 50px;
  height: 50px;
  color: #fff;
  display: none;
  text-align: center;
}

.mobilemenu:hover,
.mobilemenu:focus {
  color: #fff;
}

/* ===============================
   PAGE & SECTION STRUCTURE
   =============================== */

.page-container {
  position: relative;
}

.pageheader {
  background: var(--bg-pageheader);
  position: relative;
  padding: 60px 0 45px 0;
}

.headercontent .title {
  font-size: 50px;
  text-shadow: 2px 2px 4px #000000;
  margin-bottom: 25px;
  border-bottom: 1px solid #ccc;
  padding: 0 0 20px 0;
}

.headercontent .title.noborder {
  border: none;
}

.headercontent .subtitle {
  border-bottom: 1px solid #ccc;
  margin: 0 0 10px 0;
  padding: 5px 0;
}

.headercontent .subtitle h3 {
  margin: 0;
  padding: 0;
}

.page .section {
  padding: 70px 0;
  position: relative;
}

.section-container {
  padding: 0 10%;
}

.intro-p {
  margin-bottom: 40px;
}

.section .title {
  border-bottom: 1px solid #ccc;
  margin: 0 0 30px 0;
  padding: 20px 0;
}

.section .title h3 {
  padding: 0;
  margin: 0;
  font-size: 26px;
}

/* ===============================
   UTILITY — COLOURS
   =============================== */

.color-1 {
  background: var(--bg-color-1);
}
.color-2 {
  background: var(--bg-color-2);
}
.color-3 {
  background: var(--bg-color-3);
  color: var(--text-color-3);
}
.color-4 {
  background: var(--bg-color-4);
}
.color-5 {
  color: #fff;
}

/* ===============================
   UTILITY — LISTS
   =============================== */

.ul-bolded li {
  font-weight: bold;
}

.ul-boxed li {
  padding: 7px;
  background-color: var(--bg-list-item);
  margin-bottom: 10px;
  box-shadow: 0px 3px 3px -3px #ccc;
  border-radius: 2px;
  border-left: 5px solid;
}

/* ===============================
   UI COMPONENTS — BACK TO TOP
   Colour comes from theme CSS. z-index sits above overlay (z-index 300).
   JS toggles visibility via .is-visible; the transition smooths the appearance.
   =============================== */

#toTop {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 1200;
  width: 46px;
  height: 46px;
  border: 0;
  border-radius: 999px;
  color: #fff;
  cursor: pointer;
  display: none;
  opacity: 0;
  transform: translateY(10px) scale(0.98);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.22);
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    opacity 180ms ease,
    filter 180ms ease;
}

#toTop.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

#toTop:hover,
#toTop:focus {
  outline: none;
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.28);
  filter: brightness(1.06);
}

#toTop i {
  font-size: 18px;
  line-height: 46px;
}

/* ===============================
   MEDIA QUERIES
   =============================== */

/* — Matches JS threshold (≤ 1100px): page stacking inactive, hide its settings row — */
@media (max-width: 1100px) {
  #row-page-stack {
    display: none;
  }
}

/* — Large tablet (992px – 1100px): page fills remaining width beside sidebar — */
@media (max-width: 1100px) and (min-width: 992px) {
  .page {
    width: 100% !important;
  }
}

/* — Tablet (601px – 1100px): nav releases from scroll container — */
@media (max-width: 1100px) and (min-width: 601px) {
  #nav {
    flex: 0 0 auto !important;
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
  }

  footer {
    margin-top: auto;
  }
}

/* — Tablet and below (≤ 991px): sidebar collapses, mobile menu appears — */
@media (max-width: 991px) {
  .mobilemenu {
    display: block;
  }

  #nav {
    padding-top: 100px;
    padding-bottom: 70px; /* clears the absolutely-positioned profile overlay at the bottom */
    order: 1;
    z-index: 0;
  }

  main {
    left: 0;
  }

  .page {
    width: 100% !important;
    left: 0 !important;
    padding: 0;
  }

  .section-container {
    padding-left: 3%;
    padding-right: 3%;
  }

  .h2 {
    font-size: 30px;
  }

  /* Mobile hamburger layout: profile sits above footer */
  #profile {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 120px;
    padding: 0;
    margin: 0;
    text-align: center;
    z-index: 2;
  }

  #profile .portrate {
    width: auto;
    height: auto;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .logo-text {
    font-size: 47px;
    line-height: 1;
    white-space: nowrap;
  }

  footer {
    order: 3;
  }
}

/* — Small mobile (≤ 600px): back-to-top button repositioned — */
@media (max-width: 600px) {
  #toTop {
    right: 12px;
    bottom: 12px;
    width: 42px;
    height: 42px;
  }

  #toTop i {
    line-height: 42px;
  }
}
