/* GeneratePress-style mirror (theme tokens aligned to reference layout, subset for static PHP). */
:root {
  --contrast: #222222;
  --contrast-2: #575760;
  --contrast-3: #b2b2be;
  --base: #f0f0f0;
  --base-2: #f7f8f9;
  --base-3: #ffffff;
  --accent: #1e73be;
  --nav-bg: #cb2026;
  --nav-bg-hover: #9f191e;
  --link: #0062a0;
  --link-hover: #111111;
  --gp-max: 1100px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background-color: #eaeced;
  color: #333333;
  font-family: "Noto Sans", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
}

/* Related Resources (LabDeck ecosystem) — above site footer on all pages */
#pythondeck-related-resources {
  max-width: var(--gp-max);
  margin: 0.75rem auto 1rem;
  padding: 0 1.5rem;
  clear: both;
}

#pythondeck-related-resources h2 {
  font-size: 1.35rem;
  margin: 0 0 1rem;
  color: var(--contrast);
}

#pythondeck-related-resources .links-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.15rem;
  align-items: baseline;
}

#pythondeck-related-resources .link-item {
  font-size: 0.95rem;
}

#pythondeck-related-resources .link-item a {
  text-decoration: underline;
}

@media (max-width: 768px) {
  #pythondeck-related-resources {
    padding: 0 1rem;
  }
}

/* WordPress block rhythm (FlexiPCLink / GeneratePress + core block-library) */
.entry-content > [class*="wp-block-"]:not(:last-child):not(.wp-block-heading) {
  margin-bottom: 1.5em;
}

a {
  color: var(--link);
}
a:hover,
a:focus,
a:active {
  color: var(--link-hover);
}

.screen-reader-text {
  position: absolute !important;
  clip: rect(1px, 1px, 1px, 1px);
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 999999;
  padding: 1em;
  background: #fff;
}
.skip-link:focus {
  left: 0;
}

.grid-container {
  max-width: var(--gp-max);
  margin-left: auto;
  margin-right: auto;
}

.grid-parent {
  display: flex;
  flex-wrap: wrap;
  flex-direction: column;
}

/* Unsemantic-style widths (simplified) */
.grid-25 {
  width: 25%;
}
.grid-75 {
  width: 75%;
}
.pull-75 {
  position: relative;
  left: -75%;
}
.push-25 {
  position: relative;
  left: 25%;
}

@media (max-width: 900px) {
  .tablet-grid-25 {
    width: 25%;
  }
  .tablet-grid-75 {
    width: 75%;
  }
  .tablet-pull-75 {
    left: -75%;
  }
  .tablet-push-25 {
    left: 25%;
  }
}

@media (max-width: 768px) {
  .mobile-grid-100 {
    width: 100% !important;
    left: 0 !important;
  }
  .grid-25,
  .grid-75 {
    width: 100%;
    left: 0;
  }
}

/* Header: full-bleed hero photo only on the home page (body.home). Other pages keep a solid bar. */
.site-header {
  color: #ffffff;
  background-color: #636363;
}

.site-header {
  background-image:
    linear-gradient(
      to right,
      rgba(0, 0, 0, 0.78) 0%,
      rgba(0, 0, 0, 0.62) 45%,
      rgba(0, 0, 0, 0.25) 80%,
      rgba(0, 0, 0, 0.1) 100%
    ),
    url("/assets/images/home-hero-1024x521.png");
  background-repeat: no-repeat, no-repeat;
  background-size: cover, cover;
  background-position: center, center;
  background-attachment: scroll, scroll;
}

@media (min-width: 900px) {
  .site-header {
    background-attachment: scroll, fixed;
  }
}

.site-header a {
  color: #ffffff;
}

/* Align header / nav / content: outer container provides the 20px gutter;
   inner .inside-header and .inside-navigation must not add their own. */
.inside-header,
.inside-navigation {
  padding-left: 0 !important;
  padding-right: 0 !important;
  max-width: none !important;
}

.inside-header {
  padding-top: 2.5rem;
  padding-bottom: 2rem;
}

.main-title {
  font-size: 45px;
  font-weight: 700;
  margin: 0 0 0.25rem;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
}

.main-title a {
  text-decoration: none;
  color: #ffffff;
}

.site-description {
  margin: 0;
  color: #f2f2f2;
  max-width: 52rem;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.55);
}

/* Primary navigation */
.main-navigation {
  background-color: var(--nav-bg);
}

.inside-navigation {
  position: relative;
}

.main-navigation .menu-toggle {
  display: none;
  background: transparent;
  border: 0;
  color: #fff;
  padding: 0 16px;
  line-height: 40px;
  cursor: pointer;
}

.main-nav > ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
}

.main-nav > ul > li {
  position: relative;
}

.main-nav > ul > li > a {
  display: block;
  padding: 0 16px;
  line-height: 40px;
  color: #ffffff;
  text-decoration: none;
  font-weight: 600;
}

.main-nav > ul > li:hover > a,
.main-nav > ul > li:focus-within > a {
  background-color: var(--nav-bg-hover);
}

.main-nav .sub-menu {
  display: none;
  position: absolute;
  left: 0;
  top: 100%;
  min-width: 260px;
  max-height: 70vh;
  overflow-y: auto;
  list-style: none;
  margin: 0;
  padding: 0;
  background-color: var(--nav-bg-hover);
  z-index: 200;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.main-nav li:hover > .sub-menu,
.main-nav li:focus-within > .sub-menu {
  display: block;
}

.main-nav .sub-menu a {
  display: block;
  padding: 10px 16px;
  color: #fff;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.35;
}

.main-nav .sub-menu a:hover {
  background-color: var(--nav-bg);
}

.dropdown-menu-toggle {
  display: inline-block;
  margin-left: 4px;
  border: 4px solid transparent;
  border-top-color: #fff;
  vertical-align: middle;
}

/* Mobile header swap (GeneratePress pattern) */
#mobile-header {
  display: none;
}

@media (max-width: 768px) {
  .site-header,
  #site-navigation {
    display: none !important;
  }
  #mobile-header {
    display: block !important;
    width: 100%;
  }
  #mobile-header .main-nav > ul {
    display: none;
  }
  #mobile-header.toggled .main-nav > ul {
    display: flex;
    flex-direction: column;
  }
  #mobile-header .menu-toggle {
    display: block;
  }
  .main-navigation .menu-toggle {
    display: block;
  }
  #site-navigation .main-nav > ul {
    display: none;
  }
  #site-navigation.toggled .main-nav > ul {
    display: flex;
    flex-direction: column;
  }
  #mobile-header .main-nav .menu-item-has-children > .sub-menu {
    display: none;
  }
  #mobile-header .main-nav .menu-item-has-children.sub-open > .sub-menu {
    display: block;
  }
  .main-nav .sub-menu {
    position: static;
    max-height: none;
    box-shadow: none;
  }
  .main-title {
    font-size: 30px;
  }
}

/* Page shell */
.site.grid-container {
  margin-top: 0;
  margin-bottom: 0;
}

.site-content {
  padding: 0 0 2rem;
}

/* Course nav left + article right: push/pull need a shared row; without it, #primary and
   #left-sidebar stack and page height becomes the sum of both (huge grey band before footer). */
.lesson-sidebar-layout .site-content {
  display: grid;
  grid-template-columns: minmax(200px, 260px) minmax(0, 1fr);
  gap: 0 1.25rem;
  align-items: start;
  width: 100%;
  padding: 20px 0;
}

.lesson-sidebar-layout #primary.content-area {
  grid-column: 2;
  grid-row: 1;
  left: 0 !important;
  width: 100% !important;
  max-width: 100%;
}

.lesson-sidebar-layout #left-sidebar {
  grid-column: 1;
  grid-row: 1;
  left: 0 !important;
  width: 100% !important;
  max-width: none;
  background-color: var(--base-3);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.06);
  position: sticky;
  top: 0;
  align-self: start;
  max-height: 100vh;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.lesson-sidebar-layout #left-sidebar::-webkit-scrollbar {
  width: 8px;
}

.lesson-sidebar-layout #left-sidebar::-webkit-scrollbar-thumb {
  background-color: rgba(0, 0, 0, 0.18);
  border-radius: 4px;
}

.lesson-sidebar-layout #left-sidebar::-webkit-scrollbar-thumb:hover {
  background-color: rgba(0, 0, 0, 0.32);
}

@media (max-width: 768px) {
  .lesson-sidebar-layout .site-content {
    grid-template-columns: 1fr;
    gap: 0;
    padding-bottom: 1.25rem;
  }

  .lesson-sidebar-layout #primary.content-area {
    grid-column: 1;
    grid-row: 1;
  }

  .lesson-sidebar-layout #left-sidebar {
    grid-column: 1;
    grid-row: 2;
    position: static;
    max-height: none;
    overflow-y: visible;
  }
}

.inside-article,
.inside-page-header {
  background-color: #ffffff;
  padding: 40px;
}

@media (max-width: 768px) {
  .inside-article,
  .inside-page-header {
    padding: 30px;
  }
}

.entry-content > *:not(:last-child) {
  margin-bottom: 1.5em;
}

.entry-content h1 {
  font-weight: 700;
  font-size: 36px;
  margin-top: 0;
  color: var(--contrast);
}

.entry-content h2 {
  font-weight: 700;
  font-size: 24px;
  margin-top: 1.5rem;
}

.entry-content h3 {
  font-weight: 700;
  font-size: 20px;
}

@media (max-width: 768px) {
  .entry-content h1 {
    font-size: 30px;
  }
  .entry-content h2 {
    font-size: 25px;
  }
}

.wp-block-image img,
.entry-content img {
  max-width: 100%;
  height: auto;
}

.wp-block-list,
.entry-content ul {
  padding-left: 1.25rem;
}

.entry-content ul li {
  margin-bottom: 0.45em;
}

/* Inner page title (FlexiPCLink / GeneratePress inner pages) */
.lesson-sidebar-layout .entry-header {
  margin-bottom: 1.25rem;
}

.lesson-sidebar-layout .entry-header .entry-title {
  font-weight: 700;
  font-size: 36px;
  line-height: 1.2;
  margin: 0;
}

@media (max-width: 768px) {
  .lesson-sidebar-layout .entry-header .entry-title {
    font-size: 30px;
  }
}

/* Tight match for FlexiPCLink-like lesson body rhythm */
.lesson-sidebar-layout .entry-content p {
  margin: 0 0 1.5em;
}

.lesson-sidebar-layout .entry-content .wp-block-image {
  margin-bottom: 1.5em;
}

.lesson-sidebar-layout .entry-content .wp-block-list {
  margin: 0 0 1.5em;
}

.aligncenter {
  text-align: center;
}

/* Left sidebar widget (lesson list) */
.inside-left-sidebar {
  padding: 0;
}

.widget_nav_menu .menu {
  list-style: none;
  margin: 0;
  padding: 0;
}

.widget_nav_menu .menu li.menu-item {
  list-style: none;
}

.widget_nav_menu .menu a {
  display: block;
  padding: 8px 12px;
  text-decoration: none;
  color: var(--contrast);
  border-radius: 4px;
  font-size: 14px;
  line-height: 1.35;
}

.widget_nav_menu .menu a:hover {
  background: var(--base-2);
  color: var(--link);
}

.widget_nav_menu .menu .current-menu-item > a,
.widget_nav_menu .menu a.active {
  background: var(--nav-bg);
  color: #fff;
}

.widget-title {
  font-size: 16px;
  font-weight: 700;
  margin: 0 0 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--nav-bg);
}

.inner-padding {
  padding: 24px 16px;
}

/* Footer */
.site-footer {
  margin-top: 0;
}

.footer-widgets {
  background: #d8dadd;
  padding: 28px 0;
}

.inside-footer-widgets {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
}

.grid-33 {
  width: calc(33.333% - 16px);
}

@media (max-width: 900px) {
  .tablet-grid-50 {
    width: calc(50% - 12px);
  }
  .grid-33 {
    width: calc(50% - 12px);
  }
}

@media (max-width: 768px) {
  .grid-33,
  .tablet-grid-50 {
    width: 100%;
  }
}

.footer-links {
  list-style: none;
  margin: 0;
  padding: 0;
  columns: 1;
}

.footer-links li {
  margin-bottom: 6px;
}

.footer-links a {
  text-decoration: none;
  font-size: 14px;
}

.site-info {
  background: #e2e4e6;
  color: #444444;
  padding: 20px;
  text-align: center;
  font-size: 14px;
}

/* Lesson prev/next */
.lesson-pager {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid #e1e4e8;
  flex-wrap: wrap;
}

.lesson-pager a {
  font-weight: 600;
}

/* Code in articles */
.entry-content pre {
  background: #f8f9fa;
  border: 1px solid #dee2e6;
  padding: 1rem;
  border-radius: 6px;
  overflow-x: auto;
}

.entry-content code {
  font-family: ui-monospace, Consolas, monospace;
  color: #c7254e;
}

.entry-content pre code {
  color: inherit;
}
