/*
Theme Name: NOVELDEE Child
Theme URI: https://noveldee.com
Description: NOVELDEE customizations (cream paper palette, Thai fonts, mascot, Thai translation) on top of Fictioneer.
Author: NOVELDEE
Template: fictioneer
Version: 0.2.0
Text Domain: noveldee-child
*/

/* Sarabun (SIL OFL 1.1, see assets/fonts/OFL-Sarabun.txt), self-hosted, Thai + Latin */
@font-face{font-family:"Sarabun";font-style:normal;font-weight:400;font-display:swap;src:url("assets/fonts/Sarabun-Regular.woff2") format("woff2")}
@font-face{font-family:"Sarabun";font-style:italic;font-weight:400;font-display:swap;src:url("assets/fonts/Sarabun-Italic.woff2") format("woff2")}
@font-face{font-family:"Sarabun";font-style:normal;font-weight:700;font-display:swap;src:url("assets/fonts/Sarabun-Bold.woff2") format("woff2")}
@font-face{font-family:"Sarabun";font-style:italic;font-weight:700;font-display:swap;src:url("assets/fonts/Sarabun-BoldItalic.woff2") format("woff2")}

/* Use Sarabun for body, headings and notes. Tripled :root beats the Customizer's inline :root block. */
:root:root:root{
  --ff-base:"Sarabun", var(--ff-system);
  --ff-heading:"Sarabun", var(--ff-base);
  --ff-note:"Sarabun", var(--ff-base);
  --font-line-height-base:1.8;
  --font-letter-spacing-base:0em;
}

/* Palette B (cream paper) is tuned after activation: base #FAF5EA, card #FFFFFF, text #2B2118, muted #6B5E50, accent #B5472B. */

/* Phone layout: shrink the mascot and park it at the right so it never covers the site title/tagline. */
@media only screen and (max-width: 767px){
  :root:root .header__logo{width:84px!important;height:84px!important;left:auto!important;right:14px!important;top:auto!important;bottom:14px!important}
  :root:root .header__logo img{width:100%!important;height:auto!important}
}

/* Chapter text: the theme's reader script defaults to Open Sans (no Thai glyphs); keep Sarabun for Thai text.
   Size, line height and colour controls in the reader toolbar still work. */
:root:root .chapter-formatting,
:root:root .chapter-formatting p,
:root:root .chapter__content{font-family:"Sarabun",var(--ff-system)!important}

/* Mascot: footer and 404 */
.noveldee-footer-mascot-wrap{text-align:center;margin:0 0 6px}
.noveldee-footer-mascot{width:56px;height:auto;display:inline-block}
.the-404__content img{max-width:260px;height:auto;display:block;margin:0 auto 12px}
.the-404__content{text-align:center}

/* Theme hides the whole bookmarks block when empty, which also hides its own "no bookmarks" note: show it. */
:root:root .bookmarks-block.hidden:has(.bookmarks-block__no-bookmarks:not(.hidden)){display:block!important;content-visibility:visible!important}

/* ===== Home (Webnovel-style, speed first) ===== */
.nd-home{display:flex;flex-direction:column;gap:28px}
.nd-row__head{display:flex;justify-content:space-between;align-items:baseline;margin-bottom:10px}
.nd-row__head h2{margin:0;font-size:1.3rem}
.nd-row__head a{font-size:.9rem;font-weight:600}
.nd-hot{display:grid;grid-template-columns:minmax(260px,38%) 1fr;gap:16px;align-items:start}
.nd-hot__grid .showcase,.nd-row .showcase{--showcase-min-width:110px}
.nd-hot__grid>*,.nd-row>.showcase{margin:0}
.nd-ranks{display:grid;grid-template-columns:repeat(3,1fr);gap:20px}
.nd-rank__title{margin:0 0 8px;font-size:1.05rem;border-left:4px solid var(--fictioneer-theme-accent,#B5472B);padding-left:8px}
.nd-home img{content-visibility:auto}
@media (max-width:900px){.nd-hot{grid-template-columns:1fr}.nd-ranks{grid-template-columns:1fr}}

/* Search results: two-column cards on wide screens */
@media (min-width:900px){.search .search-results__list, .search .article-cards, body.search .main__wrapper .card-list{display:grid;grid-template-columns:1fr 1fr;gap:14px}}

/* Showcase tiles: fixed-size cover grid (no stretching with few stories) */
.nd-home .showcase__list{display:grid!important;grid-template-columns:repeat(auto-fill,minmax(110px,150px));gap:10px;justify-content:start}
.nd-home .showcase__list-item{width:auto;min-width:0;max-width:150px}
.nd-home .showcase__image._no-cover{background:#EADFC8 url(/wp-content/uploads/2026/10/noveldee-mascot-sit-look.png) center 40%/60% no-repeat}
@media (max-width:600px){.nd-home .showcase__list{grid-template-columns:repeat(3,1fr)}.nd-home .showcase__list-item{max-width:none}}

/* ===== Search page: filter chips + 2-column results ===== */
.nd-filters{margin:14px 0 18px;display:flex;flex-direction:column;gap:8px}
.nd-filters__row{display:flex;flex-wrap:wrap;align-items:center;gap:6px}
.nd-filters__label{font-size:.8rem;opacity:.75;min-width:4.5em}
.nd-chip{display:inline-block;padding:3px 12px;border-radius:999px;border:1px solid rgba(107,94,80,.35);font-size:.88rem;line-height:1.7;text-decoration:none;color:inherit;background:transparent}
.nd-chip:hover{background:rgba(181,71,43,.08)}
.nd-chip.is-active{background:#B5472B;border-color:#B5472B;color:#fff;font-weight:600}
@media (min-width:900px){
  #search-result-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;align-items:start}
  #search-result-list>li{margin:0}
}
