/* ============================================================
   Blinkylights Retro — supplemental styling
   Dark is the default (theme.json). Light mode overrides the WP
   color preset vars so everything that reads from them follows.
   ============================================================ */

/* ---------- Light reading mode ---------- */
:root[data-theme="light"]{
  --wp--preset--color--base:#f5f1e8;     /* warm paper */
  --wp--preset--color--contrast:#1d2026;
  --wp--preset--color--accent-1:#b56a0e; /* amber, darkened for contrast on light */
  --wp--preset--color--accent-2:#1f9d57; /* green, darkened */
  --wp--preset--color--accent-3:#ffffff; /* surface */
  --wp--preset--color--accent-4:#5d646f; /* muted */
  --wp--preset--color--accent-5:#e7dfce; /* line */
  --wp--preset--color--accent-6:#8a5208; /* amber-deep for code text */
  color-scheme:light;
}
@media (prefers-color-scheme:light){
  :root:not([data-theme="dark"]){
    --wp--preset--color--base:#f5f1e8;
    --wp--preset--color--contrast:#1d2026;
    --wp--preset--color--accent-1:#b56a0e;
    --wp--preset--color--accent-2:#1f9d57;
    --wp--preset--color--accent-3:#ffffff;
    --wp--preset--color--accent-4:#5d646f;
    --wp--preset--color--accent-5:#e7dfce;
    --wp--preset--color--accent-6:#8a5208;
    color-scheme:light;
  }
}
:root{ color-scheme:dark; }

/* ---------- Links: terminal underline ---------- */
.wp-block-post-content a,
.entry-content a,
.wp-block-post-excerpt a{
  text-underline-offset:0.18em;
  text-decoration-thickness:1px;
  text-decoration-color:color-mix(in srgb, var(--wp--preset--color--accent-1) 55%, transparent);
}

/* ---------- Selection + focus ---------- */
::selection{ background:var(--wp--preset--color--accent-1); color:var(--wp--preset--color--base); }
:where(a,button,input,summary):focus-visible{
  outline:2px solid var(--wp--preset--color--accent-1);
  outline-offset:2px;
  border-radius:3px;
}

/* ---------- Masthead ---------- */
.bl-masthead{ padding-block:1.1rem 0.6rem; }
.bl-brand .wp-block-site-title{ margin:0; }
.bl-brand .wp-block-site-title a{
  color:var(--wp--preset--color--contrast);
  text-transform:lowercase;
  letter-spacing:-0.02em;
}
.bl-brand .wp-block-site-title a::before{
  content:"> ";
  color:var(--wp--preset--color--accent-2);
}
.bl-brand .wp-block-site-title a::after{
  content:"_";
  color:var(--wp--preset--color--accent-1);
  margin-left:1px;
  animation:bl-blink 1.15s steps(1) infinite;
}
@media (prefers-reduced-motion:reduce){
  .bl-brand .wp-block-site-title a::after{ animation:none; }
}
@keyframes bl-blink{ 50%{ opacity:0; } }

/* Nav: monospace, compact */
.bl-masthead .wp-block-navigation{
  font-family:var(--wp--preset--font-family--fira-code);
  font-size:0.82rem;
}

/* ---------- Status-LED bar ---------- */
.bl-ledbar{
  display:flex;
  gap:0.42rem;
  align-items:center;
  margin-top:0.7rem;
  padding-top:0.7rem;
  border-top:1px solid var(--wp--preset--color--accent-5);
}
.bl-ledbar i{
  width:9px; height:9px; border-radius:50%;
  background:var(--wp--preset--color--accent-5);
}
.bl-ledbar i.on{ background:var(--wp--preset--color--accent-1); box-shadow:0 0 7px color-mix(in srgb,var(--wp--preset--color--accent-1) 70%,transparent); }
.bl-ledbar i.g{  background:var(--wp--preset--color--accent-2); box-shadow:0 0 7px color-mix(in srgb,var(--wp--preset--color--accent-2) 70%,transparent); }

/* ---------- Theme toggle button ---------- */
.bl-theme-toggle{
  display:inline-flex; align-items:center; gap:0.5rem;
  font-family:var(--wp--preset--font-family--fira-code);
  font-size:0.76rem;
  color:var(--wp--preset--color--accent-4);
  background:transparent;
  border:1px solid var(--wp--preset--color--accent-5);
  border-radius:999px;
  padding:0.3rem 0.7rem;
  cursor:pointer;
  line-height:1;
  transition:border-color .15s, color .15s;
}
.bl-theme-toggle:hover{ color:var(--wp--preset--color--contrast); border-color:var(--wp--preset--color--accent-1); }
.bl-theme-toggle .bl-led{
  width:9px; height:9px; border-radius:50%;
  background:var(--wp--preset--color--accent-1);
  box-shadow:0 0 6px color-mix(in srgb,var(--wp--preset--color--accent-1) 70%,transparent);
}
.bl-theme-toggle .bl-toggle-label::before{ content:"theme: "; color:var(--wp--preset--color--accent-5); }

/* ---------- Post meta (date / category) in the loop ---------- */
.wp-block-post-date, .wp-block-post-terms,
.wp-block-post-date a, .wp-block-post-terms a{
  font-family:var(--wp--preset--font-family--fira-code);
  font-size:0.76rem;
  letter-spacing:0.03em;
  color:var(--wp--preset--color--accent-4);
}
.wp-block-post-terms a{ color:var(--wp--preset--color--accent-1); text-decoration:none; }

/* ---------- Inline code ---------- */
:not(pre) > code{
  font-family:var(--wp--preset--font-family--fira-code);
  font-size:0.86em;
  background:var(--wp--preset--color--accent-3);
  color:var(--wp--preset--color--accent-6);
  padding:0.12em 0.4em;
  border-radius:5px;
  border:1px solid var(--wp--preset--color--accent-5);
}

/* ---------- Gentle rounding (warm blend) ---------- */
.wp-block-image img, .wp-block-post-featured-image img{ border-radius:9px; }

/* ---------- Footer ---------- */
.bl-footer{ padding-block:2rem; border-top:1px solid var(--wp--preset--color--accent-5); margin-top:3rem; }
.bl-footer .bl-foot-line{
  font-family:var(--wp--preset--font-family--fira-code);
  font-size:0.78rem;
  color:var(--wp--preset--color--accent-4);
  margin:0;
}
.bl-footer .bl-foot-line a{ color:var(--wp--preset--color--accent-1); text-decoration:none; }

/* ---------- Post list (home / archives) ---------- */
.bl-post{ padding-block:1.7rem; border-bottom:1px solid var(--wp--preset--color--accent-5); }
.bl-post:first-child{ padding-top:0.5rem; }
.bl-post .wp-block-post-title{ margin:0.3rem 0 0.55rem; }
/* Titles read in the main text color; amber is reserved for the accent/hover */
.wp-block-post-title a{ color:var(--wp--preset--color--contrast); text-decoration:none; }
.wp-block-post-title a:hover{ color:var(--wp--preset--color--accent-1); }
.bl-post-cat{ font-family:var(--wp--preset--font-family--fira-code); font-size:0.74rem; letter-spacing:0.04em; margin:0; }
.bl-post-cat a{ color:var(--wp--preset--color--accent-1); text-decoration:none; }
.bl-post-cat a::before{ content:"# "; color:var(--wp--preset--color--accent-4); }
.bl-post .wp-block-post-excerpt{ color:var(--wp--preset--color--accent-4); }
.bl-post .wp-block-post-excerpt__more-link{ font-family:var(--wp--preset--font-family--fira-code); font-size:0.78rem; display:inline-block; margin-top:0.4rem; }
.bl-post .wp-block-post-date{ margin-top:0.5rem; }

/* ---------- Single post ---------- */
.bl-single{ padding-top:1.4rem; }
.bl-single-head .wp-block-post-title{ margin:0.4rem 0 0.55rem; line-height:1.14; }
.bl-single-meta{ gap:0.9rem; align-items:center; font-family:var(--wp--preset--font-family--fira-code); font-size:0.78rem; color:var(--wp--preset--color--accent-4); }
.bl-single-meta .bl-meta-date::before{ content:"$ "; color:var(--wp--preset--color--accent-2); }
.bl-single-fi img{ border-radius:10px; margin:1.6rem 0; }
/* dashed terminal divider */
.bl-rule.bl-rule{ border:0; border-top:1px dashed var(--wp--preset--color--accent-5); background:none; opacity:1; max-width:100%; margin:2.6rem 0 1.4rem; }
/* prev / next */
.bl-postnav{ gap:1rem; font-family:var(--wp--preset--font-family--fira-code); font-size:0.8rem; }
.bl-postnav a{ color:var(--wp--preset--color--accent-1); text-decoration:none; }
.bl-postnav a:hover{ color:var(--wp--preset--color--accent-2); }
.bl-nav-next{ margin-left:auto; text-align:right; }
.bl-backhome{ margin-top:2.2rem; }
.bl-backhome a{ font-family:var(--wp--preset--font-family--fira-code); font-size:0.8rem; color:var(--wp--preset--color--accent-4); text-decoration:none; }
.bl-backhome a::before{ content:""; }
.bl-backhome a:hover{ color:var(--wp--preset--color--accent-1); }
/* in-article headings get a subtle amber ">" marker */
.bl-single .wp-block-post-content h2::before,
.bl-single .wp-block-post-content h3::before{ content:"# "; color:var(--wp--preset--color--accent-1); }

/* ---------- Archive / search headers ---------- */
.bl-archive{ padding-top:1.4rem; }
.bl-archive-title{ font-family:var(--wp--preset--font-family--fira-code); font-weight:600; margin:0.4rem 0 0.3rem; }
.bl-archive-title::before{ content:"// "; color:var(--wp--preset--color--accent-4); }
.bl-archive-desc{ color:var(--wp--preset--color--accent-4); font-size:0.9rem; margin:0 0 0.4rem; }
.bl-search{ margin:0.4rem 0 1.4rem; max-width:24rem; }
.bl-search .wp-block-search__input{
  background:var(--wp--preset--color--accent-3);
  color:var(--wp--preset--color--contrast);
  border:1px solid var(--wp--preset--color--accent-5);
  border-radius:7px 0 0 7px;
  font-family:var(--wp--preset--font-family--fira-code);
  font-size:0.84rem;
}
.bl-search .wp-block-search__button{
  font-family:var(--wp--preset--font-family--fira-code);
  font-size:0.8rem;
  border-radius:0 7px 7px 0;
}
