/* ==========================================================================
   Smile4mation — Dedicated Blog & Rich Content Typography System
   Ensures 100% pixel-perfect spacing parity between Editor & Live Site,
   fluid responsive media, reading tools, and album-style lightbox.
   ========================================================================== */

:root {
  --blog-primary: #FB776B;
  --blog-primary-dark: #E8604F;
  --blog-ink: #111827;
  --blog-text: #374151;
  --blog-muted: #6B7280;
  --blog-border: #E5E7EB;
  --blog-bg-soft: #F9FAFB;
}

/* ── Reading Progress Bar ─────────────────────────────────────────────────── */
#reading-progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 3.5px;
  background: linear-gradient(90deg, #FB776B 0%, #E8604F 100%);
  z-index: 9999;
  width: 0%;
  transition: width 0.08s ease-out;
  box-shadow: 0 1px 3px rgba(251, 119, 107, 0.4);
}

/* ── Article Content Typography ───────────────────────────────────────────── */
.article-content {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 1.0625rem; /* 17px */
  line-height: 1.82;
  color: var(--blog-text);
  letter-spacing: -0.011em;
  word-break: break-word;
}

@media (max-width: 640px) {
  .article-content {
    font-size: 1rem; /* 16px */
    line-height: 1.75;
  }
}

/* Lead paragraph pullout / first paragraph styling */
.article-content > p:first-of-type {
  font-size: 1.1875rem;
  line-height: 1.8;
  color: #1F2937;
  font-weight: 400;
}

@media (max-width: 640px) {
  .article-content > p:first-of-type {
    font-size: 1.0625rem;
  }
}

/* Standard Paragraphs & Spacing */
.article-content p {
  margin-top: 0;
  margin-bottom: 1.35rem;
}

.article-content p:last-child {
  margin-bottom: 0;
}

/* Normalize & collapse accidental double-enters / empty paragraphs */
.article-content p:empty,
.article-content p > br:only-child {
  display: none !important;
}

/* Headings */
.article-content h1,
.article-content h2,
.article-content h3,
.article-content h4,
.article-content h5,
.article-content h6 {
  font-family: 'Geist', 'Inter', -apple-system, sans-serif;
  color: var(--blog-ink);
  font-weight: 800;
  line-height: 1.3;
  letter-spacing: -0.025em;
  scroll-margin-top: 100px;
}

.article-content h2 {
  font-size: 1.75rem; /* 28px */
  margin-top: 2.75rem;
  margin-bottom: 0.85rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid #F3F4F6;
}

@media (max-width: 640px) {
  .article-content h2 {
    font-size: 1.45rem;
    margin-top: 2rem;
  }
}

.article-content h3 {
  font-size: 1.35rem; /* 21.6px */
  margin-top: 2.25rem;
  margin-bottom: 0.65rem;
}

@media (max-width: 640px) {
  .article-content h3 {
    font-size: 1.2rem;
    margin-top: 1.75rem;
  }
}

.article-content h4 {
  font-size: 1.15rem;
  margin-top: 1.75rem;
  margin-bottom: 0.5rem;
  font-weight: 700;
}

/* Blockquotes */
.article-content blockquote {
  position: relative;
  margin: 2.25rem 0;
  padding: 1.35rem 1.75rem 1.35rem 1.75rem;
  border-left: 4px solid var(--blog-primary);
  background: rgba(251, 119, 107, 0.05);
  border-radius: 0 1rem 1rem 0;
  font-style: italic;
  font-size: 1.15rem;
  line-height: 1.75;
  color: #1F2937;
}

.article-content blockquote p {
  margin-bottom: 0.5rem;
}

.article-content blockquote p:last-child {
  margin-bottom: 0;
}

/* Lists */
.article-content ul {
  list-style-type: disc;
  margin: 0 0 1.5rem 1.5rem;
  padding: 0;
}

.article-content ol {
  list-style-type: decimal;
  margin: 0 0 1.5rem 1.5rem;
  padding: 0;
}

.article-content li {
  margin-bottom: 0.5rem;
  padding-left: 0.35rem;
  line-height: 1.75;
}

.article-content li::marker {
  color: var(--blog-primary);
}

/* Links */
.article-content a {
  color: var(--blog-primary);
  text-decoration: underline;
  text-underline-offset: 3px;
  font-weight: 500;
  transition: color 0.15s ease-in-out;
}

.article-content a:hover {
  color: var(--blog-primary-dark);
}

/* Strong & Emphasis */
.article-content strong,
.article-content b {
  color: var(--blog-ink);
  font-weight: 700;
}

/* Horizontal Rule */
.article-content hr {
  border: 0;
  border-top: 1px solid var(--blog-border);
  margin: 3rem 0;
}

/* Inline Code */
.article-content code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.875em;
  background-color: #F3F4F6;
  color: #E8604F;
  padding: 0.2rem 0.45rem;
  border-radius: 0.375rem;
  border: 1px solid #E5E7EB;
}

/* ── Responsive In-Content Media & Lightbox Triggers ──────────────────────── */
.article-content img {
  width: 100% !important;
  max-width: 100% !important;
  height: 320px !important;
  object-fit: cover !important;
  object-position: center !important;
  display: block;
  margin: 2.25rem auto;
  border-radius: 1.5rem !important;
  border: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.08);
  cursor: zoom-in;
  transition: transform 0.5s ease, box-shadow 0.3s ease, opacity 0.2s ease;
}

@media (min-width: 640px) {
  .article-content img {
    height: 420px !important;
  }
}

@media (min-width: 1024px) {
  .article-content img {
    height: 480px !important;
  }
}

.article-content img:hover {
  transform: scale(1.02);
  box-shadow: 0 12px 28px -4px rgba(0, 0, 0, 0.14);
  opacity: 0.98;
}

/* In-content image when wrapped in interactive frame matching top featured hero */
.article-content .article-img-frame img,
.post-hero-media img {
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 100% !important;
  min-width: 100% !important;
  min-height: 100% !important;
  max-width: 100% !important;
  max-height: 100% !important;
  margin: 0 !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  object-fit: cover !important;
  object-position: center !important;
  transition: transform 0.5s ease !important;
}

.article-content .article-img-frame:hover img,
.post-hero-media:hover img {
  transform: scale(1.05) !important;
}

.article-content figure {
  margin: 2.5rem auto;
  text-align: center;
}

.article-content figcaption {
  font-size: 0.85rem;
  color: var(--blog-muted);
  margin-top: 0.75rem;
  text-align: center;
  font-style: italic;
}

/* If an image is enclosed in a paragraph alone */
.article-content p:has(> img:only-child) {
  margin-top: 2rem;
  margin-bottom: 2rem;
  text-align: center;
}

/* ── Floating & Sticky Social Share Bar ───────────────────────────────────── */
.share-floating-bar {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 0.75rem;
  background: #FFFFFF;
  border: 1px solid #E5E7EB;
  border-radius: 9999px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
}

.share-action-btn {
  width: 40px;
  height: 40px;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #6B7280;
  background: #F9FAFB;
  border: 1px solid #F3F4F6;
  font-size: 0.875rem;
  transition: all 0.2s ease;
  cursor: pointer;
}

.share-action-btn:hover {
  transform: translateY(-2px);
  color: #FFFFFF;
}

.share-action-btn.share-fb:hover { background-color: #1877F2; border-color: #1877F2; }
.share-action-btn.share-tw:hover { background-color: #000000; border-color: #000000; }
.share-action-btn.share-wa:hover { background-color: #25D366; border-color: #25D366; }
.share-action-btn.share-li:hover { background-color: #0A66C2; border-color: #0A66C2; }
.share-action-btn.share-copy:hover { background-color: var(--blog-primary); border-color: var(--blog-primary); }

/* ── Toast Notification ───────────────────────────────────────────────────── */
#blog-toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: #111827;
  color: #FFFFFF;
  padding: 0.75rem 1.25rem;
  border-radius: 0.85rem;
  font-family: 'Inter', sans-serif;
  font-size: 0.875rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.625rem;
  box-shadow: 0 12px 30px -4px rgba(0, 0, 0, 0.3);
  z-index: 10000;
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
}

#blog-toast.show {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

/* ── Table of Contents (TOC) ──────────────────────────────────────────────── */
.blog-toc-card {
  background: #F9FAFB;
  border: 1px solid #E5E7EB;
  border-radius: 1rem;
  padding: 1.25rem 1.5rem;
  margin: 2rem 0;
}

.blog-toc-title {
  font-family: 'Geist', 'Inter', sans-serif;
  font-weight: 800;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #111827;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.blog-toc-list {
  list-style: none !important;
  margin: 0 !important;
  padding: 0 !important;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.blog-toc-list a {
  font-size: 0.925rem;
  color: #4B5563;
  text-decoration: none !important;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: color 0.15s ease, transform 0.15s ease;
}

.blog-toc-list a:hover {
  color: var(--blog-primary);
  transform: translateX(4px);
}

.blog-toc-list .toc-h3 {
  padding-left: 1.25rem;
  font-size: 0.875rem;
  color: #6B7280;
}

/* ==========================================================================
   WYSIWYG PARITY: Quill Snow Editor Customizations
   Forces the Quill editor to mirror the exact typography & margins above!
   ========================================================================== */
.ql-toolbar.ql-snow {
  border-top-left-radius: 0.75rem !important;
  border-top-right-radius: 0.75rem !important;
  border-color: #E5E7EB !important;
  background-color: #F9FAFB !important;
  padding: 0.75rem !important;
}

.ql-container.ql-snow {
  border-bottom-left-radius: 0.75rem !important;
  border-bottom-right-radius: 0.75rem !important;
  border-color: #E5E7EB !important;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
}

.ql-snow .ql-editor {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
  font-size: 1.0625rem !important; /* Exactly 17px */
  line-height: 1.82 !important;
  color: var(--blog-text) !important;
  padding: 1.5rem 1.75rem !important;
  min-height: 380px !important;
}

.ql-snow .ql-editor.ql-blank::before {
  color: #9CA3AF !important;
  font-style: normal !important;
  left: 1.75rem !important;
  right: 1.75rem !important;
  font-size: 1.0625rem !important;
}

/* Editor Paragraphs — Mirroring live site */
.ql-snow .ql-editor p {
  margin-top: 0 !important;
  margin-bottom: 1.35rem !important; /* Exact visual gap on single Enter */
  line-height: 1.82 !important;
  color: var(--blog-text) !important;
}

/* Editor Headings */
.ql-snow .ql-editor h2 {
  font-family: 'Geist', 'Inter', sans-serif !important;
  font-size: 1.75rem !important;
  font-weight: 800 !important;
  color: var(--blog-ink) !important;
  margin-top: 2.5rem !important;
  margin-bottom: 0.85rem !important;
  line-height: 1.3 !important;
}

.ql-snow .ql-editor h3 {
  font-family: 'Geist', 'Inter', sans-serif !important;
  font-size: 1.35rem !important;
  font-weight: 700 !important;
  color: var(--blog-ink) !important;
  margin-top: 2rem !important;
  margin-bottom: 0.65rem !important;
  line-height: 1.4 !important;
}

.ql-snow .ql-editor h4 {
  font-family: 'Geist', 'Inter', sans-serif !important;
  font-size: 1.15rem !important;
  font-weight: 700 !important;
  color: #1F2937 !important;
  margin-top: 1.75rem !important;
  margin-bottom: 0.5rem !important;
}

/* Editor Blockquotes */
.ql-snow .ql-editor blockquote {
  border-left: 4px solid var(--blog-primary) !important;
  background: rgba(251, 119, 107, 0.05) !important;
  padding: 1.25rem 1.5rem !important;
  margin: 2rem 0 !important;
  border-radius: 0 1rem 1rem 0 !important;
  font-style: italic !important;
  color: #1F2937 !important;
  font-size: 1.15rem !important;
  line-height: 1.75 !important;
}

/* Editor Images */
.ql-snow .ql-editor img {
  width: 100% !important;
  max-width: 100% !important;
  height: 360px !important;
  object-fit: cover !important;
  object-position: center !important;
  border-radius: 1.5rem !important;
  margin: 1.75rem auto !important;
  display: block !important;
  border: 1px solid #E5E7EB !important;
  box-shadow: 0 4px 15px -2px rgba(0, 0, 0, 0.06) !important;
}
