/* ==========================================================================
   Blocksy Child — Lomus
   Warm ink / cream palette + subtle homepage micro-animations
   ========================================================================== */

:root {
    --ink-bg:           #f1e9db;
    --ink-bg-soft:      #ebe1cf;
    --ink-text:         #2b241d;
    --ink-text-soft:    #7a6f62;
    --ink-accent:       #c0562a;
    --ink-accent-hover: #8a3d1a;
    --ink-divider:      rgba(120, 100, 80, 0.25);
    --ink-divider-strong: rgba(120, 100, 80, 0.4);
    --ink-glow:         rgba(192, 86, 42, 0.22);

    --font-heading: "EB Garamond", "Noto Serif SC", "Source Han Serif SC",
                    "PingFang SC", "Songti SC", "STSong", serif;
    --font-body:    "Noto Serif SC", "Source Han Serif SC", "PingFang SC",
                    system-ui, -apple-system, sans-serif;
}

/* --- Override Blocksy theme palette variables ----------------------------- */
html body {
    --theme-palette-color-1: var(--ink-accent);
    --theme-palette-color-2: var(--ink-accent-hover);
    --theme-palette-color-3: var(--ink-text);
    --theme-palette-color-4: var(--ink-text);
    --theme-palette-color-5: var(--ink-divider);
    --theme-palette-color-6: var(--ink-bg-soft);
    --theme-palette-color-7: var(--ink-bg);
    --theme-palette-color-8: var(--ink-bg);
}

/* --- Base ---------------------------------------------------------------- */
html,
body {
    background-color: var(--ink-bg) !important;
    color: var(--ink-text);
    font-family: var(--font-body);
}

#main-container {
    position: relative;
    z-index: 1;
}

/* --- Typography ---------------------------------------------------------- */
h1, h2, h3, h4, h5, h6,
.site-title,
.entry-title,
.entry-title a {
    font-family: var(--font-heading);
    font-weight: 600;
    color: var(--ink-text);
    letter-spacing: 0;
}

.site-title a {
    color: var(--ink-text);
}

.site-description {
    color: var(--ink-text-soft);
    font-family: var(--font-body);
}

.entry-excerpt,
.entry-excerpt p,
.entry-content p {
    color: var(--ink-text-soft);
    font-family: var(--font-body);
    line-height: 1.85;
}

/* --- Links & menu -------------------------------------------------------- */
a,
.ct-menu-link {
    color: var(--ink-text);
    transition: color 0.25s ease;
}
a:hover,
.ct-menu-link:hover {
    color: var(--ink-accent);
}

/* Active menu item underline (matches mockup) */
#header-menu-1 .current-menu-item > .ct-menu-link {
    color: var(--ink-text);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 6px;
}

/* --- Category tag -------------------------------------------------------- */
.meta-categories a {
    color: var(--ink-accent) !important;
    font-family: var(--font-body);
    font-weight: 600;
    letter-spacing: 0.02em;
}
.meta-categories a:hover {
    color: var(--ink-accent-hover) !important;
}

/* --- Entry meta (author / date / comments) ------------------------------ */
.entry-meta {
    color: var(--ink-text-soft);
}
.entry-meta .meta-author,
.entry-meta .meta-date,
.entry-meta .meta-comments {
    color: var(--ink-text-soft);
    font-family: var(--font-body);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-size: 0.78em;
}
.entry-meta a {
    color: var(--ink-text-soft);
}
.entry-meta a:hover {
    color: var(--ink-accent);
}

/* --- Header divider ------------------------------------------------------ */
#header .ct-container {
    border-bottom: 1px dashed var(--ink-divider);
    padding-bottom: 18px;
}

/* --- Entry card list ----------------------------------------------------- */
.entries[data-layout="simple"] .entry-card {
    border-bottom: 1px dashed var(--ink-divider);
    padding-bottom: 2.2rem;
    margin-bottom: 2.2rem;
    transition:
        opacity 0.7s ease-out,
        transform 0.7s ease-out,
        border-color 0.35s ease;
}
.entries[data-layout="simple"] .entry-card:last-child {
    border-bottom: none;
}
.entries[data-layout="simple"] .entry-card:hover {
    border-bottom-color: var(--ink-divider-strong);
}
/* Gate the hidden state on `has-js` so a JS failure never leaves content
   invisible. The <html> class is added inline by functions.php. */
html.has-js .entries[data-layout="simple"] .entry-card:not(.is-revealed) {
    opacity: 0;
    transform: translateY(10px);
}

/* Title underline on hover */
.entry-card .entry-title a {
    background-image: linear-gradient(var(--ink-accent), var(--ink-accent));
    background-size: 0 1px;
    background-repeat: no-repeat;
    background-position: 0 100%;
    transition: background-size 0.4s ease, color 0.25s ease;
    padding-bottom: 3px;
}
.entry-card:hover .entry-title a {
    background-size: 100% 1px;
    color: var(--ink-accent);
}

/* Gentle lift without shadow (keep paper feel) */
.entry-card .ct-media-container {
    transition: transform 0.4s ease, filter 0.4s ease;
}
.entry-card:hover .ct-media-container {
    transform: translateY(-2px);
    filter: brightness(0.98) saturate(0.95);
}

/* --- Pagination ---------------------------------------------------------- */
.ct-pagination .page-numbers {
    color: var(--ink-text-soft);
    font-family: var(--font-heading);
    font-size: 1.05em;
}
.ct-pagination .page-numbers.current {
    color: var(--ink-accent);
    font-weight: 600;
}
.ct-pagination a.page-numbers:hover {
    color: var(--ink-accent);
}

/* --- Footer -------------------------------------------------------------- */
#footer,
.ct-footer,
.scf-footer {
    background: transparent !important;
    color: var(--ink-text-soft);
}
#runtime-js {
    color: var(--ink-text-soft) !important;
}
.scf-footer a {
    color: var(--ink-text-soft);
}
.scf-footer a:hover {
    color: var(--ink-accent);
}

/* --- Back to top & search modal ----------------------------------------- */
.ct-back-to-top {
    background-color: var(--ink-bg-soft) !important;
    color: var(--ink-text) !important;
}

.ct-search-form .modal-field {
    font-family: var(--font-heading);
    color: var(--ink-text);
}

/* ==========================================================================
   Animation 1 — drifting ink particles (all pages, behind content)
   ========================================================================== */

body::before {
    content: "";
    position: fixed;
    inset: -6% -6%;
    pointer-events: none;
    z-index: 0;
    background-image:
      radial-gradient(circle at 10% 20%,  rgba(120,100,80,0.18) 1.5px, transparent 2px),
      radial-gradient(circle at 25% 65%,  rgba(120,100,80,0.14) 1.2px, transparent 2px),
      radial-gradient(circle at 40% 15%,  rgba(120,100,80,0.16) 1.5px, transparent 2px),
      radial-gradient(circle at 55% 80%,  rgba(120,100,80,0.12) 1.2px, transparent 2px),
      radial-gradient(circle at 70% 30%,  rgba(120,100,80,0.18) 1.8px, transparent 2px),
      radial-gradient(circle at 85% 55%,  rgba(120,100,80,0.14) 1.5px, transparent 2px),
      radial-gradient(circle at 18% 85%,  rgba(120,100,80,0.16) 1.2px, transparent 2px),
      radial-gradient(circle at 92% 88%,  rgba(120,100,80,0.12) 1.5px, transparent 2px),
      radial-gradient(circle at 48% 45%,  rgba(120,100,80,0.15) 1.3px, transparent 2px),
      radial-gradient(circle at 62% 12%,  rgba(120,100,80,0.13) 1.2px, transparent 2px),
      radial-gradient(circle at 8%  50%,  rgba(120,100,80,0.15) 1.4px, transparent 2px),
      radial-gradient(circle at 78% 72%,  rgba(120,100,80,0.15) 1.6px, transparent 2px),
      radial-gradient(circle at 33% 35%,  rgba(120,100,80,0.12) 1.2px, transparent 2px),
      radial-gradient(circle at 88% 18%,  rgba(120,100,80,0.14) 1.3px, transparent 2px);
    background-size: 100% 100%;
    animation: ink-drift 90s ease-in-out infinite alternate;
    opacity: 0.9;
}

@keyframes ink-drift {
    0%   { transform: translate3d(0, 0, 0); }
    50%  { transform: translate3d(-14px, 10px, 0); }
    100% { transform: translate3d(12px, -8px, 0); }
}

/* ==========================================================================
   Animation 2 — cursor-following soft glow (home page only)
   ========================================================================== */

#ink-cursor-glow {
    position: fixed;
    top: 0;
    left: 0;
    width: 44vw;
    height: 44vw;
    max-width: 720px;
    max-height: 720px;
    min-width: 380px;
    min-height: 380px;
    pointer-events: none;
    z-index: 0;
    border-radius: 50%;
    background: radial-gradient(closest-side,
        var(--ink-glow) 0%,
        rgba(192, 86, 42, 0.08) 40%,
        transparent 72%);
    filter: blur(50px);
    mix-blend-mode: multiply;
    transform: translate3d(-50vw, -50vw, 0);
    will-change: transform, opacity;
    opacity: 0;
    transition: opacity 0.8s ease;
}
body.home #ink-cursor-glow.is-active {
    opacity: 1;
}

/* ==========================================================================
   Accessibility / device fallbacks
   ========================================================================== */

@media (hover: none) {
    #ink-cursor-glow { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    body::before { animation: none; }
    #ink-cursor-glow { display: none; }
    .entries[data-layout="simple"] .entry-card {
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
    }
    .entry-card .ct-media-container,
    .entry-card .entry-title a {
        transition: none;
    }
}
