/* =========================================================
   Breakpoints (matching w3.css):
     Phone:   up to 600px
     Tablet:  601px – 992px
     Desktop: 993px and up
   ========================================================= */

* { box-sizing: border-box; }

body, h1, h2, h3, h4, h5, h6 {
  font-family: "Newsreader", serif;
}

.section-divider {
  width: 400px;
  margin: 60px 0;
}

body { font-size: 17px; }

/* Headings never justified; balance line lengths when they wrap */
h1, h2, h3, h4, h5, h6 {
  text-align: left;
  text-wrap: balance;
}

/* =========================================================
   CALENDAR DATE
   ========================================================= */

.calendar-date {
  display: grid;
  grid-template-rows: repeat(4, auto);
  width: 160px;
  background: #f5f5f5;
  color: #222;
  border-radius: 8px;
  overflow: hidden;
  text-align: center;
  justify-self: end;
  align-self: center;
}

.calendar-day {
  background: #336600;
  color: #fff;
  font-size: 20px;
  font-weight: bold;
  padding: 8px;
}

.calendar-number {
  font-size: 64px;
  font-weight: bold;
  line-height: 1.2;
  padding-top: 8px;
}

.calendar-number sup {
  font-size: 24px;
  vertical-align: super;
}

.calendar-month {
  font-size: 22px;
  font-weight: bold;
  color: #336600;
  padding-bottom: 4px;
}

.calendar-time {
  font-size: 18px;
  font-weight: bold;
  color: #222;
  text-align: center;
  line-height: 1.2;
  padding: 0 8px 12px;
}

.calendar-datetime {
  font-weight: bold;
}

/* =========================================================
   CALENDAR EVENTS
   ========================================================= */

.calendar-event {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 160px;
  align-items: center;
  gap: 24px;
  padding: 20px 0;
}

.calendar-details {
  text-align: left;
}

.calendar-details p {
  margin: 8px 0;
  white-space: pre-line;
}

@media (max-width: 600px) {
  .calendar-event {
    grid-template-columns: 1fr;
  }

  .calendar-date {
    justify-self: center;
  }
}




/* Keep images from ever pushing wider than their container */
img { max-width: 100%; }

.press-start-2p-regular {
  font-family: "Press Start 2P", system-ui;
  font-weight: 400;
  font-style: normal;
}

.svg-icon {
  width: 1em;
  height: 1em;
  vertical-align: -0.125em;
  fill: currentColor;
  flex-shrink: 0;
}


/* =========================================================
   PHOTO GRID
   ========================================================= */

.photo-grid {
  column-count: 2;
  column-gap: 12px;
}

.photo-grid img {
  display: block;
  width: 100%;
  margin-bottom: 12px;
}


/* =========================================================
   SIDEBAR
   ========================================================= */

/* Sidebar: 120px wide, with matching left margin on page content */
.w3-sidebar {
  width: 120px;
  background: #222;
}

#main {
  margin-left: 120px;
}


/* =========================================================
   HEADER
   ========================================================= */

.title-block {
  position: relative;
  isolation: isolate;
  width: fit-content;
  max-width: 100%;
  margin: 0 auto;
}

h1.press-start-2p-regular {
  position: relative;
  z-index: 1;
  line-height: 1;
  margin-bottom: 0;
}

/* Animation (75%) and rotating subtitle (25%) */
.title-bottom {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 1fr);
  align-items: end;
  width: 100%;
  overflow: visible;
}

/* Compact animation with upward overlap and a soft left-edge fade. */
.title-bottom [data-rock-stacker] {
  position: relative;
  width: 100%;
  height: 80px;
  min-width: 0;
  overflow: visible !important;
  z-index: 2;
}

.title-bottom [data-rock-stacker] > svg {
  position: absolute;
  bottom: 0;
  left: 0;
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
  -webkit-mask-image: linear-gradient(to right, transparent 0%, black 15%, black 100%);
  mask-image: linear-gradient(to right, transparent 0%, black 15%, black 100%);
}

/* Hide only the ground line; the physics remain unchanged. */
.title-bottom [data-rock-stacker] > svg > path {
  stroke: none;
}

.rotator {
  position: relative;
  z-index: 3;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  contain: inline-size;
  white-space: normal;
  overflow-wrap: anywhere;
  text-align: right;
  margin: 0;
  font-size: 17px;
  transition: opacity .6s ease;
}

.rotator.fade {
  opacity: 0;
}

@media (prefers-reduced-motion: reduce) {
  .rotator {
    transition: none;
  }
}

/* =========================================================
   CALL TO ACTION
   ========================================================= */

#cta {
  display: grid;
  grid-template-columns: 2fr 1fr;
  align-items: center;
  gap: 24px;
  background: #336600;
  padding: 10px 20px;
  font-size: 16px;
  border-radius: 5px;
  margin-top: 32px;
  margin-bottom: 32px;
}

#cta .cta-svg {
  width: 80%;
  height: auto;
  display: block;
  justify-self: end;
  align-self: center;
}


/* =========================================================
   PREVIOUS WORK
   ========================================================= */

#work {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px 48px;
}

#work .cta {
  grid-column: 1 / -1;
  background: #336600;
  padding: 10px 20px;
  font-size: 16px;
  border-radius: 5px;
}

#work .div3 { grid-row-start: 3; }
#work .div4 { grid-row-start: 3; }
#work .div5 { grid-row-start: 4; }
#work .div6 { grid-row-start: 4; }

#work li {
  padding: 10px;
}


/* =========================================================
   LUNCH AND LEARN
   ========================================================= */

#learn {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-rows: auto auto;
  gap: 8px 48px;
}

#learn .div1 {
  grid-column: 1 / -1;
}

#learn .div2 {
  grid-column: 1;
  grid-row-start: 2;
}

#learn .div4 {
  grid-column: 2 / span 2;
  grid-row-start: 2;
  min-width: 0;
}

#learn .div2 img {
  width: 100%;
  height: auto;
  border-radius: 4px;
  display: block;
}

#learn .learn-intro {
  margin: 0 0 16px;
  text-align: left;
}

#learn .calendar-event {
  padding-top: 0;
}

#learn .calendar-details h3 {
  margin-top: 0;
}


/* =========================================================
   SLIDESHOW
   ========================================================= */

.slideshow-container {
  --slides-per-view: 3;
  max-width: 900px;
  position: relative;
  margin: auto;
  overflow: hidden;
}

/* The row of slides that moves */
.slides-track {
  display: flex;
  transition: transform 0.6s ease;
}

/* Each slide takes 1/--slides-per-view of the width */
.mySlides {
  flex: 0 0 calc(100% / var(--slides-per-view));
  position: relative;
  padding: 0 4px;
}

.mySlides img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  background: #222;
  object-position: top;
  border-radius: 5px;
}

/* Next and previous buttons */
.prev, .next {
  cursor: pointer;
  position: absolute;
  top: 50%;
  margin-top: -22px;
  padding: 16px;
  color: white;
  font-weight: bold;
  font-size: 18px;
  transition: 0.6s ease;
  border-radius: 0 3px 3px 0;
  user-select: none;
  z-index: 1;
}

.next {
  right: 0;
  border-radius: 3px 0 0 3px;
}

.prev:hover, .next:hover {
  background-color: rgba(0, 0, 0, 0.8);
}

/* Slide captions */
.text {
  color: #000;
  font-size: 15px;
  padding: 8px 12px;
  position: absolute;
  bottom: 8px;
  left: 4px;
  right: 4px;
  text-align: center;
  background: #fff;
  text-wrap: balance;
}

/* Slideshow navigation dots */
.dot {
  cursor: pointer;
  height: 15px;
  width: 15px;
  margin: 0 2px;
  background-color: #bbb;
  border-radius: 50%;
  display: inline-block;
  transition: background-color 0.6s ease;
}

.dot.active, .dot:hover {
  background-color: #717171;
}


/* =========================================================
   SURVEY
   ========================================================= */

.ws.ws {
  --ws-accent: #336600;
}

#survey {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px 48px;
}


/* =========================================================
   SERVICES
   ========================================================= */

#services .services {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-template-rows: repeat(6, auto);
  grid-auto-flow: column;
  gap: 8px;
  list-style: none;
  padding: 0;
  margin: 0;
}

.w3-section p {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* =========================================================
   CONTACT FORM STATUS
   ========================================================= */

.contact-success,
.contact-error {
  padding: 12px 16px;
  margin-top: 16px;
  border-radius: 4px;
  color: #f5f5f5;
}

.contact-success {
  background: #336600;
}

.contact-error {
  background: #992222;
}

#contact-form button:disabled {
  opacity: 0.6;
  cursor: wait;
}

.contact-honeypot {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}


/* =========================================================
   TABLET (601px – 992px)
   ========================================================= */

@media only screen and (max-width: 992px) {

/* Lunch and Learn: stack on tablets */
#learn {
  grid-template-columns: 1fr;
  gap: 16px;
}

#learn .div1,
#learn .div2,
#learn .div4 {
  grid-column: 1 / -1;
  grid-row-start: auto;
}

  #work {
    gap: 8px 32px;
  }

}


/* =========================================================
   PHONE (up to 600px)
   ========================================================= */

@media only screen and (max-width: 600px) {

  /* Mobile navigation spacing.
     Change this value to adjust the space beneath the menu. */
  :root {
    --mobile-nav-height: 130px;
  }


  /* -------------------------------------------------------
     MOBILE NAVIGATION
     ------------------------------------------------------- */

  /* Allow the eight menu items to occupy three rows */
  #myNavbar .w3-flex {
    flex-wrap: wrap;
  }

  #myNavbar .w3-button {
    flex: 1 1 33.333% !important;
    padding: 10px 4px;
  }

  #myNavbar {
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
  }

  /* Prevent section headings from scrolling beneath the menu */
  html {
    scroll-padding-top: var(--mobile-nav-height);
  }

  /* Sidebar is hidden on phones.
     Reserve physical space beneath the fixed navigation. */
  #main {
    margin-left: 0;
    padding-top: var(--mobile-nav-height) !important;
  }


  /* -------------------------------------------------------
     MOBILE HEADER
     ------------------------------------------------------- */

  /* Header: one word per line */
  h1.press-start-2p-regular {
    width: min-content;
    font-size: min(13vw, 4rem) !important;
    line-height: 1.15;
    overflow-wrap: normal;
    word-break: normal;
    hyphens: none;
  }

  /* Stack animation and subtitle on phones */
  .title-bottom {
    grid-template-columns: 1fr;
  }

  .rotator {
    text-align: left !important;
    font-size: 12px;
  }


  /* -------------------------------------------------------
     MOBILE PHOTO GRID
     ------------------------------------------------------- */

  .photo-grid {
    column-count: 1;
  }


  /* -------------------------------------------------------
     MOBILE PREVIOUS WORK
     ------------------------------------------------------- */

  /* One column, with fixed row assignments removed */
  #work {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  #work .div3,
  #work .div4,
  #work .div5,
  #work .div6 {
    grid-row-start: auto;
  }

  #work li {
    padding: 6px 0;
  }


  /* -------------------------------------------------------
     MOBILE LUNCH AND LEARN
     ------------------------------------------------------- */

  /* One column, everything stacked in order */
  #learn {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  #learn .div1,
  #learn .div2,
  #learn .div3,
  #learn .div4 {
    grid-column: auto;
    grid-row-start: auto;
  }

  #learn li {
    padding: 6px 0;
  }

  /* -------------------------------------------------------
     MOBILE SLIDESHOW
     ------------------------------------------------------- */

  /* Place captions below images */
  .mySlides {
    display: flex;
    flex-direction: column;
  }

  .text {
    position: static;
    flex: 1;
    font-size: 12px;
    line-height: 1.3;
    padding: 6px 4px;
  }

  .dot {
    height: 18px;
    width: 18px;
    margin: 0 5px;
  }

  /* To show one slide at a time on phones, uncomment below.
     Only do this once the slideshow JavaScript reads
     --slides-per-view. */

  /* .slideshow-container {
    --slides-per-view: 1;
  } */


  /* -------------------------------------------------------
     MOBILE SURVEY
     ------------------------------------------------------- */

  #survey {
    grid-template-columns: 1fr;
  }


  /* -------------------------------------------------------
     MOBILE SERVICES
     ------------------------------------------------------- */

  #services .services {
    grid-template-columns: 1fr;
    grid-template-rows: none;
    grid-auto-flow: row;
  }


/* -------------------------------------------------------
   MOBILE CALL TO ACTION
   ------------------------------------------------------- */

#cta {
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto auto;
  gap: 12px;
  padding: 24px 20px;
}

#cta .cta-svg {
  grid-column: 1;
  grid-row: 1;
  width: 80px;
  height: auto;
  justify-self: center;
  align-self: center;
}

#cta .cta-text {
  grid-column: 1;
  grid-row: 2;
  min-width: 0;
}

#cta .cta-text p {
  text-align: left;
}


#cta .cta-text h3 {
  text-align: left !important;
  text-wrap: wrap;
}

/* Bullet the first three headings */
#cta .cta-text h3:nth-of-type(-n+3) {
  position: relative;
  padding-left: 22px;
}

#cta .cta-text h3:nth-of-type(-n+3)::before {
  content: "•";
  position: absolute;
  left: 0;
  font-weight: bold;
}

}


/* =========================================================
   SIMPLIFY ANIMATION
   ========================================================= */

@media (prefers-reduced-motion: no-preference) {

  [data-simplify][data-simplify-hide-initial]:not([data-simplify-hide-initial="false"]):not([data-simplify-revealed]) {
    opacity: 0 !important;
  }

}