/* ====================================================================
   BERKELEY COLORS AND BANNER
   ====================================================================*/

/* UC Berkeley Official Colors */
:root {
  --berkeley-blue: #003262;
  --california-gold: #FDB515;
}

/* Page background - light yellow like landing page */
body {
  background-color: #F2F7FA !important;
}

#quarto-content {
  background-color: #FEFDF8 !important;
}

/* Banner at top */
.navbar {
  background-color: var(--berkeley-blue) !important;
  border-bottom: 3px solid var(--california-gold) !important;
  padding: 0.75rem 1rem !important;
}

.navbar-brand {
  color: var(--california-gold) !important;
  font-weight: 600 !important;
  font-size: 1.3rem !important;
}

.navbar a {
  color: rgba(253, 181, 21, 0.9) !important;
}

.navbar a:hover {
  color: var(--california-gold) !important;
}

/* Update existing colors to use Berkeley palette */


/* ====================================================================
   CUSTOM STYLING FOR QUARTO BOOK
   ====================================================================*/

/* Import EB Garamond font */
@import url('https://fonts.googleapis.com/css2?family=EB+Garamond:ital,wght@0,400;0,500;0,600;0,700;1,400;1,500&display=swap');

:root {
  --question-color: #B71C1C;
  --answer-color: #0A3050;
  --definition-color: #B8860B;
  --important-bg: #f5f5f5;
  --important-border: #b0b0b0;
}

/* ====================================================================
   QUESTION ENVIRONMENT
   ====================================================================*/
.question {
  margin: 1.5em 0;
  padding: 1em;
  border-left: 4px solid var(--question-color);
  background-color: rgba(183, 28, 28, 0.05);
  border-radius: 2px;
}

.question::before {
  content: "Q";
  display: inline-block;
  width: 24px;
  height: 24px;
  background-color: var(--question-color);
  color: white;
  border-radius: 50%;
  text-align: center;
  line-height: 24px;
  font-weight: bold;
  font-size: 0.9em;
  margin-right: 0.5em;
  vertical-align: middle;
}

.question p {
  display: inline;
  margin: 0;
  font-weight: 500;
}

/* ====================================================================
   ANSWER ENVIRONMENT
   ====================================================================*/
.answer {
  margin: 1em 0 1.5em 0;
  padding: 1em;
  border-left: 4px solid var(--answer-color);
  background-color: rgba(10, 48, 80, 0.05);
  border-radius: 2px;
}

.answer::before {
  content: "A";
  display: inline-block;
  width: 24px;
  height: 24px;
  background-color: var(--answer-color);
  color: white;
  border-radius: 50%;
  text-align: center;
  line-height: 24px;
  font-weight: bold;
  font-size: 0.9em;
  margin-right: 0.5em;
  vertical-align: middle;
}

.answer p:first-of-type {
  display: inline;
}

/* ====================================================================
   DEFINITION ENVIRONMENT
   ====================================================================*/
.definition {
  margin: 1.5em 0;
  padding: 1em;
  border-left: 4px solid var(--definition-color);
  background-color: rgba(184, 134, 11, 0.05);
  border-radius: 2px;
}

.definition::before {
  content: "D";
  display: inline-block;
  width: 24px;
  height: 24px;
  background-color: var(--definition-color);
  color: white;
  border-radius: 50%;
  text-align: center;
  line-height: 24px;
  font-weight: bold;
  font-size: 0.9em;
  margin-right: 0.5em;
  vertical-align: middle;
}

/* ====================================================================
   IMPORTANT BOX ENVIRONMENT
   ====================================================================*/
.callout.callout-style-default {
  border-left: 4px solid var(--important-border);
  background-color: var(--important-bg);
  padding: 1.5em;
  margin: 1.5em 0;
  border-radius: 2px;
}

.callout-title {
  font-weight: bold;
  color: #333;
  margin-bottom: 0.5em;
}

/* ====================================================================
   VIDEO STYLING - FANCY EMBEDDED PLAYER
   ====================================================================*/
.video-container {
  position: relative;
  max-width: 100%;
  margin: 2em 0;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  background-color: #000;
}

.video-wrapper {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%; /* 16:9 aspect ratio */
}

.video-wrapper video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.video-caption {
  padding: 1em;
  background-color: #f9f9f9;
  font-size: 0.95em;
  color: #555;
  border-top: 1px solid #e0e0e0;
  line-height: 1.6;
}

.video-caption strong {
  color: #333;
  font-weight: 600;
}

/* Play button styling for poster frames */
.video-play-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 80px;
  height: 80px;
  background-color: rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  z-index: 10;
}

.video-play-overlay:hover {
  background-color: rgba(255, 255, 255, 1);
  transform: translate(-50%, -50%) scale(1.1);
}

.video-play-overlay::after {
  content: "";
  width: 0;
  height: 0;
  border-left: 30px solid #0A3050;
  border-top: 20px solid transparent;
  border-bottom: 20px solid transparent;
  margin-left: 6px;
}

/* ====================================================================
   RESPONSIVE ADJUSTMENTS
   ====================================================================*/
@media (max-width: 768px) {
  .question,
  .answer,
  .definition {
    padding: 0.75em;
  }

  .video-play-overlay {
    width: 60px;
    height: 60px;
  }

  .video-play-overlay::after {
    border-left: 20px solid #0A3050;
    border-top: 15px solid transparent;
    border-bottom: 15px solid transparent;
  }
}

/* ====================================================================
   CODE AND MATH STYLING
   ====================================================================*/
code {
  background-color: #f0f0f0;
  padding: 0.2em 0.4em;
  border-radius: 3px;
  font-size: 0.95em;
}

.math-display {
  margin: 1.5em 0;
  padding: 1em;
  background-color: #fafafa;
  border-radius: 4px;
}

/* ====================================================================
   TABLE STYLING
   ====================================================================*/
table {
  margin: 1.5em 0;
  border-collapse: collapse;
  width: 100%;
}

th {
  background-color: #0A3050;
  color: white;
  padding: 0.75em;
  text-align: left;
  font-weight: 600;
}

td {
  padding: 0.75em;
  border-bottom: 1px solid #e0e0e0;
}

tr:nth-child(even) {
  background-color: #f9f9f9;
}

/* ====================================================================
   SIDEBAR AND NAVIGATION
   ====================================================================*/
.sidebar-menu {
  font-size: 0.95em;
}

.sidebar-menu-container {
  max-height: calc(100vh - 200px);
  overflow-y: auto;
}

/* Highlight current section in sidebar */
.sidebar .active {
  background-color: rgba(10, 48, 80, 0.1);
  border-left: 3px solid #0A3050;
  padding-left: calc(1em - 3px);
}

/* ====================================================================
   GENERAL TEXT AND SPACING
   ====================================================================*/
body {
  font-family: 'EB Garamond', "Palatino Linotype", "Book Antiqua", Palatino, serif !important;
  color: #333;
  line-height: 1.7;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'EB Garamond', "Palatino Linotype", "Book Antiqua", Palatino, serif !important;
  color: #1a1a1a;
  font-weight: 600;
  margin-top: 1.5em;
  margin-bottom: 0.5em;
}

h1 {
  border-bottom: 2px solid #0A3050;
  padding-bottom: 0.3em;
}

p {
  margin: 0.5em 0;
}

/* ====================================================================
   HIDE DUPLICATE TITLES
   ====================================================================*/

/* Hide duplicate title in sidebar navigation list */
.sidebar-item-container a[href="./index.html"] {
  display: none !important;
}





/* ====================================================================
   REORDER SIDEBAR ELEMENTS
   ====================================================================*/

/* Make the sidebar menu container a flex container */
.sidebar-menu-container {
  display: flex !important;
  flex-direction: column !important;
}

/* Set specific order for elements */
#TOC {
  order: 1 !important;
}

.sidebar-menu {
  order: 2 !important;
}

/* ====================================================================
   HIDE DUPLICATE BOOK TITLES IN SIDEBAR
   ====================================================================*/

/* Hide the clickable book title link in the chapter navigation */
.sidebar-item a[href="./index.html"] {
  display: none !important;
}

/* Hide the book title in the Table of Contents section */
#TOC > ul > li:first-child {
  display: none !important;
}


/* Hide the Table of Contents section */
#TOC {
  display: none !important;
}

/* Show chapter titles (h1 in main content) */
#quarto-document-content h1.title {
  display: block !important;
  font-size: 2.5em;
  font-weight: 700;
  color: #0A3050;
  border-bottom: 3px solid #0A3050;
  padding-bottom: 0.4em;
  margin-top: 0;
  margin-bottom: 1em;
}