/* ============================================================================
   FilmLab – "safelight" theme layer on top of Furo
   Gunmetal-slate ground, a darkroom red-orange accent. Palette tokens live in
   conf.py; this file handles typography, the heading rule, admonitions, etc.
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;600&family=Fraunces:opsz,wght@9..144,400;9..144,600&display=swap');

/* --- Admonition accent tokens (theme-aware) --------------------------------
   Defined here rather than in conf.py so the auto (system) theme resolves them
   from prefers-color-scheme, not just the manual toggle. Furo puts the theme
   flag on <body>, so the dark overrides key off `body[data-theme]`. */

:root {
  --adm-summary:      #b03e26;   /* safelight red – the brand accent */
  --adm-summary-text: #8c3120;
  --adm-keyidea:      #0f8f7a;   /* darkroom-clock green */
  --adm-keyidea-text: #0b6a5a;
  --adm-funfact:      #2f6ed0;   /* enlarger-lamp blue */
  --adm-funfact-text: #2358ac;
  --adm-myth:         #bb3a7d;   /* selenium magenta */
  --adm-myth-text:    #93305f;
  --adm-jargon:       #5f4fc0;   /* UV-lamp violet */
  --adm-jargon-text:  #493c9c;
}
@media (prefers-color-scheme: dark) {
  body:not([data-theme="light"]) {
    --adm-summary:      #e2694f;
    --adm-summary-text: #ffb0a0;
    --adm-keyidea:      #35cdb4;
    --adm-keyidea-text: #74e2cf;
    --adm-funfact:      #5ea0f5;
    --adm-funfact-text: #9ac6fb;
    --adm-myth:         #ee6bb2;
    --adm-myth-text:    #f7a2ce;
    --adm-jargon:       #9585ee;
    --adm-jargon-text:  #bcb1f6;
  }
}
body[data-theme="dark"] {
  --adm-summary:      #e2694f;
  --adm-summary-text: #ffb0a0;
  --adm-keyidea:      #35cdb4;
  --adm-keyidea-text: #74e2cf;
  --adm-funfact:      #5ea0f5;
  --adm-funfact-text: #9ac6fb;
  --adm-myth:         #ee6bb2;
  --adm-myth-text:    #f7a2ce;
  --adm-jargon:       #9585ee;
  --adm-jargon-text:  #bcb1f6;
}

/* --- Global tuning --------------------------------------------------------- */

body { -webkit-font-smoothing: antialiased; }

h1, h2, h3, h4 {
  font-family: 'Fraunces', Georgia, 'Times New Roman', serif;
  letter-spacing: -0.01em;
}

h1 {
  font-weight: 600;
  margin-bottom: 0.9em;
  padding-bottom: 0;
}

/* Heading rule: a short accent bar, blueprint title-block style */
article > section > h1::after,
.content-icon-container + section > h1::after {
  content: "";
  display: block;
  width: 2.75rem;
  height: 3px;
  margin-top: 0.55rem;
  border-radius: 2px;
  background: var(--color-brand-primary);
}

article h2 {
  margin-top: 2.2em;
  padding-top: 0.4em;
  border-top: 1px solid var(--color-background-border);
}

/* --- Sidebar brand ------------------------------------------------------- */

.sidebar-brand { display: flex; flex-direction: column; align-items: flex-start; }
.sidebar-logo-container { margin: 0.2rem 0 0.6rem; max-width: 78%; }
.sidebar-logo { max-width: 100%; height: auto; }
.sidebar-brand-text { font-family: 'Fraunces', serif; font-weight: 600; }

/* --- Links & code ----------------------------------------------------- */

a.reference.internal code.literal { color: inherit; }

/* Visited links look exactly like unvisited ones (Furo's --color-brand-visited
   is otherwise unset, which lets the browser's purple leak into content links). */
:root { --color-brand-visited: var(--color-brand-primary); }

code.literal {
  border-radius: 3px;
  font-size: 0.86em;
  border: 1px solid var(--color-background-border);
}

/* --- Tables --------------------------------------------------------- */

table.docutils { border-collapse: collapse; font-size: 0.86rem; width: 100%; }
table.docutils th {
  background: var(--color-background-secondary);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
table.docutils td, table.docutils th {
  border: 1px solid var(--color-background-border);
  padding: 0.5rem 0.7rem;
}
table.docutils tr:nth-child(even) { background: var(--color-background-secondary); }

/* --- Custom admonitions -------------------------------------------------
   MyST:  :::{admonition} Fun fact
          :class: fun-fact
   Classes: fun-fact, summary, key-idea, myth, jargon
   ------------------------------------------------------------------- */

.admonition.summary  { --acc: var(--adm-summary);  --acc-t: var(--adm-summary-text); }
.admonition.key-idea { --acc: var(--adm-keyidea);  --acc-t: var(--adm-keyidea-text); }
.admonition.fun-fact { --acc: var(--adm-funfact);  --acc-t: var(--adm-funfact-text); }
.admonition.myth     { --acc: var(--adm-myth);     --acc-t: var(--adm-myth-text); }
.admonition.jargon   { --acc: var(--adm-jargon);   --acc-t: var(--adm-jargon-text); }

.admonition.summary,
.admonition.key-idea,
.admonition.fun-fact,
.admonition.myth,
.admonition.jargon {
  border-radius: 8px;
  /* sit on a real surface so the box lifts off the page, then frame it */
  background: var(--color-background-secondary);
  border: 1px solid color-mix(in srgb, var(--acc) 45%, var(--color-background-border));
  border-left: 5px solid var(--acc);
  box-shadow: none;
}
.admonition.summary  > .admonition-title,
.admonition.key-idea > .admonition-title,
.admonition.fun-fact > .admonition-title,
.admonition.myth     > .admonition-title,
.admonition.jargon   > .admonition-title {
  background: color-mix(in srgb, var(--acc) 24%, var(--color-background-secondary));
  color: var(--acc-t);
  font-weight: 600;
}

/* swap Furo's masked-SVG icon for an emoji on our classes */
.admonition.summary  > .admonition-title::before,
.admonition.key-idea > .admonition-title::before,
.admonition.fun-fact > .admonition-title::before,
.admonition.myth     > .admonition-title::before,
.admonition.jargon   > .admonition-title::before {
  -webkit-mask-image: none !important;
  mask-image: none !important;
  background-color: transparent !important;
  background: none !important;
  font-size: 1rem;
  line-height: 1;
  text-align: center;
}
.admonition.summary  > .admonition-title::before { content: "\1F4CB"; }
.admonition.key-idea > .admonition-title::before { content: "\1F511"; }
.admonition.fun-fact > .admonition-title::before { content: "\1F4A1"; }
.admonition.myth     > .admonition-title::before { content: "\2696\FE0F"; }
.admonition.jargon   > .admonition-title::before { content: "\1F4D6"; }

/* --- Figures & captions --------------------------------------------- */

figure { margin: 1.6rem auto; }
figure img, .figure img, img.align-center {
  border-radius: 6px;
  border: 1px solid var(--color-background-border);
}
figcaption, .caption-text {
  font-size: 0.82rem;
  color: var(--color-foreground-muted);
  font-style: italic;
  margin-top: 0.5rem;
}
figcaption a { font-style: normal; }
img[src$=".svg"], object[type="image/svg+xml"] { border: none !important; }

/* --- sphinx-design cards ------------------------------------------- */

.sd-card { border-radius: 8px; border-color: var(--color-background-border); }
.sd-card-title { font-family: 'Fraunces', serif; }

/* --- misc --------------------------------------------------------- */

.bottom-of-page { border-top: 1px solid var(--color-background-border); }

/* Furo's footer always prints "Made with Furo"; keep only copyright + last-updated.
   Zero the parent's font so the bare "Made with" text collapses, restore it on the
   two child <div>s, and hide the Furo link outright. */
.bottom-of-page .left-details { font-size: 0; }
.bottom-of-page .left-details .copyright,
.bottom-of-page .left-details .last-updated { font-size: 0.82rem; }
.bottom-of-page .left-details > a[href*="pradyunsg/furo"] { display: none; }

/* --- Landing-page hero ------------------------------------------- */

.filmlab-hero {
  margin: 1.5rem 0 2.5rem;
  padding: 1.8rem;
  border-radius: 10px;
  background:
    linear-gradient(135deg,
      color-mix(in srgb, var(--color-brand-primary) 15%, transparent),
      transparent 62%),
    var(--color-background-secondary);
  border: 1px solid var(--color-background-border);
}
.filmlab-hero p:first-child { font-size: 1.15rem; line-height: 1.6; margin-top: 0; }
.filmlab-hero p:last-child { margin-bottom: 0; }

/* --- meta / reading-time line ---------------------------------- */

.page-meta {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--color-foreground-muted);
  margin-bottom: 1.5rem;
}
