
/* =====================================================
   Single Responsive CSS (merged desktop + mobile rules)
   Author: ChatGPT
   Date: 2025-08-27
   Notes:
   - Keeps original desktop layout intact.
   - Adds clean mobile overrides at the bottom with @media.
   - Removes duplicate/errant blocks and fixes minor syntax issues.
   ===================================================== */

/* ---------- Base & Resets ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  /* Header (75px) + small offset so anchors don't hide */
  scroll-padding-top: 100px;
}

body {
  margin: 0;
  padding: 0;
  font-family: Arial, sans-serif;
  background-color: #f5f5f5;
  color: #333;
  max-width: 100%;
  overflow-x: hidden;
}

/* ---------- Header ---------- */
.header {
  height: 75px;
  display: flex;
  align-items: center;
  padding: 0 20px;
  background-color: #ffffff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.header .logo img {
  height: 50px;
}

.header .title {
  flex-grow: 1;
  text-align: center;
}

.header .title h1 {
  margin: 0;
  font-size: 20px;
  color: #333;
}

/* ---------- Sidebar Navbar (Desktop) ---------- */
.navbar {
  width: 200px;
  background-color: #444;
  position: fixed;
  top: 75px;   /* below sticky header */
  bottom: 0;
  left: 0;
  display: flex;
  flex-direction: column;
  padding-top: 20px;
  padding-left: 10px;
  overflow-y: auto;
}

.navbar a {
  color: white;
  padding: 15px 20px;
  text-decoration: none;
  transition: background 0.3s, color 0.3s;
  font-size: 14px;
  border-radius: 4px;
}

.navbar a:hover {
  background-color: #fff;
  color: #444;
}

.main-content {
  margin-left: 200px; /* make space for sidebar */
  padding: 20px;
}

/* ---------- Tree-style nested nav (optional) ---------- */
.tree,
.tree ul {
  list-style: none;
  padding-left: 15px;
  margin: 0;
}

.tree li {
  position: relative;
  margin-bottom: 8px;
}

.tree li span {
  font-weight: bold;
  color: #fff;
  cursor: default;
  font-size: 14px;
  display: inline-block;
  margin-bottom: 4px;
}

.tree li a {
  display: block;
  padding: 5px 10px;
  color: #eee;
  text-decoration: none;
  font-size: 13px;
  border-radius: 4px;
}

.tree li a:hover {
  background-color: #fff;
  color: #444;
}

/* ---------- Content Blocks ---------- */
/* Style 1: 40% text (left) + 60% media (right) */
.style1 {
  display: flex;
  height: 450px;
  margin-bottom: 40px;
  background: white;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.style1 .block1 {
  flex: 40%;
  padding: 20px;
  text-align: left;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}
.style1 .block2 {
  flex: 60%;
}
.style1 iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

/* Style 2: Same as style1 but reversed (media left, text right) */
.style2 {
  display: flex;
  flex-direction: row-reverse;
  height: 450px;
  margin-bottom: 40px;
  background: white;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.style2 .block1 {
  flex: 40%;
  padding: 20px;
  text-align: left;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}
.style2 .block2 {
  flex: 60%;
  display: flex;
  flex-direction: column;
}
.style2 iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

/* Style 3: Full-width paragraph block */
.style3 {
  background: white;
  padding: 20px;
  margin-bottom: 40px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.style3 h2 { margin-top: 0; }
.style3 p {
  margin-top: 10px;
  line-height: 1.6;
}

/* Style 4: Bulleted list block */
.style4 {
  background: white;
  padding: 20px;
  margin-bottom: 40px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.style4 h2 { margin-top: 0; }
.style4 ul {
  margin-top: 10px;
  padding-left: 20px;
}
.style4 li {
  margin-bottom: 8px;
  line-height: 1.6;
}

/* Style 5: 40% text + 60% video with resource link at bottom */
.style5 {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  justify-content: space-between;
  height: 450px;
  margin-bottom: 40px;
  background: white;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  box-sizing: border-box;
}
.style5 .block1 {
  width: 40%;
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 20px;
  box-sizing: border-box;
  position: relative;
  height: 100%;
}
.style5 .block1 .topic h3 {
  margin: 0 0 5px 0;
  font-size: 16px;
  color: #444;
}
.style5 .block1 .topic p {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
}
.style5 .block2 {
  width: 60%;
  height: 100%;
  box-sizing: border-box;
}
.style5 .block2 iframe {
  width: 100%;
  height: 100%;
  border: none;
  object-fit: cover;
}
.style5 .section-title {
  font-size: 22px;
  margin-bottom: 20px;
  color: #222;
}
.style5 .section-title-with-icon {
  display: flex;
  align-items: center;
  margin-bottom: 20px;
}
.style5 .section-title-with-icon img {
  width: 32px;
  height: 32px;
  margin-right: 10px;
}
.style5 .section-title-with-icon h2 {
  font-size: 22px;
  color: #222;
  margin: 0;
}

/* Buttons/links that should sit at the bottom of .block1 */
.bottom-link {
  margin-top: auto;
  padding-top: 20px;
}
.bottom-link a {
  display: flex;
  align-items: center;
  text-decoration: none;
  background-color: #f0f0f0;
  padding: 6px 10px;
  border-radius: 4px;
  font-size: 13px;
  color: #333;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  transition: background 0.3s;
}
.bottom-link a:hover { background-color: #ddd; }
.bottom-link img {
  width: 20px;
  height: 20px;
  margin-right: 8px;
}

/* ---------- Misc ---------- */
summary {
  color: #007BFF;
  font-weight: bold;
}

/* =====================================================
   Responsive Overrides
   ===================================================== */

/* Tablet tweaks */
@media (max-width: 1024px) {
  .main-content { padding: 16px; }
  .style1, .style2, .style5 { height: 420px; }
  .header .title h1 { font-size: 18px; }
}

/* Mobile-first overrides */
@media (max-width: 768px) {
  /* Header stacks */
  .header {
    flex-direction: column;
    height: auto;
    padding: 10px;
    text-align: center;
    gap: 6px;
  }
  .header .logo img { height: 40px; }
  .header .title h1 { font-size: 18px; }

  /* Sidebar becomes top scroller */
  .navbar {
    position: relative;
    top: 0;
    left: 0;
    width: 100%;
    height: auto;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    padding: 10px;
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
  }
  .navbar a {
    display: inline-block;
    padding: 10px 12px;
    font-size: 13px;
  }

  /* Content fills full width */
  .main-content {
    margin-left: 0;
    padding: 12px;
  }

  /* Stack split sections */
  .style1, .style2, .style5 {
    flex-direction: column;
    height: auto;
  }
  .style1 .block1,
  .style1 .block2,
  .style2 .block1,
  .style2 .block2,
  .style5 .block1,
  .style5 .block2 {
    width: 100%;
    flex: none;
    padding: 12px;
    height: auto;
  }

  /* Media heights for embeds */
  iframe, .style1 iframe, .style2 iframe, .style5 .block2 iframe {
    height: 250px !important;
  }

  /* Tables scroll horizontally if wide */
  table {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
  }
}
