:root {
    --header-height: 75px;
    --footer-height: 50px;
    --grid-gap: 2rem;
    --bg-color: hsl(210, 20%, 98%);
    --border-radius: .5rem;
    --body-text-color: rgb(65, 65, 69);
}

/* Basic Reset & Typography */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    /* account for sticky header on scrolling content */
    scroll-padding-top: calc(var(--header-height) + 1rem);
}

body {
    background-color: hsl(210, 20%, 98%);
    color: var(--body-text-color);
    font-family: 'Segoe UI', 'Helvetica Neue', sans-serif;
    line-height: 1.6;
}

.container {
    display: grid;
    gap: var(--grid-gap);
    grid-template-areas: 
        "header header"
        "nav main"
        "footer footer";
    grid-template-columns: min-content 1fr;
    grid-template-rows: var(--header-height) 1fr var(--footer-height);
    max-width: 80rem;
    margin: 0 auto;
}

.container > header {
    align-items: center;
    border-bottom: 1px solid #ebe6e7;
    display: flex;
    grid-area: header;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
    background-color: hsl(210, 20%, 98%); /* Matches your body background */

    a {
      align-items: center;
      /* TODO: use more specific color */
      color: darkslategrey;
      display: flex;
      font-weight: 500;
      gap: 1rem;
      text-decoration: none;

      span {
        /* align text visually with logo */
        padding-top: 0.65rem;
      }
    }

    img {
      height: 100%;
      max-width: 10rem;
    }
}

.container > nav {
    align-self: start;
    grid-area: nav;
    max-height: calc(100vh - var(--header-height) - 4rem);
    overflow-y: auto;
    position: sticky;
    text-wrap: nowrap;
    top: calc(var(--header-height) + 2rem);

    hr {
        border-top: 1px solid #ebe6e7;
        margin: 1rem 0;
        margin-inline: 1rem;
        height: 0;
    }

    ul {
        list-style-type: none;

        li {
            /* nested lists */
            ul {
                margin-left: 1rem;
            }
        }
    }

    a {
        color: oklab(0.231575 0.00106563 -0.0036512 / 0.64);
        display: block;
        font-size: .9rem;
        padding: 0.15rem 1rem;
        text-decoration: none;

        &:hover {
            background-color: #ebe6e7;
            border-radius: var(--border-radius);
        }
    }
}

.container > main {
    grid-area: main;

    h1 {
      font-size: 1.75rem;
    }

    h2 {
      font-size: 1.25rem;
    }

    h3 {
        font-size: 1rem;
        font-weight: 500;
    }

    p {
        margin: 1rem 0;
    }
    
    a {
        text-decoration: none;
        color: rgb(130, 106, 246);
        font-weight: 400;
    }

    section {
        margin: 2.5rem 0;
    }

    ol {
      list-style-position: inside;
    }

    ol > li {
      margin: .5rem 0;
    }

    pre {
        background-color: rgb(36, 35, 47);
        border-radius: var(--border-radius);
        color: #e5e7eb;
        font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
        font-size: 0.75rem; 
        line-height: 1.5;
        margin-bottom: .75rem;
        overflow-x: auto;
        padding: .75rem 1rem;
        min-width: 50%;
        width: fit-content;

        code {
            display: block;
            padding-top: 0.25rem; 
        }
    }

    .json-example {
        background-color: #f1f5f9;
        color: var(--body-text-color);
        border: 1px solid lightgray;
    }

    table.object-properties {
        background-color: #ffffff;
        border-collapse: collapse;
        display: block; 
        font-size: 0.85rem;         
        margin-top: 1rem;
        overflow-x: auto; 
        width: 100%;

        th:nth-child(1) {
            /* Let the 1st column size naturally based on your code tags, but add breathing room */
            padding-right: 1.5rem; 
        }
      
        th:nth-child(2), 
        td:nth-child(2) {
            white-space: nowrap;
            padding-right: 1.5rem;
        }
      
        th:nth-child(3),
        td:nth-child(3) {
            /* Ensures the description column never gets awkwardly squished. 
               If the screen is too narrow, this forces the table to scroll horizontally. */
            min-width: 350px;
            width: 100%; /* Encourages this column to take up the remaining available space */
        }
      
        th, td {
            padding: 0.5rem .75rem;
            text-align: left;
            border-bottom: 1px solid #ebe6e7; 
            vertical-align: top;
        }
      
        th {
            background-color: #f8fafc;
            font-weight: 600;
            font-size: 0.9rem;
            color: #334155;
        }
      
        /* Zebra Striping: Alternating row backgrounds */
        tbody tr:nth-child(even) {
            background-color: #f8fafc; 
        }
      
        tbody tr:hover {
            background-color: #f1f5f9;
        }
    }

    td code, span.snippet {
        font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Courier New", monospace;
        font-size: 0.85em;
        background-color: #f1f5f9;
        padding: 0.2rem 0.4rem;
        border-radius: var(--border-radius);
        border: 1px solid lightgray;
        white-space: nowrap;

        &.method {
            color: rgb(48, 92, 158);
        }
    }
  }
  
.container > footer {
    grid-area: footer;
}
.json_example {
            background-color: white;
    }