/* Shared styles for every page of Loggin’ Chung. Each page adds only what's unique to it. */

/* Courier Prime, from Google Fonts: Courier with sturdier letters and real italics.
   If it can't load, pages fall back to Courier New. */
@import url("https://fonts.googleapis.com/css2?family=Courier+Prime:ital,wght@0,400;0,700;1,400;1,700&display=swap");

/* ---- Colors ----
   Light by default. theme.js sets data-theme="dark" from the device setting or the toggle. */
:root{
  --bg:#fffbfa; --panel:#fff8f6; --field:var(--panel);
  --ink:#000; --muted:#6b6b6b; --line:#969696; --slash:rgb(150 150 150/.3);
  --accent:#ff948f; --scrim:rgb(0 0 0/.5); --bgimg:none;
  --note:#c4544e;  /* coral text (notes), deepened so it reads on the light background */
  --font:"Courier Prime","Courier New",Courier,monospace;
  color-scheme:light;
}
:root[data-theme="dark"]{
  --bg:#12161e; --panel:#1b212c; --field:transparent;
  --ink:#e6eaf1; --muted:#8b95a7; --line:#303949; --slash:rgb(48 57 73/.55);
  --scrim:rgb(0 0 0/.65); --note:var(--accent);
  /* A blurred Pale Blue Dot behind every page, under a wash of the background so text stays readable. */
  --bgimg:linear-gradient(rgb(18 22 30/.55) 0 0),url(images/pale-blue-dot.jpg);
  color-scheme:dark;
}

/* ---- Base ---- */
*{box-sizing:border-box}
:root{padding:env(safe-area-inset-top,0px) 0 env(safe-area-inset-bottom,0px)}
html{scroll-padding-top:env(safe-area-inset-top,0px);-webkit-text-size-adjust:100%;text-size-adjust:100%}  /* stop iPhone Safari enlarging text on its own */
body{margin:0;background:var(--bg);color:var(--ink);font:400 .85rem/1.6 var(--font)}
body::before{content:"";position:fixed;inset:0;z-index:-1;background:var(--bgimg) center/cover no-repeat}
main{max-width:64rem;padding:3rem 1.5rem 5rem}
h1{font:700 clamp(2.2rem,8vw,2.75rem)/1 var(--font);margin:0 0 .5rem}
h1 a,h1 a:hover{color:inherit;background:none;text-decoration:none}
h2{font:400 1.75rem/1 var(--font);margin:0 0 1.25rem}
h3{font:600 1.05rem/1.3 var(--font);margin:2rem 0 .4rem}
[hidden]{display:none!important}
:focus-visible{outline:2px solid var(--accent);outline-offset:2px}

/* ---- Links and nav ---- */
a,.linkbtn{color:var(--ink);text-decoration:underline dotted var(--accent) 2px;text-underline-offset:.25em}
a:hover,.linkbtn:hover:not(:disabled),.links a[aria-current]{background:var(--accent);color:#000;text-decoration-color:transparent}
/* Buttons that read as links: "watch TV", "click here", "sign up" */
.linkbtn{font:inherit;background:none;border:0;padding:0;cursor:pointer}
.linkbtn:disabled{opacity:.5;cursor:default}
.links{display:flex;flex-wrap:wrap;gap:.25rem 1.5rem;margin:0 0 1.25rem;font-size:1rem}

/* ---- Fields ---- */
input{font:inherit;padding:.5rem .75rem;border:1px dotted var(--line);border-radius:1px;background:var(--field);color:var(--ink)}

/* ---- Round buttons: arrows and close ---- */
.circle{border:1px dotted var(--line);border-radius:50%;background:var(--panel);color:var(--ink);font:inherit;cursor:pointer}
.circle:hover:not(:disabled){border-color:var(--accent);color:var(--accent)}
.circle:disabled{opacity:.3;cursor:default}

/* ---- The small "i" that shows a note (coral while open), and notes in coral ---- */
.i{flex:none;width:1.6rem;height:1.6rem;padding:0;font-size:.8rem;font-style:italic;font-weight:700}
.i[aria-expanded="true"]{border-color:var(--accent);color:var(--accent)}
.note{color:var(--note);font-size:.85rem;line-height:1.4}
.note a{color:inherit}

/* ---- A YouTube video in a post (a YouTube link on a line by itself) ---- */
.video{aspect-ratio:16/9;margin:0 0 1rem;background:#000;border:1px dotted var(--line);border-radius:1px;overflow:hidden}
.video iframe{display:block;width:100%;height:100%;border:0}

/* ---- An audio file in a post (a link to an .mp3 or similar on a line by itself), captioned with its name ---- */
.track{margin:0 0 1rem;padding:.75rem .9rem .8rem;border:1px dotted var(--line);border-radius:1px;background:var(--bg)}
.track figcaption{font-size:.8rem;color:var(--note);margin:0 0 .5rem;overflow-wrap:anywhere}
.track figcaption::before{content:"♪ "}
.track audio{display:block;width:100%;height:2.25rem;accent-color:var(--accent)}

/* ---- Lightbox ---- */
dialog{border:0;padding:0;background:transparent;width:100%;max-width:none;height:100%;max-height:none;color:var(--ink)}
dialog::backdrop{background:var(--scrim)}
.wrap{min-height:100%;display:grid;grid-template-columns:3rem minmax(0,44rem) 3rem;gap:1rem;justify-content:center;align-items:center;padding:2rem 1rem}
#art{background:var(--panel);border:1px dotted var(--line);border-radius:1px;padding:2.25rem 2.5rem;max-height:calc(100vh - 4rem);overflow:auto}
.nav{width:3rem;height:3rem;font-size:1.2rem}
.close{position:fixed;top:calc(.75rem + env(safe-area-inset-top,0px));right:1rem;background:none;border:0;color:#fff;font-size:1.6rem;cursor:pointer}

/* ---- Light/dark toggle (added by theme.js) ---- */
.theme-toggle{position:fixed;left:1rem;bottom:calc(1rem + env(safe-area-inset-bottom,0px));z-index:5;width:2.25rem;height:2.25rem;padding:0;display:grid;place-items:center;border-radius:50%;border:1px dotted var(--line);background:var(--panel);color:var(--ink);opacity:.65;cursor:pointer}
.theme-toggle:hover,.theme-toggle:focus-visible{opacity:1}
.theme-toggle svg{width:1.1rem;height:1.1rem;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}

@media (prefers-reduced-motion:reduce){*{transition:none!important}}
