/* styles/portfolio.css */

/*––––– Variables –––––*/
:root {
  --bg: #111;
  --fg: #ddd;
  --highlight: #e54e3b;
  --font-sans: 'Montserrat', sans-serif;
}

/*––––– Reset –––––*/
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/*––––– Base –––––*/
body.dark-theme {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  line-height: 1.5;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  overflow-x: hidden;
}

main {
  flex: 1;
  display: flex;
  flex-direction: column;
}

/*––––– Skip Link –––––*/
.skip-link {
  position: absolute;
  top: -40px;
  left: 1rem;
  background: var(--highlight);
  color: #fff;
  padding: 0.5rem;
  text-decoration: none;
  transition: top 0.3s;
}

.skip-link:focus {
  top: 1rem;
}

/*––––– Header/Nav –––––*/
.nav--primary {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  padding: 1rem 2rem;
  z-index: 10;
}

.nav--primary .logo {
  color: var(--fg);
  font-size: 1.25rem;
  font-weight: 700;
  text-decoration: none;
}

/*––––– Hero –––––*/
.portfolio-hero {
  position: relative;
  height: 50vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.portfolio-hero .eyebrow {
  font-size: 0.875rem;
  color: var(--fg);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin-bottom: 1rem;
}

.portfolio-hero .hero-title {
  font-size: clamp(3rem, 8vw, 5rem);
  font-weight: 700;
  line-height: 1;
}

.portfolio-hero .accent-dot {
  position: absolute;
  top: 20%;
  right: 25%;
  width: 1rem;
  height: 1rem;
  background: var(--highlight);
  border-radius: 50%;
  opacity: 0.8;
  animation: float 6s ease-in-out infinite;
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-1rem);
  }
}

/*––––– Section Titles –––––*/
.section-block {
  margin: 4rem 2rem;
}

.section-title {
  font-size: clamp(2rem, 6vw, 3rem);
  font-weight: 700;
  color: var(--highlight);
  margin-bottom: 2rem;
  text-align: center;
}

/*––––– Middle Containers –––––*/
.middle-containers {
  display: flex;
  gap: 2rem;
  margin: 0;
  flex: 1;
}

.middle-containers .container {
  flex: 1;
  height: 60vh;
  padding: 2rem;
  background: transparent;
}

/* Left “services” styling */
.services-title {
  font-size: clamp(2.5rem, 8vw, 6rem);
  font-weight: 700;
  color: var(--highlight);
  line-height: 1.1;
  margin-bottom: 1rem;
}

.services-desc {
  font-size: 1rem;
  max-width: 40ch;
  line-height: 1.6;
}

/*––––– Right free‐scroll boxes –––––*/
.container--right {
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  scroll-behavior: smooth;       /* smooth scrolling */
  overscroll-behavior-y: contain;/* keep scroll in this container */
  gap: 2.5rem;                   /* spacing between boxes */
}

.container--right::-webkit-scrollbar {
  display: none;                 /* Chrome/Safari */
}

/* Adjusted box dimensions: slightly shorter and wider */
.container--right .box {
  flex: 0 0 100%;                /* 80% of container’s height */
  background: #222;
  border-radius: 0.5rem;
  position: relative;
  width: calc(100% + 4rem);     /* extend width by 4rem total */
  margin-left: -2rem;           /* pull left by half of extra width */
  margin-right: -2rem;          /* pull right by half of extra width */
}

/*––––– Image Container inside each Box –––––*/
.box-image-container {
  position: absolute;
  top: 3rem;
  left: 3rem;
  width: calc(100% - 6rem);
  height: calc(100% - 6rem);
  border-radius: 0.5rem;
  overflow: hidden;
}

/* Ensure the image covers the container */
.box-image-container img.box-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/*––––– Side‐bars –––––*/
.side-bar {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  z-index: 5;
}

.side-bar--left {
  left: 1rem;
}

.side-bar--right {
  right: 0;
}

/* Social Links –––––*/
.social-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.social-list a {
  color: var(--fg);
  font-weight: 700;
  font-size: 0.875rem;
  text-decoration: none;
  transition: color 0.3s;
}

.social-list a:hover {
  color: var(--highlight);
}

/* Visually hidden text for screen readers */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Nav tabs –––––*/
.external-tab {
  display: block;
  writing-mode: vertical-rl;
  text-orientation: mixed;
  background: var(--highlight);
  color: #fff;
  padding: 0.75rem 0.5rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-decoration: none;
  border-top-left-radius: 0.5rem;
  border-bottom-left-radius: 0.5rem;
  margin: 3rem 0;
  transition: transform 0.3s;
}

.external-tab:hover {
  transform: translateX(-0.5rem);
}

/* Footer –––––*/
footer {
  text-align: center;
  padding: 2rem 1rem;
  font-size: 0.875rem;
  color: #777;
}

/*––––– Mobile stacking & full-flow boxes –––––*/
@media (max-width: 600px) {
  /* 1) Stack left + right under each other */
  .middle-containers {
    flex-direction: column;
    margin: 0 1rem 2rem; /* pulled up under the section title, with bottom breathing room */
  }

  /* 2) Let both panels size to their content */
  .middle-containers .container {
    width: 100%;
    height: auto !important;     /* override the 60vh from desktop */
    min-height: auto !important;
    padding: 1.5rem;
  }

  /* 3) Turn the right‐hand “scroll area” into a normal block */
  .container--right {
    overflow-y: visible !important;  /* no inner scrolling */
    max-height: none !important;
    height: auto !important;
    margin-top: 2rem;                /* separate it from the left panel */
  }

  /* 4) Override the flex-basis on each box so they actually show */
  .container--right .box {
    flex: none !important;         /* remove flex:0 0 80% */
    height: auto !important;       /* let content & min-height drive their height */
    min-height: 40vh;              /* or whatever makes them big enough on phone */
    margin-bottom: 2.5rem;         /* keep your spacing */
    width: 100% !important;        /* ensure full width on mobile */
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  /* On mobile, the inset image containers become static and full-width */
  .box-image-container {
    position: static;
    width: 100%;
    height: auto;
    margin-bottom: 1rem;
  }
}

