/* ===========================
   CSS Custom Properties
   =========================== */
:root {
  --color-primary:        #804d82;
  --color-secondary:      #6ed6c2;
  --color-tertiary:       #ffc0bd;
  --color-secondary-dark: #f29591;

  /*
   * Banner natural dimensions: 1280 x 128
   * At 100vw wide: height = 100vw * (128 / 1280) = 10vw
   */
  --banner-h:  10vw;

  /*
   * Logo: 1:1 square, 20% of page width
   */
  --logo-size: 20vw;

  /*
   * How far to lift the logo so it straddles the banner/content boundary.
   */
  --logo-lift: calc((var(--logo-size) - var(--banner-h)) / 1.2);
}

/* ===========================
   Custom Fonts
   =========================== */
@font-face {
  font-family: 'Boldreel';
  src: url('fonts/Boldreel.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Chunkypuffly';
  src: url('fonts/SuperMalibu-Wp77v.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

/* ===========================
   Reset / Base
   =========================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100vh;
  width: 100%;
  overflow: hidden;          /* no page scroll */
  display: flex;
  flex-direction: column;
  font-family: sans-serif;
  background: #f4f4f4;
}

/* ===========================
   Header / Banner
   =========================== */
.site-header {
  width: 100%;
  flex-shrink: 0;
  background: transparent;
  position: relative;
  z-index: 1;
}

.banner-img {
  display: block;
  width: 100%;
  height: auto;              /* preserves 1280:128 aspect ratio */
}

/* ===========================
   Main Content
   =========================== */
.main-content {
  flex: 1;
  min-height: 0;             /* let this flex item shrink so #page-content can scroll */
  position: relative;
  z-index: 2;
  overflow: visible;         /* lets logo bleed up into the banner area */
  display: flex;
  flex-direction: column;
}

/* ===========================
   Slideshow Container
   Holds one or two side-by-side panels.
   =========================== */
#slideshow-container {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: flex;
  overflow: hidden;
}

#slideshow-left,
#slideshow-right {
  position: relative;
  flex: 1;
  overflow: hidden;
}

#slideshow-left img,
#slideshow-right img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  opacity: 0;
  display: block;
}

#slideshow-left img.active,
#slideshow-right img.active {
  opacity: 1;
}

/* ===========================
   Nav Row  (logo + buttons)
   Sits flush against the bottom of the banner.
   =========================== */
.nav-row {
  position: relative;
  z-index: 5;
  display: flex;
  align-items: flex-start;   /* buttons anchor to the top of the row */
  justify-content: space-between;
  padding: 0 24px;
  margin-top: 0;             /* flush to banner — no gap */
  flex-shrink: 0;            /* never compress the nav row */
  background: transparent;   /* never paints over content beneath it */
}

/* ===========================
   Logo  (perfect circle)
   =========================== */
.logo {
  width:  var(--logo-size);
  height: var(--logo-size);
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  position: relative;
  z-index: 10;
  margin-left: -2.5vw;
  margin-top: calc(-1 * var(--logo-lift)); /* straddles the banner boundary */
  /* Keep the nav row only as tall as the buttons: the oversized logo
     overflows below instead of stretching the row's height. */
  margin-bottom: calc(-1 * (var(--logo-size) - var(--logo-lift)));
}

.logo-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

/* Hide the logo on the gallery and RFQ pages */
body.page-gallery .logo,
body.page-rfq .logo {
  display: none;
}

/* ===========================
   Decorative rotating-logo background
   Scattered down the left/right gutters on the gallery and RFQ
   pages, only on wide (>= 1400px) screens. Sits behind the page
   content and never intercepts pointer events.
   =========================== */
#logo-bg {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

@media (min-width: 1400px) {
  body.page-gallery #logo-bg,
  body.page-rfq #logo-bg,
  body.page-contact #logo-bg {
    display: block;
  }
}

/* Each gutter is a clipped strip so logos never spill over the
   banner, content or footer. */
.logo-bg-strip {
  position: absolute;
  overflow: hidden;
}

.logo-bg-item {
  position: absolute;
  top: 0;
  left: 0;
  width: 63px;
  height: 51px;
  opacity: 0.18;
  user-select: none;
  animation-name: logo-spin;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
  will-change: transform;
}

@keyframes logo-spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* ===========================
   Nav Buttons
   Top corners square, bottom corners rounded.
   =========================== */
.nav-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  width: 15.625vw;
  padding: 0.75em 0;

  background: var(--color-secondary);
  color: var(--color-primary);
  font-family: 'Boldreel', sans-serif;
  font-size: clamp(0.65rem, 1.2vw, 1.1rem);
  font-weight: normal;
  text-decoration: none;
  border-radius: 0 0 16px 16px;
  border: none;
  cursor: pointer;
  transition: background 0.15s ease, opacity 0.15s ease;
  user-select: none;
}

.nav-btn:hover {
  background: var(--color-tertiary);
  color: var(--color-primary);
}

.nav-btn:active {
  background: var(--color-secondary-dark);
  color: var(--color-primary);
}

/* Currently active page button */
.nav-btn.active {
  background: var(--color-primary);
  color: #fff;
}

.nav-btn.active:hover {
  background: var(--color-primary);
  color: #fff;
  opacity: 0.85;
}

/* ===========================
   Page Content
   Sits above the slideshow, fills remaining
   space in main-content after the nav-row.
   =========================== */
#page-content {
  position: relative;
  z-index: 1;
  flex: 1;                   /* fills all remaining height */
  min-height: 0;             /* allow the flex child to shrink so it can scroll */
  overflow-y: auto;          /* scrolls internally if content overflows */
  overflow-x: hidden;        /* never scroll sideways (carousel cards overflow) */
  transition: opacity 0.15s ease;

  /* Styled scrollbar */
  scrollbar-width: thin;
  scrollbar-color: var(--color-primary) transparent;
}

#page-content::-webkit-scrollbar       { width: 6px; }
#page-content::-webkit-scrollbar-track { background: transparent; }
#page-content::-webkit-scrollbar-thumb {
  background: var(--color-primary);
  border-radius: 3px;
}

/* Subtle fade while a page is loading */
#page-content.loading {
  opacity: 0.5;
  pointer-events: none;
}

/*
 * .page-panel — wrapper used in each page partial.
 * Add a background here if you want to obscure the slideshow.
 */
.page-panel {
  padding: 24px;
  color: var(--color-primary);
}

/* Cap the RFQ and Gallery content to a max of 1200px, centred.
   The higher specificity here overrides the page-scoped CSS. */
body.page-rfq #rfq-root,
body.page-gallery #gallery-root,
body.page-contact #contact-root {
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
}.page-panel h1 {
  font-family: 'Boldreel', sans-serif;
  font-size: clamp(1.5rem, 3vw, 2.5rem);
  margin-bottom: 0.5em;
}

/* Error message shown when a page fails to load */
.page-error {
  padding: 1em;
  color: var(--color-primary);
  font-family: sans-serif;
}

/* ===========================
   Contact page
   Three large social links that fill the content area.
   =========================== */
.contact-intro {
  margin-bottom: 1.5em;
  color: var(--color-primary);
  font-family: 'Chunkypuffly', sans-serif;
  font-size: 0.95rem;
  line-height: 1.4;
}

body.page-contact #contact-root {
  margin-top: 5vh;
}

.contact-links {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 720px;
  margin: 0 auto;
}

.contact-link {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 25px 32px;
  min-height: 108px;
  background: rgba(255, 255, 255, 0.7);
  border: 2px solid var(--color-secondary);
  border-radius: 16px;
  color: var(--color-primary);
  text-decoration: none;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.1s ease;
}

.contact-link:hover {
  border-color: var(--color-primary);
  background: rgba(255, 255, 255, 0.92);
}

.contact-link:active {
  transform: translateY(1px);
}

.contact-link-icon {
  width: 65px;
  height: 65px;
  flex: 0 0 auto;
  object-fit: contain;
}

.contact-link-label {
  font-family: 'Boldreel', sans-serif;
  font-size: clamp(1.44rem, 3.6vw, 2.34rem);
  font-weight: normal;
}

/* ===========================
   Footer
   =========================== */
.footer {
  background: rgba(204, 204, 204, 0.25);
  padding: 20px 24px;
  flex-shrink: 0;
  position: relative;
  z-index: 3;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: center;
}

.footer-link {
  color: var(--color-primary);
  font-weight: 600;
  text-decoration: underline;
  font-size: 0.95rem;
  transition: opacity 0.15s;
}

.footer-link:hover {
  opacity: 0.8;
}
