/* Shared styling for pages that opt into the wide layout */
body.wide-layout .md-main__inner.md-grid {
  max-width: min(80rem, 95vw);
}

/* Reader demo gallery styling */
body.wide-layout--reader .reader-demo-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(20.5rem, 27.5rem);
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
  margin: clamp(1.5rem, 4vw, 3rem) 0;
}

body.wide-layout--reader .reader-demo-copy {
  max-width: 40rem;
}

body.wide-layout--reader .reader-demo-copy p {
  margin-bottom: 1rem;
}

body.wide-layout--reader .reader-demo-copy p:last-child {
  margin-bottom: 0;
}

body.wide-layout--reader .reader-demo-tip {
  margin: clamp(1rem, 3vw, 1.75rem) 0;
  padding: clamp(1rem, 2.5vw, 1.5rem);
  border-radius: 0.75rem;
  border-left: 4px solid #1e88e5;
  background: rgba(30, 136, 229, 0.08);
  box-shadow: inset 0 0 0 1px rgba(30, 136, 229, 0.12);
}

body.wide-layout--reader .reader-demo-tip-title {
  font-weight: 600;
  color: #1e4f8f;
  margin-bottom: 0.35rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.85rem;
}

body.wide-layout--reader .reader-demo-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05em;
  vertical-align: text-bottom;
  margin: 0 0.2em;
}

body.wide-layout--reader .reader-demo-note {
  margin-bottom: clamp(0.75rem, 2.5vw, 1.5rem);
  font-size: 0.95rem;
  color: #1d2738;
  max-width: 24rem;
  width: 100%;
}

body.wide-layout--reader .reader-demo-device {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  position: sticky;
  top: clamp(4.5rem, 8vw, 6rem);
  z-index: 1;
}

body.wide-layout--reader .reader-demo-gallery {
  position: relative;
  width: min(24.5rem, 100%);
  padding: clamp(0.5rem, 1.2vw, 0.9rem) clamp(0.45rem, 1vw, 0.75rem) clamp(0.85rem, 2vw, 1.25rem);
  border-radius: 2.25rem;
  background: linear-gradient(170deg, #212c3a, #0a0f16 65%, #0f1726);
  box-shadow: 0 24px 60px rgba(9, 17, 34, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

body.wide-layout--reader .reader-demo-gallery-scroll {
  display: flex;
  flex-direction: column;
  gap: clamp(1.25rem, 3vw, 2rem);
  max-height: clamp(32rem, 75vh, 44rem);
  padding: clamp(0.6rem, 1.5vw, 1rem) clamp(0.35rem, 1vw, 0.75rem) clamp(0.6rem, 1.5vw, 1rem);
  overflow-y: auto;
  scroll-snap-type: y proximity;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: rgba(123, 144, 176, 0.6) transparent;
}

body.wide-layout--reader .reader-demo-gallery-scroll::-webkit-scrollbar {
  width: 8px;
}

body.wide-layout--reader .reader-demo-gallery-scroll::-webkit-scrollbar-track {
  background: transparent;
}

body.wide-layout--reader .reader-demo-gallery-scroll::-webkit-scrollbar-thumb {
  background: rgba(123, 144, 176, 0.35);
  border-radius: 999px;
}

body.wide-layout--reader .reader-demo-screen {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: clamp(0.5rem, 1.2vw, 0.85rem);
  scroll-snap-align: start;
}

body.wide-layout--reader .reader-phone {
  position: relative;
  padding: clamp(0.55rem, 1.5vw, 0.9rem);
  border-radius: 1.9rem;
  background: linear-gradient(150deg, rgba(16, 24, 38, 0.95), rgba(6, 9, 15, 0.98));
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.14), inset 0 -1px 2px rgba(0, 0, 0, 0.35),
    0 18px 45px rgba(9, 17, 34, 0.45);
}

body.wide-layout--reader .reader-phone::before {
  content: '';
  position: absolute;
  top: clamp(0.35rem, 1vw, 0.5rem);
  left: 50%;
  transform: translateX(-50%);
  width: clamp(3rem, 28%, 5.5rem);
  height: clamp(0.18rem, 0.6vw, 0.35rem);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
}

body.wide-layout--reader .reader-phone-screen {
  border-radius: 1.4rem;
  background: #0b1018;
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(12, 20, 31, 0.18);
}

body.wide-layout--reader .reader-phone-screen img {
  display: block;
  width: 100%;
  height: auto;
}

body.wide-layout--reader .reader-demo-screen figcaption {
  font-size: 0.88rem;
  line-height: 1.45;
  color: rgba(231, 239, 255, 0.92);
}

body.wide-layout--reader .reader-demo-next {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.42);
  background: linear-gradient(135deg, rgba(38, 52, 75, 0.95), rgba(22, 32, 52, 0.95));
  color: #f5f8ff;
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease, background 0.2s ease,
    color 0.2s ease;
}

body.wide-layout--reader .reader-demo-next .material-symbols-outlined {
  font-size: 1.1rem;
}

body.wide-layout--reader .reader-demo-next:hover {
  transform: translateY(1px);
  border-color: rgba(255, 255, 255, 0.6);
  background: linear-gradient(135deg, rgba(60, 102, 176, 0.98), rgba(36, 64, 132, 0.98));
  box-shadow: 0 10px 22px rgba(9, 17, 34, 0.45);
}

body.wide-layout--reader .reader-demo-next:focus-visible {
  outline: 2px solid rgba(146, 206, 255, 0.95);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px rgba(88, 162, 255, 0.45);
}

body.wide-layout--reader .reader-demo-next:active {
  transform: translateY(2px);
  background: linear-gradient(135deg, rgba(34, 56, 108, 0.98), rgba(24, 42, 85, 0.98));
  border-color: rgba(255, 255, 255, 0.5);
}

body.wide-layout--reader .reader-demo-screen--cta {
  padding: clamp(1.75rem, 4vw, 2.5rem);
  background: rgba(17, 24, 34, 0.92);
  border-radius: 1.75rem;
  box-shadow: inset 0 0 0 1px rgba(231, 239, 255, 0.08), 0 16px 40px rgba(9, 17, 34, 0.45);
  color: rgba(231, 239, 255, 0.92);
  gap: clamp(0.75rem, 2vw, 1rem);
}

body.wide-layout--reader .reader-demo-cta {
  display: flex;
  flex-direction: column;
  gap: clamp(0.5rem, 1.5vw, 0.85rem);
}

body.wide-layout--reader .reader-demo-cta h3 {
  margin: 0;
  font-size: clamp(1.05rem, 2.6vw, 1.3rem);
  font-weight: 600;
  color: rgba(255, 255, 255, 0.94);
}

body.wide-layout--reader .reader-demo-cta p {
  margin: 0;
  font-size: 0.95rem;
  color: rgba(224, 234, 255, 0.94);
}

body.wide-layout--reader .reader-demo-next--cta {
  align-self: flex-start;
  font-size: 0.8rem;
  padding-inline: 1.2rem;
  background: linear-gradient(135deg, #3f3f3fff 0%, #414141ff 100%);
  border-color: rgba(255, 255, 255, 0.35);
  color: #ffffff;
  box-shadow: 0 16px 30px rgba(46, 113, 255, 0.45);
}

body.wide-layout--reader .reader-demo-next--cta:hover {
  transform: translateY(1px);
  background: linear-gradient(135deg, #5445b6ff 0%, #474747ff 100%);
  border-color: rgba(255, 255, 255, 0.5);
  box-shadow: 0 18px 34px rgba(42, 102, 240, 0.5);
}

body.wide-layout--reader .reader-demo-next--cta:focus-visible {
  outline: 2px solid rgba(199, 227, 255, 0.95);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px rgba(78, 153, 255, 0.55);
}

@media (max-width: 960px) {
  body.wide-layout--reader .reader-demo-layout {
    display: flex;
    flex-direction: column;
    gap: clamp(1.5rem, 4vw, 2.5rem);
    margin: clamp(1.25rem, 3vw, 2rem) 0;
  }

  body.wide-layout--reader .reader-demo-device {
    justify-content: center;
    align-items: center;
    position: static;
  }

  body.wide-layout--reader .reader-demo-note {
    text-align: center;
    max-width: 30rem;
  }

  body.wide-layout--reader .reader-demo-gallery {
    margin: clamp(1.25rem, 3vw, 2.5rem) auto 0;
  }
}

@media (max-width: 720px) {
  body.wide-layout .md-main__inner.md-grid {
    max-width: 100%;
  }

  body.wide-layout--reader .reader-demo-layout {
    margin: 1.5rem 0;
  }

  body.wide-layout--reader .reader-demo-copy {
    max-width: none;
  }

  body.wide-layout--reader .reader-demo-note {
    text-align: left;
    width: 100%;
    max-width: none;
    margin-bottom: 1rem;
  }

  body.wide-layout--reader .reader-demo-gallery {
    width: 100%;
    margin: 0;
    padding: clamp(0.5rem, 3vw, 1rem);
    border-radius: 1.5rem;
    box-shadow: none;
    background: linear-gradient(185deg, rgba(20, 27, 36, 0.92), rgba(8, 12, 18, 0.95));
  }

  body.wide-layout--reader .reader-demo-gallery-scroll {
    max-height: none;
    padding: 0;
    overflow: visible;
    scroll-snap-type: none;
  }

  body.wide-layout--reader .reader-demo-next {
    align-self: center;
  }

  body.wide-layout--reader .reader-demo-screen--cta {
    align-items: center;
    text-align: center;
  }

  body.wide-layout--reader .reader-demo-next--cta {
    align-self: center;
  }
}

/* Monograph workflow gallery styling */
body.wide-layout--monograph .monograph-gallery-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(20rem, 26rem);
  gap: clamp(1.5rem, 4vw, 3rem);
  align-items: start;
  margin: clamp(1.5rem, 4vw, 3rem) 0;
}

body.wide-layout--monograph .monograph-gallery-copy {
  max-width: 40rem;
}

body.wide-layout--monograph .monograph-gallery-copy p {
  margin-bottom: 1rem;
}

body.wide-layout--monograph .monograph-gallery-copy p:last-child {
  margin-bottom: 0;
}

body.wide-layout--monograph .monograph-gallery-device {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  position: sticky;
  top: clamp(4.5rem, 8vw, 6rem);
}

body.wide-layout--monograph .monograph-gallery {
  position: relative;
  width: min(24rem, 100%);
  padding: clamp(0.75rem, 1.5vw, 1.25rem) clamp(0.6rem, 1.5vw, 1rem);
  border-radius: 1.5rem;
  background: linear-gradient(170deg, #f5f7fa, #dfe7f2 65%, #eef2f8);
  box-shadow: 0 24px 60px rgba(19, 36, 63, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

body.wide-layout--monograph .monograph-gallery-scroll {
  display: flex;
  flex-direction: column;
  gap: clamp(1.1rem, 3vw, 1.8rem);
  max-height: clamp(30rem, 70vh, 42rem);
  padding: clamp(0.5rem, 1.2vw, 0.9rem);
  overflow-y: auto;
  scroll-snap-type: y proximity;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: rgba(110, 130, 160, 0.4) transparent;
}

body.wide-layout--monograph .monograph-gallery-scroll::-webkit-scrollbar {
  width: 8px;
}

body.wide-layout--monograph .monograph-gallery-scroll::-webkit-scrollbar-track {
  background: transparent;
}

body.wide-layout--monograph .monograph-gallery-scroll::-webkit-scrollbar-thumb {
  background: rgba(110, 130, 160, 0.45);
  border-radius: 999px;
}

body.wide-layout--monograph .monograph-gallery-screen {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: clamp(0.45rem, 1vw, 0.85rem);
  scroll-snap-align: start;
}

body.wide-layout--monograph .monograph-gallery-page {
  position: relative;
  padding: clamp(0.55rem, 1.2vw, 0.9rem);
  border-radius: 1.3rem;
  background: linear-gradient(140deg, rgba(255, 255, 255, 0.95), rgba(233, 239, 249, 0.95));
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.8), inset 0 -1px 2px rgba(185, 195, 212, 0.6),
    0 18px 40px rgba(17, 36, 66, 0.25);
}

body.wide-layout--monograph .monograph-gallery-page::before {
  content: '';
  position: absolute;
  inset: clamp(0.4rem, 1vw, 0.55rem) clamp(0.3rem, 0.8vw, 0.5rem);
  border-radius: 0.9rem;
  border: 1px solid rgba(180, 193, 217, 0.5);
  pointer-events: none;
}

body.wide-layout--monograph .monograph-gallery-page img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 0.9rem;
}

body.wide-layout--monograph .monograph-gallery-screen figcaption {
  font-size: 0.9rem;
  line-height: 1.45;
  color: #16243b;
}

body.wide-layout--monograph .monograph-gallery-next {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  border: 1px solid rgba(38, 62, 104, 0.35);
  background: linear-gradient(135deg, rgba(80, 112, 168, 0.95), rgba(62, 92, 144, 0.95));
  color: #ffffff;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease, background 0.2s ease,
    color 0.2s ease;
}

body.wide-layout--monograph .monograph-gallery-next .material-symbols-outlined {
  font-size: 1.1rem;
}

body.wide-layout--monograph .monograph-gallery-next:hover {
  transform: translateY(1px);
  border-color: rgba(38, 62, 104, 0.5);
  background: linear-gradient(135deg, rgba(96, 136, 200, 0.98), rgba(74, 110, 176, 0.98));
  box-shadow: 0 12px 26px rgba(24, 48, 92, 0.35);
}

body.wide-layout--monograph .monograph-gallery-next:focus-visible {
  outline: 2px solid rgba(146, 186, 255, 0.9);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px rgba(88, 132, 216, 0.35);
}

body.wide-layout--monograph .monograph-gallery-next:active {
  transform: translateY(2px);
  background: linear-gradient(135deg, rgba(64, 96, 152, 0.98), rgba(52, 80, 128, 0.98));
  border-color: rgba(38, 62, 104, 0.45);
}

@media (max-width: 1080px) {
  body.wide-layout--monograph .monograph-gallery-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  body.wide-layout--monograph .monograph-gallery-device {
    position: static;
    align-items: center;
  }
}
