/* ============================================================
   Clearlii — Blog index, Article, FAQ
   ============================================================ */

/* ---- blog index ---- */
.blog-hero { padding: 40px 0 20px; }
.blog-hero .eyebrow { margin-bottom: 18px; }
.blog-hero h1 { max-width: 16ch; }
.blog-hero p { color: var(--muted); font-size: 18px; max-width: 56ch; margin: 20px 0 0; }

.blog-cats { display: flex; flex-wrap: wrap; gap: 8px; margin: 36px 0 10px; }
.blog-cat { height: 38px; padding: 0 18px; border-radius: var(--r-pill); border: 1px solid var(--line); background: #fff; font-size: 13.5px; font-weight: 500; color: var(--muted); cursor: pointer; transition: .18s; }
.blog-cat.active { background: var(--purple); border-color: var(--purple); color: #fff; }

.feature-post {
  position: relative; display: grid; grid-template-columns: 1.15fr .85fr; gap: 0; border-radius: var(--r-lg); overflow: hidden;
  background: #fff; border: 1px solid var(--line); box-shadow: var(--sh-soft); margin-bottom: 40px;
}
.feature-post .fp-media { position: relative; min-height: 380px; }
.feature-post .fp-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.feature-post .fp-body { padding: 50px; display: flex; flex-direction: column; justify-content: center; }
.feature-post .fp-body .tag { align-self: flex-start; }
.feature-post h2 { font-size: 34px; font-weight: 500; letter-spacing: -0.03em; color: var(--ink); margin: 18px 0 14px; text-wrap: balance; }
.feature-post p { font-size: 16px; line-height: 1.6; color: var(--muted); margin: 0 0 26px; }
.post-meta { display: flex; align-items: center; gap: 12px; font-size: 13px; color: var(--muted-2); margin-bottom: 22px; }
.post-meta .dot-sep { width: 3px; height: 3px; border-radius: 50%; background: currentColor; }

.tag { display: inline-flex; padding: 5px 13px; border-radius: var(--r-pill); font-size: 12.5px; font-weight: 500; color: #fff; }
.tag.purple { background: var(--purple); } .tag.blue { background: var(--blue); } .tag.science { background: #b31aef; }
.tag.tips { background: var(--blue); } .tag.health { background: #1f8a5b; } .tag.guide { background: #c2410c; } .tag.support { background: #555; }

.posts-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px; }
.post-card { display: flex; flex-direction: column; border-radius: var(--r-lg); overflow: hidden; background: #fff; border: 1px solid var(--line); transition: transform .2s, box-shadow .2s; }
.post-card:hover { transform: translateY(-3px); box-shadow: var(--sh-card); }
.post-card .pc-media { position: relative; aspect-ratio: 16/10; overflow: hidden; }
.post-card .pc-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.post-card:hover .pc-media img { transform: scale(1.05); }
.post-card .pc-media .tag { position: absolute; top: 14px; left: 14px; }
.post-card .pc-media.noimg { aspect-ratio: 16/10; background: linear-gradient(150deg, var(--purple), var(--blue)); display: grid; place-items: center; }
.post-card .pc-media.noimg svg { width: 54px; height: 54px; color: rgba(255,255,255,.85); }
.post-card .pc-body { padding: 26px; display: flex; flex-direction: column; flex: 1; }
.post-card h3 { font-size: 20px; font-weight: 500; letter-spacing: -0.02em; color: var(--ink); margin: 0 0 10px; line-height: 1.25; }
.post-card p { font-size: 14px; line-height: 1.55; color: var(--muted); margin: 0 0 18px; flex: 1; }
.post-card .more { color: var(--purple); font-weight: 600; font-size: 14px; display: inline-flex; align-items: center; gap: 6px; }
.post-card .more svg { width: 14px; height: 14px; flex: none; }

/* ---- article ---- */
.article-hero { padding: 30px 0 0; }
.article-head { max-width: 760px; margin: 0 auto; text-align: center; }
.article-head h1 { font-size: clamp(32px, 4.4vw, 56px); font-weight: 500; letter-spacing: -0.04em; line-height: 1.05; color: var(--ink); margin: 18px 0 0; text-wrap: balance; }
.article-cover { max-width: 1000px; margin: 44px auto 0; border-radius: var(--r-lg); overflow: hidden; aspect-ratio: 21/9; box-shadow: var(--sh-card); }
.article-cover img { width: 100%; height: 100%; object-fit: cover; }
.article-body { max-width: 720px; margin: 0 auto; padding: 56px 0 20px; }
.article-body > p { font-size: 17px; line-height: 1.75; color: #2b2b30; margin: 0 0 22px; }
.article-body .lead-p { font-size: 20px; line-height: 1.6; color: var(--ink); }
.article-body h2 { font-size: 28px; font-weight: 500; letter-spacing: -0.03em; color: var(--ink); margin: 44px 0 16px; }
.article-body h3 { font-size: 21px; font-weight: 600; color: var(--ink); margin: 32px 0 12px; }
.article-body ul { margin: 0 0 22px; padding-left: 0; list-style: none; }
.article-body ul li { position: relative; padding-left: 30px; margin-bottom: 12px; font-size: 17px; line-height: 1.65; color: #2b2b30; }
.article-body ul li::before { content: ''; position: absolute; left: 4px; top: 11px; width: 8px; height: 8px; border-radius: 50%; background: var(--purple); }
.article-body .callout { background: var(--surface); border-radius: var(--r-md); padding: 28px 32px; margin: 32px 0; border-left: 4px solid var(--purple); }
.article-body .callout p { margin: 0; font-size: 17px; line-height: 1.6; color: var(--ink); font-style: italic; }
.article-share { max-width: 720px; margin: 30px auto 0; padding-top: 26px; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.article-share .lbl { font-size: 14px; color: var(--muted); }
.article-share .sh { display: flex; gap: 8px; }
.article-share .sh a { width: 40px; height: 40px; border-radius: 50%; background: var(--surface); display: grid; place-items: center; color: var(--muted); transition: .2s; }
.article-share .sh a:hover { background: var(--purple); color: #fff; }

/* ---- FAQ ---- */
.faq-hero { text-align: center; padding: 40px 0 10px; }
.faq-hero .eyebrow { margin-bottom: 20px; }
.faq-hero h1 { max-width: 18ch; margin: 0 auto; }
.faq-hero p { color: var(--muted); font-size: 18px; max-width: 56ch; margin: 20px auto 0; }
.faq-layout { display: grid; grid-template-columns: 240px 1fr; gap: 50px; align-items: start; }
.faq-side { position: sticky; top: 120px; display: flex; flex-direction: column; gap: 4px; }
.faq-side a { padding: 11px 16px; border-radius: 12px; font-size: 14.5px; color: var(--muted); transition: .15s; }
.faq-side a:hover, .faq-side a.active { background: var(--surface); color: var(--purple); font-weight: 500; }
.faq-cat { margin-bottom: 44px; scroll-margin-top: 120px; }
.faq-cat h2 { font-size: 24px; font-weight: 500; letter-spacing: -0.02em; color: var(--ink); margin: 0 0 18px; }
.faq-q { border: 1px solid var(--line); border-radius: var(--r-md); margin-bottom: 12px; overflow: hidden; transition: border-color .2s; }
.faq-q.open { border-color: rgba(120,33,129,.35); }
.faq-q summary { list-style: none; cursor: pointer; padding: 22px 24px; display: flex; justify-content: space-between; align-items: center; gap: 20px; font-size: 16.5px; font-weight: 500; color: var(--ink); }
.faq-q summary::-webkit-details-marker { display: none; }
.faq-q .qico { flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; color: var(--purple); box-shadow: inset 0 0 0 1.5px rgba(120,33,129,.25); transition: .3s; }
.faq-q[open] .qico { transform: rotate(45deg); background: var(--purple); color: #fff; box-shadow: none; }
.faq-q .qico svg { width: 14px; height: 14px; }
.faq-q .ans { padding: 0 24px 24px; }
.faq-q .ans p { margin: 0; font-size: 15.5px; line-height: 1.7; color: var(--muted); }
.faq-q .ans ol { margin: 8px 0 0; padding-left: 20px; font-size: 15px; line-height: 1.7; color: var(--muted); }

@media (max-width: 1000px) {
  .feature-post { grid-template-columns: 1fr; }
  .feature-post .fp-media { min-height: 240px; }
  .feature-post .fp-body { padding: 32px; }
  .posts-grid { grid-template-columns: 1fr 1fr; }
  .faq-layout { grid-template-columns: 1fr; gap: 24px; }
  .faq-side { position: static; flex-direction: row; flex-wrap: wrap; }
}
@media (max-width: 640px) {
  .posts-grid { grid-template-columns: 1fr; }
  .article-body > p, .article-body ul li { font-size: 16px; }
}

/* ── Blog pagination (First · Prev · numbers · Next · Last) ── */
.blog-pager { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; align-items: center; margin-top: 56px; }
.blog-pager .pg {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 44px; height: 44px; padding: 0 8px; border-radius: 12px;
  border: 1px solid var(--line); background: #fff; color: var(--ink);
  font-size: 15px; font-weight: 600; text-decoration: none; user-select: none;
  transition: border-color .15s, background .15s, color .15s, box-shadow .15s;
}
.blog-pager .pg:hover { border-color: rgba(121,33,129,.4); color: var(--purple); }
.blog-pager .pg.is-current { background: var(--purple); border-color: var(--purple); color: #fff; box-shadow: 0 4px 14px rgba(121,33,129,.28); cursor: default; }
.blog-pager .pg.pg-arrow { color: var(--muted); }
.blog-pager .pg.pg-arrow svg { width: 18px; height: 18px; }
.blog-pager .pg.is-disabled { opacity: .35; pointer-events: none; }
@media (max-width: 480px) { .blog-pager .pg { min-width: 40px; height: 40px; font-size: 14px; } }

/* ── Blog search ── */
.blog-search { display: flex; gap: 10px; margin-top: 28px; max-width: 560px; flex-wrap: wrap; }
.blog-search__field { position: relative; flex: 1 1 260px; display: flex; align-items: center; }
.blog-search__icon { position: absolute; left: 16px; width: 18px; height: 18px; color: var(--muted); pointer-events: none; }
.blog-search input[type="search"] {
  width: 100%; height: 52px; padding: 0 44px; box-sizing: border-box;
  border: 1px solid var(--line); border-radius: 999px; background: #fff;
  font-size: 15px; color: var(--ink); outline: none;
  transition: border-color .15s, box-shadow .15s; -webkit-appearance: none; appearance: none;
}
.blog-search input[type="search"]::-webkit-search-cancel-button { -webkit-appearance: none; display: none; }
.blog-search input[type="search"]::placeholder { color: var(--muted); }
.blog-search input[type="search"]:focus { border-color: var(--purple); box-shadow: 0 0 0 4px rgba(121,33,129,.12); }
.blog-search__clear {
  position: absolute; right: 12px; display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: 50%; color: var(--muted); background: transparent;
  transition: background .15s, color .15s;
}
.blog-search__clear:hover { background: rgba(0,0,0,.06); color: var(--ink); }
.blog-search__clear svg { width: 16px; height: 16px; }
.blog-search .btn { height: 52px; display: inline-flex; align-items: center; }

/* ── Blog search: results header + empty state ── */
.blog-results-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 28px; }
.blog-results-head h2 { font-size: clamp(20px, 3vw, 26px); margin: 0; }
.blog-empty { text-align: center; padding: 48px 0 60px; }
.blog-empty h2 { font-size: clamp(22px, 3.5vw, 30px); margin: 0 0 10px; }
.blog-empty p { color: var(--muted); max-width: 480px; margin: 0 auto; }
.blog-empty a { color: var(--purple); font-weight: 600; }
@media (max-width: 560px) { .blog-search { flex-direction: column; } .blog-search .btn { width: 100%; justify-content: center; } }

/* ── Category filter pills as links (server-rendered) + eye-health tag colour ── */
.blog-cat { display: inline-flex; align-items: center; text-decoration: none; }
.blog-cat:hover { border-color: rgba(121,33,129,.45); color: var(--purple); }
.blog-cat.active, .blog-cat.active:hover { background: var(--purple); border-color: var(--purple); color: #fff; }
.tag.eye-health { background: #1f8a5b; }

/* ── Tame Google-Docs / rich-text paste inside CMS article bodies ──
   Post bodies are pasted from Docs with heavy inline styles (Arial 11pt,
   color:#000, list-style:disc, padding-inline-start:48px, white-space:pre…)
   that override the theme. Neutralise them so posts match the design. */
.article-body span {
  font-family: inherit !important;
  font-size: inherit !important;
  color: inherit !important;
  background: transparent !important;
  white-space: normal !important;
  vertical-align: baseline !important;
  letter-spacing: normal !important;
}
.article-body p { white-space: normal !important; }
.article-body ul,
.article-body ol {
  padding-inline-start: 0 !important;
  padding-left: 0 !important;
  margin: 0 0 22px !important;
}
.article-body ol { padding-left: 26px !important; }
.article-body li {
  font-family: inherit !important;
  font-size: 17px !important;
  line-height: 1.65 !important;
  white-space: normal !important;
}
.article-body ul li { list-style: none !important; padding-left: 30px !important; }
.article-body ol li { list-style: decimal !important; padding-left: 6px !important; margin-bottom: 10px; }
.article-body ol li::before { content: none !important; }
.article-body hr { border: 0; border-top: 1px solid var(--line); margin: 34px 0; }
.article-body b, .article-body strong { font-weight: 600; color: var(--ink); }
