/*
Theme Name: Good Freddy Terminal
Theme URI: https://goodfreddy.com
Author: Good Freddy
Description: Terminal-styled theme with a persistent radio player. Built to survive real posts: images, galleries, embeds all contained automatically.
Version: 1.0.0
Text Domain: goodfreddy-terminal
*/

:root{
  --bg:#1c1d29;
  --bg-alt:#242536;
  --bg-alt2:#2b2c40;
  --panel-alpha:0.80; /* tune: lower = more background photo shows through */
  --fg:#f2f2f7;
  --dim:#4a4b66;
  --dim2:#9d9eb8;
  --purple:#b48bfa;
  --pink:#ff6fc5;
  --cyan:#5fe3ff;
  --green:#63f7a4;
  --amber:#ffcf6e;
  --red:#ff6363;
}
*{ box-sizing:border-box; -webkit-tap-highlight-color:transparent; }
html{ scroll-behavior:smooth; }
body{
  margin:0;
  font-family:'VT323', monospace;
  color:var(--fg);
  min-height:100vh;
}

/* ---------------------------------------------------------
   PAGE BACKDROP
--------------------------------------------------------- */
.page-bg{
  position:fixed; inset:0; z-index:-2;
  background-image:var(--gf-bg-image, none);
  background-size:cover;
  background-position:center 30%;
}
.page-bg-tint{
  position:fixed; inset:0; z-index:-1;
  background:
    radial-gradient(ellipse at 50% 30%, rgba(28,29,41,0.25), rgba(8,8,13,0.85) 78%),
    linear-gradient(120deg, rgba(180,139,250,0.25), rgba(95,227,255,0.18));
  mix-blend-mode:multiply;
}
.page-scanlines{
  position:fixed; inset:0; z-index:50; pointer-events:none;
  background:repeating-linear-gradient(to bottom,
    rgba(0,0,0,0.16) 0px, rgba(0,0,0,0.16) 1px, transparent 2px, transparent 3px);
  mix-blend-mode:multiply;
}

/* ---------------------------------------------------------
   WINDOW CHROME
--------------------------------------------------------- */
.term-window{
  max-width:760px;
  margin:0 auto 40px;
  border-radius:10px;
  overflow:hidden;
  box-shadow:0 30px 70px rgba(0,0,0,0.6), inset 0 0 0 1px #33344a;
  position:relative; z-index:2;
}
.titlebar{
  display:flex; align-items:center; gap:10px;
  padding:9px 8px 9px 14px;
  background:#2c0a24;
  border-bottom:2px solid #e95420;
}
.titlebar .icon{
  width:16px; height:16px; border-radius:3px; background:#e95420;
  display:flex; align-items:center; justify-content:center;
  font-family:'Space Mono',monospace; font-size:0.60rem; color:#2c0a24; font-weight:700; flex:none;
}
.titlebar .tab{ margin:0; font-family:'Space Mono',monospace; font-size:0.68rem; color:#cbb8c6; }
.titlebar .winctl{ margin-left:auto; display:flex; gap:6px; }
.titlebar .winctl span{
  width:20px; height:20px; border-radius:4px;
  display:flex; align-items:center; justify-content:center;
  color:#cbb8c6; font-size:0.7rem; background:rgba(255,255,255,0.06);
}
.titlebar .winctl span.close:hover{ background:#e95420; color:#2c0a24; }

.term-content{
  background:rgba(28,29,41,var(--panel-alpha));
  position:relative;
  backdrop-filter:blur(2px);
}
.term-content::before{
  content:"";
  position:absolute; inset:0;
  background:repeating-linear-gradient(to bottom,
    rgba(0,0,0,0.10) 0px, rgba(0,0,0,0.10) 1px, transparent 2px, transparent 3px);
  pointer-events:none; mix-blend-mode:multiply; z-index:1;
}

section, .post, .archive-wrap{ position:relative; z-index:2; padding:26px 26px 6px; }
.prompt{
  font-family:'Space Mono',monospace; font-size:0.78rem; color:var(--dim2);
  margin-bottom:10px; letter-spacing:0.02em;
}
.prompt .u{ color:var(--green); } .prompt .p{ color:var(--pink); }

/* ---------------------------------------------------------
   HERO (front page only)
--------------------------------------------------------- */
.hero{ padding-top:30px; text-align:left; }
.hero h1{ margin:0 0 4px; font-size:2.7rem; line-height:1; color:var(--fg); text-shadow:0 0 18px rgba(180,139,250,0.4); }
.hero .glow{ color:var(--purple); }
.hero p.tagline{ margin:6px 0 0; font-size:1.25rem; color:var(--cyan); }
.hero p.sub{ margin:2px 0 4px; font-size:1.05rem; color:var(--dim2); font-style:italic; }
.hero .exif{ font-family:'Space Mono',monospace; font-size:0.6rem; color:var(--dim2); letter-spacing:0.04em; margin:2px 0 18px; }

/* ---------------------------------------------------------
   NAV
--------------------------------------------------------- */
.nav{ list-style:none; display:flex; flex-wrap:wrap; gap:8px; padding:0 26px 22px; margin:0; z-index:2; position:relative; }
.nav li{ margin:0; }
.nav a{
  font-family:'Space Mono',monospace; font-size:0.7rem; font-weight:700;
  text-decoration:none; color:#1c1024; padding:8px 12px; border-radius:4px;
  letter-spacing:0.02em; display:inline-block; border:2px solid transparent;
}
.nav li:nth-child(5n+1) a{ background:var(--cyan); }
.nav li:nth-child(5n+2) a{ background:var(--pink); }
.nav li:nth-child(5n+3) a{ background:var(--amber); }
.nav li:nth-child(5n+4) a{ background:var(--green); }
.nav li:nth-child(5n+5) a{ background:var(--purple); }
.nav a.gf-active{ border-color:#fff; }

/* ---------------------------------------------------------
   RADIO WIDGET (persistent, lives in header, never swapped)
--------------------------------------------------------- */
.radio-card{
  display:flex; gap:14px; align-items:center;
  background:rgba(36,37,54,0.9);
  border-bottom:1px solid #33344a; padding:14px 22px;
  flex-wrap:wrap; position:relative; z-index:2;
}
.art-wrap{ width:48px; height:48px; flex:none; border-radius:4px; overflow:hidden; background:#12131c; box-shadow:0 0 0 1px #33344a; }
#gfArtCanvas{ width:100%; height:100%; image-rendering:pixelated; display:block; }
.radio-text{ min-width:0; flex:1; }
.radio-status{ font-family:'Space Mono',monospace; font-size:0.58rem; letter-spacing:0.1em; color:var(--purple); margin-bottom:2px; }
.radio-title{ font-size:1.05rem; color:var(--fg); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.radio-artist{ font-size:0.88rem; color:var(--cyan); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.radio-bar{ font-family:'Space Mono',monospace; font-size:0.8rem; letter-spacing:1px; margin-top:3px; }
.rb-fill{ color:var(--pink); } .rb-empty{ color:#33344a; }
.radio-btns{ display:flex; gap:6px; flex:none; }
.radio-btns button{ font-family:'Space Mono',monospace; font-size:0.62rem; font-weight:700; border:none; border-radius:4px; padding:8px 10px; cursor:pointer; color:#1c1024; }
.radio-btns .play{ background:var(--cyan); } .radio-btns .stop{ background:var(--pink); }

/* ---------------------------------------------------------
   CONTENT PANE (swapped by the router)
--------------------------------------------------------- */
#gfContentPane{ transition:opacity 0.18s ease; }
#gfContentPane.gf-fading{ opacity:0; }
.net-line{ font-family:'Space Mono',monospace; font-size:0.68rem; color:var(--green); margin:0 26px 10px; opacity:0.85; }

/* ---------------------------------------------------------
   POST / PAGE CONTENT
--------------------------------------------------------- */
.post-meta{ font-family:'Space Mono',monospace; font-size:0.65rem; color:var(--dim2); margin-bottom:6px; }
.post-meta .cat{ color:var(--amber); }
.post h1, .page-title{ font-size:2rem; line-height:1.1; margin:0 0 16px; color:var(--fg); text-shadow:0 0 14px rgba(180,139,250,0.3); }

.post-body{ font-size:1.15rem; line-height:1.55; max-width:100%; }
.post-body p{ margin:0 0 18px; }
.post-body h2{ font-size:1.3rem; color:var(--purple); margin:26px 0 10px; }
.post-body h3{ font-size:1.1rem; color:var(--cyan); margin:22px 0 8px; }
.post-body a{ color:var(--cyan); }
.post-body strong{ color:var(--amber); }

/* images: constrained, never overflow, whatever size WP gives them */
.post-body img{ max-width:100%; height:auto; display:block; border-radius:6px; box-shadow:0 0 0 1px #33344a; }
.post-body figure{ margin:0 0 20px; }
.post-body figure img{ width:100%; }
.post-body figcaption{ font-family:'Space Mono',monospace; font-size:0.65rem; color:var(--dim2); margin-top:6px; }

/* responsive embeds (YouTube etc.) - aspect-ratio wrapper, works regardless of WP core version behavior */
.post-body .wp-block-embed__wrapper,
.post-body .video-embed{
  position:relative; width:100%; padding-top:56.25%;
  margin:0 0 22px; border-radius:6px; overflow:hidden;
  box-shadow:0 0 0 1px #33344a; background:#000;
}
.post-body .wp-block-embed__wrapper iframe,
.post-body .video-embed iframe{ position:absolute; inset:0; width:100%; height:100%; border:0; }

/* galleries: grid, wraps automatically no matter how many images */
.post-body .wp-block-gallery,
.post-body .gallery-grid{
  display:grid; grid-template-columns:repeat(auto-fit, minmax(140px, 1fr));
  gap:8px; margin:0 0 22px; list-style:none; padding:0;
}
.post-body .wp-block-gallery img,
.post-body .gallery-grid img{ width:100%; height:140px; object-fit:cover; border-radius:6px; }

.post-body blockquote{
  margin:0 0 20px; padding:10px 16px; border-left:3px solid var(--pink);
  background:rgba(255,111,197,0.06); font-style:italic; color:var(--dim2);
}
.post-body ul, .post-body ol{ margin:0 0 20px; padding-left:22px; }
.post-body li{ margin-bottom:6px; }

.post-tags{ display:flex; flex-wrap:wrap; gap:6px; margin:6px 0 24px; }
.post-tags a{
  font-family:'Space Mono',monospace; font-size:0.65rem; color:var(--fg);
  background:var(--bg-alt2); border:1px solid #3a3b55; border-radius:4px;
  padding:4px 9px; text-decoration:none;
}

/* prev/next post navigation */
.post-nav{ display:flex; justify-content:space-between; gap:12px; margin:10px 0 30px; font-family:'Space Mono',monospace; font-size:0.72rem; flex-wrap:wrap; }
.post-nav a{ color:var(--cyan); text-decoration:none; max-width:48%; }
.post-nav a:hover{ text-decoration:underline; }
.post-nav .next{ margin-left:auto; text-align:right; }

/* listing / archive rows */
.entry-list{ margin-bottom:6px; }
.entry{ padding:16px 0; border-bottom:1px dashed rgba(42,43,63,0.7); }
.entry:last-child{ border-bottom:none; }
.entry-meta{ font-family:'Space Mono',monospace; font-size:0.68rem; color:var(--dim2); margin-bottom:4px; }
.entry-meta .cat{ color:var(--amber); }
.entry-title{ margin:0 0 6px; font-size:1.4rem; line-height:1.2; }
.entry-title a{ color:var(--fg); text-decoration:none; }
.entry-title a:hover{ color:var(--cyan); text-decoration:underline; }
.entry-excerpt{ font-size:1.05rem; line-height:1.4; color:var(--dim2); margin:0 0 8px; max-width:65ch; }
.entry-more{ font-family:'Space Mono',monospace; font-size:0.7rem; color:var(--cyan); text-decoration:none; }
.entry-more:hover{ text-decoration:underline; }

.pagination{ display:flex; gap:8px; padding:16px 0 26px; font-family:'Space Mono',monospace; font-size:0.72rem; }
.pagination a, .pagination span{
  color:var(--fg); background:var(--bg-alt2); border:1px solid #3a3b55; border-radius:4px;
  padding:6px 11px; text-decoration:none;
}
.pagination .current{ background:var(--purple); color:#1c1024; border-color:var(--purple); }

footer.site-footer{
  position:relative; z-index:2;
  padding:16px 26px 22px;
  font-family:'Space Mono',monospace; font-size:0.65rem; color:var(--dim2); line-height:1.7;
}
footer.site-footer .p{ color:var(--pink); } footer.site-footer .u{ color:var(--green); }

/* screen-reader only, used by the router for the a11y focus target */
.sr-only{
  position:absolute; width:1px; height:1px; padding:0; margin:-1px;
  overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0;
}

@media (max-width:520px){
  .hero h1{ font-size:2rem; }
  section, .post, .archive-wrap{ padding:20px 16px 4px; }
  .nav{ padding:0 16px 20px; }
  footer.site-footer{ padding:16px; }
}