/* Tech Traversers: style.css
   Alternating service layout (image-left for odd rows),
   easy to add more services: always put text (groupLeft) THEN image (groupRight)
*/

/* Variables */
:root {
  --primary: #1a73e8;
  --bg: #ffffff;
  --text: #202124;
  --sidebar-bg: rgba(255,100,100,0.12);
  --hover-bg: #e8f0fe;
  --container-bg: rgba(0,255,255,0.06);
  --radius: 12px;
  --max-width: 1200px;
}

/* Reset box sizing */
*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  position: relative;
}

/* Hamburger Menu */
.menu-toggle {
  display: none;
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 1000;
  background: var(--primary);
  border: none;
  padding: 0.5rem;
  cursor: pointer;
  border-radius: 6px;
  width: 50px;
  height: 50px;
  justify-content: center;
  align-items: center;
}
.menu-toggle span {
  position: absolute;
  width: 24px;
  height: 3px;
  background: white;
  border-radius: 2px;
  transition: all 0.3s ease-in-out;
}
.menu-toggle span:nth-child(1) {
  transform: translateY(-8px);
}
.menu-toggle span:nth-child(2) {
  transform: translateY(0);
}
.menu-toggle span:nth-child(3) {
  transform: translateY(8px);
}
.menu-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: rotate(45deg);
}
.menu-toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}
.menu-toggle[aria-expanded="true"] span:nth-child(3) {
  transform: rotate(-45deg);
}

/* Hero */
#image {
  background: url("Pictures/what_is_a_programming_language.jpg") center/cover no-repeat;
  background-size: cover;
  background-attachment: fixed;
  height: clamp(250px, 50vh, 400px);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
#image::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(rgba(0,0,0,0.45), rgba(0,0,0,0.28));
}
#webTop {
  position: relative;
  z-index: 1;
  color: #fff;
  font-size: clamp(1.75rem, 5vw, 3rem);
  text-shadow: 2px 2px 6px rgba(0,0,0,0.5);
}

/* Container */
.container {
  display: flex;
  gap: 2rem;
  max-width: var(--max-width);
  margin: 20px auto;
  padding: 1.5rem;
  background: var(--container-bg);
  border-radius: var(--radius);
}
main {
  flex: 1;
  min-width: 0;
  order: 2;
}

.techWel {
  margin-bottom: 0.5rem;
}

.lead {
  font-size: 1.05rem;
  line-height: 1.7;
  max-width: 70ch;
  margin-bottom: 1.5rem;
}

.intro-highlights {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.highlight-card {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(26, 115, 232, 0.16);
  border-radius: 12px;
  padding: 1rem 1.25rem;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.05);
}

.highlight-card h2 {
  margin-top: 0;
  margin-bottom: 0.5rem;
  font-size: 1.15rem;
  color: var(--primary);
}

.highlight-card p,
.highlight-card ul {
  margin: 0;
  line-height: 1.6;
}

.highlight-card ul {
  padding-left: 1.1rem;
}

.highlight-card li + li {
  margin-top: 0.35rem;
}

/* Sidebar */
.sidebar {
  width: 250px;
  flex-shrink: 0;
  background: var(--sidebar-bg);
  border-radius: var(--radius);
  padding: 1rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  position: sticky;
  top: 1.5rem;
  order: 1;
}
.sidebar a {
  display: block;
  padding: .8rem 1rem;
  margin-bottom: .5rem;
  text-decoration: none;
  color: var(--text);
  border-radius: 8px;
}
.sidebar a:hover {
  background: var(--hover-bg);
  color: var(--primary);
  transform: translateX(4px);
  transition: all 0.2s ease-in-out;
}
#current {
  background: var(--hover-bg);
  color: var(--primary);
  font-weight: bold;
}

/* Services */
.service {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.service h2{
  text-align: center;
}
.service button {
  padding: 0.8rem 1.5rem;
  font-size: 1rem;
  color: #fff;
  background-color: var(--primary);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.2s ease-in-out;
  min-height: 44px;
  min-width: 44px;
}

.groupLeft, .groupRight {
  flex: 1 1 45%;
  min-width: 0;
  padding: 0.25rem;
}
.service-image-mobile {
  display: none;
  margin-bottom: 1rem;
}
.service-image-mobile img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 8px;
  object-fit: cover;
  aspect-ratio: 4 / 3;
  background: linear-gradient(135deg, #f0f0f0 0%, #e0e0f0 100%);
}
.groupLeft img, .groupRight img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 8px;
  object-fit: cover;
  aspect-ratio: 4 / 3;
  background: linear-gradient(135deg, #f0f0f0 0%, #e0e0e0 100%);
}

/* CORE: alternate layout automatically
   DOM rule: every service must be text (groupLeft) THEN image (groupRight).
   CSS: odd services are reversed so the image appears left for service #1, #3, ...
*/
.service:nth-of-type(odd) {
  flex-direction: row-reverse;
} /* odd -> image left */
.service:nth-of-type(even){ flex-direction: row; }      /* even -> image right */

/* Mobile menu backdrop */
body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.9);
  opacity: 0;
  pointer-events: none;
  z-index: 998;
  transition: opacity 0.3s ease-in-out;
}
body.sidebar-open::before {
  opacity: 1;
  pointer-events: auto;
}

/* Responsive: stack on small screens */
@media (max-width: 768px) {
  .menu-toggle {
    display: flex;
  }
  .container { 
    flex-direction: column; 
    padding: 1rem; 
    margin: 0 10px; 
    gap: 1rem;
    margin-top: 0;
  }
  .sidebar { 
    width: 100%;
    position: fixed;
    top: 0;
    right: -100%;
    bottom: 0;
    height: 100vh;
    max-height: 100vh;
    overflow-y: auto;
    background: var(--sidebar-bg);
    z-index: 999;
    transition: right 0.3s ease-in-out;
    padding-top: 5rem;
    border-radius: 0;
    box-shadow: -2px 0 8px rgba(0,0,0,0.15);
  }
  .sidebar.open {
    right: 0;
  }
  main {
    order: 1;
  }
  .intro-highlights {
    grid-template-columns: 1fr;
  }

  .service { 
    flex-direction: column !important; 
    gap: 1.5rem;
    margin-bottom: 1.5rem;
  }
  .groupLeft, .groupRight { 
    flex: 1 1 100%; 
    width: 100%;
    padding: 0;
  }
  .service-image-mobile {
    display: block;
  }
  .groupRight {
    display: none;
  }
  .service .groupLeft {
    order: 1;
  }
  .service .groupRight {
    order: 2;
  }
  .service button {
    width: 100%;
    font-size: 1.05rem;
  }
  .service h2 {
    margin-top: 0;
  }
}

/* Footer */
#footer{ text-align:center; padding:1rem 0 2rem; color:rgba(32,33,36,0.8); }
