/* Styles for Project-1.html: project content, image carousel, header, and footer. */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Site-wide colors and typography tokens */
:root {
    --color-1: #23513AFF;
    --color-2: #740C00FF;
    --color-3: #FDCD00FF;
    --color-4: #F0eFF4FF;
    --color-5: #212529FF;
    --font-1: 'Roboto Mono', monospace;
    --font-2: 'Inter', sans-serif;
    font-size: 16px;
}

/* Default heading, paragraph, and link typography */
body {
    background-color: var(--color-4);
    color: var(--color-5);
    font-family: var(--font-1);
}

/* Header and brand layout */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--color-4);
    padding: 10px 20px;
}

#logo {
    height: 75px;
    width: auto;
    padding: 5;
    margin: 0;
}

/* Brand name and slogan */
.brand {
    display: flex;
    flex-direction: column;
}

.brand h1 {
    color: var(--color-1);
}

.brand p  {
    color: var(--color-2);
}

.brand a {
    text-decoration: none;
}

/* Main navigation links */
.nav {
    list-style: none;
    display: flex;
    align-items: center;
}

.nav-item a {
    color: var(--color-1);
    text-decoration: none;
    padding: 14px 16px;
    font-size: 1rem;
    display: block;
}

.nav-item a:hover {
    background-color: var(--color-2);
    color: var(--color-3);
}

/* Portfolio dropdown menu */
.dropdown {
    position: relative;
}

.dropdown-item {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 160px;
    list-style: none;
    background-color: var(--color-4);
    z-index: 100;
}

.dropdown:hover .dropdown-item,
.dropdown:focus-within .dropdown-item {
    display: block;
}

/* Project hero banner and its title/summary text. */
.banner {
    background-image: url(resources/images/PCB3.png);

    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 2rem 5%;
    background-size: cover;
    background-position: center;
    height: 330px;
}

.banner-text {
    text-align: left;
    width: 40%;
    padding: 10px 10px;
    margin: 2%;
}

.banner-text h2 {
    font-size: 2rem;
    color: var(--color-3);
}

.banner-text h3 {
    color: var(--color-3);
    padding-top: 10px;
}

/* Full-width gallery container, aligned to the page's main content margins. */
.content {
    margin: 3rem;
}

.visual {
    min-width: 0;
}

/* Project description and specifications */
.project-details {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
    margin: 3rem;
}

/* Description panel, same bordered style as the About panel on the home page */
.text {
    border: 2px solid var(--color-2);
    border-radius: 1rem;
    display: flex;
    align-items: center;
}

.text-content {
    padding: 1.5rem;
}

.text-content h2 {
    padding-bottom: 1rem;
}

.text-content p {
    line-height: 1.6;
}

.text-content p + p {
    margin-top: 1rem;
}

.specifications {
    border: 2px solid var(--color-2);
    border-radius: 1rem;
    padding: 1.5rem;
}

.specifications h2 {
    margin-bottom: 0.75rem;

}

#budget {
    padding-top: 1.5rem;
}

.specifications ul {
    padding-left: 1.25rem;
}

.specifications li + li {
    margin-top: .75rem;
}

/* Shared button style (same as the home page) */
.button {
    display: block;
    text-transform: uppercase;
    cursor: pointer;
    padding: 0.25em 0.5em;
    border-radius: 1rem;
    position: relative;
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
    text-align: center;
    text-decoration: none;
    font-family: inherit;
    font-size: 1rem;
    background: transparent;
}

.button:active {
    box-shadow: 0px 0px 0px 0px;
    top: 5px;
    left: 5px;
}

/* Desktop gallery places the thumbnail/control rail beside the main image. */
.gallery {
    display: grid;
    grid-template-columns: 7rem minmax(0, 1fr);
    grid-template-areas: "controls stage";
    align-items: stretch;
    gap: 7.5rem;
}

.gallery-stage {
    grid-area: stage;
}

.gallery-stage {
    position: relative;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border: 2px solid var(--color-2);
    border-radius: 1rem;
    background-color: var(--color-1);
    background-image:
        linear-gradient(var(--color-5) 1px, transparent 1px),
        linear-gradient(90deg, var(--color-5) 1px, transparent 1px);
    background-size: 1.5rem 1.5rem;
}

/* Slides sit on top of each other and fade between */
.gallery-slide {
    position: absolute;
    inset: 0;
    margin: 0;
    opacity: 0;
    visibility: hidden;
    background-color: var(--color-1);
    transition: opacity 0s ease, visibility 0s;
}

.gallery-slide--embed > * {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
}

.step-viewer {
    position: relative;
    width: 100%;
    height: 100%;
}

.step-viewer canvas {
    display: block;
    width: 100%;
    height: 100%;
    cursor: grab;
}

.step-status {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    margin: 0;
    padding: .25rem .5rem;
    background: var(--color-1);
    color: var(--color-3);
    font-size: .875rem;
    z-index: 1;
}

.gallery-slide.is-active {
    opacity: 1;
    visibility: visible;
}

.gallery-slide img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: pointer;
    transform: scale(1);
    transition: transform 5s ease-out;
}

/* Placeholder label shown behind a picture until the image file exists */
.gallery-slide::before {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: .25rem .5rem;
    background: var(--color-1);
    color: var(--color-3);
    font-size: .875rem;
    white-space: nowrap;
}

.gallery-slide img {
    position: relative;
}

.gallery-counter {
    position: absolute;
    right: 1rem;
    bottom: 1rem;
    padding: .25rem .75rem;
    background: var(--color-5);
    color: var(--color-3);
    font-size: .875rem;
    border-radius: 1rem;
    z-index: 2;
}

.gallery-controls {
    grid-area: controls;
}

.gallery-thumbs {
    display: grid;
    grid-auto-rows: minmax(0, 1fr);
    min-height: 0;
    gap: 1rem;
}

.gallery-thumb {
    padding: 0;
    width: 100%;
    min-width: 0;
    min-height: 5rem;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid var(--color-5);
    border-radius: 1rem;
    background-color: var(--color-1);
    background-image:
        linear-gradient(var(--color-5) 1px, transparent 1px),
        linear-gradient(90deg, var(--color-5) 1px, transparent 1px);
    background-size: 1rem 1rem;
    opacity: .6;
    transition: opacity .15s, border-color .15s;
}

.gallery-thumb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gallery-thumb:hover {
    opacity: 1;
}

.gallery-thumb.is-active {
    opacity: 1;
    border-color: var(--color-3);
    outline: 3px solid var(--color-2);
    outline-offset: 0;
}

.gallery-thumb:focus-visible {
    outline: 3px solid var(--color-2);
    outline-offset: 3px;
}
 
/*Footer*/

.site-footer { 
    background: var(--color-5); 
    color: var(--color-4); 
}
 
/* Four columns on desktop, fewer on smaller screens (see bottom) */
.site-footer__inner {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1fr;
    gap: 2rem;
    max-width: 1200px;
    margin: 2rem auto;
    margin-bottom: 0.5rem;
    padding-top: 2rem;
}

.site-footer h2 { 
    margin: 0 0 1rem; 
    font-size: 1rem; 
    font-weight: 700; 
    color: var(--color-3); 
}

.site-footer p  { 
    margin: 0;
}

.site-footer ul {
    margin: 0;
    padding: 0; 
    list-style: none; 
}

.site-footer li { 
    margin-bottom: .625rem;
    line-height: 1;
    font-size: 0.75rem; 
}
 
.site-footer__logo { 
    margin-bottom: .75rem !important; 
    font-size: 1.75rem; 
    font-weight: 700;
    color: var(--color-3); 
}

#site-footer__slogan {
    font-size: 0.75rem;
    color: var(--color-4);
}
 
/* Links */
.site-footer a { 
    color: var(--color-4);
    text-decoration: none; 
    border-bottom: 1px solid transparent;
}

.site-footer a:hover { 
    color: var(--color-3);
    border-bottom-color: var(--color-3); 
}

.site-footer a:focus-visible { 
    outline: 3px solid var(--color-3); 
    outline-offset: 3px; 
}
 
/* Bottom bar */
.site-footer__bottom {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.5rem;
    border-top: 2px solid var(--color-1);
    font-size: .8125rem;
}
.site-footer__bottom ul { 
    display: flex; 
    gap: 1.5rem; 
}

.site-footer__bottom li { 
    margin: 0; 
}


/* Tablet: two columns, brand block on its own row */
@media (max-width: 900px) {
  .site-footer__inner { grid-template-columns: 1fr 1fr; }
  .site-footer__brand { grid-column: 1 / -1; }
}
 
/* Phone: one column */
@media (max-width: 500px) {
  .site-footer__inner { grid-template-columns: 1fr; }
}

/* Stack gallery and project details on narrow screens */
@media (max-width: 800px) {
  .content,
  .project-details { margin: 2rem 1.5rem; }
  .project-details { grid-template-columns: 1fr; }
  .gallery { grid-template-columns: minmax(0, 1fr); grid-template-areas: "stage" "controls"; }
  .gallery-thumbs { grid-template-columns: repeat(5, minmax(0, 1fr)); grid-template-rows: auto; }
  .gallery-thumb { aspect-ratio: 4 / 3; }
}

/* Respect reduced-motion accessibility settings */
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
  .gallery-slide img { transform: none; }
}

/* Wrap the shared navigation and reduce gallery margins on narrow screens. */
@media (max-width: 800px) {
  header {
    flex-wrap: wrap;
    gap: .75rem 1rem;
  }

  header > .nav {
    flex-basis: 100%;
    justify-content: center;
  }

  header > .nav > .nav {
    justify-content: center;
    flex-wrap: wrap;
  }
}

@media (max-width: 600px) {
  header { padding: .75rem 1rem; }
  .nav-item a { padding: .6rem .75rem; }
  .site-footer__inner { padding-left: 1.5rem; padding-right: 1.5rem; }
  .banner {
    min-height: 150px;
    height: auto;
    background-image: none;
    background-color: #000;
  }
  .banner-text { width: 100%; }
  .banner-text h3 { display: none; }
  .content,
  .project-details { margin: 2rem 1rem; }
  .gallery-thumb { min-height: 3.5rem; }
  .text-content,
  .specifications { padding: 1rem; }
  .site-footer__bottom { justify-content: center; text-align: center; padding: 1rem; }
}