/* ============================================================
   Project detail pages — shared design system
   Extracted from the Routino page, extended for galleries,
   video, and embeds. Loaded inside the GLightbox detail dialog.
   ============================================================ */

html,
body {
  background: #f4f7fb;
  scroll-padding-top: 24px;
}

/* style.css offsets #main for the fixed desktop nav — not needed here */
@media (min-width: 992px) {
  #main {
    margin-left: 0;
  }
}

.rn {
  /* brand — mirrors the main site tokens (see :root in style.css) */
  --rn-accent: var(--primary);
  --rn-accent-deep: var(--primary-hover);
  --rn-accent-ink: #1d4ed8;
  --rn-accent-soft: var(--primary-soft);
  --rn-accent-line: rgba(59, 130, 246, 0.24);
  /* ink */
  --rn-ink: #0b1220;
  --rn-body: #55647c;
  --rn-soft: #8b9ab1;
  --rn-line: rgba(11, 18, 32, 0.08);
  --rn-line-strong: rgba(11, 18, 32, 0.13);
  --rn-card: #ffffff;
  --rn-shadow: 0 22px 45px -32px rgba(11, 18, 32, 0.45);

  font-family: var(--font-sans);
  color: var(--rn-ink);
  padding: 20px 0 34px;
  -webkit-font-smoothing: antialiased;
}

.rn-shell {
  width: min(1140px, calc(100% - 36px));
  margin: 0 auto;
}

.rn-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  background: var(--rn-accent-soft);
  border: 1px solid var(--rn-accent-line);
  color: var(--rn-accent-ink);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  line-height: 1;
}

.rn-eyebrow i {
  font-size: 0.85rem;
}

/* ---------------- Top bar ---------------- */
.rn-topbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 0 4px 16px;
  font-size: 0.82rem;
  color: var(--rn-soft);
}

.rn-crumb {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--rn-body);
  font-weight: 600;
  transition: color 0.25s var(--ease), transform 0.25s var(--ease);
}

.rn-crumb:hover {
  color: var(--rn-accent-ink);
  transform: translateX(-2px);
}

.rn-topbar .rn-sep {
  opacity: 0.5;
}

.rn-topbar .rn-current {
  color: var(--rn-ink);
  font-weight: 600;
}

.rn-topbar-spacer {
  flex: 1 1 auto;
}

/* Chips — used in the breadcrumb bar */
.rn-chips {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
}

.rn-chips li {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  background: #fff;
  border: 1px solid var(--rn-line);
  color: var(--rn-body);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1;
}

.rn-chips li i {
  color: var(--rn-accent-ink);
  font-size: 0.85rem;
}

/* ---------------- Page header ---------------- */
.rn-head {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 4px 4px 0;
}

.rn-head-icon {
  flex: 0 0 auto;
  width: 76px;
  height: 76px;
  padding: 4px;
  border-radius: 21px;
  background: #fff;
  border: 1px solid var(--rn-line);
  box-shadow: var(--rn-shadow);
}

.rn-head-icon img {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 17px;
  object-fit: cover;
}

.rn-head-copy {
  min-width: 0;
}

.rn-title {
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 4vw, 2.7rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.05;
  color: var(--rn-ink);
  margin: 0;
}

.rn-subtitle {
  color: var(--rn-body);
  font-size: clamp(0.92rem, 1.5vw, 1rem);
  line-height: 1.6;
  margin: 5px 0 0;
  max-width: 46ch;
}

.rn-btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 12px 22px;
  border-radius: var(--radius-full);
  font-size: 0.88rem;
  font-weight: 700;
  line-height: 1;
  border: 1px solid transparent;
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease), background 0.3s var(--ease),
    color 0.3s var(--ease), border-color 0.3s var(--ease);
}

.rn-btn i {
  font-size: 1rem;
}

.rn-btn-primary {
  background: linear-gradient(135deg, var(--rn-accent), var(--rn-accent-deep));
  color: #fff;
  box-shadow: 0 14px 32px -12px rgba(59, 130, 246, 0.55);
}

.rn-btn-primary:hover {
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 20px 38px -14px rgba(59, 130, 246, 0.65);
}

.rn-btn-ghost {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.16);
  color: #e2e8f0;
}

.rn-btn-ghost:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.3);
  transform: translateY(-2px);
}

/* ---------------- Sections ---------------- */
/* style.css gives every <section> 90px padding and overflow: hidden.
   The hidden overflow clips the card shadows at the section edge. */
.rn-section,
.rn-cta {
  padding: 0;
  overflow: visible;
}

.rn-section {
  margin: 30px 0 0;
}

.rn-panel {
  background: var(--rn-card);
  border: 1px solid var(--rn-line);
  border-radius: 24px;
  padding: 30px;
  box-shadow: var(--rn-shadow);
}

.rn-panel-label {
  margin-bottom: 20px;
}

/* Showcase frame */
.rn-frame {
  margin: 0;
  border-radius: 20px;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--rn-line-strong);
  box-shadow: 0 30px 55px -34px rgba(11, 18, 32, 0.5);
}

.rn-frame-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 16px;
  background: #f8fafc;
  border-bottom: 1px solid var(--rn-line);
}

.rn-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #e2e8f0;
}

.rn-dot:first-child {
  background: #fca5a5;
}

.rn-dot:nth-child(2) {
  background: #fcd34d;
}

.rn-dot:nth-child(3) {
  background: #86efac;
}

.rn-frame-title {
  margin-left: 8px;
  color: var(--rn-soft);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.rn-frame img {
  display: block;
  width: 100%;
}

/* ---------------- Detail: image left / description right ---------------- */
.rn-detail {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 30px;
  align-items: stretch;
}

.rn-detail-media {
  min-width: 0;
}

.rn-detail-body {
  min-width: 0;
}

.rn-story p {
  color: var(--rn-body);
  font-size: 0.96rem;
  line-height: 1.78;
  margin: 0 0 14px;
}

.rn-story p:last-child {
  margin-bottom: 0;
}

.rn-story strong {
  color: var(--rn-ink);
  font-weight: 600;
}

/* Meta grid */
.rn-meta {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 16px 20px;
  margin: 0 0 22px;
  padding: 0 0 22px;
  border-bottom: 1px solid var(--rn-line);
}

.rn-meta-label {
  display: block;
  color: var(--rn-soft);
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.rn-meta-value {
  display: block;
  color: var(--rn-ink);
  font-size: 0.9rem;
  font-weight: 500;
  line-height: 1.5;
  margin-top: 3px;
}

.rn-meta-value a {
  color: var(--rn-accent-ink);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.rn-meta-value a:hover {
  color: var(--rn-accent-deep);
}

/* ---------------- Action bar ---------------- */
.rn-cta {
  position: relative;
  overflow: hidden;
  margin-top: 30px;
  border-radius: 26px;
  padding: 26px 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  flex-wrap: wrap;
  color: #fff;
  background:
    radial-gradient(120% 160% at 100% 0%, rgba(59, 130, 246, 0.32), transparent 55%),
    linear-gradient(135deg, #0a1120, #13203a);
  box-shadow: 0 30px 55px -34px rgba(11, 18, 32, 0.6);
}

.rn-cta-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: rgba(226, 232, 240, 0.85);
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.rn-cta-brand span.rn-cta-mark {
  width: 34px;
  height: 34px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  background: rgba(59, 130, 246, 0.16);
  border: 1px solid rgba(59, 130, 246, 0.3);
  color: #93c5fd;
  font-size: 1rem;
}

.rn-cta-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

/* ---------------- Footer ---------------- */
.rn-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 22px 6px 0;
  color: var(--rn-soft);
  font-size: 0.8rem;
}

.rn-footer a {
  color: var(--rn-body);
  font-weight: 600;
}

.rn-footer a:hover {
  color: var(--rn-accent-ink);
}

/* ---------------- Reveal on scroll ---------------- */
.js .rn-reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.65s var(--ease), transform 0.65s var(--ease);
  transition-delay: var(--rn-delay, 0s);
  will-change: opacity, transform;
}

.js .rn-reveal.is-in {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .js .rn-reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .rn-btn {
    transition: none !important;
  }
}

/* ---------------- Responsive ---------------- */
@media (max-width: 1024px) {
  .rn-detail {
    grid-template-columns: 1fr;
    gap: 24px;
  }
}

@media (max-width: 640px) {
  .rn {
    padding: 14px 0 26px;
  }

  .rn-shell {
    width: calc(100% - 24px);
  }

  .rn-panel,
  .rn-cta {
    padding: 24px 20px;
    border-radius: 20px;
  }

  .rn-head {
    gap: 14px;
  }

  .rn-head-icon {
    width: 60px;
    height: 60px;
    border-radius: 17px;
  }

  .rn-head-icon img {
    border-radius: 13px;
  }

  .rn-topbar {
    row-gap: 10px;
  }

  .rn-cta-actions .rn-btn {
    flex: 1 1 auto;
    justify-content: center;
  }
}

/* ============================================================
   Media components
   ============================================================ */

/* The media column can hold more than one frame */
.rn-media-stack {
  display: grid;
  gap: 18px;
}

/* ---------------- Video ---------------- */
.rn-frame video {
  display: block;
  width: 100%;
  max-height: min(62vh, 560px);
  margin: 0 auto;
  background: #0b1220;
  object-fit: contain;
}

/* ---------------- Gallery viewer ---------------- */
.rn-stage {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 200px;
  padding: 18px;
  background: #eef2f7;
}

.rn-stage img {
  display: block;
  width: auto;
  max-width: 100%;
  max-height: min(56vh, 500px);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 22px 40px -28px rgba(11, 18, 32, 0.6);
  animation: rn-fade 0.4s var(--ease) both;
}

@keyframes rn-fade {
  from {
    opacity: 0.35;
    transform: translateY(5px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

.rn-counter {
  margin-left: auto;
  color: var(--rn-soft);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  font-variant-numeric: tabular-nums;
}

.rn-thumbs {
  display: grid;
  grid-template-columns: repeat(auto-fill, 56px);
  justify-content: start;
  gap: 8px;
  padding: 12px;
  background: #f8fafc;
  border-top: 1px solid var(--rn-line);
}

.rn-thumb {
  aspect-ratio: 1 / 1;
  padding: 0;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--rn-line);
  border-radius: 9px;
  cursor: pointer;
  transition: transform 0.25s var(--ease), border-color 0.25s var(--ease), box-shadow 0.25s var(--ease);
}

.rn-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.rn-thumb:hover {
  transform: translateY(-2px);
  border-color: var(--rn-accent-line);
}

.rn-thumb.is-active {
  border-color: var(--rn-accent);
  box-shadow: 0 0 0 2px var(--rn-accent-soft);
}

.rn-thumb:focus-visible {
  outline: 2px solid var(--rn-accent-deep);
  outline-offset: 2px;
}

/* ---------------- Embed (LinkedIn and friends) ---------------- */
.rn-embed {
  display: grid;
  place-items: center;
  padding: 16px;
  background: #eef2f7;
}

.rn-embed iframe {
  width: 100%;
  max-width: 504px;
  border: 0;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 22px 40px -28px rgba(11, 18, 32, 0.6);
}

/* ---------------- Status pill ---------------- */
.rn-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 13px;
  border-radius: var(--radius-full);
  background: rgba(11, 18, 32, 0.04);
  border: 1px solid var(--rn-line);
  color: var(--rn-body);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  line-height: 1;
  text-transform: uppercase;
}

.rn-status i {
  color: var(--rn-accent-ink);
  font-size: 0.85rem;
}

/* ---------------- Bulleted story list ---------------- */
.rn-list {
  display: grid;
  gap: 10px;
  margin: 0 0 16px;
  padding: 0;
  list-style: none;
}

.rn-list li {
  position: relative;
  padding-left: 20px;
  color: var(--rn-body);
  font-size: 0.96rem;
  line-height: 1.72;
}

.rn-list li::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 0.66em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--rn-accent);
}

.rn-list strong {
  color: var(--rn-ink);
  font-weight: 600;
}

/* ---------------- Responsive additions ---------------- */
@media (max-width: 640px) {
  .rn-stage {
    padding: 12px;
  }

  .rn-stage img {
    max-height: 46vh;
  }

  .rn-thumbs {
    grid-template-columns: repeat(auto-fill, 48px);
    padding: 10px;
  }

  .rn-embed {
    padding: 10px;
  }

  .rn-frame video {
    max-height: 50vh;
  }
}

@media (prefers-reduced-motion: reduce) {
  .rn-stage img {
    animation: none;
  }
}
