/* ============================================================
   Overlapping Slider Card Styles (Public View)
   Extracted from cms/pages/overlapping-slider-preview.html
   for htmx-loaded card fragments on profile pages.
   ============================================================ */

/* Loading state (shown while htmx fetches cards) */
.os-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 4rem 2rem;
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.875rem;
}
.os-loading-spinner {
  width: 24px;
  height: 24px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-top-color: #fff;
  border-radius: 50%;
  animation: os-spin 0.8s linear infinite;
}
@keyframes os-spin {
  to {
    transform: rotate(360deg);
  }
}

/* Empty state */
.os-empty {
  text-align: center;
  padding: 3em;
  color: rgba(255, 255, 255, 0.7);
}

/* ── Global Labels ── */
.os-stack-label {
  font-size: 0.75em;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #999;
  margin: 1rem;
}

/* ── Wrapper / Header ── */

/* Profile slider host: vertically center the card stack (no iframe) */
#profile-slider {
  display: flex;
  align-items: center;
  min-height: 50vh;
}

.os-wrap {
  width: 100%;
  padding: 4rem 0;
  overflow: hidden;
}

.os-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 2.5rem;
  margin-bottom: 1.5rem;
}

.os-title {
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.125rem;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.7);
}

.os-count {
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.5);
}

.os-header-right {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.os-add-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: #000;
  color: #fff;
  border: none;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.os-add-btn:hover {
  background: #333;
}

.os-add-btn svg {
  width: 16px;
  height: 16px;
}

/* ── Horizontal Flex Strip ── */

.os-collection {
  display: flex;
  position: relative;
  padding: 0 2.5em;
}

.os-list {
  display: flex;
  position: relative;
  cursor: grab;
  user-select: none;
  padding: 1em 0 1em 0;
  gap: 1em;
  flex-shrink: 0;
  min-width: max-content;
}

.os-list:active {
  cursor: grabbing;
}

.os-item {
  flex: none;
  will-change: transform;
  transform-origin: center center;
  margin-right: 1em;
}

/* Focused card highlight */
.os-item.os-focused .os-card {
  box-shadow: 0 0.5em 2em rgba(0, 0, 0, 0.3);
  transition: box-shadow 0.3s ease;
}

/* Keyboard focus indicator */
.os-item:focus-visible {
  outline: 2px solid rgba(153, 0, 0, 0.6);
  outline-offset: 4px;
  border-radius: 0.75rem;
}

/* Leftmost card shuffle tilt */
.os-item.os-shuffle {
  transform: rotate(-3deg);
}

/* ── Card Base ── */

.os-card {
  position: relative;
  aspect-ratio: 4 / 6;
  width: clamp(16rem, 28vw, 26rem);
  max-width: 85vw;
  font-size: clamp(12px, 1.4vw, 16px);
  background: #fff;
  border-radius: 0.75em;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 0.25em 1em rgba(0, 0, 0, 0.15);
}

/* ── Full-bleed Cover Image Card ── */

.os-card.has-cover {
  padding: 0;
  display: flex;
  flex-direction: column;
}

.os-card-cover {
  position: relative;
  width: 100%;
  flex-shrink: 0;
  background: linear-gradient(135deg, #2d2d2d 0%, #3a3a3a 50%, #444444 100%);
  overflow: hidden;
  border-radius: 1em 1em 0 0;
}

.os-card-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
}

.os-card-cover-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.75em;
}

.os-card-cover-placeholder svg {
  width: 2.5em;
  height: 2.5em;
  margin-bottom: 0.5em;
  opacity: 0.4;
}

/* ── Content Area (below cover) ── */

.os-card-content-area {
  flex: 1;
  overflow-y: auto;
  padding: 1.25em 1.5em;
  background: #fff;
  display: flex;
  flex-direction: column;
}

.os-card-content-area .os-card-type {
  font-size: 0.65em;
  font-weight: 700;
  color: #555555;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.25em;
}

.os-card-content-area .os-card-name {
  font-size: 1.25em;
  font-weight: 700;
  color: #1a1a1a;
  line-height: 1.2;
  margin: 0 0 0.5em 0;
}

.os-card-content-area .os-card-body-content {
  font-size: 0.85em;
  color: #333;
  line-height: 1.5;
  flex: 1;
  overflow-y: auto;
}

.os-card-content-area .os-card-body-content img {
  max-width: 100%;
  height: auto;
  border-radius: 0.5em;
  margin: 0.5em 0;
}

/* Legacy title overlay for backward compatibility */
.os-card-title-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: #fff;
  padding: 1.25em 1.5em;
  z-index: 10;
}

.os-card-title-overlay .os-card-type {
  font-size: 0.65em;
  font-weight: 700;
  color: #555555;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.25em;
}

.os-card-title-overlay .os-card-name {
  font-size: 1.25em;
  font-weight: 700;
  color: #1a1a1a;
  line-height: 1.2;
  margin: 0;
}

.os-card-title-overlay .os-card-excerpt {
  font-size: 0.8em;
  color: #666;
  margin-top: 0.5em;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ── Type Badge (overlay on cover image) ── */

.os-card-type-badge {
  position: absolute;
  top: 0.75em;
  left: 0.75em;
  padding: 0.35em 0.75em;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  font-size: 0.65em;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-radius: 3px;
  z-index: 15;
}

/* ── Visibility Badge + Color Variants ── */

.os-card-visibility-badge {
  position: absolute;
  top: 0.75em;
  right: 0.75em;
  padding: 0.35em 0.75em;
  background: rgba(255, 255, 255, 0.9);
  color: #333;
  font-size: 0.65em;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  border-radius: 3px;
  z-index: 15;
}

.os-card-visibility-badge.private {
  background: #fef3c7;
  color: #92400e;
}

.os-card-visibility-badge.unlisted {
  background: #e0e7ff;
  color: #3730a3;
}

.os-card-visibility-badge.group-only {
  background: #d1fae5;
  color: #065f46;
}

.os-card-visibility-badge.specific-people {
  background: #fce7f3;
  color: #9d174d;
}

/* ── Card Topbar (type left, actions right) ── */

.os-card-topbar {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  padding: 0.6em 0.75em 0.35em;
  gap: 0.5em;
  position: relative;
  z-index: 20;
  background: #fff;
}

.os-card.has-cover .os-card-topbar {
  background: transparent;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
}

.os-card-topbar-type {
  font-size: 0.65em;
  font-weight: 700;
  color: #900;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  flex-shrink: 0;
  white-space: nowrap;
}

.os-card.has-cover .os-card-topbar-type {
  color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.os-card-topbar-meta {
  font-size: 0.55em;
  font-weight: 400;
  color: #999;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  white-space: nowrap;
}

.os-card-topbar-meta strong {
  font-weight: 700;
}

.os-card.has-cover .os-card-topbar-meta {
  color: rgba(255, 255, 255, 0.7);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

/* ── Topbar Color Picker (text color swatch) ── */

.os-topbar-color-picker {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  width: 1.2em;
  height: 1.2em;
  border: 1.5px solid #ccc;
  border-radius: 50%;
  padding: 0;
  cursor: pointer;
  background: none;
  flex-shrink: 0;
}

.os-topbar-color-picker::-webkit-color-swatch-wrapper {
  padding: 0;
}

.os-topbar-color-picker::-webkit-color-swatch {
  border: none;
  border-radius: 50%;
}

.os-topbar-color-picker::-moz-color-swatch {
  border: none;
  border-radius: 50%;
}

.os-card-topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.35em;
  margin-left: auto;
  flex-shrink: 0;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.os-card:hover .os-card-topbar-actions,
.os-card:focus-within .os-card-topbar-actions {
  opacity: 1;
}

/* ── Position Badge (inside actions, visible on hover) ── */

.os-position-badge {
  font-size: 0.55em;
  font-weight: 700;
  color: #666;
  background: rgba(240, 240, 240, 0.9);
  border: 1px solid #ddd;
  border-radius: 3px;
  padding: 0.35em 0.65em;
  line-height: 1;
  white-space: nowrap;
  letter-spacing: 0.02em;
}

/* ── Icon Buttons (dark circles, white stroke) ── */

.os-card-icon-btn {
  position: relative;
  z-index: 25;
  width: 1.6em;
  height: 1.6em;
  border-radius: 50%;
  background: rgba(51, 51, 51, 0.85);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: background 0.15s ease;
  color: #fff;
}

.os-card-icon-btn:hover {
  background: rgba(0, 0, 0, 0.95);
}

.os-card-icon-btn svg {
  stroke: #fff;
  width: 0.7em;
  height: 0.7em;
}

.os-card-icon-btn.os-reorder-btn.locked {
  background: rgba(153, 0, 0, 0.85);
}

/* ── Legacy card header (non-cover cards) — kept for fallback ── */

.os-card-header {
  padding: 1em 1em 0.5em;
  font-size: 0.75em;
  font-weight: 600;
  color: #555555;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: #fff;
}

/* Hide legacy header when topbar exists */
.os-card-topbar + .os-card-header,
.os-card.has-cover .os-card-header {
  display: none;
}

/* ── Card Title + Body (standard cards) ── */

.os-card-title {
  padding: 0 1em;
  font-size: 1.25em;
  font-weight: 700;
  color: #111;
  line-height: 1.3;
  margin-bottom: 0.75em;
  background: #fff;
}

.os-card-body {
  flex: 1;
  padding: 0 1em 1em;
  overflow-y: auto;
  overflow-x: hidden;
  min-height: 0;
  background: #fff;
}

/* Custom scrollbar for card body */
.os-card-body::-webkit-scrollbar {
  width: 4px;
}
.os-card-body::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 2px;
}
.os-card-body::-webkit-scrollbar-thumb {
  background: #555555;
  border-radius: 2px;
}

/* ── Rich Content inside .os-card-body ── */

.os-card-body p {
  font-size: 0.875em;
  color: #333;
  line-height: 1.5;
  margin-bottom: 0.5em;
}

.os-card-body h1,
.os-card-body h2,
.os-card-body h3 {
  font-size: 1.125em;
  color: #111;
  margin-bottom: 0.5em;
}

.os-card-body img {
  width: 100%;
  height: auto;
  border-radius: 0.5em;
  margin: 0.5em 0;
}

/* Embed containers */
.os-card-body iframe {
  width: 100%;
  min-height: 22em;
  border-radius: 0.75em;
  margin: 0.5em 0;
  border: none;
}

/* Spotify specific - full player height */
.os-card-body iframe[src*='spotify.com'] {
  min-height: 35rem;
  height: 22em;
}

/* YouTube poster thumbnail with play button */
.os-yt-poster {
  position: relative;
  width: 100%;
  cursor: pointer;
  border-radius: 0.5rem;
  overflow: hidden;
}
.os-yt-poster img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
}
.os-yt-play {
  display: none;
}

/* Responsive video wrapper (YouTube) — UIkit-style */
.os-video-responsive {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 0.5rem;
}
.os-video-responsive iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
}

/* Links inside card body */
.os-card-body a,
.os-card-body-content a {
  color: #990000;
  font-weight: 500;
  font-size: 0.9rem;
  text-decoration: underline;
  cursor: pointer;
  word-break: break-all;
}

.os-card-body a:hover,
.os-card-body-content a:hover {
  color: #660000;
}

/* Inline code */
.os-card-body code,
.os-card-body-content code {
  background: #f5f5f5;
  color: #1f1e1e;
  font-size: 0.85rem;
  padding: 0.15em 0.4em;
  border-radius: 3px;
  font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
}

/* Code blocks */
.os-card-body pre,
.os-card-body-content pre {
  background: #f5f5f5;
  color: #1f1e1e;
  font-size: 0.85rem;
  padding: 0.75em 1em;
  border-radius: 6px;
  overflow-x: auto;
  margin: 0.5em 0;
  font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
  line-height: 1.5;
}

.os-card-body pre code,
.os-card-body-content pre code {
  background: none;
  padding: 0;
  border-radius: 0;
}

/* When card_color is set (inline style), children inherit the custom color */
.os-card-body[style*='color'] p,
.os-card-body[style*='color'] h1,
.os-card-body[style*='color'] h2,
.os-card-body[style*='color'] h3,
.os-card-body[style*='color'] a,
.os-card-body[style*='color'] li,
.os-card-body[style*='color'] span,
.os-card-body-content[style*='color'] p,
.os-card-body-content[style*='color'] h1,
.os-card-body-content[style*='color'] h2,
.os-card-body-content[style*='color'] h3,
.os-card-body-content[style*='color'] a,
.os-card-body-content[style*='color'] li,
.os-card-body-content[style*='color'] span {
  color: inherit;
}

.os-card-body [data-rt-embed-type] {
  margin: 0.5em 0;
}

/* Embed blocks inside card body content */
.os-card-body-content .embed-block {
  margin: 0.75rem 0;
  padding: 0.75rem;
  background: #f8f8f8;
  border: 1px solid #eee;
  border-radius: 0.5rem;
}

.os-card-body-content .embed-block iframe {
  max-width: 100%;
  border-radius: 0.5rem;
}

/* Payment buttons container */
.os-payment-buttons {
  margin-top: 1em;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5em;
}

/* Stripe button styling */
.os-payment-buttons stripe-buy-button,
.os-card-body stripe-buy-button {
  display: block;
  width: 100%;
  text-align: center;
}

/* Other payment buttons (links) */
.os-payment-buttons a {
  min-width: 180px;
  text-align: center;
}

/* ── Card Footer ── */

.os-card-footer {
  padding: 0.75em 1em;
  margin-top: auto;
  border-top: 1px solid #eee;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5em;
  background: #fff;
}

.os-card-author {
  display: flex;
  align-items: center;
  gap: 0.5em;
  flex: 1;
  min-width: 0;
}

.os-card-author-photo {
  width: 1.75em;
  height: 1.75em;
  border-radius: 50%;
  background: #555555;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7em;
  font-weight: 600;
  flex-shrink: 0;
  overflow: hidden;
}

.os-card-author-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.os-card-author-email {
  font-size: 0.7em;
  color: #666;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.os-card-footer-actions {
  display: flex;
  align-items: center;
  gap: 0.25em;
  flex-shrink: 0;
  margin-left: auto;
}

.os-footer-btn {
  width: 1.75em;
  height: 1.75em;
  background: transparent;
  border: none;
  border-radius: 50%;
  color: #999;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
  padding: 0;
}

.os-footer-btn:hover {
  background: #f0f0f0;
  color: #555555;
}

/* ── Privacy Indicator (inline badge in footer) ── */

.os-privacy-indicator {
  font-size: 0.6em;
  color: #2d2d2d;
  background: rgba(115, 0, 10, 0.1);
  padding: 0.15em 0.35em;
  border-radius: 0.25em;
  margin-left: 0.35em;
}

.os-privacy-indicator.group_only {
  color: #065f46;
  background: rgba(6, 95, 70, 0.1);
}

.os-privacy-indicator.specific_people {
  color: #9d174d;
  background: rgba(157, 23, 77, 0.1);
}

.os-privacy-indicator.unlisted {
  color: #3730a3;
  background: rgba(55, 48, 163, 0.1);
}

/* ── Document Count Badge ── */

.os-card-doc-count {
  display: flex;
  align-items: center;
  gap: 0.25em;
  font-size: 0.7em;
  color: #666;
  padding: 0.25em 0.5em;
  background: #f5f5f5;
  border-radius: 3px;
}

.os-card-doc-count svg {
  width: 0.75em;
  height: 0.75em;
}

/* ── Stack Cover Card (first card) ── */

.os-card.stack-cover {
  background: #fff;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 2em;
}

.os-stack-title {
  font-size: 2.5em;
  font-weight: 800;
  color: #1a1a1a;
  margin-bottom: 1em;
  line-height: 1.1;
}

.os-stack-meta {
  display: flex;
  flex-direction: column;
  gap: 0.5em;
  color: #666;
  font-size: 0.875em;
}

.os-stack-count {
  font-size: 3em;
  font-weight: 800;
  color: #555555;
  margin-bottom: 0.5em;
}

.os-stack-label {
  font-size: 0.75em;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #999;
}

/* ── Sponsored / Advertising Card ── */

.os-ad-card {
  border: 1.5px solid rgba(218, 165, 32, 0.35);
  background: linear-gradient(180deg, #fffef7 0%, #fff 15%);
}

.os-card-sponsored-badge {
  position: absolute;
  top: 0.75em;
  right: 0.75em;
  display: flex;
  align-items: center;
  gap: 0.25em;
  padding: 0.35em 0.75em;
  background: rgba(218, 165, 32, 0.9);
  color: #fff;
  font-size: 0.6em;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-radius: 3px;
  z-index: 16;
}

.os-card-sponsored-badge svg {
  flex-shrink: 0;
}

.os-sponsor-attribution {
  display: flex;
  align-items: center;
  gap: 0.5em;
  padding: 0.5em 1em;
  border-top: 1px solid rgba(218, 165, 32, 0.2);
  background: rgba(218, 165, 32, 0.04);
  font-size: 0.7em;
  color: #666;
}

.os-sponsor-logo {
  width: 1.25em;
  height: 1.25em;
  border-radius: 3px;
  object-fit: contain;
}

.os-sponsor-name {
  font-weight: 600;
  color: #555;
}

/* Override type badge color for ad cards */
.os-ad-card .os-card-type-badge {
  background: rgba(218, 165, 32, 0.85);
}

/* ── Navigation (prev / next) ── */

.os-nav {
  display: flex;
  justify-content: space-between;
  padding: 0 2.5em;
  margin-top: 1.5em;
}

.os-nav-btn {
  padding: 0.75em 1.5em;
  background: #000;
  border: none;
  border-radius: 0;
  color: #fff;
  font-size: 0.875em;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.os-nav-btn:hover:not(:disabled) {
  background: #333;
}

.os-nav-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

/* ── Game / Embed Card Styles ── */

.os-game-container {
  width: 100%;
  position: relative;
  background: #fff;
  border-radius: 0.5rem;
  overflow: hidden;
}

.os-game-frame {
  width: 100%;
  height: 500px;
  border: none;
  display: block;
  pointer-events: none; /* Prevent iframe from capturing swipe/drag events on slider */
}

.os-game-expand-btn {
  display: inline-block;
  margin: 0.5rem 0;
  padding: 0.4rem 1rem;
  background: #000;
  color: #fff;
  border: none;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  border-radius: 0.25rem;
}

.os-game-expand-btn:hover {
  background: #222;
}

/* Game Fullscreen Modal (public - view-only) */
.os-game-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(0, 0, 0, 0.85);
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.os-game-modal-overlay.active {
  display: flex;
}

.os-game-modal {
  position: relative;
  width: 100%;
  max-width: calc(100vw - 3rem);
  height: calc(100vh - 3rem);
  background: #fff;
  border-radius: 0.5rem;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.os-game-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.75rem;
  background: #000;
  color: #fff;
  flex-shrink: 0;
}

.os-game-modal-title {
  font-size: 0.8125rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.os-game-modal-close {
  background: none;
  border: none;
  color: #fff;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 0.25rem;
}

.os-game-modal-close:hover {
  opacity: 0.7;
}

.os-game-modal iframe {
  width: 100%;
  flex: 1;
  border: none;
  display: block;
}

/* Card Content Fullscreen Modal */
/* "Open Fullscreen" button at bottom of card body */
.os-open-fullscreen-btn {
  display: block;
  width: 100%;
  padding: 0.75rem 1rem;
  margin: 0;
  background: #f5f5f5;
  color: #000;
  border: none;
  font-size: 0.6rem;
  font-weight: 100;
  text-transform: uppercase;
  cursor: pointer;
  text-align: center;
  letter-spacing: 0.02em;
}
.os-open-fullscreen-btn:hover {
  background: #e8e8e8;
}

.os-card-fullscreen-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(0, 0, 0, 0.85);
  align-items: center;
  justify-content: center;
  padding: 2%;
}

.os-card-fullscreen-overlay.active {
  display: flex;
}

.os-card-fullscreen-modal {
  position: relative;
  width: 100%;
  max-width: 70rem;
  margin: 0 auto;
  height: auto;
  max-height: 100%;
  background: #fff;
  border-radius: 0.5rem;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.os-card-fullscreen-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  background: #000;
  color: #fff;
  flex-shrink: 0;
}

.os-card-fullscreen-title {
  font-size: 0.9375rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-right: 1rem;
}

.os-card-fullscreen-close {
  background: none;
  border: none;
  color: #fff;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 0.25rem;
  flex-shrink: 0;
}

.os-card-fullscreen-close:hover {
  opacity: 0.7;
}

.os-card-fullscreen-body {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 1.5rem;
  font-size: 1rem;
  line-height: 1.7;
  color: #333;
  /* Visible scrollbar */
  scrollbar-width: thin;
  scrollbar-color: #bbb #f0f0f0;
}

.os-card-fullscreen-body::-webkit-scrollbar {
  width: 8px;
}

.os-card-fullscreen-body::-webkit-scrollbar-track {
  background: #f0f0f0;
  border-radius: 4px;
}

.os-card-fullscreen-body::-webkit-scrollbar-thumb {
  background: #bbb;
  border-radius: 4px;
}

.os-card-fullscreen-body::-webkit-scrollbar-thumb:hover {
  background: #999;
}

.os-card-fullscreen-body img {
  max-width: 100%;
  height: auto;
  border-radius: 0.5rem;
}

.os-card-fullscreen-body .os-card-fullscreen-cover {
  width: 100%;
  max-height: 400px;
  object-fit: cover;
  border-radius: 0.5rem;
  margin-bottom: 1.5rem;
}

.os-card-fullscreen-body iframe {
  width: 100%;
  height: 100%;
  min-height: 352px;
  border: none;
  border-radius: 0.5rem;
  pointer-events: auto;
}

/* Spotify in fullscreen: force tall */
.os-card-fullscreen-body iframe[src*='spotify'] {
  min-height: 65rem;
  height: 85svh !important;
}

/* Discussion thread in fullscreen: fill viewport like Spotify */
.os-card-fullscreen-modal:has(.sc-replies-section) {
  height: 85svh;
  max-height: 85svh;
}

.os-card-fullscreen-body:has(.sc-replies-section) {
  display: flex;
  flex-direction: column;
  overflow-y: hidden;
}

.os-card-fullscreen-body .sc-replies-section {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.os-card-fullscreen-body .sc-comments-list {
  max-height: none !important;
  flex: 1;
  overflow-y: auto;
}

.os-card-fullscreen-body .sc-reply-form {
  flex-shrink: 0;
}

.os-card-fullscreen-body a {
  color: #990000;
}

.os-card-fullscreen-body a:hover {
  color: #660000;
}

.os-card-fullscreen-body h1,
.os-card-fullscreen-body h2,
.os-card-fullscreen-body h3 {
  margin: 1rem 0 0.5rem;
  color: #111;
}

.os-card-fullscreen-body blockquote {
  border-left: 3px solid #990000;
  margin: 1rem 0;
  padding: 0.5rem 1rem;
  color: #555;
  background: #f9f9f9;
  border-radius: 0 0.25rem 0.25rem 0;
}

.os-card-fullscreen-body pre,
.os-card-fullscreen-body code {
  background: #f4f4f4;
  border-radius: 0.25rem;
  font-size: 0.875rem;
}

.os-card-fullscreen-body pre {
  padding: 1rem;
  overflow-x: auto;
}

.os-card-fullscreen-body code {
  padding: 0.125rem 0.375rem;
}

/* Fullscreen story content sections (API-loaded) */
.os-fullscreen-meta {
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #eee;
}

.os-fullscreen-content {
  margin-bottom: 1.5rem;
}

.os-fullscreen-content p {
  font-size: 1rem;
  line-height: 1.7;
  color: #333;
  margin-bottom: 1rem;
}

.os-fullscreen-content iframe {
  width: 100%;
  min-height: 352px;
  border: none;
  border-radius: 0;
  margin: 1rem 0;
}

.os-fullscreen-content iframe[src*='spotify'] {
  min-height: 352px;
}

.os-fullscreen-author {
  display: flex;
  align-items: center;
  padding: 1rem 0;
  margin-top: 1rem;
  border-top: 1px solid #eee;
}

.os-fullscreen-tags {
  padding: 0.75rem 0;
}

/* ── Mobile Toggle ── */

.os-mobile-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  padding: 0;
}

.os-mobile-toggle:hover {
  color: rgba(255, 255, 255, 0.7);
}

.os-mobile-toggle svg {
  width: 20px;
  height: 20px;
}

/* ── Stack Privacy Badge (in header) ── */

.os-stack-privacy-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
  padding: 0.35em 0.75em;
  background: rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.7em;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  border-radius: 3px;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: all 0.2s;
}

.os-stack-privacy-badge:hover {
  background: rgba(255, 255, 255, 0.25);
  border-color: rgba(255, 255, 255, 0.4);
}

.os-stack-privacy-badge svg {
  width: 12px;
  height: 12px;
}

/* ============================================================
   Responsive (max-width: 48rem)
   ============================================================ */

@media (max-width: 48rem) {
  .os-wrap {
    padding: 2rem 0;
  }

  .os-header,
  .os-collection,
  .os-nav {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  /* Mobile: single card centered, viewport-proportional */
  .os-card {
    font-size: clamp(10px, 3.5vw, 14px);
    width: clamp(14rem, 75vw, 22rem);
    max-width: 90vw;
    margin-left: auto;
    margin-right: auto;
  }

  #profile-slider {
    min-height: 40vh;
  }

  .os-item {
    display: flex;
    justify-content: center;
  }

  .os-collection {
    padding-left: 0;
    padding-right: 0;
  }

  .os-list {
    padding-left: 2rem;
    padding-right: 2rem;
  }

  /* Header: collapse for mobile dropdown */
  .os-header {
    position: relative;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0;
    padding: 0;
  }

  .os-header .os-title {
    padding-left: 1rem;
  }

  .os-header .os-mobile-toggle {
    position: absolute;
    top: 0;
    right: 1rem;
    margin-right: 0;
  }

  .os-header .os-filter-badge {
    margin-left: 0;
    padding-left: 1rem;
  }

  /* Show hamburger toggle */
  .os-mobile-toggle {
    display: flex;
  }

  /* Dropdown: full-width, no gaps */
  .os-header-right {
    display: none;
    flex-direction: column;
    width: 100%;
    gap: 0;
    background: #fff;
    padding: 0;
    margin-top: 0.75rem;
  }

  .os-header-right.open {
    display: flex;
  }

  /* Each nav item inside dropdown */
  .os-header-right .os-add-btn {
    width: 100%;
    justify-content: flex-start;
    background: none;
    color: #111;
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 0.875rem 1rem;
    border-bottom: 1px solid #eee;
  }

  .os-header-right .os-add-btn:hover {
    background: #f5f5f5;
  }

  /* Hide the + icon in dropdown nav items */
  .os-header-right .os-add-btn svg {
    display: none;
  }

  .os-header-right .os-stack-privacy-badge {
    width: 100%;
    justify-content: flex-start;
    padding: 0.875rem 1rem;
    border-bottom: 1px solid #eee;
    border-radius: 0;
    background: none;
    color: #111;
    font-size: 0.9rem;
    letter-spacing: 0.08em;
    border-left: none;
    border-right: none;
    border-top: none;
  }

  .os-header-right .os-count {
    display: none;
  }

  /* Game embed responsive */
  .os-game-frame {
    height: 350px;
  }
}
