@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700&family=Fira+Sans:wght@400;600;700&family=Lora:wght@400;600;700&family=Montserrat:wght@400;600;700&family=Poppins:wght@400;600;700&family=Playfair+Display:wght@400;600;700&family=Space+Mono:wght@400;700&display=swap');

/* ==========================================================================
   #BLOG SHARED STYLES
   ========================================================================== */

/* Disable scroll-snap on blog pages for TOC navigation */
html:has(.blogs-page) {
    scroll-snap-type: none !important;
    height: auto !important;
    /* Remove h-full constraint from Tailwind */
}

/* Fix sticky TOC by removing overflow constraint on the root container */
.landing-root.blogs-page {
    overflow: visible !important;
}

/* Remove height constraints on blog pages to allow scrolling */
.blogs-page,
.blogs-page~body,
body:has(.blogs-page) {
    height: auto !important;
}

body:has(.blogs-page) #app {
    height: auto !important;
}

.blogs-page main section {
    scroll-snap-align: none !important;
    scroll-snap-stop: normal !important;
}

/* Fallback for browsers that don't support :has() */
.blogs-page~* main section,
.blogs-page main section {
    scroll-snap-align: none !important;
    scroll-snap-stop: normal !important;
}

.blogs-preview {
    padding: 1rem 5% 0.5rem;
    background: #f9fafb;
    height: auto;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 100vw;
    box-sizing: border-box;
}

.blogs-preview .section-header {
    margin: 0 0 0.5rem 0;
    padding: 0.5rem 1rem 0;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

.blogs-preview .section-title {
    font-size: 3rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    margin: 0 0 16px 0;
    color: #1e293b;
    order: 1;
}

@media (max-width: 640px) {
    .blogs-preview .section-title {
        font-size: 1.75rem !important;
    }
}

@media (max-width: 480px) {
    .blogs-preview .section-title {
        font-size: 1.75rem !important;
    }
}

.blogs-preview .section-eyebrow {
    font-size: 0.75rem;
    margin: 0 0 0.25rem 0;
    order: 2;
}

.blogs-preview .section-subtitle {
    font-size: 0.9rem;
    margin: 0;
    order: 3;
}

.blogs-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
    margin: 0.5rem auto;
    max-width: 1400px;
    padding: 1rem 1rem;
    width: 100%;
    flex: 1;
    overflow: hidden;
}

.blog-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.3rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    text-align: left;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
    width: 100%;
    max-width: 300px;
    height: fit-content;
}

.blog-card-link-wrapper {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
}

.blog-card-link {
    text-decoration: none;
    color: inherit;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.blog-card:hover {
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

.blog-card-media {
    margin: -1.5rem -1.5rem 1rem;
    border-radius: 16px 16px 0 0;
    overflow: hidden;
    background: #e5e7eb;
}

.blog-card-media img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    display: block;
}

.blog-card h3 {
    font-size: 1rem;
    margin: 0;
    line-height: 1.3;
}

.blog-card-summary {
    margin: 0;
    color: #4b5563;
    font-size: 0.95rem;
}

.blog-card-author {
    margin: 0;
    color: #6b7280;
    font-size: 0.95rem;
}

.blog-card-compact {
    min-height: unset;
    padding: 1rem;
    justify-content: flex-start;
    gap: 0.5rem;
}

.blog-card-compact .blog-card-media {
    margin: -1rem -1rem 0.5rem;
}

.blog-card-compact h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.blog-card-compact .blog-card-author {
    font-size: 1rem;
}

.blog-card-read {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-weight: 600;
    text-decoration: none;
    color: #111827;
    margin-top: 0.5rem;
}

.blog-card:hover .blog-card-read {
    text-decoration: underline;
}

.blogs-preview-footer {
    margin-top: 0.5rem;
    text-align: center;
    padding: 0.5rem 0 1rem 0;
}

/* ==========================================================================
   #BLOG LIST PAGE
   ========================================================================== */

.blogs-page main {
    padding: calc(var(--header-height) + 2rem) 5% 4rem;
}

.blog-list-hero {
    text-align: center;
    padding: 3rem 0 2rem;
}

.blog-list-hero h1 {
    font-size: 2.5rem;
    margin: 0.5rem 0;
}

.blog-list-section {
    margin-top: 3rem;
}

.blogs-page .blogs-grid {
    display: flex;
    flex-direction: column;
    gap: 1.75rem;
    align-items: center;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    width: 100%;
}

.blogs-page .blog-card {
    width: min(1100px, 100%);
    max-width: 1100px;
}

.blogs-page .blog-card-compact {
    min-height: auto;
    justify-content: flex-start;
}

/* ==========================================================================
   #BLOG DETAIL PAGE
   ========================================================================== */

.blog-detail-hero {
    text-align: left;
    padding: 3rem 5% 1rem;
    max-width: 1240px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: minmax(0, 260px) minmax(0, 1fr);
    column-gap: 2.75rem;
}

.blog-detail-hero>* {
    grid-column: 2 / -1;
}

.blog-detail-hero h1 {
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 700;
    margin-bottom: 1rem;
}

.blog-detail-hero .section-subtitle {
    max-width: 800px;
    margin: 0.5rem auto 0;
}

.blog-detail-meta {
    color: #6b7280;
    margin: 1rem 0;
    text-align: center;
}

.blog-preview-banner {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.75rem;
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fcd34d;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.95rem;
}

.blog-detail-layout {
    display: grid;
    grid-template-columns: minmax(0, 260px) minmax(0, 1fr);
    gap: 2.5rem;
    max-width: 1240px;
    margin: 0 auto 4rem;
    padding: 0 5%;
    align-items: start;
}

.blog-detail-toc {
    position: sticky;
    top: calc(var(--header-height) + 20px);
    align-self: start;
    padding-top: 1rem;
    max-height: calc(100vh - var(--header-height) - 40px);
    overflow: auto;
    padding-right: 0.5rem;
}

.blog-detail-toc ul {
    list-style: none;
    padding: 0;
    margin: 0.75rem 0 0;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.blog-detail-toc a {
    text-decoration: none;
    color: #9ca3af;
    font-weight: 500;
    transition: color 0.2s;
    display: block;
    padding: 0.25rem 0.35rem;
    border-radius: 6px;
}

.blog-detail-toc a:hover,
.blog-detail-toc a:focus {
    color: #4b5563;
}

.blog-detail-toc a.active {
    color: #111827;
    font-weight: 700;
}

.blog-detail-body {
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
}

.blog-detail-hero-image {
    grid-column: 2 / 3;
    margin: 2rem 0 0;
    max-width: 100%;
    border-radius: 16px;
    overflow: hidden;
}

.blog-detail-hero-image img {
    width: 100%;
    height: auto;
    display: block;
}

.blog-detail-content {
    text-align: left;
    scroll-margin-top: calc(var(--header-height) + 32px);
    border: none;
    padding: 0;
    background: transparent;
}

.blog-detail-heading {
    margin: 0 0 1rem;
    line-height: 1.3;
}

.blog-detail-heading p,
.blog-detail-heading h1,
.blog-detail-heading h2,
.blog-detail-heading h3 {
    margin: 0;
}

.blog-detail-rich p,
.blog-detail-heading p {
    margin-bottom: 1rem;
    line-height: 1.7;
    color: #374151;
}

.blog-detail-rich a {
    color: #2563eb !important;
    text-decoration: underline;
}

.blog-detail-rich blockquote {
    margin: 1.5rem 0;
    padding: 0.35rem 1.4rem;
    border-left: 4px solid #1f2937;
    background: linear-gradient(90deg, rgba(15, 23, 42, 0.05), rgba(15, 23, 42, 0));
    font-style: italic;
    color: #1f2937;
    border-radius: 8px;
}

.blog-detail-rich pre {
    background: linear-gradient(180deg, #0f172a 0%, #0b1220 100%);
    color: #e5e7eb;
    padding: 1rem 1.25rem;
    border-radius: 12px;
    border: 1px solid #111827;
    overflow-x: auto;
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
    line-height: 1.6;
    margin: 1.25rem 0;
    white-space: pre;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.28), 0 6px 18px rgba(0, 0, 0, 0.18);
}

.blog-detail-rich ul,
.blog-detail-rich ol {
    margin: 1rem 0 1.25rem;
    padding-left: 1.5rem;
}

.blog-detail-rich ul {
    list-style: disc;
}

.blog-detail-rich ol {
    list-style: decimal;
}

.blog-detail-rich li {
    margin: 0.35rem 0;
}

.blog-detail-rich ul ul {
    list-style: circle;
}

.blog-detail-rich ul ul ul {
    list-style: square;
}

.blog-detail-rich code {
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
    background: #f3f4f6;
    color: #111827;
    padding: 0.2rem 0.4rem;
    border-radius: 6px;
}

.blog-detail-rich pre code {
    background: transparent;
    color: inherit;
    padding: 0;
}

.blog-detail-rich img {
    max-width: 100%;
    height: auto;
    display: block;
    border-radius: 12px;
    margin: 0 auto;
}

.blog-image-card {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 1rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    margin: 2rem auto;
    width: fit-content;
    max-width: 100%;
    box-sizing: border-box;
}

.blog-image-card img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 8px;
}

.blog-detail-rich img[data-inline="true"] {
    display: inline-block;
    padding: 0;
    border: none;
    background: none;
    box-shadow: none;
}

.blog-detail-rich figure.blog-image-figure {
    margin: 1.5rem auto;
    text-align: center;
}

.blog-detail-rich figure.inline-figure {
    display: inline-block;
    margin: 0 0.75rem 1.25rem 0;
    vertical-align: top;
}

.blog-detail-rich figure.inline-figure img {
    margin: 0;
}

.blog-detail-rich .blog-image-caption,
.blog-detail-rich figcaption.blog-image-caption {
    font-size: 0.9rem;
    color: #6b7280;
    margin-top: 0.35rem;
}

.blog-detail-rich img+.blog-image-caption {
    display: block;
}

.blog-detail-rich .blog-image-caption {
    text-align: center;
}

.blog-detail-rich .ql-font-sans {
    font-family: "Inter", "Helvetica Neue", Arial, sans-serif;
}

.blog-detail-rich .ql-font-poppins,
.blog-detail-heading .ql-font-poppins {
    font-family: "Poppins", "Inter", "Helvetica Neue", Arial, sans-serif;
}

.blog-detail-rich .ql-font-serif {
    font-family: "Georgia", "Times New Roman", serif;
}

.blog-detail-rich .ql-font-lora,
.blog-detail-heading .ql-font-lora {
    font-family: "Lora", "Georgia", "Times New Roman", serif;
}

.blog-detail-rich .ql-font-playfair,
.blog-detail-heading .ql-font-playfair {
    font-family: "Playfair Display", "Times New Roman", serif;
}

.blog-detail-rich .ql-font-montserrat,
.blog-detail-heading .ql-font-montserrat {
    font-family: "Montserrat", "Inter", "Helvetica Neue", Arial, sans-serif;
}

.blog-detail-rich .ql-font-fira,
.blog-detail-heading .ql-font-fira {
    font-family: "Fira Sans", "Inter", "Helvetica Neue", Arial, sans-serif;
}

.blog-detail-rich .ql-font-mono,
.blog-detail-heading .ql-font-mono {
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

.blog-detail-rich .ql-font-space-mono,
.blog-detail-heading .ql-font-space-mono {
    font-family: "Space Mono", "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

.blog-detail-rich .ql-size-small,
.blog-detail-heading .ql-size-small {
    font-size: 0.95rem;
}

.blog-detail-rich .ql-size-normal,
.blog-detail-heading .ql-size-normal {
    font-size: 1.05rem;
}

.blog-detail-rich .ql-size-large,
.blog-detail-heading .ql-size-large {
    font-size: 1.28rem;
}

.blog-detail-rich .ql-size-huge,
.blog-detail-heading .ql-size-huge {
    font-size: 1.6rem;
}

.blog-share {
    padding: 0 5% 4rem;
    text-align: center;
}

.blog-share-inline {
    max-width: 1240px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    justify-content: center;
}

.share-label {
    font-weight: 700;
    color: #111827;
    letter-spacing: 0.02em;
}

.blog-share-actions {
    display: flex;
    gap: 0.5rem;
}

.share-btn {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #111827;
    font-weight: 700;
    text-decoration: none;
    transition: transform 0.12s ease, box-shadow 0.12s ease, opacity 0.12s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border: 1px solid #e5e7eb;
    padding: 0;
    background: transparent;
    overflow: hidden;
}

.share-btn img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.share-btn span {
    font-size: 1rem;
    line-height: 1;
}

.share-btn:hover,
.share-btn:focus {
    transform: translateY(-1px) scale(1.02);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.share-whatsapp,
.share-twitter,
.share-linkedin,
.share-facebook,
.share-reddit {
    background: transparent;
    border-color: #e5e7eb;
}

.share-copy {
    background: #111827;
    border-color: #111827;
    color: #ffffff;
}

.blog-detail-rich p,
.blog-detail-heading p,
.blog-detail-rich h2,
.blog-detail-rich h3,
.blog-detail-rich h4,
.blog-detail-rich h5,
.blog-detail-rich h6,
.blog-detail-rich li,
.blog-detail-rich blockquote {
    white-space: normal;
    overflow-wrap: break-word;
}

@media (max-width: 1024px) {
    .blog-detail-layout {
        grid-template-columns: 1fr;
    }

    .blog-detail-toc {
        display: none;
    }

    .blog-detail-hero {
        grid-template-columns: 1fr;
        column-gap: 1rem;
    }

    .blog-detail-hero>* {
        grid-column: 1 / -1;
    }

    .blog-detail-hero-image {
        grid-column: 1 / -1;
        margin: 1.5rem auto 0;
    }
}



/* ===========================
   FORCE BLOG TEXT WRAPPING
   Paste at END of file
   =========================== */

/* 1) Make sure grid/flex items can shrink (common reason wrapping "doesn't happen") */
.blog-detail-layout > *,
.blog-detail-body,
.blog-detail-content {
  min-width: 0 !important;
}

/* 2) Force wrapping on ALL rich text nodes (including spans from Quill) */
.blog-detail-rich,
.blog-detail-heading {
  white-space: normal !important;
  overflow-wrap: anywhere !important;
  word-break: break-word !important;
}

/* Quill produces lots of inline spans/strong/em — override nowrap if any */
.blog-detail-rich p,
.blog-detail-rich li,
.blog-detail-rich blockquote,
.blog-detail-rich h1, .blog-detail-rich h2, .blog-detail-rich h3,
.blog-detail-rich h4, .blog-detail-rich h5, .blog-detail-rich h6,
.blog-detail-rich span,
.blog-detail-rich strong,
.blog-detail-rich em,
.blog-detail-rich a,
.blog-detail-heading p,
.blog-detail-heading li,
.blog-detail-heading blockquote,
.blog-detail-heading h1, .blog-detail-heading h2, .blog-detail-heading h3,
.blog-detail-heading h4, .blog-detail-heading h5, .blog-detail-heading h6,
.blog-detail-heading span,
.blog-detail-heading strong,
.blog-detail-heading em,
.blog-detail-heading a {
  white-space: normal !important;
  overflow-wrap: anywhere !important;
  word-break: break-word !important;
}

/* 3) Keep code blocks behaving like code */
.blog-detail-rich pre,
.blog-detail-rich pre * {
  white-space: pre-wrap !important;     /* preserves newlines, allows wrapping */
  overflow-wrap: anywhere !important;   /* breaks very long tokens */
  word-break: break-word !important;
  overflow-x: hidden !important;        /* no horizontal scroll */
}
