body { font-family: sans-serif; margin: 0; display: flex; flex-direction: column; min-height: 100vh;}

footer { background: #fbf6b4; color: #000000; padding: 1rem; text-align: center; margin-top: auto; }

.main-container {
    display: grid;
    grid-template-columns: 1fr 200px 500px 1fr;
    /* min-width: 360px; */
    column-gap: 50px;
    padding: 0;
}
header {
    grid-column: 1 / -1;
    border-bottom: 1px solid #ccc;
    background: #ffffff;
    display: grid;
    /* Use the exact same column template as the parent */
    grid-template-columns: inherit; 
    column-gap: inherit;
}
.wide-header-content {
    grid-column: 1 / 3;
    text-align: left;
    padding: 20px 0;
    font-weight: bold;
    padding: 1rem; 
    /* border-bottom: 1px solid #ddd; */
}
.narrow-header-content {
    grid-column: 1 / -1;
    /* text-align: left; */
    align-items: center;
    justify-content: space-between;
    padding: 20px 0;
    font-weight: bold;
    padding: 1rem;
    display: none;
    /* border-bottom: 1px solid #ddd; */
}

/* Left Column: Sidebar (Right Aligned) */
#sidebar {
    grid-column: 2;
    text-align: right;
    /* border-left: 1px solid #ddd; */
}
#sidebar ul { list-style: none; padding: 0; }
#sidebar li { color: #c1e2eb; font-family: 'Baloo 2', sans-serif; font-size: 1.5rem; line-height: 1.5; }
#sidebar li:hover { cursor: pointer; text-decoration: underline; }
#sidebar li.active-li { color: #4ba6a8; font-weight: bold; }
#sidebar li.active-li:hover { cursor: auto; text-decoration: none; }

.narrow-header-content ul { list-style: none; display: flex; gap: 20px; margin: 0; padding: 0; padding-right: 20px; }
.narrow-header-content li { color: #c1e2eb; font-family: 'Baloo 2', sans-serif; font-size: 1rem; line-height: 1.5; width: 50px; display: flow; }
.narrow-header-content li:hover { cursor: pointer; text-decoration: underline; }
.narrow-header-content li.active-small-li { color: #4ba6a8; font-weight: bold; }
.narrow-header-content li.active-small-li:hover { cursor: auto; text-decoration: none; }

/* Right Column: Content (Left Aligned) */
#content-bar {
    grid-column: 3;
    text-align: left;
}
#content-bar h3 {
    color: #ad579b; font-family: 'Noteworthy', sans-serif; font-size: bold;
    font-size: 2rem; margin-bottom: 0rem; margin-top: 0rem;
}
#content-bar p { font-family: 'Baloo 2', sans-serif; font-size: 1rem; margin-top: 0rem; margin-bottom: 0rem; line-height: 1.5; }
#content-bar ul { margin-top: 0;  margin-left: 0; padding-left: 1.2rem; list-style-type: '✦  '; margin-bottom: .5rem;}
#content-bar li { font-family: 'Baloo 2', sans-serif; font-size: 1rem; margin-top: .5rem; line-height: 1.5rem; margin-left: 0rem; }
#content-bar strong { font-family: 'Roboto Slab', sans-serif; font-size: 1rem; margin-top: 0rem; margin-bottom: 0rem; line-height: 1.5; }

/* Visibility Logic */
.section-group, .subsection-item { display: none; }
.active { display: block !important; }

/* Dot Navigation */
.dot-nav { margin-top: 1rem; display: flex; gap: 10px; }
.dot { height: 12px; width: 12px; background-color: #c1e2eb; border-radius: 50%; display: inline-block; cursor: pointer; }
.dot.active-dot { background-color: #4ba6a8; }


/* Breakpoint: When the screen is too narrow for fixed widths */
@media (max-width: 960px) {
  .main-container {
    /* Middle columns now squeeze (minmax) */
    grid-template-columns: 1fr minmax(200px, 200px) minmax(360px, 500px) 1fr;
  }
}

/* Breakpoint: Hide the 2nd column */
@media (max-width: 760px) {
  .main-container {
    /* Collapse the 2nd column to 0 */
    grid-template-columns: 1fr 0px 360px 1fr;
    grid-gap: 0;
  }

  #sidebar, .wide-header-content {
    display: none; /* Hides the 2nd column and the header tied to it */
  }

  .narrow-header-content {
    display: flex;
  }
  /* #content-bar {
    grid-column: 3;
  } */
}
