/* Plugin styles for server-rendered pages (blog list + blog post templates).
   Blog pages don't load the ClientApp bundle, so without this file the
   plugin markup ([hero], [stats], [cta], [countdown], [timeline], …) renders
   unstyled as a plain vertical list (#150). ClientApp/App.css still holds
   the same rules for the SPA; keep the two in sync until we consolidate. */

/* ── [hero] ─────────────────────────────────────── */
.typely-hero {
  position: relative;
  margin: 1.5rem 0 2rem;
  min-height: 60vh;
  padding: 4rem 1.5rem;
  border-radius: 16px;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  color: #ffffff;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}
.typely-hero-inner { max-width: 780px; width: 100%; }
.typely-hero-title {
  color: #ffffff !important;
  font-size: clamp(2rem, 5vw, 3.5rem);
  line-height: 1.05;
  letter-spacing: -0.01em;
  margin: 0 0 1rem;
}
.typely-hero-subtitle {
  color: rgba(255, 255, 255, 0.9);
  font-size: clamp(1rem, 1.6vw, 1.15rem);
  line-height: 1.5;
  max-width: 640px;
  margin: 0;
}

/* ── [stats] ────────────────────────────────────── */
.typely-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1.5rem 2rem;
  margin: 2rem 0;
  padding: 1.75rem 1.5rem;
  border-top: 1px solid var(--typely-user-font1-secondary, #e5e7eb);
  border-bottom: 1px solid var(--typely-user-font1-secondary, #e5e7eb);
}
.typely-stat-label {
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--typely-user-accent1, #666);
  margin: 0 0 0.35rem;
  font-weight: 500;
}
.typely-stat-value {
  font-size: clamp(1.6rem, 3vw, 2.25rem);
  line-height: 1.1;
  color: var(--typely-user-font1, #111);
  margin: 0;
  font-weight: 500;
}

/* ── [cta] ──────────────────────────────────────── */
.typely-cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 1.5rem 0;
}
.typely-cta-btn {
  display: inline-flex;
  align-items: center;
  padding: 0.75rem 1.5rem;
  border-radius: 999px;
  font-weight: 500;
  text-decoration: none !important;
  transition: transform 0.15s ease, background-color 0.15s ease, color 0.15s ease;
  border: 1px solid transparent;
  line-height: 1.2;
}
.typely-cta-btn:hover { transform: translateY(-1px); text-decoration: none !important; }
.typely-cta-primary {
  background-color: var(--typely-user-accent1, #212529);
  color: var(--typely-user-bg1, #ffffff) !important;
  border-color: var(--typely-user-accent1, #212529);
}
.typely-cta-primary:hover {
  background-color: var(--typely-user-accent2, #333);
  border-color: var(--typely-user-accent2, #333);
}
.typely-cta-secondary {
  background: transparent;
  color: var(--typely-user-font1, #111) !important;
  border-color: var(--typely-user-font1-secondary, #d0d0d0);
}
.typely-cta-secondary:hover { background-color: var(--typely-user-bg2, #f5f5f5); }
.typely-hero + .typely-cta-row,
.typely-hero .typely-cta-row { margin-top: 1rem; }
.typely-hero .typely-cta-secondary,
.typely-hero + .typely-cta-row .typely-cta-secondary {
  color: #ffffff !important;
  border-color: rgba(255, 255, 255, 0.35);
}
.typely-hero .typely-cta-secondary:hover,
.typely-hero + .typely-cta-row .typely-cta-secondary:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

/* ── [countdown] ────────────────────────────────── */
.typely-countdown { margin: 1.5rem 0; }
.countdown-label { font-size: 1rem; margin-bottom: 0.75rem; font-weight: 500; }
.countdown-display { display: flex; gap: 1.5rem; flex-wrap: wrap; }
.countdown-unit { display: flex; flex-direction: column; align-items: center; min-width: 48px; }
.countdown-value { font-size: 2rem; font-weight: 700; line-height: 1; }
.countdown-name {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  opacity: 0.6;
  margin-top: 0.25rem;
}

/* ── [timeline] ─────────────────────────────────── */
.typely-timeline { margin: 1.5rem 0; position: relative; padding-left: 1.5rem; }
.typely-timeline::before {
  content: '';
  position: absolute;
  left: 6px; top: 0; bottom: 0;
  width: 2px;
  background: #ddd;
}
.timeline-item {
  position: relative;
  margin-bottom: 1.75rem;
  opacity: 0;
  transform: translateX(-18px);
  transition: opacity 0.45s ease, transform 0.45s ease;
}
.timeline-item.is-visible { opacity: 1; transform: translateX(0); }
.timeline-marker {
  position: absolute;
  left: -1.5rem; top: 4px;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: #555;
  border: 2px solid #fff;
  box-shadow: 0 0 0 2px #ddd;
}
.timeline-content { padding-left: 0.5rem; }
.timeline-date { display: block; font-size: 0.8rem; opacity: 0.6; margin-bottom: 0.2rem; }
.timeline-title { display: block; font-size: 1rem; margin-bottom: 0.25rem; }
.timeline-description { font-size: 0.9rem; opacity: 0.75; margin: 0; }

/* ── [google-maps] ──────────────────────────────── */
.typely-maps-wrapper { margin: 1rem 0; width: 100%; aspect-ratio: 16 / 9; }
.typely-maps-iframe { width: 100%; height: 100%; border: 0; border-radius: 4px; }

/* ── [dropbox-gallery] / [dropbox-media] — image grid + skeleton loader ── */
.image-container {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}
.image-wrapper {
  position: relative;
  width: 300px;
  height: 200px;
  border-radius: 8px;
  overflow: hidden;
  background-color: #f0f0f0;
}
.image-wrapper.skeleton-loading {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite;
}
.skeleton-image {
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite;
}
@keyframes skeleton-loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.dbx-public-gallery-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 8px;
  transition: opacity 0.3s ease;
}
.image-wrapper:not(.skeleton-loading) .dbx-public-gallery-image { opacity: 1; }

/* Paginated grid variant used by the SPA — mirror here so blog pages
   with [dropbox-gallery] get a proper viewport-sized grid. */
.image-container.typely-media-gallery {
  min-height: 90vh;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(clamp(9rem, 42vw, 14rem), 1fr));
  gap: clamp(0.5rem, 2vw, 1rem);
  align-content: start;
}
.image-container.typely-media-gallery .image-wrapper {
  position: relative;
  width: 100%;
  min-width: unset;
  min-height: unset;
  aspect-ratio: 4 / 3;
  border-radius: 4px;
  overflow: hidden;
}
.image-container.typely-media-gallery .dbx-public-gallery-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  cursor: pointer;
  display: block;
}
.image-container.typely-media-gallery .image-wrapper.skeleton-loading { min-width: unset; }
.image-container.typely-media-gallery .typely-media-load-hint,
.image-container.typely-media-gallery .typely-media-sentinel { grid-column: 1 / -1; }
.typely-media-sentinel { width: 100%; height: 1px; pointer-events: none; }
.typely-media-load-hint { width: 100%; margin: 0.25rem 0 0; }

/* ── [section-background] — full-bleed backdrop ─── */
/* On the SPA, `[section-background]` is inside `.typely-content-body` and
   plugins.js promotes that ancestor to `position: relative; min-height: 75vh`.
   On blog pages there is no `.typely-content-body`, so plugins.js instead
   wraps the .sbg in an `.sbg-wrap` container with those rules baked in. */
.sbg-wrap {
  position: relative;
  min-height: 75vh;
  margin: 1.5rem 0 2rem;
  border-radius: 12px;
  overflow: hidden;
  isolation: isolate;
}
.sbg { position: absolute; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.sbg__slide { position: absolute; inset: 0; background-size: cover; background-position: center; background-repeat: no-repeat; }
.sbg__overlay { position: absolute; inset: 0; background: rgba(0,0,0,0.35); }

/* ── [dropbox-file-download] — inline button ────── */
.dbx-file-download-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.55rem 0.95rem;
  border: 1px solid currentColor;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 500;
  text-decoration: none;
  color: inherit;
  background: transparent;
  transition: background-color 0.15s ease, color 0.15s ease, transform 0.05s ease;
}
.dbx-file-download-btn:hover,
.dbx-file-download-btn:focus-visible { background: currentColor; text-decoration: none; outline: none; }
.dbx-file-download-btn:hover .dbx-file-download-label,
.dbx-file-download-btn:hover .dbx-file-download-icon,
.dbx-file-download-btn:focus-visible .dbx-file-download-label,
.dbx-file-download-btn:focus-visible .dbx-file-download-icon { color: #fff; filter: invert(1); }
.dbx-file-download-btn:active { transform: translateY(1px); }
.dbx-file-download-icon { font-size: 1.05em; line-height: 1; }

/* ── [youtube-channel] / [youtube-playlist] / [youtube-video] ──── */
.youtube-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
  gap: 1rem;
  margin: 1.25rem 0;
}
.youtube-item { display: flex; flex-direction: column; }
.youtube-video-container {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: 8px;
  overflow: hidden;
}
.youtube-video-container iframe { width: 100%; height: 100%; border: 0; display: block; }
.yt-duration {
  position: absolute;
  right: 6px; bottom: 6px;
  background: rgba(0, 0, 0, 0.75);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 3px;
  pointer-events: none;
}
.youtube-video-title {
  margin: 0.5rem 0 0.15rem;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--typely-user-font1, #111);
  line-height: 1.35;
}
.yt-views {
  font-size: 0.78rem;
  color: var(--typely-user-font1-secondary, #6b7280);
}
.youtube-playlist { margin: 1.5rem 0; }
.youtube-playlist-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0 0 0.75rem;
  color: var(--typely-user-font1, #111);
}

/* ── [youtube-live] — "live now" banner ────────────── */
.youtube-live-banner {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 0.95rem;
  border-radius: 999px;
  background: #ff0000;
  color: #fff !important;
  text-decoration: none !important;
  font-size: 0.85rem;
  font-weight: 500;
  margin: 1rem 0;
}
.youtube-live-banner:hover { opacity: 0.92; text-decoration: none !important; }
.youtube-live-upcoming { background: #334155; }
.yt-live-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.35);
  animation: yt-live-pulse 1.4s ease-in-out infinite;
}
.youtube-live-upcoming .yt-live-dot { animation: none; }
@keyframes yt-live-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.3); }
}
.yt-live-label { font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; font-size: 0.72rem; }
.yt-live-title { opacity: 0.95; }

/* ── [youtube-stats] — channel badge ────────────────── */
.youtube-stats {
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.6rem 0.9rem;
  border: 1px solid var(--typely-user-font1-secondary, #e5e7eb);
  border-radius: 10px;
  text-decoration: none !important;
  color: inherit !important;
  margin: 1rem 0;
}
.youtube-stats:hover { border-color: var(--typely-user-accent1, #ff0000); text-decoration: none !important; }
.yt-stats-avatar { width: 48px; height: 48px; border-radius: 50%; flex-shrink: 0; }
.yt-stats-text { display: flex; flex-direction: column; gap: 0.2rem; }
.yt-stats-title { font-size: 0.95rem; }
.yt-stats-counts {
  display: flex;
  gap: 0.8rem;
  font-size: 0.78rem;
  color: var(--typely-user-font1-secondary, #6b7280);
  flex-wrap: wrap;
}
.yt-stats-counts strong { color: var(--typely-user-font1, #111); font-weight: 600; }

/* ── [vimeo-channel] / [vimeo-showcase] / [vimeo-video] ───────── */
.vimeo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
  gap: 1rem;
  margin: 1.25rem 0;
}
.vimeo-item { display: flex; flex-direction: column; }
.vimeo-video-container {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: 8px;
  overflow: hidden;
}
.vimeo-video-container iframe { width: 100%; height: 100%; border: 0; display: block; }
.vm-duration {
  position: absolute;
  right: 6px; bottom: 6px;
  background: rgba(0, 0, 0, 0.75);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 3px;
  pointer-events: none;
}
.vimeo-video-title {
  margin: 0.5rem 0 0.15rem;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--typely-user-font1, #111);
  line-height: 1.35;
}
.vm-plays {
  font-size: 0.78rem;
  color: var(--typely-user-font1-secondary, #6b7280);
}
.vimeo-showcase { margin: 1.5rem 0; }
.vimeo-showcase-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0 0 0.75rem;
  color: var(--typely-user-font1, #111);
}

/* ── [vimeo-live] — "live now" banner ────────────── */
.vimeo-live-banner {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 0.95rem;
  border-radius: 999px;
  background: #1ab7ea;  /* Vimeo blue */
  color: #fff !important;
  text-decoration: none !important;
  font-size: 0.85rem;
  font-weight: 500;
  margin: 1rem 0;
}
.vimeo-live-banner:hover { opacity: 0.92; text-decoration: none !important; }
.vimeo-live-pre_live { background: #334155; }
.vm-live-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.35);
  animation: vm-live-pulse 1.4s ease-in-out infinite;
}
.vimeo-live-pre_live .vm-live-dot { animation: none; }
@keyframes vm-live-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.3); }
}
.vm-live-label { font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; font-size: 0.72rem; }
.vm-live-title { opacity: 0.95; }

/* ── [vimeo-stats] — profile badge ──────────────────── */
.vimeo-stats {
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.6rem 0.9rem;
  border: 1px solid var(--typely-user-font1-secondary, #e5e7eb);
  border-radius: 10px;
  text-decoration: none !important;
  color: inherit !important;
  margin: 1rem 0;
}
.vimeo-stats:hover { border-color: #1ab7ea; text-decoration: none !important; }
.vm-stats-avatar { width: 48px; height: 48px; border-radius: 50%; flex-shrink: 0; }
.vm-stats-text { display: flex; flex-direction: column; gap: 0.2rem; }
.vm-stats-title { font-size: 0.95rem; }
.vm-stats-counts {
  display: flex;
  gap: 0.8rem;
  font-size: 0.78rem;
  color: var(--typely-user-font1-secondary, #6b7280);
  flex-wrap: wrap;
}
.vm-stats-counts strong { color: var(--typely-user-font1, #111); font-weight: 600; }

/* ── [spotify-embed] + [soundcloud-embed] — audio embeds ──────── */
.typely-spotify-embed,
.typely-soundcloud-embed {
  margin: 1.25rem 0;
  max-width: 100%;
}
.typely-spotify-embed iframe {
  border-radius: 12px;
  display: block;
  width: 100%;
}
.typely-soundcloud-embed iframe {
  display: block;
  width: 100%;
  border-radius: 4px;
}

/* ── Shared error style ─────────────────────────── */
.typely-error {
  color: #888;
  font-style: italic;
  font-size: 0.9em;
  padding: 0.5rem 0.75rem;
  border-left: 3px solid #ddd;
  background: rgba(0, 0, 0, 0.02);
  margin: 0.75rem 0;
}
.typely-error code {
  background: rgba(0, 0, 0, 0.06);
  padding: 0 4px;
  border-radius: 3px;
}
