/* =====================================================================
   Sweet Dear Words: blog grid, category menu, pagination and post pages
   Shared by blog.html and post.html.
   ===================================================================== */
:root { --sdw-blue: #4A90E2; --sdw-blue-dark: #3a7bc8; }

.sdw-container { max-width: 1280px; margin: 0 auto; padding-left: 16px; padding-right: 16px; }
@media (min-width: 768px) { .sdw-container { padding-left: 32px; padding-right: 32px; } }

/* ---------- category bar + dropdowns ---------- */
.browse-section { scroll-margin-top: 80px; }
.cat-bar { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.cat-bar .category-tag { font-size: 13px; padding: 8px 18px; display: inline-flex; align-items: center; gap: 6px; font-family: 'Poppins', sans-serif; }
.dd-chevron { transition: transform 0.2s ease; }
.cat-dd.open .dd-chevron { transform: rotate(180deg); }
.cat-dd { position: relative; }
.cat-dd-panel {
    display: none; position: absolute; left: 0; top: calc(100% + 6px); z-index: 40;
    min-width: 250px; max-width: calc(100vw - 32px); max-height: min(70vh, 480px); overflow-y: auto;
    background: #ffffff; border: 1px solid #e5e7eb; border-radius: 16px; padding: 8px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.14);
}
.cat-dd-panel::before { content: ''; position: absolute; top: -8px; left: 0; right: 0; height: 8px; }
.cat-dd-panel.align-right { left: auto; right: 0; }
.cat-dd.open .cat-dd-panel { display: block; }
.dd-item {
    display: block; width: 100%; text-align: left; padding: 10px 14px; border-radius: 10px;
    font-size: 14px; font-weight: 600; color: #111111; background: transparent; border: 0; cursor: pointer;
    font-family: 'Poppins', sans-serif; transition: background 0.2s ease, color 0.2s ease;
}
.dd-item:hover, .dd-item:focus-visible { background: #f3f4f6; color: var(--sdw-blue); outline: none; }
.dd-item.active { background: rgba(74, 144, 226, 0.12); color: #2f6db5; }
.dd-group { padding: 12px 14px 6px; margin-top: 6px; border-top: 1px solid #e5e7eb; font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: #9ca3af; }

/* ---------- category colours ---------- */
.cat-birthday { --c: #2563eb; --t1: #eff6ff; --t2: #dbeafe; }
.cat-celebrations { --c: #7c3aed; --t1: #f5f3ff; --t2: #ede9fe; }
.cat-love { --c: #db2777; --t1: #fdf2f8; --t2: #fce7f3; }
.cat-inspiration { --c: #059669; --t1: #ecfdf5; --t2: #d1fae5; }
.cat-tips { --c: #b45309; --t1: #fffbeb; --t2: #fef3c7; }
.cat-stories { --c: #4f46e5; --t1: #eef2ff; --t2: #e0e7ff; }

/* ---------- cards ---------- */
.blog-grid { display: grid; gap: 24px; grid-template-columns: 1fr; }
@media (min-width: 768px) { .blog-grid { grid-template-columns: repeat(2, 1fr); gap: 28px; } }
@media (min-width: 1024px) { .blog-grid { grid-template-columns: repeat(3, 1fr); gap: 32px; } }
.blog-article { position: relative; display: flex; flex-direction: column; background: #ffffff; border: 1px solid #eef0f2; border-radius: 12px; overflow: hidden; transition: all 0.3s ease-in-out; }
.blog-article:hover { box-shadow: 0 12px 40px rgba(0, 0, 0, 0.1); transform: translateY(-4px); }
.blog-article.is-hidden { display: none; }
.card-thumb { height: 190px; overflow: hidden; background: linear-gradient(135deg, var(--t1, #eff6ff), var(--t2, #dbeafe)); }
.card-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.4s ease-in-out; }
.blog-article:hover .card-thumb img { transform: scale(1.05); }
.card-body { padding: 24px; display: flex; flex-direction: column; flex: 1; }
.card-pills { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.card-title { font-size: 1.15rem; line-height: 1.35; font-weight: 600; color: #000000; margin-bottom: 0.6rem; }
.card-link { color: inherit; text-decoration: none; }
.card-link::after { content: ''; position: absolute; inset: 0; z-index: 1; }
.card-link:focus-visible { outline: 3px solid var(--sdw-blue); outline-offset: -3px; border-radius: 12px; }
.card-excerpt { color: #4b5563; font-size: 0.875rem; font-weight: 300; line-height: 1.6; margin-bottom: 1.1rem; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.card-meta { font-size: 12px; color: #6b7280; font-weight: 300; }
.read-more { color: var(--sdw-blue); font-weight: 600; font-size: 0.875rem; transition: color 0.3s ease-in-out; }
.blog-article:hover .read-more { color: var(--sdw-blue-dark); }
.pill { display: inline-block; font-size: 11px; font-weight: 600; padding: 4px 12px; border-radius: 999px; text-decoration: none; }
.pill-cat { background: var(--t2, #dbeafe); color: var(--c, #2563eb); }
.pill-sub { background: #f3f4f6; color: #4b5563; }
a.pill:hover { filter: brightness(0.95); }

.clear-filters { border: 0; color: var(--sdw-blue); font-weight: 600; font-size: 0.875rem; background: none; cursor: pointer; font-family: 'Poppins', sans-serif; }
.clear-filters:hover { color: var(--sdw-blue-dark); }
.clear-filters[hidden], .blog-empty[hidden] { display: none; }
.blog-empty { text-align: center; padding: 3rem 0; }

/* ---------- pagination ---------- */
.pagination { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px; margin-top: 3rem; }
.pagination:empty { display: none; }
.pg-btn { min-width: 42px; height: 42px; padding: 0 14px; border-radius: 999px; border: 2px solid #e5e7eb; background: #ffffff; color: #000000; font-size: 14px; font-weight: 600; cursor: pointer; transition: all 0.3s ease-in-out; font-family: 'Poppins', sans-serif; }
.pg-btn:hover:not(:disabled):not(.current) { border-color: var(--sdw-blue); color: var(--sdw-blue); }
.pg-btn.current { background: var(--sdw-blue); border-color: var(--sdw-blue); color: #ffffff; }
.pg-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.pg-gap { color: #9ca3af; padding: 0 4px; }
@media (max-width: 480px) { .pg-btn { min-width: 38px; height: 38px; padding: 0 10px; } .pg-label { display: none; } }

/* ---------- featured article ---------- */
.feat-grid { display: grid; gap: 28px; grid-template-columns: 1fr; }
@media (min-width: 1024px) { .feat-grid { grid-template-columns: 2fr 1fr; gap: 32px; } }
.feat-card { position: relative; display: block; height: 400px; border-radius: 16px; overflow: hidden; text-decoration: none; }
.feat-card img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.5s ease-in-out; }
.feat-card:hover img { transform: scale(1.03); }
.feat-card::after { content: ''; position: absolute; inset: 0; background: linear-gradient(to top, rgba(0,0,0,0.82), rgba(0,0,0,0.15)); }
.feat-overlay { position: absolute; left: 0; right: 0; bottom: 0; padding: 28px; color: #ffffff; z-index: 2; }
.feat-pill { background: var(--sdw-blue); color: #ffffff; margin-bottom: 14px; }
.feat-overlay h3 { font-size: 1.5rem; line-height: 1.3; font-weight: 600; margin-bottom: 10px; }
@media (min-width: 768px) { .feat-overlay h3 { font-size: 1.9rem; } .feat-overlay { padding: 32px; } }
.feat-overlay p { color: #e5e7eb; font-weight: 300; margin-bottom: 14px; }
.feat-meta { font-size: 13px; color: #d1d5db; }
.feat-side { display: flex; flex-direction: column; gap: 24px; }
.feat-facts { background: #ffffff; border-radius: 16px; padding: 24px; box-shadow: 0 4px 14px rgba(0,0,0,0.08); }
.feat-facts h4 { font-size: 1.1rem; font-weight: 600; margin-bottom: 14px; }
.feat-facts ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.feat-facts li { display: flex; gap: 12px; align-items: flex-start; font-size: 14px; color: #374151; font-weight: 300; }
.feat-facts li svg { flex-shrink: 0; margin-top: 3px; }
.feat-btn { display: block; text-align: center; border-radius: 999px; padding: 12px 24px; font-weight: 600; text-decoration: none; }

/* =====================================================================
   POST PAGE
   ===================================================================== */
.post-top { padding-top: 28px; }
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 13px; color: #6b7280; margin-bottom: 18px; }
.crumbs a { color: #4b5563; text-decoration: none; }
.crumbs a:hover { color: var(--sdw-blue); }
.crumbs span { color: #9ca3af; }
.post-title { font-size: 2rem; line-height: 1.2; font-weight: 700; color: #000000; margin: 14px 0 14px; letter-spacing: -0.01em; max-width: 920px; }
@media (min-width: 768px) { .post-title { font-size: 2.8rem; } }
.post-lead { font-size: 1.1rem; line-height: 1.7; color: #4b5563; font-weight: 300; max-width: 820px; margin-bottom: 16px; }
.post-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; font-size: 13px; color: #6b7280; }
.post-meta .dot { color: #d1d5db; }
.post-hero { margin: 28px 0 8px; }
.post-hero img { width: 100%; height: 260px; object-fit: cover; border-radius: 16px; display: block; }
@media (min-width: 768px) { .post-hero img { height: 420px; } }

.post-layout { display: grid; gap: 40px; grid-template-columns: minmax(0, 1fr); padding-top: 28px; padding-bottom: 56px; }
@media (min-width: 1024px) { .post-layout { grid-template-columns: minmax(0, 1fr) 320px; gap: 56px; } }
.post-main { min-width: 0; }
.post-side { min-width: 0; }
.side-sticky { display: grid; gap: 20px; }
@media (min-width: 1024px) { .side-sticky { position: sticky; top: 96px; max-height: calc(100vh - 120px); overflow-y: auto; padding-right: 4px; } }

/* body typography */
.post-prose { font-size: 1.05rem; line-height: 1.85; color: #1f2937; max-width: 740px; }
.post-prose > * + * { margin-top: 1.25rem; }
.post-prose p { font-weight: 300; }
.post-prose strong { font-weight: 600; color: #111827; }
.post-prose h2 { font-size: 1.65rem; line-height: 1.3; font-weight: 600; color: #000000; margin-top: 2.6rem; scroll-margin-top: 96px; }
.post-prose h3 { font-size: 1.25rem; line-height: 1.35; font-weight: 600; color: #000000; margin-top: 2rem; }
.post-prose ul, .post-prose ol { padding-left: 1.4rem; font-weight: 300; }
.post-prose ul { list-style: disc; }
.post-prose ol { list-style: decimal; }
.post-prose li { margin-bottom: 0.6rem; padding-left: 4px; }
.post-prose a { color: var(--sdw-blue); text-decoration: underline; text-underline-offset: 3px; }
.post-prose a:hover { color: var(--sdw-blue-dark); }
.post-prose blockquote { border-left: 4px solid var(--sdw-blue); background: #f8fafc; padding: 18px 22px; border-radius: 0 12px 12px 0; }
.post-prose blockquote p { font-size: 1.15rem; font-style: italic; color: #111827; }
.post-prose blockquote cite { display: block; margin-top: 8px; font-size: 13px; color: #6b7280; font-style: normal; }
.post-fig img { width: 100%; border-radius: 12px; display: block; }
.post-fig figcaption { font-size: 13px; color: #6b7280; margin-top: 8px; text-align: center; }

.callout { border-radius: 14px; padding: 18px 22px; border: 1px solid #bfdbfe; background: #eff6ff; }
.callout strong { display: block; color: #1d4ed8; margin-bottom: 4px; font-size: 0.95rem; }
.callout p { margin: 0; font-size: 0.98rem; }
.callout-note { background: #fefce8; border-color: #fde68a; }
.callout-note strong { color: #a16207; }

.msg-list { display: grid; gap: 10px; }
.msg-row { display: flex; gap: 14px; align-items: flex-start; justify-content: space-between; padding: 16px 18px; border: 1px solid #e5e7eb; border-radius: 14px; background: #f9fafb; }
.msg-row p { margin: 0; color: #1f2937; font-weight: 300; line-height: 1.65; font-size: 1rem; }
.copy-btn { border: 0; flex-shrink: 0; font-size: 12px; font-weight: 600; padding: 6px 14px; border-radius: 999px; background: var(--sdw-blue); color: #ffffff; cursor: pointer; transition: all 0.3s ease-in-out; font-family: 'Poppins', sans-serif; }
.copy-btn:hover { background: var(--sdw-blue-dark); }

.faq-list { display: grid; gap: 10px; }
.faq-item { border: 1px solid #e5e7eb; border-radius: 12px; background: #ffffff; padding: 0 18px; }
.faq-item summary { cursor: pointer; padding: 16px 0; font-weight: 600; color: #111827; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: '+'; color: var(--sdw-blue); font-size: 1.3rem; line-height: 1; }
.faq-item[open] summary::after { content: '\2212'; }
.faq-item p { padding-bottom: 16px; margin: 0; }

.cta-box { background: #000000; color: #ffffff; border-radius: 18px; padding: 28px; text-align: center; }
.post-prose .cta-box h3 { color: #ffffff; margin-top: 0; }
.post-prose .cta-box p { color: #d1d5db; margin: 8px 0 18px; }
.cta-btn { display: inline-block; border-radius: 999px; padding: 12px 26px; font-weight: 600; text-decoration: none; color: #ffffff !important; }

/* affiliate */
.disclosure { background: #fff7ed; border: 1px solid #fed7aa; color: #7c2d12; border-radius: 12px; padding: 12px 16px; font-size: 13px; line-height: 1.6; margin-bottom: 22px; }
.disclosure a { color: #9a3412; text-decoration: underline; }
.disclosure-end { margin: 28px 0 18px; }
.aff-card { display: flex; gap: 18px; align-items: stretch; border: 1px solid #e5e7eb; border-radius: 16px; background: #ffffff; padding: 16px; box-shadow: 0 4px 14px rgba(0,0,0,0.05); }
.aff-card.aff-empty { border-style: dashed; background: #fafafa; }
.aff-img { flex: 0 0 120px; }
.aff-img img { width: 100%; height: 100%; object-fit: cover; border-radius: 12px; display: block; }
.aff-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.aff-tag { align-self: flex-start; font-size: 10px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: #9a3412; background: #ffedd5; padding: 2px 10px; border-radius: 999px; margin-bottom: 8px; }
.aff-info h4 { font-size: 1.05rem; font-weight: 600; color: #000000; margin: 0 0 4px; }
.post-prose .aff-info p, .aff-info p { font-size: 0.9rem; font-weight: 300; color: #4b5563; margin: 0 0 12px; line-height: 1.6; }
.aff-row { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.aff-price { font-weight: 600; color: #111827; }
.aff-btn { display: inline-block; background: var(--sdw-blue); color: #ffffff !important; text-decoration: none !important; font-weight: 600; font-size: 13px; padding: 9px 20px; border-radius: 999px; transition: all 0.3s ease-in-out; }
.aff-btn:hover { background: var(--sdw-blue-dark); transform: scale(1.04); }
.aff-compact { flex-direction: column; gap: 12px; }
.aff-compact .aff-img { flex: none; height: 140px; }
@media (max-width: 520px) { .aff-card:not(.aff-compact) { flex-direction: column; } .aff-img { flex: none; height: 150px; } }

/* sidebar */
.side-card { background: #ffffff; border: 1px solid #e5e7eb; border-radius: 16px; padding: 20px; }
.side-card h4 { font-size: 0.8rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: #6b7280; margin-bottom: 12px; }
.toc ol { list-style: none; padding: 0; margin: 0; display: grid; gap: 4px; }
.toc a { display: block; padding: 6px 10px; border-radius: 8px; font-size: 14px; color: #374151; text-decoration: none; border-left: 3px solid transparent; transition: all 0.2s ease; }
.toc a:hover { background: #f3f4f6; color: var(--sdw-blue); }
.toc a.current { border-left-color: var(--sdw-blue); background: rgba(74,144,226,0.08); color: #2f6db5; font-weight: 600; }
.side-links { list-style: none; padding: 0; margin: 0; display: grid; gap: 4px; }
.side-links a { display: block; padding: 6px 10px; border-radius: 8px; font-size: 14px; color: #374151; text-decoration: none; }
.side-links a:hover { background: #f3f4f6; color: var(--sdw-blue); }
.toc-inline { border: 1px solid #e5e7eb; border-radius: 12px; background: #ffffff; padding: 0 16px; margin-bottom: 22px; }
.toc-inline summary { cursor: pointer; padding: 14px 0; font-weight: 600; }
.toc-inline ol { list-style: decimal; padding: 0 0 14px 1.2rem; display: grid; gap: 6px; font-size: 14px; }
.toc-inline a { color: #374151; text-decoration: none; }
@media (min-width: 1024px) { .toc-inline { display: none; } }

.post-share { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 40px; padding-top: 24px; border-top: 1px solid #e5e7eb; max-width: 740px; }
.post-share span { font-size: 14px; font-weight: 600; color: #374151; margin-right: 6px; }
.post-share a { font-size: 13px; font-weight: 600; color: #111827; text-decoration: none; padding: 7px 16px; border: 2px solid #e5e7eb; border-radius: 999px; transition: all 0.3s ease-in-out; }
.post-share a:hover { border-color: var(--sdw-blue); color: var(--sdw-blue); }

.related { background: #f9fafb; padding: 56px 0; border-top: 1px solid #e5e7eb; }
.related h2 { font-size: 1.7rem; font-weight: 600; margin-bottom: 28px; color: #000000; }
.related-grid { display: grid; gap: 24px; grid-template-columns: 1fr; }
@media (min-width: 768px) { .related-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .related-grid { grid-template-columns: repeat(3, 1fr); gap: 32px; } }
.related .blog-article.is-hidden { display: flex; }

.post-missing { text-align: center; padding: 96px 16px; }
.post-missing h1 { font-size: 2rem; font-weight: 700; margin-bottom: 12px; }
.post-missing p { color: #4b5563; margin-bottom: 24px; }
.post-missing-btn { display: inline-block; border-radius: 999px; padding: 12px 28px; font-weight: 600; text-decoration: none; }

/* ---------- category hub pages ---------- */
.chip-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.chip-row .category-tag { text-decoration: none; }
.cat-grid-wrap { padding-top: 32px; padding-bottom: 64px; }

/* newsletter sign-up (post sidebar + blog page) */
.newsletter { background: linear-gradient(180deg, #eff6ff 0%, #ffffff 100%); border-color: #bfdbfe; }
.nl-text { font-size: 14px; line-height: 1.6; color: #374151; margin-bottom: 14px; }
.nl-label { display: block; font-size: 13px; font-weight: 600; color: #111827; margin-bottom: 6px; }
.nl-input { width: 100%; padding: 11px 14px; border: 1px solid #d1d5db; border-radius: 12px; background: #fff; color: #111827; font-size: 14px; outline: none; }
.nl-input:focus { border-color: #4A90E2; box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.2); }
.nl-btn { width: 100%; margin-top: 10px; border: 0; cursor: pointer; background: #4A90E2; color: #fff; font-weight: 600; font-size: 14px; padding: 11px 16px; border-radius: 999px; transition: background .2s, transform .2s; }
.nl-btn:hover { background: #3a7bc8; }
.nl-btn:disabled { opacity: .7; cursor: default; }
.nl-bot { display: none !important; }
.nl-msg { margin-top: 10px; font-size: 13px; font-weight: 600; }
.nl-ok { color: #047857; }
.nl-err { color: #b91c1c; }
.nl-msg[hidden] { display: none; }
.nl-band { background: #f9fafb; padding: 56px 0; }
.nl-band-inner { max-width: 560px; margin: 0 auto; text-align: center; padding: 0 16px; }
.nl-band h2 { font-size: 1.75rem; font-weight: 700; color: #111827; margin-bottom: 8px; }
.nl-band .nl-text { font-size: 16px; }
.nl-band .nl-label { text-align: left; }
