/**
 * Fragment Template Styles
 * 
 * Modern futuristic code style with neon accents.
 * All styles use CSS custom properties for theming compatibility.
 */

/* ===================================
   SAFE AREA BACKGROUND EXTENSION (iOS)
   =================================== */

/* Extend background to notch and home indicator areas */
html:has(.template-fragment),
html:has(.template-fragment) body {
  background-color: #111111;
}

/* ===================================
   BASE TEMPLATE STYLES
   =================================== */

.template-fragment {
  /* Template-specific variables */
  --template-bg: #0a0a0a;
  --template-surface: #111111;
  --template-surface-hover: #1a1a1a;
  --template-text: #ffffff;
  --template-text-muted: #888888;
  --template-text-subtle: #666666;
  --template-border: #222222;
  --template-border-hover: #333333;
  
  /* Base styles */
  font-family: 'Space Grotesk', sans-serif;
  background-color: var(--template-bg);
  color: var(--template-text);
}

/* ===================================
   BUTTONS
   =================================== */

/* Primary button - neon pill with glow */
.template-fragment .btn-primary {
  background-color: var(--cms-primary);
  color: #000000;
  font-weight: 600;
  border-radius: 9999px;
  padding: 0.5rem 1.5rem;
  transition: all 0.2s ease;
  border: none;
  cursor: pointer;
}

.template-fragment .btn-primary:hover {
  box-shadow: 0 0 20px var(--cms-secondary-glow);
  transform: scale(1.05);
}

.template-fragment .btn-primary:active {
  transform: scale(0.95);
}

.template-fragment .btn-primary:focus-visible {
  outline: 2px solid var(--cms-primary);
  outline-offset: 2px;
}

/* Secondary button - dark with border */
.template-fragment .btn-secondary {
  background-color: var(--template-surface-hover);
  color: var(--template-text);
  font-weight: 500;
  border-radius: 9999px;
  padding: 0.5rem 1.5rem;
  border: 1px solid var(--template-border-hover);
  transition: all 0.2s ease;
  cursor: pointer;
}

.template-fragment .btn-secondary:hover {
  border-color: var(--cms-primary);
  color: var(--cms-primary);
  box-shadow: 0 0 15px var(--cms-secondary-glow);
}

/* Outline button */
.template-fragment .btn-outline {
  background-color: transparent;
  color: var(--cms-primary);
  font-weight: 500;
  border-radius: 9999px;
  padding: 0.5rem 1.5rem;
  border: 2px solid var(--cms-primary);
  transition: all 0.2s ease;
  cursor: pointer;
}

.template-fragment .btn-outline:hover {
  background-color: var(--cms-primary);
  color: #000000;
  box-shadow: 0 0 20px var(--cms-secondary-glow);
}

/* Ghost button */
.template-fragment .btn-ghost {
  background-color: transparent;
  color: var(--template-text);
  border-radius: 9999px;
  padding: 0.5rem 1rem;
  border: none;
  transition: all 0.2s ease;
  cursor: pointer;
}

.template-fragment .btn-ghost:hover {
  color: var(--cms-primary);
  background-color: var(--template-surface-hover);
}

/* ===================================
   CARDS
   =================================== */

.template-fragment .card {
  background-color: var(--template-surface);
  border: 1px solid var(--template-border);
  border-radius: 1rem;
  transition: all 0.3s ease;
}

.template-fragment .card:hover {
  border-color: var(--cms-primary);
  box-shadow: 0 0 30px var(--cms-secondary-glow);
  transform: scale(1.01);
}

/* Article card specific */
.template-fragment .article-card {
  background-color: var(--template-surface);
  border: 1px solid var(--template-border);
  border-radius: 1rem;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.3s ease;
}

.template-fragment .article-card:hover {
  border-color: var(--cms-primary);
  box-shadow: 0 0 30px var(--cms-secondary-glow);
  transform: scale(1.01);
}

.template-fragment .article-card-image {
  width: 100%;
  height: 12rem;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.template-fragment .article-card:hover .article-card-image {
  transform: scale(1.05);
}

.template-fragment .article-card-content {
  padding: 1.5rem;
}

.template-fragment .article-card-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--template-text);
  margin-bottom: 0.5rem;
  transition: color 0.2s ease;
}

.template-fragment .article-card:hover .article-card-title {
  color: var(--cms-primary);
}

.template-fragment .article-card-excerpt {
  font-size: 0.875rem;
  color: var(--template-text-muted);
  line-height: 1.5;
  margin-bottom: 1rem;
}

.template-fragment .article-card-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.875rem;
  color: var(--template-text-subtle);
}

.template-fragment .article-card-date {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

/* Paywall card */
.template-fragment .paywall-card {
  background-color: var(--template-surface);
  border: 1px solid var(--template-border);
  border-radius: 1rem;
  padding: 2rem;
  text-align: center;
}

.template-fragment .paywall-wrapper {
  margin-top: 2rem;
}

.template-fragment .paywall-icon-wrapper {
  display: flex;
  justify-content: center;
  margin-bottom: 1rem;
}

.template-fragment .paywall-icon-bg {
  position: relative;
  padding: 0.75rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Background as pseudo-element BEHIND the icon */
.template-fragment .paywall-icon-bg::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  /* Primary à 15% opacité - fond subtil flat */
  background-color: color-mix(in srgb, var(--cms-primary) 15%, transparent);
  z-index: 0;
}

/* Icon ABOVE the background - éclairci pour contraste */
.template-fragment .paywall-icon-bg > svg,
.template-fragment .paywall-icon {
  position: relative;
  z-index: 1;
  width: 2rem !important;
  height: 2rem !important;
  /* Primary mélangé avec 40% blanc = toujours visible */
  color: color-mix(in srgb, var(--cms-primary), white 40%) !important;
}

.template-fragment .paywall-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--template-text);
}

.template-fragment .paywall-description {
  margin-bottom: 1.5rem;
  color: var(--template-text-muted);
}

.template-fragment .paywall-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  justify-content: center;
}

@media (min-width: 640px) {
  .template-fragment .paywall-actions {
    flex-direction: row;
  }
}

.template-fragment .paywall-form {
  max-width: 28rem;
  margin: 0 auto;
}

/* ===================================
   INPUTS
   =================================== */

.template-fragment .input {
  background-color: var(--template-surface-hover);
  border: 1px solid var(--template-border-hover);
  border-radius: 9999px;
  padding: 0.5rem 1rem;
  color: var(--template-text);
  font-size: 1rem; /* Prevent iOS zoom on focus */
  transition: all 0.2s ease;
}

.template-fragment .input::placeholder {
  color: var(--template-text-subtle);
}

.template-fragment .input:focus {
  border-color: var(--cms-primary);
  box-shadow: 0 0 0 2px var(--cms-primary-glow);
  outline: none;
}

/* Textarea */
.template-fragment .textarea {
  background-color: var(--template-surface-hover);
  border: 1px solid var(--template-border-hover);
  border-radius: 1rem;
  padding: 0.75rem 1rem;
  color: var(--template-text);
  font-size: 1rem; /* Prevent iOS zoom on focus */
  transition: all 0.2s ease;
  resize: vertical;
}

.template-fragment .textarea:focus {
  border-color: var(--cms-primary);
  box-shadow: 0 0 0 2px var(--cms-primary-glow);
  outline: none;
}

/* ===================================
   TABS
   =================================== */

.template-fragment .tabs-list {
  background-color: var(--template-surface);
  border: 1px solid var(--template-border);
  border-radius: 9999px;
  padding: 0.25rem;
}

.template-fragment .tabs-trigger {
  border-radius: 9999px;
  color: var(--template-text-muted);
  padding: 0.5rem 1rem;
  transition: all 0.2s ease;
}

.template-fragment .tabs-trigger[data-state="active"] {
  background-color: var(--cms-primary);
  color: #000000;
}

/* ===================================
   NAVIGATION
   =================================== */

.template-fragment.site-nav,
.template-fragment .site-nav {
  border-bottom: 1px solid var(--template-border);
  background-color: rgba(10, 10, 10, 0.95);
  backdrop-filter: blur(10px);
  color: var(--template-text);
}

.template-fragment .nav-inner {
  height: auto;
  padding: 0.75rem 0;
  font-size: 0.875rem;
}

/* Logo in navigation - circular */
.template-fragment .nav-logo {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

/* ===================================
   AUTHOR CARD (vertical & horizontal)
   =================================== */

/* Neutralize Card container to avoid double box effect */
.template-fragment .author-card {
  background-color: transparent;
  border: none;
  padding: 0;
  box-shadow: none;
}

/* Apply visual styles only to author-card-content */
.template-fragment .author-card-content {
  background-color: var(--template-surface);
  border: 1px solid var(--template-border);
  border-radius: 1rem;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  transition: all 0.3s ease;
}

.template-fragment .author-card:hover .author-card-content {
  border-color: var(--cms-primary);
  box-shadow: 0 0 20px var(--cms-secondary-glow);
}

.template-fragment .author-card-vertical {
  flex-direction: column;
  text-align: center;
  align-items: center;
}

/* Author card horizontal - mobile first, then desktop */
.template-fragment .author-card-horizontal {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: center;
  text-align: center;
}

@media (min-width: 640px) {
  .template-fragment .author-card-horizontal {
    flex-direction: row;
    align-items: flex-start;
    text-align: left;
  }
}

.template-fragment .author-avatar-large {
  width: 5rem;
  height: 5rem;
  border-radius: 50%;
  border: 2px solid var(--cms-primary);
  flex-shrink: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative; /* CRUCIAL for Next.js Image fill */
}

.template-fragment .author-avatar-medium {
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  border: 1px solid var(--cms-primary-glow);
  flex-shrink: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative; /* CRUCIAL for Next.js Image fill */
}

/* Author avatar image styling - Next.js Image with fill */
.template-fragment .author-avatar {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  border-radius: 50%;
  position: absolute;
  top: 0;
  left: 0;
}

.template-fragment .author-avatar-icon {
  width: 2rem;
  height: 2rem;
  color: var(--cms-primary);
}

.template-fragment .author-avatar-icon-small {
  width: 1.5rem;
  height: 1.5rem;
  color: var(--cms-primary);
}

.template-fragment .author-info {
  flex: 1;
  min-width: 0;
  text-align: center;
}

@media (min-width: 640px) {
  .template-fragment .author-info {
    text-align: left;
  }
}

.template-fragment .author-bio-short {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: var(--template-text-muted);
  font-size: 0.875rem;
  line-height: 1.5;
  /* Embellissement subtil */
  padding: 0.75rem 1rem;
  background-color: color-mix(in srgb, var(--template-text) 5%, transparent);
  border-left: 2px solid var(--cms-primary);
  border-radius: 0 0.25rem 0.25rem 0;
  margin: 0.5rem 0;
}

.template-fragment .author-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  width: 100%;
}

.template-fragment .author-actions-section {
  flex-shrink: 0;
  margin-top: 1rem;
  width: 100%;
}

.template-fragment .author-checkbox-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  justify-content: center;
}

.template-fragment .author-checkbox-label {
  font-size: 0.875rem;
  color: var(--template-text-muted);
  cursor: pointer;
}

.template-fragment .author-button {
  width: 100%;
}

.template-fragment .author-button-disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.template-fragment .author-card-footer {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--template-border);
}

/* Author name and bio styles */
.template-fragment .author-name {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--template-text);
}

.template-fragment .author-bio {
  font-size: 0.9375rem;
  color: var(--template-text-muted);
  line-height: 1.6;
  margin: 0.75rem 0 1rem;
  padding: 0.75rem 1rem;
  background-color: var(--template-surface-hover);
  border-radius: 0.5rem;
  border-left: 3px solid var(--cms-primary);
  font-style: italic;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Author avatar fallback (when no image) */
.template-fragment .author-avatar-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--cms-primary-glow);
  color: var(--cms-primary);
  font-weight: 600;
  font-size: 1.25rem;
  border-radius: 50%;
}

/* Author status (following/subscribed) */
.template-fragment .author-status {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem 0;
  color: var(--template-text-muted);
}

.template-fragment .author-status-icon {
  width: 1rem;
  height: 1rem;
  color: var(--cms-primary);
}

.template-fragment .author-status-text {
  font-size: 0.875rem;
  color: var(--template-text);
}

/* Checkbox checked state */

/* Checkbox checked state */
.template-fragment .checkbox[data-state="checked"] {
  background-color: var(--cms-primary);
  border-color: var(--cms-primary);
}

.template-fragment .nav-site-title {
  font-weight: 700;
  font-size: 1.125rem;
  color: var(--template-text);
}

@media (min-width: 640px) {
  .template-fragment .nav-site-title {
    font-size: 1.25rem;
  }
}

.template-fragment .nav-back-icon {
  color: var(--cms-primary);
}

.template-fragment .nav-divider {
  background-color: var(--template-border);
}

.template-fragment .nav-link {
  color: var(--template-text);
  font-size: 0.875rem;
  font-weight: 500;
  transition: color 0.2s ease;
}

.template-fragment .nav-link:hover {
  color: var(--cms-primary);
}

/* Mobile navigation links */
.template-fragment .nav-link-mobile {
  display: block;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  color: var(--template-text);
  transition: all 0.2s ease;
}

.template-fragment .nav-link-mobile:hover,
.template-fragment .nav-link-mobile:active {
  background-color: var(--cms-secondary);
  color: var(--template-bg);
}

/* ===================================
   HERO SECTION
   =================================== */

.template-fragment .site-hero {
  min-height: 280px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 1rem;
  text-align: center;
}

.template-fragment .site-hero-title {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.template-fragment .site-hero-description {
  font-size: 1.25rem;
  color: var(--template-text-muted);
  max-width: 32rem;
}

.template-fragment .hero-input {
  background-color: var(--template-surface-hover);
  border: 1px solid var(--template-border-hover);
  border-radius: 9999px;
  padding: 0.75rem 1.25rem;
  color: var(--template-text);
}

.template-fragment .hero-input:focus {
  border-color: var(--cms-primary);
  box-shadow: 0 0 0 2px var(--cms-primary-glow);
}

/* ===================================
   DIALOG / MODAL / SHEET
   =================================== */

/* Dialog - works for portals with template-fragment class on DialogContent */
.template-fragment.dialog-content,
.template-fragment .dialog-content {
  background-color: var(--template-bg);
  border: 1px solid var(--template-border);
  border-radius: 1rem;
  color: var(--template-text);
}

.template-fragment .dialog-header,
.template-fragment.dialog-content .dialog-header {
  color: var(--template-text);
}

.template-fragment .dialog-description,
.template-fragment.dialog-content .dialog-description {
  color: var(--template-text-muted);
}

/* Pricing dialog specific styles */
.template-fragment .dialog-section-title {
  color: var(--template-text);
}

.template-fragment .dialog-product-title {
  color: var(--template-text);
}

.template-fragment .pricing-price {
  color: var(--template-text);
}

.template-fragment .pricing-interval {
  color: var(--template-text-muted);
}

.template-fragment .pricing-product-description {
  color: var(--template-text-muted);
}

.template-fragment .pricing-footer {
  color: var(--template-text-muted);
  border-top-color: var(--template-border);
}

/* Sheet - mobile menu */
.template-fragment.sheet-content,
.template-fragment .sheet-content {
  background-color: var(--template-bg);
  border-left: 1px solid var(--template-border);
  color: var(--template-text);
}

/* Labels inside dialogs/sheets */
.template-fragment.dialog-content label,
.template-fragment.sheet-content label,
.template-fragment .dialog-content label,
.template-fragment .sheet-content label {
  color: var(--template-text);
}

/* Dialog close button (X icon) */
.template-fragment.dialog-content [data-radix-dialog-close],
.template-fragment .dialog-content [data-radix-dialog-close],
.template-fragment.sheet-content [data-radix-close],
.template-fragment .sheet-content [data-radix-close] {
  color: var(--template-text);
}

.template-fragment.dialog-content [data-radix-dialog-close]:hover,
.template-fragment .dialog-content [data-radix-dialog-close]:hover,
.template-fragment.sheet-content [data-radix-close]:hover,
.template-fragment .sheet-content [data-radix-close]:hover {
  color: var(--cms-primary);
}

/* Close button styling for dialogs */
.template-fragment .close-button,
.template-fragment [class*="DialogClose"],
.template-fragment [class*="SheetClose"],
.template-fragment button[aria-label="Close"] {
  color: var(--template-text);
}

.template-fragment .close-button:hover,
.template-fragment [class*="DialogClose"]:hover,
.template-fragment [class*="SheetClose"]:hover,
.template-fragment button[aria-label="Close"]:hover {
  color: var(--cms-primary);
  background-color: var(--template-surface-hover);
}

/* ===================================
   AUTHOR STATUS (Already subscribed)
   =================================== */

.template-fragment .author-status {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem 0;
  color: var(--template-text);
}

.template-fragment .author-status-icon {
  width: 1rem;
  height: 1rem;
  color: var(--cms-primary);
}

.template-fragment .author-status-text {
  font-size: 0.875rem;
  color: var(--template-text);
}

/* ===================================
   FOOTER
   =================================== */

.template-fragment .site-footer {
  border-top: 1px solid var(--template-border);
  padding: 1rem 0;
  text-align: center;
  color: var(--template-text-muted);
  background-color: var(--template-bg);
}

.template-fragment .site-footer-legal {
  margin-top: 1rem;
  padding-top: 1rem;
  background-color: var(--template-bg);
}

.template-fragment .icon-muted {
  color: var(--template-text-muted);
  opacity: 0.7;
}

.template-fragment .author-subscribe-hint {
  font-size: 0.9375rem;
  color: var(--template-text-muted);
  margin: 1.25rem 0 1rem;
  line-height: 1.5;
  text-align: center;
}

.template-fragment .site-footer-branding {
  padding-bottom: 5rem;
  border-top: 1px solid var(--template-border);
  background-color: var(--template-bg);
  margin-top: 0;
}

@media (min-width: 768px) {
  .template-fragment .site-footer-branding {
    padding-bottom: 1rem;
  }
}

.template-fragment .site-footer-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

.template-fragment .site-footer-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

@media (min-width: 640px) {
  .template-fragment .site-footer-content {
    flex-direction: row;
    justify-content: space-between;
  }
}

.template-fragment .footer-copyright {
  font-size: 0.75rem;
  color: var(--template-text-muted);
}

.template-fragment .site-footer-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  font-size: 0.75rem;
}

.template-fragment .footer-separator {
  color: var(--template-border);
}

.template-fragment .footer-link {
  color: var(--template-text-muted);
  text-decoration: none;
  transition: color 0.2s ease;
  line-height: 1.5;
}

.template-fragment .footer-link:hover {
  color: var(--cms-primary, #00ff66);
}

.template-fragment .footer-branding-link {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.75rem;
  line-height: 1.5;
  color: var(--template-text-muted);
  text-decoration: none;
  transition: color 0.2s ease;
}

.template-fragment .footer-branding-link:hover {
  color: var(--cms-primary);
}

.template-fragment .footer-brand-name {
  font-weight: 500;
}

.template-fragment .footer-icon {
  width: 0.75rem;
  height: 0.75rem;
}

/* ===================================
   LOADER
   =================================== */

.template-fragment .loader {
  background-color: var(--template-bg);
}

.template-fragment .loader-spinner {
  color: var(--cms-primary);
}

.template-fragment .loader-text {
  color: var(--template-text-muted);
}

/* ===================================
   AVATAR
   =================================== */

.template-fragment .avatar {
  border-radius: 50%;
}

.template-fragment .avatar-fallback {
  background-color: var(--template-surface-hover);
  color: var(--cms-primary);
}

/* ===================================
   CHECKBOX
   =================================== */

.template-fragment .checkbox {
  border-color: var(--template-border-hover);
  border-radius: 0.25rem;
}

.template-fragment .checkbox[data-state="checked"] {
  background-color: var(--cms-primary);
  border-color: var(--cms-primary);
}

/* ===================================
   ICONS
   =================================== */

.template-fragment .icon-accent {
  color: var(--cms-primary);
}

.template-fragment .icon-background {
  padding: 1rem;
  border-radius: 50%;
  background-color: var(--template-surface-hover);
}

/* ===================================
   PAGE CONTENT
   =================================== */

.template-fragment .page-content {
  max-width: 42rem;
  margin: 0 auto;
}

/* ===================================
   PROSE / CONTENT
   =================================== */

.template-fragment .prose,
.template-fragment .article-prose {
  color: var(--template-text);
}

.template-fragment .prose p,
.template-fragment .article-prose p {
  color: var(--template-text);
  margin-bottom: 1.25rem;
}

.template-fragment .prose h1,
.template-fragment .prose h2,
.template-fragment .prose h3,
.template-fragment .prose h4,
.template-fragment .prose h5,
.template-fragment .prose h6,
.template-fragment .article-prose h1,
.template-fragment .article-prose h2,
.template-fragment .article-prose h3,
.template-fragment .article-prose h4,
.template-fragment .article-prose h5,
.template-fragment .article-prose h6 {
  color: var(--template-text);
  font-weight: 700;
  margin-top: 2rem;
  margin-bottom: 1rem;
}

.template-fragment .prose a,
.template-fragment .article-prose a {
  color: var(--cms-primary);
  text-decoration: none;
}

.template-fragment .prose a:hover,
.template-fragment .article-prose a:hover {
  text-decoration: underline;
}

.template-fragment .prose strong,
.template-fragment .article-prose strong {
  color: var(--template-text);
}

.template-fragment .prose ul,
.template-fragment .article-prose ul {
  list-style-type: disc;
  padding-left: 1.5rem;
  margin-bottom: 1rem;
}

.template-fragment .prose ol,
.template-fragment .article-prose ol {
  list-style-type: decimal;
  padding-left: 1.5rem;
  margin-bottom: 1rem;
}

.template-fragment .prose li,
.template-fragment .article-prose li {
  color: var(--template-text);
  margin-bottom: 0.25rem;
}

.template-fragment .prose code,
.template-fragment .article-prose code {
  color: var(--cms-primary);
  background-color: var(--template-surface-hover);
  padding: 0.125rem 0.375rem;
  border-radius: 0.375rem;
}

.template-fragment .prose pre,
.template-fragment .article-prose pre {
  background-color: var(--template-surface);
  border: 1px solid var(--template-border);
  border-radius: 0.75rem;
}

.template-fragment .prose blockquote,
.template-fragment .article-prose blockquote {
  border-left-color: var(--cms-primary);
  color: var(--template-text-muted);
}

.template-fragment .prose img,
.template-fragment .article-prose img {
  border-radius: 0.75rem;
  margin: 1.5rem 0;
}

/* ===================================
   AUTHOR CARD (legacy - neutralized, see main section above)
   =================================== */

/* Legacy .author-card styles removed - now handled in main AUTHOR CARD section */
/* Note: .author-avatar is now defined in the main AUTHOR CARD section above (lines ~422-430) */

.template-fragment .author-name {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--template-text);
  margin-bottom: 0.5rem;
}

.template-fragment .author-bio {
  font-size: 0.9375rem;
  color: var(--template-text-muted);
  line-height: 1.6;
  margin: 0.75rem 0 1rem;
  padding: 0.75rem 1rem;
  background-color: var(--template-surface-hover);
  border-radius: 0.5rem;
  border-left: 3px solid var(--cms-primary);
  font-style: italic;
}

/* ===================================
   PAGE WRAPPER & CONTAINER
   =================================== */

.template-fragment .page-wrapper {
  min-height: 100vh;
  background-color: var(--template-bg);
  color: var(--template-text);
  font-family: 'Space Grotesk', sans-serif;
}

.template-fragment .page-container {
  max-width: 80rem;
  margin: 0 auto;
  padding: 3rem 1rem;
}

.template-fragment .page-container-narrow {
  max-width: 56rem;
  margin: 0 auto;
  padding: 1.5rem 1rem 3rem;
}

/* ===================================
   SECTION HEADER
   =================================== */

.template-fragment .section-header {
  margin-bottom: 3rem;
}

.template-fragment .section-path {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--cms-primary);
  margin-bottom: 1rem;
  font-size: 0.875rem;
}

.template-fragment .section-path-dim {
  opacity: 0.6;
}

.template-fragment .section-title {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  letter-spacing: -0.02em;
}

@media (min-width: 768px) {
  .template-fragment .section-title {
    font-size: 3rem;
  }
}

.template-fragment .section-title-prefix {
  color: var(--cms-primary);
}

.template-fragment .section-subtitle {
  color: var(--template-text-muted);
  font-size: 1.125rem;
}

/* ===================================
   ARTICLES LAYOUT
   =================================== */

.template-fragment .articles-layout {
  display: grid;
  gap: 2rem;
}

@media (min-width: 1024px) {
  .template-fragment .articles-layout {
    grid-template-columns: 2fr 1fr;
  }
}

.template-fragment .articles-main {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.template-fragment .articles-sidebar {
  position: sticky;
  top: 2rem;
}

.template-fragment .sidebar-card {
  /* Neutralized for author-card - styling is on .author-card-content */
  background-color: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
}

.template-fragment .sidebar-label {
  font-size: 0.75rem;
  color: var(--cms-primary);
  font-family: monospace;
  letter-spacing: 0.1em;
  margin-bottom: 1rem;
}

/* ===================================
   ARTICLE LIST ITEMS
   =================================== */

.template-fragment .article-list-item {
  cursor: pointer;
}

.template-fragment .article-list-image-wrapper {
  position: relative;
  overflow: hidden;
  border-radius: 1rem 1rem 0 0;
}

.template-fragment .article-list-image {
  width: 100%;
  height: 12rem;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.template-fragment .article-card:hover .article-list-image {
  transform: scale(1.05);
}

.template-fragment .article-list-gradient {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, var(--template-surface) 0%, transparent 100%);
  opacity: 0.6;
}

.template-fragment .article-list-badge {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
}

.template-fragment .article-list-content {
  padding: 1.5rem;
}

.template-fragment .article-list-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--template-text);
  margin-bottom: 0.5rem;
  transition: color 0.2s ease;
}

.template-fragment .article-card:hover .article-list-title {
  color: var(--cms-primary);
}

.template-fragment .article-list-excerpt {
  font-size: 0.875rem;
  color: var(--template-text-muted);
  line-height: 1.5;
  margin-bottom: 1rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.template-fragment .article-list-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.template-fragment .article-list-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.875rem;
  color: var(--template-text-subtle);
}

.template-fragment .article-meta-item {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.template-fragment .article-read-btn {
  background-color: var(--cms-primary);
  color: #000000;
  font-size: 0.875rem;
  font-weight: 600;
  padding: 0.375rem 1rem;
  border-radius: 9999px;
  opacity: 0;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.template-fragment .article-card:hover .article-read-btn {
  opacity: 1;
  box-shadow: 0 0 15px var(--cms-primary-glow);
}

/* ===================================
   BACK BUTTON
   =================================== */

.template-fragment .btn-back {
  background-color: var(--template-surface-hover);
  color: var(--template-text);
  font-weight: 500;
  border-radius: 9999px;
  padding: 0.5rem 1.25rem;
  border: 1px solid var(--template-border-hover);
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  cursor: pointer;
}

.template-fragment .btn-back:hover {
  border-color: var(--cms-primary);
  color: var(--cms-primary);
  box-shadow: 0 0 15px var(--cms-primary-glow);
}

/* ===================================
   ARTICLE PAGE
   =================================== */

.template-fragment .article-cover-wrapper {
  position: relative;
  margin-bottom: 2rem;
  border-radius: 1rem;
  overflow: hidden;
}

.template-fragment .article-cover-image {
  width: 100%;
  height: 16rem;
  object-fit: cover;
}

@media (min-width: 768px) {
  .template-fragment .article-cover-image {
    height: 24rem;
  }
}

.template-fragment .article-cover-gradient {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, var(--template-bg) 0%, transparent 50%);
}

.template-fragment .article-cover-badge {
  position: absolute;
  top: 1rem;
  right: 1rem;
}

.template-fragment .article-title {
  font-size: 1.875rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  line-height: 1.2;
}

@media (min-width: 768px) {
  .template-fragment .article-title {
    font-size: 2.25rem;
  }
}

.template-fragment .article-title-prefix {
  color: var(--cms-primary);
}

.template-fragment .article-meta-bar {
  background-color: var(--template-surface);
  border: 1px solid var(--template-border);
  border-radius: 1rem;
  padding: 1rem;
  margin-bottom: 2rem;
}

.template-fragment .article-meta-content {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  font-size: 0.875rem;
}

.template-fragment .article-author {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  transition: color 0.2s ease;
}

.template-fragment .article-author:hover {
  color: var(--cms-primary);
}

.template-fragment .article-author-avatar {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  border: 1px solid var(--cms-primary-glow);
  overflow: hidden;
}

.template-fragment .article-author-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.template-fragment .article-author-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--template-surface-hover);
  color: var(--cms-primary);
  font-size: 0.75rem;
}

.template-fragment .article-meta-separator {
  height: 1rem;
  width: 1px;
  background-color: var(--template-border);
}

.template-fragment .article-meta-date,
.template-fragment .article-meta-reading {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--template-text-muted);
}

.template-fragment .article-excerpt {
  font-size: 1.25rem;
  color: var(--template-text-muted);
  margin-bottom: 2rem;
  border-left: 2px solid var(--cms-primary);
  padding-left: 1rem;
}

.template-fragment .article-prose {
  color: var(--template-text);
  max-width: none;
}

.template-fragment .article-prose h1,
.template-fragment .article-prose h2,
.template-fragment .article-prose h3,
.template-fragment .article-prose h4 {
  color: var(--template-text);
}

.template-fragment .article-prose a {
  color: var(--cms-primary);
  text-decoration: none;
}

.template-fragment .article-prose a:hover {
  text-decoration: underline;
}

.template-fragment .article-prose strong {
  color: var(--template-text);
}

.template-fragment .article-prose code {
  color: var(--cms-primary);
  background-color: var(--template-surface-hover);
  padding: 0.125rem 0.5rem;
  border-radius: 0.375rem;
}

.template-fragment .article-prose pre {
  background-color: var(--template-surface);
  border: 1px solid var(--template-border);
  border-radius: 0.75rem;
}

.template-fragment .article-prose blockquote {
  border-left-color: var(--cms-primary);
  color: var(--template-text-muted);
}

.template-fragment .article-prose li {
  color: var(--template-text);
}

/* Pricing dialog titles */
.template-fragment .dialog-section-title {
  color: var(--template-text);
}

.template-fragment .dialog-product-title {
  color: var(--template-text);
}

.template-fragment .article-interactions {
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid var(--template-border);
}

/* ===================================
   AUTHOR CARD WRAPPER
   =================================== */

.template-fragment .author-card-wrapper {
  /* Neutralized to avoid double box - styling is on .author-card-content */
  background-color: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
}

.template-fragment .author-card-label {
  font-size: 0.75rem;
  color: var(--cms-primary);
  font-family: monospace;
  letter-spacing: 0.1em;
  margin-bottom: 1rem;
}

/* ===================================
   LOADER
   =================================== */

.template-fragment .loader {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem;
}

.template-fragment .loader-spinner {
  color: var(--cms-primary);
  margin-right: 0.5rem;
}

.template-fragment .loader-text {
  color: var(--template-text-muted);
}

/* ===================================
   EMPTY STATE
   =================================== */

.template-fragment .empty-state {
  padding: 3rem;
  text-align: center;
}

.template-fragment .empty-state-text {
  color: var(--template-text-muted);
}

/* ===================================
   ICONS
   =================================== */

.template-fragment .icon-xs {
  width: 0.75rem;
  height: 0.75rem;
  flex-shrink: 0;
}

.template-fragment .icon-sm {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
}

.template-fragment .icon-md {
  width: 1.25rem;
  height: 1.25rem;
  flex-shrink: 0;
}

.template-fragment .icon-lg {
  width: 1.5rem;
  height: 1.5rem;
  flex-shrink: 0;
}

/* ===================================
   BADGES
   =================================== */

.template-fragment .article-category-badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  margin-bottom: 0.75rem;
  background-color: var(--template-surface-hover);
  color: var(--cms-primary);
}

/* ===================================
   ANIMATIONS
   =================================== */

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.template-fragment .loader-spinner {
  animation: spin 1s linear infinite;
}

/* ===================================
   AVATAR SIZES
   =================================== */

.template-fragment .author-avatar-sm {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  border: 1px solid var(--cms-primary-glow);
}

.template-fragment .author-avatar-sm img {
  object-fit: cover;
}

.template-fragment .author-avatar-fallback {
  background-color: var(--template-surface-hover);
  color: var(--cms-primary);
}

/* ===================================
   PREMIUM BADGES
   =================================== */

.template-fragment .premium-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
}

.template-fragment .premium-badge-subscription {
  background-color: #f59e0b;
  color: #000000;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.5);
}

.template-fragment .premium-badge-course {
  background-color: #3b82f6;
  color: #000000;
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.5);
}

.template-fragment .premium-badge-sm {
  font-size: 0.625rem;
  padding: 0.125rem 0.5rem;
}

.template-fragment .premium-badge-icon {
  width: 0.875rem;
  height: 0.875rem;
}

.template-fragment .premium-badge-sm .premium-badge-icon {
  width: 0.75rem;
  height: 0.75rem;
}

/* ===================================
   SUBSCRIBE HERO
   =================================== */

.template-fragment .subscribe-hero {
  width: 100%;
  padding: 5rem 1rem;
}

.template-fragment .subscribe-hero-container {
  max-width: 42rem;
  margin: 0 auto;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  min-height: 160px;
  justify-content: center;
}

.template-fragment .subscribe-hero-skeleton-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.template-fragment .subscribe-hero-skeleton {
  border-radius: 9999px;
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.template-fragment .subscribe-hero-skeleton-title-long {
  height: 2.25rem;
  width: 20rem;
  max-width: 100%;
  margin: 0 auto;
}

.template-fragment .subscribe-hero-skeleton-title-short {
  height: 2.25rem;
  width: 12rem;
  margin: 0 auto;
}

.template-fragment .subscribe-hero-skeleton-title {
  height: 2.5rem;
  width: 18rem;
  margin: 0 auto;
}

.template-fragment .subscribe-hero-skeleton-description {
  height: 1.25rem;
  width: 24rem;
  max-width: 100%;
  margin: 0 auto;
}

.template-fragment .subscribe-hero-skeleton-button {
  height: 3rem;
  width: 12rem;
  margin: 0 auto;
  border-radius: 9999px;
}

.template-fragment .subscribe-hero-title {
  font-size: 2.5rem;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 0.5rem;
}

.template-fragment .subscribe-hero-description {
  font-size: 1.25rem;
  color: var(--template-text-muted);
  line-height: 1.5;
  margin-bottom: 0.75rem;
}

.template-fragment .subscribe-hero-owner-message {
  font-size: 0.875rem;
  opacity: 0.75;
  line-height: 1.5;
}

.template-fragment .subscribe-hero-actions {
  max-width: 28rem;
  margin: 0 auto;
}

.template-fragment .subscribe-hero-status {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  opacity: 0.75;
}

.template-fragment .subscribe-hero-check-icon {
  width: 1.25rem;
  height: 1.25rem;
}

.template-fragment .subscribe-hero-status-text {
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.5;
}

.template-fragment .subscribe-hero-subscribed {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.template-fragment .subscribe-hero-form {
  max-width: 28rem;
  margin: 0 auto;
}

/* Fix gap inheritance for hydration wrapper div */
.template-fragment .subscribe-hero-container > div {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Hero email input - used by EmailOnlySignup inline variant */
.template-fragment .hero-email-input,
.template-fragment .subscribe-hero-form .input-base,
.template-fragment .subscribe-hero-form input[type="email"] {
  background-color: var(--template-surface-hover);
  border: 1px solid var(--template-border-hover);
  border-radius: 9999px !important;
  padding: 0.75rem 1.25rem;
  padding-left: 2.5rem;
  color: var(--template-text);
  font-size: 1rem; /* Prevent iOS zoom on focus - must be >= 16px */
  transition: all 0.2s ease;
}

.template-fragment .hero-email-input:focus,
.template-fragment .subscribe-hero-form .input-base:focus,
.template-fragment .subscribe-hero-form input[type="email"]:focus {
  border-color: var(--cms-primary);
  box-shadow: 0 0 0 2px var(--cms-primary-glow);
  outline: none;
}

.template-fragment .hero-email-input::placeholder,
.template-fragment .subscribe-hero-form input[type="email"]::placeholder {
  color: var(--placeholder-color, var(--template-text-subtle));
  opacity: 1;
}

/* ===================================
   ARTICLE INTERACTIONS
   =================================== */

.template-fragment .interactions-wrapper {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  border-top: 1px solid var(--template-border);
  padding-top: 1.5rem;
  margin-top: 2rem;
}

.template-fragment .interactions-bar {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.template-fragment .interaction-group {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.template-fragment .interaction-btn {
  padding: 0.5rem;
  border-radius: 9999px;
  transition: all 0.2s ease;
}

.template-fragment .interaction-btn:hover {
  background-color: var(--template-surface-hover);
  box-shadow: 0 0 15px var(--cms-primary-glow);
}

.template-fragment .interaction-btn-liked {
  color: #ef4444;
}

.template-fragment .interaction-btn-shared {
  color: var(--cms-primary);
}

.template-fragment .interaction-btn-muted {
  color: var(--template-text-muted);
}

.template-fragment .interaction-btn-muted:hover {
  color: var(--template-text);
}

.template-fragment .interaction-icon {
  width: 1.25rem;
  height: 1.25rem;
}

.template-fragment .interaction-icon-filled {
  fill: currentColor;
}

.template-fragment .interaction-count {
  font-size: 0.875rem;
}

.template-fragment .interaction-count-inline {
  font-size: 0.875rem;
  margin-left: 0.25rem;
}

/* ===================================
   COMMENTS
   =================================== */

.template-fragment .comments-section {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding-left: 1rem;
  border-left: 2px solid var(--template-border);
}

.template-fragment .comment-form {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding-bottom: 1.5rem;
}

.template-fragment .comment-textarea {
  min-height: 60px;
  resize: none;
}

.template-fragment .comments-login-prompt {
  font-size: 0.875rem;
  color: var(--template-text-muted);
  padding: 1rem 0;
}

.template-fragment .comments-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.template-fragment .comments-loading,
.template-fragment .comments-empty {
  text-align: center;
  padding: 2rem 0;
  color: var(--template-text-muted);
}

.template-fragment .comments-load-more {
  padding: 1rem 0;
  text-align: center;
}

.template-fragment .comments-loading-more {
  font-size: 0.875rem;
  color: var(--template-text-muted);
}

.template-fragment .comment-wrapper {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.template-fragment .comment-reply {
  margin-left: 2rem;
}

.template-fragment .comment-row {
  display: flex;
  gap: 0.75rem;
}

.template-fragment .comment-avatar {
  flex-shrink: 0;
}

.template-fragment .comment-avatar-img {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  border: 1px solid var(--cms-primary-glow);
}

.template-fragment .comment-avatar-fallback {
  background-color: var(--template-surface-hover);
  color: var(--cms-primary);
}

.template-fragment .comment-content {
  flex: 1;
}

.template-fragment .comment-bubble {
  background-color: var(--template-surface);
  border: 1px solid var(--template-border);
  border-radius: 1rem;
  padding: 0.75rem 1rem;
}

.template-fragment .comment-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.template-fragment .comment-author {
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--template-text);
}

.template-fragment .comment-author:hover {
  color: var(--cms-primary);
}

.template-fragment .comment-delete-btn {
  height: 1.5rem;
  padding: 0 0.5rem;
  font-size: 0.75rem;
  border-radius: 9999px;
}

.template-fragment .comment-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.25rem;
}

.template-fragment .comment-time {
  font-size: 0.75rem;
  color: var(--template-text-muted);
}

.template-fragment .comment-like-btn {
  height: 1.5rem;
  padding: 0 0.5rem;
  font-size: 0.75rem;
  border-radius: 9999px;
}

.template-fragment .comment-like-btn-active {
  color: #ef4444;
}

.template-fragment .comment-like-icon {
  width: 0.75rem;
  height: 0.75rem;
}

.template-fragment .comment-like-icon-active {
  fill: currentColor;
}

.template-fragment .comment-like-count {
  margin-left: 0.25rem;
}

.template-fragment .comment-reply-btn {
  height: 1.5rem;
  padding: 0 0.5rem;
  font-size: 0.75rem;
  border-radius: 9999px;
}

.template-fragment .comment-reply-form {
  margin-left: 2.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.template-fragment .comment-reply-actions {
  display: flex;
  gap: 0.5rem;
}

.template-fragment .comment-replies {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

/* ===================================
   CONTENT RENDERER
   =================================== */

.template-fragment .content-renderer {
  position: relative;
}

.template-fragment .content-fade-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 8rem;
  pointer-events: none;
}

/* ===================================
   PRICING DIALOG
   =================================== */

.template-fragment .pricing-loader {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 0;
}

.template-fragment .pricing-loader-icon {
  width: 2rem;
  height: 2rem;
}

.template-fragment .pricing-empty {
  text-align: center;
  padding: 2rem 0;
}

.template-fragment .pricing-empty-text {
  color: var(--template-text-muted);
}

/* ===================================
   PRODUCT BUTTON
   =================================== */

.template-fragment .product-button-skeleton {
  margin: 1.5rem 0;
  padding: 1rem;
  border-radius: 1rem;
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.template-fragment .product-button-skeleton-title {
  height: 1.5rem;
  background-color: var(--template-surface-hover);
  border-radius: 0.25rem;
  width: 33%;
  margin-bottom: 0.5rem;
}

.template-fragment .product-button-skeleton-desc {
  height: 1rem;
  background-color: var(--template-surface-hover);
  border-radius: 0.25rem;
  width: 66%;
}

.template-fragment .product-button-card {
  margin: 1.5rem 0;
  padding: 1.5rem;
  border-radius: 1rem;
}

.template-fragment .product-button-content {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.template-fragment .product-button-icon-wrapper {
  padding: 0.75rem;
  border-radius: 50%;
  flex-shrink: 0;
  background-color: var(--template-surface-hover);
}

.template-fragment .product-button-icon {
  width: 1.5rem;
  height: 1.5rem;
}

.template-fragment .product-button-info {
  flex: 1;
  min-width: 0;
}

.template-fragment .product-button-title {
  font-weight: 600;
  font-size: 1.125rem;
  color: var(--template-text);
}

.template-fragment .product-button-description {
  margin-top: 0.25rem;
  color: var(--template-text-muted);
}

.template-fragment .product-button-reviews {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  margin-top: 0.5rem;
  transition: opacity 0.2s ease;
}

.template-fragment .product-button-reviews:hover {
  opacity: 0.8;
}

.template-fragment .product-button-no-reviews {
  font-size: 0.75rem;
  margin-top: 0.5rem;
  color: var(--template-text-muted);
}

.template-fragment .product-button-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 1rem;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.template-fragment .product-button-price {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--cms-primary);
}

.template-fragment .product-button-purchased {
  flex-shrink: 0;
  opacity: 0.6;
}

.template-fragment .product-button-buy {
  flex-shrink: 0;
}

.template-fragment .product-button-loader {
  width: 1rem;
  height: 1rem;
  margin-right: 0.5rem;
}

/* ===================================
   BACK BUTTON (alternate style)
   =================================== */

.template-fragment .back-button {
  margin-bottom: 1.5rem;
}

/* ===================================
   ARTICLE & PAYWALL SECTIONS
   =================================== */

.template-fragment .article-section {
  margin-bottom: 2rem;
}

.template-fragment .paywall-section {
  margin-top: 2rem;
}

.template-fragment .author-card-section {
  margin-top: 2rem;
}

/* ===================================
   AUTHOR INFO ROW
   =================================== */

.template-fragment .author-info-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  color: var(--template-text-muted);
  margin-bottom: 1.5rem;
}

.template-fragment .article-meta-item {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.875rem;
}

.template-fragment .article-meta-icon {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
  vertical-align: middle;
  margin-top: -0.125rem;
}

/* Navigation avatar link */
.template-fragment .nav-avatar-link {
  display: flex;
  align-items: center;
  transition: opacity 0.2s ease;
}

.template-fragment .nav-avatar-link:hover {
  opacity: 0.8;
}

.template-fragment .nav-avatar {
  border: 2px solid var(--cms-primary-glow, rgba(124, 58, 237, 0.5));
}

/* Sheet content (mobile menu) */
.template-fragment.sheet-content,
.template-fragment .sheet-content {
  background-color: var(--template-bg, hsl(0 0% 7%));
  border-left: 1px solid var(--template-border, hsl(0 0% 20%));
  color: var(--template-text, hsl(0 0% 95%));
}

/* Dialog header */
.template-fragment .dialog-header {
  color: var(--template-text, hsl(0 0% 95%));
}

.template-fragment .author-info-row .author-avatar-sm {
  width: 2rem;
  height: 2rem;
  min-width: 2rem;
  min-height: 2rem;
  border-radius: 50%;
  overflow: hidden;
  object-fit: cover;
}

.template-fragment .author-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  transition: color 0.2s ease;
}

.template-fragment .author-link:hover {
  color: var(--cms-primary);
}

.template-fragment .author-link-name {
  font-weight: 500;
}

/* ===================================
   RESPONSIVE
   =================================== */

@media (max-width: 768px) {
  .template-fragment .site-hero-title {
    font-size: 1.75rem;
  }
  
  .template-fragment .site-hero-description {
    font-size: 1rem;
  }
  
  .template-fragment .article-card-image,
  .template-fragment .article-list-image {
    height: 10rem;
  }

  .template-fragment .subscribe-hero-title {
    font-size: 1.75rem;
  }

  .template-fragment .subscribe-hero-description {
    font-size: 1rem;
  }
}

/* ===================================
   PAYWALL CTA
   =================================== */

.paywall-cta-fragment {
  background-color: #111111;
  border: 1px solid #222222;
  color: #ffffff;
  border-radius: 1rem;
}

.paywall-cta-fragment h3,
.paywall-cta-fragment h4 {
  color: #ffffff !important;
}

.paywall-cta-fragment p,
.paywall-cta-fragment .text-muted-foreground {
  color: #888888 !important;
}

.paywall-cta-fragment a {
  color: var(--cms-primary, #00ff66);
}

.paywall-cta-fragment a:hover {
  color: var(--cms-secondary, #00cc52);
}

.paywall-cta-fragment button {
  background-color: var(--cms-primary, #00ff66);
  color: #000000;
  font-weight: 600;
  border-radius: 9999px;
  transition: all 0.2s ease;
}

.paywall-cta-fragment button:hover {
  box-shadow: 0 0 20px var(--cms-primary-glow, rgba(0, 255, 102, 0.5));
  transform: scale(1.02);
}

.paywall-cta-fragment input {
  background-color: #0a0a0a;
  border: 1px solid #222222;
  color: #ffffff;
  border-radius: 9999px;
}

.paywall-cta-fragment input::placeholder {
  color: #666666;
}

.paywall-cta-fragment input:focus {
  border-color: var(--cms-primary, #00ff66);
  outline: none;
}

/* Product cards in paywall */
.paywall-cta-fragment .product-card,
.paywall-cta-fragment > div > div > div {
  border: 1px solid #222222;
  background-color: #111111;
  border-radius: 0.75rem;
}

.paywall-cta-fragment .product-card:hover,
.paywall-cta-fragment > div > div > div:hover {
  border-color: var(--cms-primary, #00ff66);
}

/* Fade gradient for premium content */
.paywall-cta-fragment .bg-gradient-to-t {
  background: linear-gradient(to top, #0a0a0a, transparent) !important;
}

/* ===================================
   AUTHOR SIGNUP FORM (inline EmailOnlySignup)
   =================================== */

.template-fragment .author-signup-form {
  width: 100%;
  text-align: center;
}

.template-fragment .author-signup-form .author-email-input,
.template-fragment .author-card .author-email-input {
  background-color: var(--template-surface-hover) !important;
  border: 1px solid var(--template-border-hover) !important;
  border-radius: 9999px !important;
  padding: 0.75rem 1.25rem !important;
  padding-left: 2.5rem !important;
  color: var(--template-text) !important;
  font-size: 1rem !important; /* >= 16px to prevent iOS zoom */
  width: 100%;
}

.template-fragment .author-signup-form .author-email-input::placeholder {
  color: var(--template-text-muted) !important;
}

.template-fragment .author-signup-form .author-email-input:focus {
  border-color: var(--cms-primary) !important;
  outline: none;
}

.template-fragment .author-signup-form .btn-primary {
  width: 100%;
  border-radius: 9999px;
}

/* Prevent iOS zoom on all form inputs */
.template-fragment input[type="email"],
.template-fragment input[type="text"] {
  font-size: 1rem; /* 16px minimum */
}

/* ===================================
   NAVIGATION SLOTS FOR CUSTOM JS
   =================================== */

/* Desktop slot for custom actions (dark mode toggle, etc.) */
.template-fragment .nav-actions-slot {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Mobile slot for custom actions */
.template-fragment .nav-mobile-actions-slot {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--template-border);
  margin-bottom: 0.5rem;
}

.template-fragment .nav-mobile-actions-slot:empty {
  display: none;
}

/* Dark mode toggle button (injected via custom JS) */
.template-fragment .dark-mode-toggle-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.5rem;
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--template-text);
  transition: all 0.2s ease;
}

.template-fragment .dark-mode-toggle-btn svg {
  width: 1.25rem;
  height: 1.25rem;
}

.template-fragment .dark-mode-toggle-btn:hover {
  background: var(--template-surface-hover);
  color: var(--cms-primary);
}
