/*
  Pure HTML/CSS overrides — replaces jQuery scroll, carousel,
  pie charts, progress bars, lightbox and text rotator.
*/

html {
  scroll-behavior: smooth;
  height: 100%;
  margin: 0;
}

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

#root {
  height: 100%;
  margin: 0;
  padding: 0;
}

/* ---- Horizontal section scroll (no JS) ---- */
.content-scroller {
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
}

.content-wrapper {
  display: flex;
  width: max-content;
  height: 100%;
  overflow: visible;
  position: relative;
}

.content {
  flex: 0 0 795px;
  float: none;
  scroll-snap-align: start;
  overflow-y: auto;
  height: 100%;
}

.content:last-child {
  flex-basis: min(1720px, calc(100vw - 200px));
  width: auto;
}

.content.introduction {
  overflow: hidden;
}

/* Active nav highlight via :has(:target) */
#link_introduction {
  color: #ffb400;
  font-weight: 400;
}

body:has(#chapterabout:target) #link_introduction,
body:has(#chapterskills:target) #link_introduction,
body:has(#chapterexperience:target) #link_introduction,
body:has(#chaptereducation:target) #link_introduction,
body:has(#chapterportfolio:target) #link_introduction,
body:has(#chaptercontact:target) #link_introduction,
body:has(#chapterthankyou:target) #link_introduction,
body:has(#work1:target) #link_introduction,
body:has(#work2:target) #link_introduction,
body:has(#work3:target) #link_introduction,
body:has(#work4:target) #link_introduction,
body:has(#work5:target) #link_introduction {
  color: inherit;
  font-weight: 300;
}

body:has(#chapterabout:target) #link_about,
body:has(#chapterskills:target) #link_skills,
body:has(#chapterexperience:target) #link_experience,
body:has(#chaptereducation:target) #link_education,
body:has(#chapterportfolio:target) #link_portfolio,
body:has(#work1:target) #link_portfolio,
body:has(#work2:target) #link_portfolio,
body:has(#work3:target) #link_portfolio,
body:has(#work4:target) #link_portfolio,
body:has(#work5:target) #link_portfolio,
body:has(#chaptercontact:target) #link_contact {
  color: #ffb400;
  font-weight: 400;
}

body:has(#chapterintroduction:target) #link_introduction {
  color: #ffb400;
  font-weight: 400;
}

/* ---- Mobile menu (checkbox hack) ---- */
.menu-link {
  cursor: pointer;
}

@media only screen and (max-width: 800px) {
  body {
    overflow: auto;
  }

  .content-scroller {
    position: relative;
    left: 0;
    overflow-x: visible;
    overflow-y: visible;
    height: auto;
    scroll-snap-type: none;
  }

  .content-wrapper {
    display: block;
    width: 100% !important;
    height: auto;
    position: relative;
  }

  .content {
    flex: none;
    width: 100% !important;
    float: none;
    height: auto;
    overflow: visible;
    scroll-snap-align: none;
  }

  .content:last-child {
    width: 100% !important;
    flex-basis: auto;
  }

  .menu-link {
    display: block;
  }

  #nav-toggle:checked ~ #container .menu {
    height: 460px;
  }

  #nav-toggle:checked ~ #container .menu nav {
    display: block;
    overflow: visible !important;
    width: 100% !important;
    background-color: #000;
    height: 400px;
  }

  .introduction {
    min-height: 480px;
  }

  .introduction .inner {
    position: relative;
    margin: 40% 0 0 0;
  }

  .css-carousel {
    position: absolute;
  }

  .css-carousel,
  .css-carousel img {
    width: 100%;
    height: 100%;
  }
}

/* ---- CSS profile carousel ---- */
.css-carousel {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  overflow: hidden;
  z-index: 0;
}

.introduction .inner {
  z-index: 2;
  position: absolute;
}

.css-carousel-track {
  display: flex;
  width: 300%;
  height: 100%;
  animation: carousel-slide 12s infinite;
}

.css-carousel .item {
  width: 33.333%;
  height: 100%;
  flex-shrink: 0;
}

.css-carousel img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 72% center; /* keep the subject (right side) in frame */
  display: block;
  float: none;
  z-index: 0;
}

@keyframes carousel-slide {
  0%, 28% { transform: translateX(0); }
  33%, 61% { transform: translateX(-33.333%); }
  66%, 94% { transform: translateX(-66.666%); }
  100% { transform: translateX(0); }
}

/* ---- CSS pie charts ---- */
.chart {
  background:
    radial-gradient(circle at center, #fff 58%, transparent 59%),
    conic-gradient(#ffb400 0 var(--p, 75%), #e6e6e6 0);
}

/* Percent set via inline style: style={{ '--p': `${n}%` }} */

.percent:after {
  content: "%";
}

/* ---- Progress bars ---- */
.progress-value {
  background-color: #8f8f8f;
  height: 6px;
  position: relative;
}

.progress-value span {
  font-family: 'Oswald', sans-serif;
  font-size: 40px;
  font-weight: 400;
  position: absolute;
  left: -93px;
  color: #000;
  top: -19px;
}

.progress-value span:after {
  content: "%";
  font-weight: 100;
}

/* ---- Text rotator ---- */
.css-rotate {
  position: relative;
  height: 1.4em;
  overflow: hidden;
  font-family: 'Oswald', sans-serif;
  font-size: 48px;
  font-weight: 300;
  color: #ffb400;
  text-transform: lowercase;
}

.css-rotate span {
  display: block;
  position: absolute;
  left: 0;
  right: 0;
  opacity: 0;
  animation: rotate-text 8s infinite;
}

.css-rotate span:nth-child(1) { animation-delay: 0s; }
.css-rotate span:nth-child(2) { animation-delay: 2s; }
.css-rotate span:nth-child(3) { animation-delay: 4s; }
.css-rotate span:nth-child(4) { animation-delay: 6s; }

@keyframes rotate-text {
  0% { opacity: 0; transform: translateY(10px); }
  5%, 20% { opacity: 1; transform: translateY(0); }
  25%, 100% { opacity: 0; transform: translateY(-10px); }
}

/* ---- Portfolio grid (CSS only) ---- */
.grid-gallery .grid {
  display: flex;
  flex-wrap: wrap;
  margin: 0;
  padding: 0;
  list-style: none;
}

.grid-gallery .grid li {
  width: 50%;
  float: none;
}

.grid-gallery .grid li a {
  display: block;
  color: inherit;
  text-decoration: none;
}

.grid-gallery .grid figure {
  position: relative;
  overflow: hidden;
  margin: 0;
}

.grid-gallery .grid figcaption {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  opacity: 0;
  transition: opacity 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.grid-gallery .grid li:hover figcaption {
  opacity: 1;
}

/* ---- Lightbox (:target) ---- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.lightbox:target {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.lightbox-inner {
  max-width: 720px;
  width: 100%;
  color: #fff;
  text-align: center;
}

.lightbox-inner h3 {
  font-family: 'Oswald', sans-serif;
  font-size: 28px;
  margin: 0 0 8px;
  color: #ffb400;
}

.lightbox-inner span {
  display: block;
  margin-bottom: 16px;
  opacity: 0.8;
}

.lightbox-inner img {
  max-width: 100%;
  height: auto;
  margin-top: 20px;
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 30px;
  color: #fff;
  font-size: 42px;
  text-decoration: none;
  line-height: 1;
}

.lightbox-close:hover {
  color: #ffb400;
}

/* Hide original jScrollPane scroll.css dependency side effects */
.noscroll {
  overflow: hidden !important;
}
