/* ================================================================
   Young Ones Scripts — Theme Override
   Grungy punk aesthetic for chrome, clean readable script text
   ================================================================ */

@import url('https://fonts.googleapis.com/css2?family=Special+Elite&family=Roboto:wght@300;400;500;700&display=swap');

/* ---- CSS Custom Properties ---- */
:root {
  --yo-bg:        #1a1a1a;
  --yo-surface:   #2a2a2a;
  --yo-primary:   #5a7d3a;
  --yo-accent:    #c0392b;
  --yo-mustard:   #d4a017;
  --yo-teal:      #2d6e6e;
  --yo-text:      #e8e0d0;
  --yo-text-dim:  #9a9080;
  --yo-link:      #e84393;
  --yo-border:    #3a3a3a;
  --yo-script-bg: #f5f0e6;
  --yo-script-text: #1a1a1a;
}

/* ---- Custom Scrollbar ----
   Hide native scrollbar entirely and use a JS-created div-based one
   for full control over width, colour, and behaviour.               */
html { scrollbar-width: none !important; -ms-overflow-style: none !important; }
html::-webkit-scrollbar,
body::-webkit-scrollbar { display: none !important; width: 0 !important; }

.sb-track {
  position: fixed;
  right: 0;
  top: 0;
  width: 14px;
  height: 100vh;
  background: #2e2e2e;
  z-index: 9999;
  touch-action: none;
}
.sb-thumb {
  position: absolute;
  left: 1px;
  width: 12px;
  background: #c0c0c0;
  border-radius: 6px;
  cursor: grab;
  transition: background 0.15s;
}
.sb-thumb:hover { background: #e8e8e8; }
.sb-thumb:active { cursor: grabbing; background: #fff; }

/* ---- Base ---- */
body {
  background-color: var(--yo-bg);
  color: var(--yo-text);
  font-family: "Roboto", sans-serif;
}

/* ---- Sidebar ---- */
.w3-sidebar {
  background-color: var(--yo-surface) !important;
  border-right: 3px solid var(--yo-accent);
}

.w3-sidebar .w3-bar-item {
  font-family: "Special Elite", monospace;
  color: var(--yo-text) !important;
  border-bottom: 1px solid var(--yo-border);
  transition: background-color 0.15s, color 0.15s;
}

/* Sidebar image — full width, no padding or border */
.w3-sidebar .w3-bar-item.w3-border-bottom img {
  width: 100% !important;
  display: block;
}
.w3-sidebar .w3-bar-item.w3-border-bottom.w3-large {
  padding: 0 !important;
  border-bottom: none !important;
}

.w3-sidebar .w3-bar-item:hover {
  background-color: var(--yo-primary) !important;
  color: #fff !important;
}

.w3-sidebar .w3-bar-item.w3-teal {
  background-color: var(--yo-teal) !important;
  color: #fff !important;
}

/* Section headers in sidebar — Season One, Season Two, Rick's Poems */
.w3-sidebar .w3-bar-item[style*="yo-mustard"] {
  color: var(--yo-mustard) !important;
  font-style: italic !important;
}

.w3-sidebar p.w3-bar-item {
  font-size: 18px !important;
  color: var(--yo-mustard) !important;
  font-style: italic;
  border-bottom: none;
  padding-top: 16px;
  padding-bottom: 4px;
}

/* ---- Top bar (removed — merged into header) ---- */

/* ---- Header — fully custom, zero w3.css class interference ---- */
#siteHeader {
  background: var(--yo-surface);
  border-bottom: 3px solid var(--yo-accent);
  padding: 12px 32px;
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 16px;
  overflow: visible;
  box-sizing: border-box;
}

.nav-toggle {
  background: var(--yo-teal);
  border: none;
  cursor: pointer;
  color: var(--yo-mustard);
  font-size: 24px;
  padding: 8px 14px;
  flex-shrink: 0;
  line-height: 1;
}

.site-title {
  font-family: "Special Elite", monospace;
  color: var(--yo-text);
  text-shadow: 2px 2px 0 var(--yo-accent);
  letter-spacing: 1px;
  font-size: 32px;
  margin: 0;
  padding: 0;
  flex: 1;
  line-height: 1.2;
}

#myIntro {
  font-family: "Special Elite", monospace;
  color: var(--yo-mustard);
  font-size: 24px;
  font-weight: bold;
  display: none;
  flex: 1;
  line-height: 1.2;
}

/* Scrolled state — swap site-title for myIntro */
#siteHeader.scrolled .site-title { display: none; }
#siteHeader.scrolled #myIntro    { display: block; }

/* ---- Main content area ---- */
.w3-main {
  background-color: var(--yo-bg);
  margin-left: 250px;
}

/* Content container — the script reading area */
.w3-container {
  padding: 16px 32px;
}

/* Season page content — flex to fill viewport */
.season-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* ---- Home page cards ---- */
.w3-card {
  background-color: var(--yo-surface) !important;
  border: 1px solid var(--yo-border) !important;
  box-shadow: none !important;
}

.w3-card h3 {
  font-family: "Special Elite", monospace;
  color: var(--yo-mustard) !important;
}

/* ---- Episode tiles — punk/grunge themed ---- */
.ep-tile {
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  font-family: "Special Elite", monospace;
  font-size: 22px;
  font-weight: bold;
  color: #fff !important;
  padding: 24px 16px;
  min-height: 80px;
  text-align: center;
  border: 2px solid #000;
  transition: transform 0.15s, filter 0.15s;
  position: relative;
  overflow: hidden;
  line-height: 1.2;
}

.ep-tile:hover {
  transform: translate(-3px, -3px) rotate(-1deg);
  filter: brightness(1.2);
  box-shadow: 4px 4px 0 #000;
}

.ep-tile::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: repeating-linear-gradient(
    45deg,
    transparent,
    transparent 8px,
    rgba(0,0,0,0.08) 8px,
    rgba(0,0,0,0.08) 16px
  );
  pointer-events: none;
}

/* Per-episode colours — Season One */
.ep-demolition    { background-color: #8B4513 !important; transform: rotate(-1deg); }
.ep-oil           { background-color: #1a1a1a !important; border-color: var(--yo-mustard); transform: rotate(0.5deg); }
.ep-boring        { background-color: #4a4a4a !important; transform: rotate(-0.5deg); }
.ep-bomb          { background-color: var(--yo-accent) !important; transform: rotate(1deg); }
.ep-interesting   { background-color: var(--yo-primary) !important; transform: rotate(-1deg); }
.ep-flood         { background-color: var(--yo-teal) !important; transform: rotate(0.5deg); }

/* Per-episode colours — Season Two */
.ep-bambi         { background-color: #6b3fa0 !important; transform: rotate(-0.5deg); }
.ep-cash          { background-color: #2d8659 !important; transform: rotate(1deg); }
.ep-nasty         { background-color: #8B0000 !important; transform: rotate(-1deg); }
.ep-sick          { background-color: #7d8c3a !important; transform: rotate(0.5deg); }
.ep-time          { background-color: #2a4d6e !important; transform: rotate(-0.5deg); }
.ep-summer-holiday { background-color: #d4a017 !important; color: #1a1a1a !important; transform: rotate(1deg); }

/* Season page tiles — same styling */
.season-tile {
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  font-family: "Special Elite", monospace;
  font-size: 24px;
  font-weight: bold;
  color: #fff !important;
  padding: 28px 16px;
  min-height: 90px;
  text-align: center;
  border: 2px solid #000;
  transition: transform 0.15s, filter 0.15s;
  position: relative;
  overflow: hidden;
  line-height: 1.2;
}

.season-tile:hover {
  transform: translate(-3px, -3px) rotate(-1deg);
  filter: brightness(1.2);
  box-shadow: 4px 4px 0 #000;
}

.season-tile::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: repeating-linear-gradient(
    45deg,
    transparent,
    transparent 8px,
    rgba(0,0,0,0.08) 8px,
    rgba(0,0,0,0.08) 16px
  );
  pointer-events: none;
}

/* ---- Footer ---- */
footer.w3-theme {
  background-color: var(--yo-surface) !important;
  border-top: 3px solid var(--yo-accent);
  color: var(--yo-text-dim) !important;
  padding: 8px 32px !important;
}

footer.w3-theme p {
  font-family: "Special Elite", monospace;
  font-size: 32px;
  color: var(--yo-text) !important;
  text-shadow: 2px 2px 0 var(--yo-accent);
  letter-spacing: 1px;
  margin: 0;
}

/* ---- Episode script content ----
   Clean, readable, copyable. Sans-serif on light background. */

.w3-container h1 {
  font-family: "Special Elite", monospace;
  color: var(--yo-mustard);
  border-bottom: none;
  padding-bottom: 4px;
}

.w3-container h2,
.w3-container h3 {
  font-family: "Roboto", sans-serif;
  color: var(--yo-text);
  font-weight: 700;
}

/* Script body text — readable area on episode pages */
.w3-container p,
.w3-container br + br,
.w3-container font,
.w3-container span {
  font-family: "Roboto", "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.7;
  color: var(--yo-text);
}

/* ---- Overlay ---- */
.w3-overlay {
  background-color: rgba(0,0,0,0.7) !important;
}

/* ---- Hamburger button ---- */
.fa-bars {
  color: var(--yo-mustard) !important;
}

/* ================================================================
   RESPONSIVE — three breakpoints matching w3.css
   Desktop (>992px): sidebar visible, no hamburger
   Tablet (≤992px):  sidebar hidden, hamburger shows
   Small  (≤768px):  phones / small tablets
   ================================================================ */

@media (max-width: 992px) {
  .w3-sidebar {
    border-right: none;
    z-index: 200 !important;
  }

  /* Column layout: hamburger on row 1, title on row 2 — full width, never clipped */
  #siteHeader {
    flex-direction: column;
    align-items: flex-start;
    padding: 8px 20px 10px 20px;
    gap: 20px;
  }
  .site-title {
    font-size: 22px;
    width: 100%;
  }
  #myIntro {
    font-size: 18px;
    width: 100%;
  }
  .w3-container {
    padding: 14px 20px;
  }
}

@media (max-width: 768px) {
  #siteHeader {
    padding: 6px 16px 10px 16px;
    gap: 20px;
  }
  .site-title {
    font-size: 20px;
  }
  #myIntro {
    font-size: 16px;
  }
  .w3-container {
    padding: 12px 16px;
  }
  .ep-tile {
    font-size: 18px;
    padding: 18px 12px;
    min-height: 64px;
  }
  .season-tile {
    font-size: 20px;
    padding: 22px 12px;
    min-height: 72px;
  }
}

@media (max-width: 480px) {
  #siteHeader {
    padding: 6px 12px 10px 12px;
    gap: 16px;
  }
  .site-title {
    font-size: 27px;
    letter-spacing: 0.5px;
  }
  #myIntro {
    font-size: 21px;
  }
  .w3-container {
    padding: 10px 12px;
  }
  .ep-tile {
    font-size: 16px;
    padding: 14px 10px;
    min-height: 56px;
  }
  .season-tile {
    font-size: 18px;
    padding: 18px 10px;
    min-height: 64px;
  }
  footer.w3-theme p {
    font-size: 22px;
  }
}
