/*
 * Theme C: "Case File"
 * Built from the Further Indications cover: graph paper, hand-drawn icons,
 * and the red title. The site reads like Manure Man's investigation notes.
 * Loaded after Bootstrap 4.5; overrides only what it needs.
 */
:root {
  --grid-blue: #d7ecf2;
  --sheet: #fffefb;
  --manila: #e8d5a6;
  --manila-dark: #cdb47a;
  --ink: #23262b;
  --ink-soft: #545a63;
  --red: #a3201b;
  --red-dark: #7d1612;
  --tea-yellow: #f1cf1a;
  --type: "Special Elite", "Courier New", monospace;
  --hand: "Kalam", "Comic Sans MS", cursive;
  --body: "Lora", Georgia, serif;
}

body.theme-casefile {
  background: #f9fcfd url("/images/graph_paper.jpg") repeat;
  background-size: 300px auto;
  color: var(--ink);
  font-family: var(--body);
  line-height: 1.7;
}
.theme-casefile h1, .theme-casefile h2, .theme-casefile h3,
.theme-casefile .display-4 {
  font-family: var(--type);
  color: var(--red);
  font-weight: 400;
}
.theme-casefile h4, .theme-casefile h5, .theme-casefile h6 { font-family: var(--type); font-weight: 400; }
.theme-casefile a { color: var(--red); }
.theme-casefile a:hover { color: var(--red-dark); }

/* Header */
.cf-header { padding-top: 1.75rem; }
.cf-header-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; }
.cf-brand { display: block; color: var(--ink) !important; text-decoration: none !important; padding-bottom: .75rem; }
.cf-stamp {
  display: inline-block;
  font-family: var(--type);
  font-size: .8rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--red);
  border: 2px solid var(--red);
  padding: .1rem .5rem;
  transform: rotate(-2deg);
  opacity: .85;
}
.cf-name {
  display: block;
  font-family: var(--type);
  font-size: clamp(2.4rem, 6vw, 3.75rem);
  line-height: 1.1;
  color: var(--red);
  margin-top: .4rem;
}
.cf-note { display: block; font-family: var(--hand); font-size: 1.2rem; color: var(--ink-soft); transform: rotate(-1deg); }
.cf-icons { list-style: none; margin: 0 0 .5rem; padding: 0; gap: .6rem; }
.cf-icons img { width: 56px; height: auto; opacity: .8; transition: transform .2s ease, opacity .2s ease; }
.cf-icons li:nth-child(odd) img { transform: rotate(-4deg); }
.cf-icons li:nth-child(even) img { transform: rotate(3deg); }
.cf-icons img:hover { opacity: 1; transform: rotate(0) scale(1.08); }

/* Folder-tab navigation */
.cf-nav { padding: 0; }
.theme-casefile .cf-nav > .container { padding-left: 15px; padding-right: 15px; }
.cf-tabs { gap: .25rem; align-items: flex-end; }
.cf-tabs .nav-link {
  font-family: var(--type);
  font-size: .95rem;
  color: var(--ink) !important;
  background: var(--manila);
  border: 1px solid var(--manila-dark);
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
  padding: .55rem 1.1rem .45rem !important;
  position: relative;
  top: 1px;
  transition: padding .15s ease, background .15s ease;
}
.cf-tabs .nav-link:hover { background: #f0e1b9; padding-top: .75rem !important; }
.cf-tabs .nav-link.active { background: var(--sheet); padding-top: .8rem !important; color: var(--red) !important; z-index: 2; }
.cf-tabs .cf-tab-fi { border-top: 3px solid var(--red); }
.cf-tabs .cf-tab-tea { border-top: 3px solid var(--tea-yellow); }
.cf-toggler {
  font-family: var(--type);
  background: var(--manila);
  border: 1px solid var(--manila-dark);
  border-radius: 6px 6px 0 0;
  color: var(--ink);
  margin-left: auto;
}
@media (max-width: 767.98px) {
  .cf-tabs { gap: 0; padding-bottom: .5rem; }
  .cf-tabs .nav-link { border-radius: 0; border-bottom: 1px solid var(--manila-dark); top: 0; }
  .cf-tabs .nav-link:hover, .cf-tabs .nav-link.active { padding-top: .55rem !important; }
}

/* The sheet: the paper that page content sits on */
.cf-sheet {
  display: block;
  background: var(--sheet);
  max-width: 1180px;
  margin: 0 auto;
  min-height: 50vh;
  padding: 0 0 3rem;
  border: 1px solid var(--manila-dark);
  box-shadow: 0 1px 2px rgba(0,0,0,.06), 0 18px 40px -18px rgba(35,38,43,.35);
  position: relative;
}
@media (min-width: 1200px) {
  /* a red margin rule, like a lab notebook */
  .cf-sheet::before {
    content: ""; position: absolute; top: 0; bottom: 0; left: 14px;
    width: 1px; background: rgba(163,32,27,.35);
  }
}
.theme-casefile header.bg-primary {
  background: transparent !important;
  border-bottom: 2px dashed var(--grid-blue);
}
.theme-casefile header.bg-primary .text-white { color: var(--red) !important; }
.theme-casefile header.bg-primary .text-white-50 { color: var(--ink-soft) !important; }
.theme-casefile .btn-primary {
  color: #fff;
  font-family: var(--type);
  background: var(--red);
  border-color: var(--red);
  border-radius: 2px;
  box-shadow: 3px 3px 0 var(--ink);
}
.theme-casefile .btn-primary:hover { color: #fff; background: var(--red-dark); border-color: var(--red-dark); transform: translate(1px, 1px); box-shadow: 2px 2px 0 var(--ink); }
.theme-casefile .card, .theme-casefile .blog-box {
  background: #fff;
  border: 1px solid #d9d4c7;
  border-radius: 2px;
  box-shadow: 2px 3px 0 rgba(35,38,43,.08);
}
.theme-casefile .form-control { font-family: var(--type); border-color: #c9c2b0; border-radius: 2px; }
.theme-casefile .form-control:focus { border-color: var(--red); box-shadow: 0 0 0 .15rem rgba(163,32,27,.18); }
.theme-casefile .alert-success { font-family: var(--type); }
.theme-casefile blockquote {
  font-family: var(--hand);
  font-size: 1.2rem;
  color: var(--ink-soft);
  border-left: 3px solid var(--tea-yellow);
  padding-left: 1rem;
}

/* Footer: evidence board */
.cf-footer { padding: 3.5rem 0 1.5rem; }
.cf-footer-heading {
  font-family: var(--type);
  color: var(--ink);
  font-size: 1.1rem;
  letter-spacing: .3em;
  text-transform: uppercase;
  text-align: center;
  margin-bottom: 2rem;
}
.cf-polaroid {
  display: inline-block;
  background: #fff;
  padding: .6rem .6rem 0;
  box-shadow: 0 2px 4px rgba(0,0,0,.12), 0 12px 24px -10px rgba(0,0,0,.4);
  color: var(--ink) !important;
  text-decoration: none !important;
  max-width: 200px;
  position: relative;
  transition: transform .25s ease;
}
.cf-polaroid::before { /* masking tape */
  content: ""; position: absolute; top: -12px; left: 50%;
  width: 80px; height: 24px; margin-left: -40px;
  background: rgba(241, 232, 196, .85);
  transform: rotate(-3deg);
  box-shadow: 0 1px 2px rgba(0,0,0,.1);
}
.cf-polaroid img { width: 100%; height: auto; display: block; }
.cf-polaroid span { display: block; font-family: var(--hand); font-size: 1rem; line-height: 1.3; padding: .6rem 0 .8rem; }
.cf-tilt-l { transform: rotate(-4deg); }
.cf-tilt-r { transform: rotate(3deg); }
.cf-polaroid:hover { transform: rotate(0) scale(1.04); }
.cf-memo {
  background: #fffbe6;
  border: 1px solid #e9dfae;
  padding: 1.25rem 1.5rem;
  box-shadow: 2px 3px 0 rgba(35,38,43,.08);
  font-size: .95rem;
}
.cf-memo-head { font-family: var(--type); text-transform: uppercase; letter-spacing: .1em; color: var(--red); border-bottom: 1px solid #e9dfae; padding-bottom: .4rem; }
.cf-scrawl { font-family: var(--hand); font-size: 1.15rem; color: #2f5fa3; transform: rotate(-1.5deg); margin: 0; }
.cf-legal { text-align: center; font-family: var(--type); font-size: .8rem; color: var(--ink-soft); margin: 1.5rem 0 0; }

@media (prefers-reduced-motion: reduce) {
  .cf-polaroid, .cf-icons img, .cf-tabs .nav-link { transition: none; }
}

/* Book pages */
.cf-file-label {
  display: inline-block;
  font-family: var(--type);
  font-size: .85rem;
  letter-spacing: .15em;
  text-transform: uppercase;
  background: var(--manila);
  border: 1px solid var(--manila-dark);
  border-top: 3px solid var(--red);
  padding: .15rem .75rem;
  margin: 0;
}
.cf-file-label-tea { border-top-color: var(--tea-yellow); }
.cf-cover { display: inline-block; margin: 0; background: #fff; padding: .6rem; position: relative;
  box-shadow: 0 2px 4px rgba(0,0,0,.12), 0 16px 30px -12px rgba(0,0,0,.45); max-width: 320px; }
.cf-cover::before { /* paper clip */
  content: ""; position: absolute; top: -14px; right: 28px; width: 18px; height: 52px;
  border: 3px solid #8d949c; border-radius: 9px; border-bottom-color: transparent;
}
.cf-cover img { width: 100%; height: auto; display: block; }
.cf-sheet .cf-scrawl { font-size: 1.25rem; }
.cf-dossier { position: relative; border-top: 3px solid var(--red); }
.cf-dossier-tea { border-top-color: var(--tea-yellow); }
.cf-dossier .card-title { font-size: 1.3rem; color: var(--red); }
.cf-dossier-tea .card-title { color: var(--ink); }
.cf-dossier .card-text { font-size: .95rem; margin-bottom: 0; }
.cf-dossier-icon { position: absolute; top: .75rem; right: .75rem; width: 34px; height: auto; opacity: .7; }
.cf-excerpt {
  font-family: var(--type);
  font-size: 1rem;
  line-height: 1.8;
  background: #fff;
  border: 1px solid #d9d4c7;
  padding: 2rem 2.25rem;
  max-width: 46rem;
  box-shadow: 4px 5px 0 rgba(35,38,43,.08);
  transform: rotate(-.4deg);
}
.cf-excerpt p:last-child { margin-bottom: 0; }
.cf-panels { display: flex; gap: .75rem; align-items: flex-start; margin-bottom: 1.5rem; }
/* flex-grow on each panel = its width/height ratio, so every panel ends up the same height */
.cf-panels img { flex-basis: 0; min-width: 0; height: auto; display: block; border: 3px solid var(--ink); background: #fff; }
@media (max-width: 767.98px) {
  .cf-panels { flex-direction: column; }
  .cf-panels img { flex: none; width: 100%; }
}
.cf-specs { display: grid; grid-template-columns: max-content 1fr; gap: .35rem 1.25rem; margin: 0; }
.cf-specs dt { font-family: var(--type); font-weight: 400; color: var(--ink-soft); text-transform: uppercase; font-size: .85rem; letter-spacing: .08em; padding-top: .2rem; }
.cf-specs dd { margin: 0; }
@media (max-width: 575.98px) {
  .cf-excerpt { padding: 1.25rem; transform: none; }
}
