/* =====================================================================
   MOTION + CAPACITY HIGHLIGHT
   Loaded last on every page (see includes/header.php).

   1. Capacity highlight components (showcase, chips)
   2. Ticker strip
   3. Scroll progress bar
   4. Reveal animations (driven by js/script.js)
   5. Reduced motion
===================================================================== */


/* =========================================
   1b. CAPACITY SHOWCASE (home)
========================================= */

.capacity-section {
  position: relative;
  overflow: hidden;
  padding: 80px 0 120px;
  background: var(--color-cream);
}

/* Huge outlined figure that drifts sideways as the section scrolls by */
.capacity-backdrop {
  position: absolute;
  top: 50%;
  left: 0;
  z-index: 0;
  white-space: nowrap;
  pointer-events: none;
  user-select: none;
  font-family: var(--font-heading);
  font-size: clamp(110px, 17vw, 260px);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.02em;
  color: transparent;
  -webkit-text-stroke: 1px rgba(72, 32, 11, 0.09);
  transform: translate3d(var(--capacity-shift, 0px), -50%, 0);
  will-change: transform;
}

.capacity-container {
  position: relative;
  z-index: 1;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 30px;
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 80px;
  align-items: center;
}

.capacity-number {
  display: flex;
  align-items: flex-end;
  gap: 18px;
  margin: 0;
  color: var(--color-brown);
  font-family: var(--font-heading);
}

.capacity-value {
  font-size: clamp(130px, 17vw, 230px);
  font-weight: 600;
  line-height: 0.82;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
}

.capacity-unit {
  margin-bottom: 0.35em;
  font-size: clamp(30px, 3.6vw, 50px);
  font-weight: 600;
  line-height: 1;
  text-transform: uppercase;
}

.capacity-label {
  position: relative;
  margin-top: 30px;
  padding-top: 18px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--color-black);
}

/* Brown rule that draws itself in when the section is reached */
.capacity-label::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 120px;
  height: 3px;
  background: var(--color-brown);
  transform-origin: left;
  transition: transform 1.2s var(--ease-out) 0.4s;
}

.reveal-init .capacity-section:not(.is-inview) .capacity-label::before {
  transform: scaleX(0);
}

.capacity-content h2 {
  font-family: var(--font-heading);
  font-size: clamp(32px, 3.6vw, 46px);
  font-weight: 600;
  line-height: 1.2;
  margin-bottom: 22px;
  color: var(--color-black);
}

.capacity-content h2 span {
  color: var(--color-brown);
}

.capacity-content > p {
  max-width: 560px;
  margin-bottom: 34px;
  color: #625c57;
  font-size: 15px;
  line-height: 1.9;
}

.capacity-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 30px;
}

.capacity-stat {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 22px 20px;
  background: var(--color-white);
  border: 1px solid #e9e2dc;
  transition: transform 0.35s var(--ease-out), box-shadow 0.35s ease, border-color 0.35s ease;
}

.capacity-stat:hover {
  transform: translateY(-6px);
  border-color: #dcd2c9;
  box-shadow: 0 18px 36px rgba(72, 32, 11, 0.09);
}

.capacity-stat strong {
  font-family: var(--font-heading);
  font-size: 34px;
  font-weight: 600;
  line-height: 1;
  color: var(--color-brown);
}

.capacity-stat > span {
  color: #716a64;
  font-size: 12px;
  line-height: 1.6;
}

@media (max-width: 900px) {
  .capacity-section {
    padding: 55px 0 85px;
  }

  .capacity-container {
    grid-template-columns: 1fr;
    gap: 45px;
  }
}

@media (max-width: 600px) {
  .capacity-container {
    padding: 0 20px;
  }

  .capacity-stats {
    grid-template-columns: 1fr;
  }

  .capacity-stat {
    flex-direction: row;
    align-items: center;
    gap: 16px;
  }

  .capacity-stat strong {
    min-width: 70px;
    font-size: 30px;
  }
}


/* =========================================
   1c. CAPACITY CHIPS (location card, about, contact, facilities)
========================================= */

p.capacity-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 18px;
  padding: 7px 14px;
  border: 1px solid rgba(72, 32, 11, 0.28);
  border-radius: 999px;
  color: var(--color-brown);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: 1.2px;
  text-transform: uppercase;
}

p.capacity-chip svg.icon {
  font-size: 16px;
}

.about-story-content p.capacity-chip {
  margin-top: 22px;
}

.facilities-intro-content .facilities-capacity {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 18px;
  margin-top: 30px;
  padding: 22px 26px;
  background: var(--color-cream);
  border-left: 3px solid var(--color-brown);
}

.facilities-capacity strong {
  font-family: var(--font-heading);
  font-size: clamp(30px, 3.4vw, 40px);
  font-weight: 600;
  line-height: 1.1;
  color: var(--color-brown);
}

.facilities-capacity > span {
  color: #625c57;
  font-size: 13px;
  line-height: 1.6;
}


/* =========================================
   2. TICKER STRIP (home, below hero)
========================================= */

.ticker {
  position: relative;
  overflow: hidden;
  padding: 20px 0;
  background: var(--color-white);
  border-bottom: 1px solid #ece5de;
}

/* Soft fade at both edges */
.ticker::before,
.ticker::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  z-index: 1;
  width: clamp(30px, 8vw, 120px);
  pointer-events: none;
}

.ticker::before {
  left: 0;
  background: linear-gradient(90deg, var(--color-white), transparent);
}

.ticker::after {
  right: 0;
  background: linear-gradient(-90deg, var(--color-white), transparent);
}

.ticker-track {
  display: flex;
  width: max-content;
  animation: ticker-scroll 40s linear infinite;
}

.ticker:hover .ticker-track {
  animation-play-state: paused;
}

.ticker-list {
  display: flex;
  align-items: center;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ticker-list li {
  display: flex;
  align-items: center;
  white-space: nowrap;
  color: #5c554e;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.ticker-list li::after {
  content: "";
  width: 7px;
  height: 7px;
  margin: 0 34px;
  background: var(--color-brown);
  transform: rotate(45deg);
  opacity: 0.55;
}

.ticker-list li.is-key {
  color: var(--color-brown);
  font-family: var(--font-heading);
  font-size: 17px;
  letter-spacing: 0.5px;
}

@keyframes ticker-scroll {
  to { transform: translate3d(-50%, 0, 0); }
}


/* =========================================
   3. SCROLL PROGRESS BAR
========================================= */

.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1100;
  width: 100%;
  height: 3px;
  background: var(--color-brown);
  transform: scaleX(0);
  transform-origin: left;
  pointer-events: none;
}


/* =========================================
   4. REVEAL ANIMATIONS
   js/script.js adds .reveal-init to <html>, tags elements with
   [data-reveal], then adds .is-revealed as they enter the viewport.
   Without JS (or with reduced motion) nothing is hidden.
========================================= */

.reveal-init [data-reveal] {
  opacity: 0;
  transform: translate3d(0, 46px, 0);
  transition:
    opacity 0.9s var(--ease-out),
    transform 1.1s var(--ease-out),
    clip-path 1.3s cubic-bezier(0.77, 0, 0.18, 1);
  transition-delay: var(--rd, 0ms);
}

.reveal-init [data-reveal="left"] {
  transform: translate3d(-56px, 0, 0);
}

.reveal-init [data-reveal="right"] {
  transform: translate3d(56px, 0, 0);
}

.reveal-init [data-reveal="zoom"] {
  transform: scale(0.92);
}

.reveal-init [data-reveal="fade"] {
  transform: none;
}

/* Image curtain: wipes up from the bottom while the photo settles */
.reveal-init [data-reveal="img"] {
  opacity: 1;
  transform: none;
  clip-path: inset(100% 0 0 0);
}

.reveal-init [data-reveal="img"] img,
.reveal-init img[data-reveal="img"] {
  transform: scale(1.14);
  transition: transform 1.7s var(--ease-out);
  transition-delay: var(--rd, 0ms);
}

.reveal-init [data-reveal].is-revealed {
  opacity: 1;
  transform: none;
  clip-path: inset(0 0 0 0);
}

.reveal-init [data-reveal="img"].is-revealed img,
.reveal-init img[data-reveal="img"].is-revealed {
  transform: none;
}

/* Split headings: every word rises out of its own mask */
.reveal-init [data-reveal="words"] {
  opacity: 1;
  transform: none;
}

x-w {
  display: inline-block;
  overflow: hidden;
  vertical-align: top;
  /* room for descenders inside the mask */
  padding-bottom: 0.1em;
  margin-bottom: -0.1em;
}

x-wi {
  display: inline-block;
}

.reveal-init [data-reveal="words"] x-wi {
  transform: translate3d(0, 110%, 0);
  transition: transform 1s var(--ease-out);
  transition-delay: calc(var(--rd, 0ms) + var(--wi, 0) * 55ms);
}

.reveal-init [data-reveal="words"].is-revealed x-wi {
  transform: none;
}

/* Inner-page banner photo slowly settles in */
.reveal-init .page-hero-image {
  animation: hero-settle 2.2s var(--ease-out) both;
}

@keyframes hero-settle {
  from { transform: scale(1.12); }
  to { transform: none; }
}


/* =========================================
   5. REDUCED MOTION
========================================= */

@media (prefers-reduced-motion: reduce) {

  .ticker-track,
  .page-hero-image {
    animation: none !important;
  }

  .ticker-track {
    flex-wrap: wrap;
    width: auto;
    justify-content: center;
  }

  .ticker-list[aria-hidden="true"] {
    display: none;
  }

  .ticker-list {
    flex-wrap: wrap;
    justify-content: center;
    row-gap: 10px;
  }

  .capacity-backdrop {
    transform: translate3d(0, -50%, 0);
  }

  .scroll-progress {
    display: none;
  }
}
