/* =====================================================================
   project-page.css: extra styles for the project breakdown pages
   (ff7-remake/, dishonored-prototype/, junior-task/, multiplayer-chat/)
   ---------------------------------------------------------------------
   Colors and fonts come from portfolio.css (load it first), so a color
   you change there changes here too.
   1. Top bar (name + menu, loaded from pages/headernav.html)
   2. Page header (banner, title, info boxes)
   3. Text, images, videos
   4. Accordions (the grey bars that open and close)
   5. Code blocks
   6. Mobile
   7. Reading progress bar (thin line at the very top)
   ===================================================================== */


/* ---------- 1. Top bar ----------------------------------------------- */
.topbar {
  max-width: 1000px; margin: 0 auto 28px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
}
.topbar .site-name { font: 700 28px/36px var(--font-heading); color: var(--name); }
.topbar nav { display: flex; flex-wrap: wrap; gap: 8px; }
.topbar nav a {
  border: 2px solid var(--text); border-radius: var(--radius);
  padding: 6px 16px; font-size: 15px; color: var(--text);
}
.topbar nav a:hover { color: var(--text-strong); border-color: var(--text-strong); }
/* Space for the top bar until portfolio.js fills it in, so the page does not jump down */
.topbar:empty { min-height: 40px; }
@media (max-width: 599px) { .topbar:empty { min-height: 92px; } }
@media (max-width: 419px) { .topbar:empty { min-height: 140px; } }


/* ---------- 2. Page header ------------------------------------------- */
.back-link { display: inline-flex; align-items: center; gap: 8px; margin: 0 0 16px; font-size: 15px; color: var(--text); }
.back-link:hover { color: var(--text-strong); text-decoration: underline; }
.back-link.bottom { margin: 32px 0 0; }
.project-page { max-width: 1000px; margin: 0 auto; }
.project-banner { display: block; width: 100%; aspect-ratio: 16 / 5; object-fit: cover; border-radius: var(--radius) var(--radius) 0 0; }
.project-head {
  padding: 4px 24px 24px; margin-bottom: 32px;
  background: var(--page-bg); border-radius: 0 0 var(--radius) var(--radius); box-shadow: var(--card-shadow);
}
.project-head h1 { margin: 20px 0 20px; }
.project-head .info-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }


/* ---------- 3. Text, images, videos ---------------------------------- */
.project-content { padding: 0 4px; }
.project-content a { color: var(--name); }
.project-content a:hover { text-decoration: underline; }
.project-content p a { text-decoration: underline; text-underline-offset: 2px; }   /* links inside text are underlined so they stand out */
.project-content img { display: block; max-width: 100%; height: auto; margin: 16px auto; border-radius: var(--radius); }
.project-content figure { margin: 24px 0; }
.project-content figcaption { font-size: 14px; line-height: 20px; text-align: center; }

/* Videos (YouTube and .mp4) sit in the same white frame as the home page slider */
.videoWrapper {
  margin: 24px 0 32px;
  border: 4px solid var(--slider-frame); border-radius: var(--radius); background: var(--slider-bg);
}
.videoWrapper iframe { display: block; width: 100%; aspect-ratio: 16 / 9; height: auto; border: 0; }
.videoWrapper video { display: block; width: 100%; height: auto; }


/* ---------- 4. Accordions -------------------------------------------- */
.accordion {
  display: flex; align-items: center; width: 100%;
  margin: 0 0 10px; padding: 14px 18px;
  border: 1px solid var(--link-btn-bg); border-radius: var(--radius); cursor: pointer;
  background: var(--link-btn-bg);
  font: 700 16px/22px var(--font-text); color: var(--text-strong); text-align: left;
  transition: background-color .2s, border-color .2s;
}
.accordion:hover, .accordion.active { background: var(--link-btn-bg-hover); border-color: var(--link-btn-bg-hover); }
.accordion i { width: 18px; margin-right: 12px; text-align: center; color: var(--text); }
.accordion::after { content: "\002B"; margin-left: auto; font-size: 20px; color: var(--text); }
.accordion.active::after { content: "\2212"; }

.panel { max-height: 0; overflow: hidden; transition: max-height .2s ease-out; padding: 0 4px; }
.panel > :first-child { margin-top: 12px; }
.panel .accordion { font-size: 15px; padding: 11px 16px; }   /* a bar inside another bar is a bit smaller */
.panel .panel { padding-left: 12px; }


/* ---------- 5. Code blocks ------------------------------------------- */
.project-content pre[class*=language-] {
  margin: 16px 0 24px; border-radius: var(--radius);
  font-size: 14px; line-height: 1.5;
  background: #1e1f21;   /* same dark in both themes */
}


/* ---------- 6. Mobile ------------------------------------------------ */
@media (max-width: 768px) {
  .page.project { padding: 16px 12px 32px; }
  .topbar .site-name { font-size: 24px; }
  .project-head { padding: 4px 16px 16px; }
  .project-head .info-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .project-content pre[class*=language-] { font-size: 12.5px; }
}

/* Footer at the same width as the page */
.page.project .footer { max-width: 1000px; }


/* ---------- 7. Reading progress bar ---------------------------------- */
/* The thin line at the very top that fills as you read. portfolio.js adds it
   and sets --progress (0 to 1) while you scroll. Color = your name color.
   To change it: thickness = height, color = background. */
.reading-progress {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  height: 3px;
  background: var(--name);
  transform-origin: 0 50%;
  transform: scaleX(var(--progress, 0));
  pointer-events: none;
}
@media print { .reading-progress { display: none; } }


/* A short engineering overview before the detailed implementation. */
.case-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; padding: 24px; margin: 0 0 24px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--sidebar-bg); }
.case-summary h2 { font-size: 20px; line-height: 1.3; margin: 0 0 12px; }
.case-summary p { margin: 0; }
.demo-links { display: flex; flex-wrap: wrap; gap: 12px 24px; margin: 0 0 28px; }
.demo-links a { text-decoration: underline; text-underline-offset: 3px; }
@media (max-width: 768px) { .case-summary { grid-template-columns: minmax(0, 1fr); padding: 20px; } }
