/* R.N. Textiles interactive corporate brochure */
:root {
  --flip-navy: #061a2b;
  --flip-navy-2: #0b2d49;
  --flip-gold: #c5a663;
  --flip-cream: #f5f0e7;
  --flip-paper: #fffefb;
}

.page-brochure {
  background: #eef1f3;
}

.flipbook-hero {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 80% 0%, rgba(197,166,99,.18), transparent 35%),
    linear-gradient(135deg, #041421 0%, #08253d 58%, #0d3959 100%);
  color: #fff;
  padding: clamp(48px, 6vw, 86px) 0 clamp(44px, 5vw, 72px);
}

.flipbook-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px);
  background-size: 52px 52px;
  mask-image: linear-gradient(to bottom, #000, transparent 88%);
}

.flipbook-hero .shell {
  position: relative;
  z-index: 1;
}

.flipbook-hero .breadcrumb {
  margin-bottom: 28px;
  color: rgba(255,255,255,.72);
}

.flipbook-hero .breadcrumb a { color: inherit; }

.flipbook-hero-copy {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 32px;
}

.flipbook-hero h1 {
  max-width: 850px;
  margin: 7px 0 15px;
  font-family: "Playfair Display", Georgia, serif;
  font-size: clamp(2.25rem, 4.5vw, 4.6rem);
  line-height: .99;
  letter-spacing: -.035em;
}

.flipbook-hero p:not(.eyebrow) {
  max-width: 760px;
  margin: 0;
  color: rgba(255,255,255,.78);
  font-size: clamp(1rem, 1.25vw, 1.18rem);
  line-height: 1.75;
}

.flipbook-hero-badge {
  min-width: 160px;
  padding: 20px 22px;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 16px;
  background: rgba(255,255,255,.07);
  box-shadow: 0 18px 45px rgba(0,0,0,.18);
  backdrop-filter: blur(10px);
  text-align: center;
}

.flipbook-hero-badge strong,
.flipbook-hero-badge span {
  display: block;
}

.flipbook-hero-badge strong {
  color: #fff;
  font-size: 2rem;
  line-height: 1;
}

.flipbook-hero-badge span {
  margin-top: 7px;
  color: rgba(255,255,255,.65);
  font-size: .75rem;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.flipbook-section {
  position: relative;
  padding: clamp(42px, 6vw, 82px) 0 clamp(64px, 8vw, 110px);
}

.flipbook-viewer {
  max-width: 1420px;
  margin-inline: auto;
}

.flipbook-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
  padding: 10px;
  border: 1px solid rgba(8,37,61,.11);
  border-radius: 18px;
  background: rgba(255,255,255,.86);
  box-shadow: 0 12px 34px rgba(7,27,47,.08);
  backdrop-filter: blur(12px);
}

.flipbook-toolbar-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.flipbook-control,
.flipbook-download {
  min-height: 44px;
  border: 1px solid rgba(8,37,61,.13);
  border-radius: 12px;
  background: #fff;
  color: var(--flip-navy);
  font: inherit;
  font-size: .9rem;
  font-weight: 800;
  transition: transform .2s ease, background .2s ease, color .2s ease, border-color .2s ease, box-shadow .2s ease;
}

.flipbook-control {
  display: inline-grid;
  place-items: center;
  width: 46px;
  padding: 0;
  cursor: pointer;
}

.flipbook-control svg,
.flipbook-download svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.flipbook-control:hover:not(:disabled),
.flipbook-control:focus-visible,
.flipbook-download:hover,
.flipbook-download:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(197,166,99,.62);
  box-shadow: 0 8px 18px rgba(7,27,47,.1);
}

.flipbook-control:disabled {
  opacity: .35;
  cursor: not-allowed;
}

.flipbook-download {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 0 16px;
  text-decoration: none;
}

.flipbook-download.primary {
  border-color: var(--flip-navy);
  background: var(--flip-navy);
  color: #fff;
}

.flipbook-page-status {
  min-width: 118px;
  padding: 0 12px;
  color: #526273;
  font-size: .86rem;
  font-weight: 800;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.flipbook-stage {
  position: relative;
  isolation: isolate;
  display: grid;
  place-items: center;
  min-height: 280px;
  padding: clamp(18px, 3.4vw, 48px);
  overflow: hidden;
  border: 1px solid rgba(8,37,61,.14);
  border-radius: clamp(18px, 2vw, 28px);
  background:
    radial-gradient(ellipse at center, rgba(255,255,255,.18), transparent 65%),
    linear-gradient(145deg, #102f48 0%, #061827 54%, #03111d 100%);
  box-shadow: 0 28px 75px rgba(4,20,33,.22);
}

.flipbook-stage::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(115deg, rgba(255,255,255,.055), transparent 23%),
    repeating-linear-gradient(90deg, rgba(255,255,255,.015) 0 1px, transparent 1px 5px);
  opacity: .72;
}

.flipbook {
  position: relative;
  width: min(100%, 1180px);
  aspect-ratio: 16 / 9;
  perspective: 2600px;
  transform-style: preserve-3d;
  filter: drop-shadow(0 28px 28px rgba(0,0,0,.36));
  user-select: none;
  -webkit-user-select: none;
  touch-action: pan-y;
  cursor: grab;
}

.flipbook:active { cursor: grabbing; }

.flipbook::before {
  content: "";
  position: absolute;
  z-index: 100;
  inset: 0 auto 0 0;
  width: clamp(10px, 1.3vw, 18px);
  pointer-events: none;
  border-radius: 7px 0 0 7px;
  background: linear-gradient(90deg, rgba(0,0,0,.44), rgba(255,255,255,.16) 45%, rgba(0,0,0,.2));
  box-shadow: 3px 0 8px rgba(0,0,0,.26);
  opacity: .58;
}

.flipbook::after {
  content: "";
  position: absolute;
  z-index: -1;
  left: 1.1%;
  right: .35%;
  bottom: -8px;
  height: 10px;
  border-radius: 0 0 7px 7px;
  background: repeating-linear-gradient(to bottom, #f6f0e7 0 1px, #d9d1c6 1px 2px);
  box-shadow: 0 7px 12px rgba(0,0,0,.35);
  transform: skewX(-14deg);
  transform-origin: left;
}

.flip-page {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: 4px 9px 9px 4px;
  background: var(--flip-paper);
  box-shadow:
    inset 1px 0 0 rgba(255,255,255,.55),
    inset -1px 0 0 rgba(0,0,0,.14),
    0 2px 4px rgba(0,0,0,.18);
  transform: rotateY(0deg);
  transform-origin: left center;
  transform-style: preserve-3d;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  will-change: transform;
  transition: transform .92s cubic-bezier(.2,.72,.18,1), filter .92s ease;
}

.flip-page::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(0,0,0,.1), transparent 3%, transparent 80%, rgba(0,0,0,.04)),
    linear-gradient(110deg, transparent 62%, rgba(255,255,255,.18) 78%, transparent 89%);
  opacity: .45;
  transition: opacity .5s ease;
}

.flip-page.is-flipped {
  transform: rotateY(-180deg);
  pointer-events: none;
  filter: brightness(.76);
}

.flip-page.is-turning {
  z-index: 120 !important;
}

.flip-page img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  -webkit-user-drag: none;
}

.flip-page-number {
  position: absolute;
  z-index: 2;
  right: 12px;
  bottom: 9px;
  display: none;
}

.flipbook-edge {
  position: absolute;
  z-index: 160;
  top: 50%;
  display: grid;
  place-items: center;
  width: 48px;
  height: 64px;
  border: 1px solid rgba(255,255,255,.17);
  border-radius: 15px;
  background: rgba(3,16,27,.64);
  color: #fff;
  box-shadow: 0 10px 24px rgba(0,0,0,.24);
  backdrop-filter: blur(8px);
  transform: translateY(-50%);
  cursor: pointer;
  transition: opacity .2s ease, transform .2s ease, background .2s ease;
}

.flipbook-edge:hover:not(:disabled),
.flipbook-edge:focus-visible {
  background: rgba(197,166,99,.9);
  color: var(--flip-navy);
  transform: translateY(-50%) scale(1.04);
}

.flipbook-edge:disabled {
  opacity: 0;
  pointer-events: none;
}

.flipbook-edge svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.flipbook-edge.prev { left: clamp(5px, 1.5vw, 20px); }
.flipbook-edge.next { right: clamp(5px, 1.5vw, 20px); }

.flipbook-meta {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  margin-top: 18px;
}

.flipbook-range-wrap {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.flipbook-range {
  width: 100%;
  height: 5px;
  accent-color: var(--flip-gold);
  cursor: pointer;
}

.flipbook-hint {
  margin: 0;
  color: #657383;
  font-size: .87rem;
  line-height: 1.45;
  white-space: nowrap;
}

.flipbook-thumbnails {
  display: flex;
  gap: 10px;
  margin-top: 18px;
  padding: 4px 2px 10px;
  overflow-x: auto;
  scrollbar-width: thin;
  scroll-snap-type: x proximity;
}

.flipbook-thumb {
  flex: 0 0 clamp(112px, 12vw, 164px);
  overflow: hidden;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 7px 18px rgba(7,27,47,.08);
  cursor: pointer;
  opacity: .66;
  transition: opacity .2s ease, transform .2s ease, border-color .2s ease, box-shadow .2s ease;
  scroll-snap-align: center;
}

.flipbook-thumb:hover,
.flipbook-thumb:focus-visible {
  opacity: 1;
  transform: translateY(-2px);
}

.flipbook-thumb[aria-current="page"] {
  border-color: var(--flip-gold);
  opacity: 1;
  box-shadow: 0 9px 22px rgba(7,27,47,.15);
}

.flipbook-thumb img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.flipbook-thumb span {
  display: block;
  padding: 6px 8px 7px;
  color: #506071;
  font-size: .72rem;
  font-weight: 800;
  text-align: center;
}

.flipbook-note {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 28px;
  margin-top: clamp(34px, 5vw, 62px);
  padding: clamp(25px, 4vw, 44px);
  border: 1px solid rgba(8,37,61,.11);
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 18px 48px rgba(7,27,47,.08);
}

.flipbook-note h2 {
  margin: 4px 0 9px;
  color: var(--flip-navy);
  font-family: "Playfair Display", Georgia, serif;
  font-size: clamp(1.55rem, 2.5vw, 2.45rem);
  line-height: 1.1;
}

.flipbook-note p:not(.eyebrow) {
  max-width: 760px;
  margin: 0;
  color: #607080;
  line-height: 1.7;
}

.flipbook-note-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.flipbook-stage:fullscreen {
  border: 0;
  border-radius: 0;
  padding: clamp(14px, 3vw, 50px);
  background: #020b12;
}

.flipbook-stage:fullscreen .flipbook {
  width: min(96vw, calc(96vh * 16 / 9));
}

.flipbook-stage.is-pseudo-fullscreen {
  position: fixed;
  z-index: 99999;
  inset: 0;
  border: 0;
  border-radius: 0;
  padding: clamp(12px, 3vw, 46px);
  background: #020b12;
}

.flipbook-stage.is-pseudo-fullscreen .flipbook {
  width: min(96vw, calc(92vh * 16 / 9));
}

body.flipbook-lock { overflow: hidden; }

@media (max-width: 900px) {
  .flipbook-hero-copy,
  .flipbook-note {
    grid-template-columns: 1fr;
  }

  .flipbook-hero-badge {
    width: fit-content;
    min-width: 145px;
  }

  .flipbook-note-actions { justify-content: flex-start; }

  .flipbook-toolbar {
    flex-wrap: wrap;
  }

  .flipbook-toolbar-group:last-child {
    margin-left: auto;
  }
}

@media (max-width: 640px) {
  .flipbook-hero { padding-top: 34px; }
  .flipbook-hero .breadcrumb { margin-bottom: 20px; }
  .flipbook-hero-badge { display: none; }
  .flipbook-section { padding-top: 28px; }

  .flipbook-toolbar {
    justify-content: center;
    border-radius: 15px;
  }

  .flipbook-toolbar-group:last-child {
    width: 100%;
    margin-left: 0;
  }

  .flipbook-download {
    flex: 1;
  }

  .flipbook-stage {
    min-height: 210px;
    padding: 14px 8px 20px;
    border-radius: 16px;
  }

  .flipbook {
    width: 100%;
  }

  .flipbook-edge {
    top: auto;
    bottom: 9px;
    width: 41px;
    height: 41px;
    border-radius: 50%;
    transform: none;
  }

  .flipbook-edge:hover:not(:disabled),
  .flipbook-edge:focus-visible { transform: scale(1.04); }

  .flipbook-edge.prev { left: 12px; }
  .flipbook-edge.next { right: 12px; }

  .flipbook-meta {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .flipbook-hint {
    white-space: normal;
    text-align: center;
  }

  .flipbook-note-actions {
    display: grid;
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .flip-page,
  .flipbook-control,
  .flipbook-download,
  .flipbook-edge,
  .flipbook-thumb {
    transition-duration: .01ms !important;
  }
}

/* The brochure has its own navigation controls; keep global floating controls out of the reading area. */
.page-brochure .page-edge-nav,
.page-brochure .email-float {
  display: none !important;
}
