/* ==========================================================================
   Mirage Furniture — Factory page (factory.html)
   A dedicated, SEO-focused page on the workshop. Reuses the global tokens and
   the home page's section look; only page-specific layout lives here.
   ========================================================================== */

/* Skip link: hidden until focused (keyboard accessibility). */
.visually-hidden-focusable {
  position: absolute;
  left: var(--space-2);
  top: var(--space-2);
  z-index: 10;
  padding: 0.5em 1em;
  background: var(--color-bg);
  color: var(--color-text-primary);
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  font-size: var(--text-xs);
  text-decoration: none;
  transform: translateY(-200%);
  transition: transform 0.2s ease;
}
.visually-hidden-focusable:focus { transform: translateY(0); }

/* --- Top nav (over the dark hero) ---------------------------------------- */
.fp-nav {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 4;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: var(--space-4);
  padding: var(--nav-pad-y) var(--nav-pad-x);
}
.fp-nav__group {
  display: flex;
  align-items: center;
  gap: clamp(1.25rem, 3vw, 2.5rem);
}
.fp-nav__group--right { justify-content: flex-end; }
.fp-nav__link {
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  font-size: var(--text-xs);
  color: var(--color-hero-text);
  opacity: 0.85;
  text-decoration: none;
  transition: opacity 0.4s ease;
}
.fp-nav__link:hover { opacity: 1; }
.fp-nav__link[aria-current="page"] { opacity: 1; text-decoration: underline; text-underline-offset: 0.4em; }
.fp-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4em;
  color: var(--color-hero-text);
  text-align: center;
  text-decoration: none;
}
.fp-logo__name {
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  font-size: clamp(1.25rem, 2.6vw, 2rem);
  line-height: 1;
  white-space: nowrap;
}
.fp-logo__tagline {
  font-family: var(--font-body);
  font-size: clamp(0.62rem, 1vw, 0.8rem);
  letter-spacing: 0.04em;
  line-height: 1;
  opacity: 0.82;
  white-space: nowrap;
}

/* --- Hero ---------------------------------------------------------------- */
.fp-hero {
  position: relative;
  width: 100%;
  min-height: 78vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
  background: #000;
  color: var(--color-hero-text);
  padding: var(--space-7) var(--nav-pad-x);
}
.fp-hero__img {
  position: absolute;
  inset: 0;
  background-position: center center;
  background-size: cover;
  background-repeat: no-repeat;
}
.fp-hero__scrim {
  position: absolute;
  inset: 0;
  /* Vertical wash for top/bottom + a centred radial pool so the heading stays
     legible over bright areas of the workshop photo. */
  background:
    radial-gradient(ellipse 82% 66% at 50% 48%, rgba(0,0,0,0.55) 0%, rgba(0,0,0,0) 78%),
    linear-gradient(to bottom, rgba(0,0,0,0.55) 0%, rgba(0,0,0,0.42) 45%, rgba(0,0,0,0.6) 100%);
}
.fp-hero__inner {
  position: relative;
  z-index: 1;
  max-width: 46rem;
  /* Near-opaque tight outline for crisp edge contrast even over blown-out
     (window-lit) areas of the workshop photo, plus a soft glow to ground the
     whole block. Guarantees the heading reads regardless of what's behind it. */
  text-shadow:
    0 1px 2px rgba(0,0,0,0.9),
    0 0 10px rgba(0,0,0,0.6),
    0 2px 24px rgba(0,0,0,0.4);
}
.fp-hero__eyebrow {
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  font-size: var(--text-sm);
  opacity: 0.9;
}
.fp-hero__title {
  margin-top: var(--space-2);
  font-family: var(--font-body);
  font-weight: 400;
  font-size: var(--text-hero);
  line-height: var(--leading-tight);
  /* base.css sets h1 to the dark primary colour via an element selector, which
     overrides the white inherited from .fp-hero. Restore it explicitly. */
  color: var(--color-hero-text);
}
.fp-hero__lead {
  margin: var(--space-3) auto 0;
  max-width: 38rem;
  font-size: var(--text-lg);
  line-height: var(--leading-normal);
  opacity: 0.92;
}

/* --- Generic content section -------------------------------------------- */
.fp-section {
  width: 100%;
  background: var(--color-bg);
  padding: clamp(3.5rem, 9vh, 7rem) var(--nav-pad-x);
}
.fp-section--alt { background: var(--color-bg-alt); }

.fp-head {
  max-width: 52rem;
  margin: 0 auto;
  text-align: center;
}
.fp-eyebrow {
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  font-size: var(--text-sm);
  color: var(--color-text-body);
}
.fp-title {
  margin-top: var(--space-2);
  font-family: var(--font-body);
  font-weight: 400;
  font-size: clamp(1.6rem, 2.7vw, 2.35rem);
  line-height: var(--leading-snug);
  color: var(--color-text-primary);
}
.fp-body {
  margin: var(--space-3) auto 0;
  max-width: 40rem;
  font-size: clamp(1.05rem, 1.25vw, 1.25rem);
  line-height: var(--leading-normal);
  color: var(--color-text-body);
}

/* --- Two-column (text + media) ------------------------------------------ */
.fp-split {
  max-width: 76rem;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: clamp(2rem, 5vw, 4.5rem);
}
.fp-split--reverse .fp-split__media { order: -1; }
.fp-split__text .fp-title,
.fp-split__text .fp-eyebrow { text-align: left; }
.fp-split__text .fp-body { margin-left: 0; text-align: left; }
.fp-split__media {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--color-bg-alt);
}
.fp-split__media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* --- Workshop gallery (captioned tiles; swap placeholders for photos) ---- */
.fp-gallery {
  max-width: 76rem;
  margin: clamp(2rem, 5vh, 3rem) auto 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(0.75rem, 1.6vw, 1.25rem);
}
.fp-tile {
  position: relative;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  background: var(--color-bg-alt);
  border: 1px solid var(--color-hairline);
  display: flex;
  align-items: flex-end;
}
.fp-tile img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.fp-tile__cap {
  position: relative;
  z-index: 1;
  width: 100%;
  padding: clamp(0.75rem, 1.4vw, 1.1rem);
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: var(--text-xs);
  color: var(--color-text-body);
}
/* When a tile holds a photo, lift the caption legibility with a scrim. */
.fp-tile.has-img .fp-tile__cap {
  color: var(--color-hero-text);
  text-shadow: 0 1px 12px rgba(0,0,0,0.5);
  background: linear-gradient(to top, rgba(0,0,0,0.55), rgba(0,0,0,0) 90%);
}

/* --- CTA ----------------------------------------------------------------- */
.fp-cta {
  max-width: 46rem;
  margin: 0 auto;
  text-align: center;
}
.fp-cta__actions {
  margin-top: var(--space-4);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
}
.fp-btn {
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  font-size: var(--text-xs);
  padding: 0.9em 1.6em;
  border: 1px solid var(--color-text-primary);
  color: var(--color-text-primary);
  text-decoration: none;
  transition: opacity 0.3s ease, background 0.3s ease, color 0.3s ease;
}
.fp-btn--primary { background: var(--color-text-primary); color: var(--color-bg); }
.fp-btn:hover { opacity: 0.85; }

/* --- Responsive ---------------------------------------------------------- */
@media (max-width: 768px) {
  .fp-split { grid-template-columns: 1fr; }
  .fp-split--reverse .fp-split__media { order: 0; }
  .fp-gallery { grid-template-columns: repeat(2, 1fr); }
  .fp-nav {
    grid-template-columns: 1fr;
    justify-items: center;
    gap: var(--space-2);
    text-align: center;
  }
  .fp-logo { order: -1; }
  /* Lift the tagline above the clamp floor (~9.9px) so it clears 12px. */
  .fp-logo__tagline { font-size: 0.78rem; }
  /* Generous touch targets on mobile (text alone is only ~19px tall). */
  .fp-nav__link { display: inline-block; padding: 0.8rem 0.9rem; }
}
@media (max-width: 460px) {
  .fp-gallery { grid-template-columns: 1fr 1fr; }
}
