/* =========================
   FONTS & TYPOGRAPHY
========================= */

.source-code-pro {
    font-family: "Source Code Pro", monospace;
    font-optical-sizing: auto;
    font-weight: 700;
    font-style: normal;
}

.roboto {
    font-family: "Roboto", sans-serif;
    font-optical-sizing: auto;
    font-weight: 400;
    font-style: normal;
    font-variation-settings: "width" 100;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: "Source Code Pro", monospace;
}

/* =========================
   GLOBAL STYLES
========================= */

body {
    background-color: hsl(210, 75%, 25%);
    color: hsl(0, 0%, 95%);
    font-family: "Roboto", sans-serif;
}

/* =========================
   HEADER / HERO
========================= */

.site-header {
    width: 100%;
}

.site-header img {
    width: 100%;
    height: auto;
    display: block;
}

.header-banner {
    width: 100%;
    height: 15rem;
    max-width: 100%;
    background-image: url(./resources/images/background-image.png);
    background-repeat: no-repeat;
    background-size: cover;
    display: flex;
    justify-content: center;
    align-content: center;
}

.header-banner h1 {
    align-content: center;
}

header h1 {
    text-align: center;
}

/* =========================
   LAYOUT
========================= */

.layout-main {
    display: flex;
}

/* =========================
   SIDEBAR NAVIGATION
========================= */

.layout-main .sidebar-nav {
    position: fixed;
    border-right: 1px solid black;
    background-color: hsl(210, 75%, 35%);
    width: 160px;
}

.layout-main .sidebar-menu ul {
    text-align: left;
    list-style: none;
    padding: 1rem;
}

.sidebar-menu a {
    color: hsl(0, 0%, 95%);
}

.sidebar-menu a:visited {
    color: hsl(0, 0%, 80%);
}

.sidebar-menu a:hover {
    color: hsl(45, 100%, 65%);
}

.sidebar-menu a:active {
    color: hsl(45, 100%, 50%);
}

/* =========================
   MAIN CONTENT
========================= */

.main-content,
.intro-section,
footer {
    margin-left: 180px;
    padding: 20px;
    max-width: 62.5rem;
}

.intro-section h1 {
    text-align: center;
}

.intro-section a {
    color: hsla(0, 0%, 95%, 0.788);
}
.intro-section a:visited {
    color: hsla(0, 0%, 80%, 0.788);
}
.intro-section a:hover {
    color: hsla(45, 100%, 65%, 0.788);
}
.intro-section a:active {
    color: hsla(45, 100%, 50%, 0.788);
}

pre {
    border: 2px solid black;
    padding: 1rem;
    font-size: 1.2rem;
    border-radius: 1rem;
    white-space: pre-wrap;
    overflow-wrap: break-word;
}
/* =========================
   TABLE STYLING
========================= */

table {
    width: max-content;
    max-width: calc(100% - 40px);
    font-size: 15px;
    border-collapse: collapse;
    margin: 20px 0;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.table-fixed {
    table-layout: fixed;
    width: 90%;
}

thead th {
    border: 1px solid;
    border-collapse: collapse;
    background-color: hsl(210, 75%, 13%);
    text-transform: uppercase;
    padding: 12px 20px;
}

td {
    border: 1px solid white;
    padding: 10px 15px;
    overflow-wrap: break-word;
}

/* =========================
   CODE / INLINE ELEMENTS
========================= */

.table-fixed td span {
    font-family: "Source Code Pro", monospace;
    color: hsl(45, 100%, 75%);
}

.quick-links {
    margin: 1rem 0 2rem 0;
}

.quick-links ul {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    list-style: none;
    padding: 0;
    margin: 0;
}

.quick-links a {
    display: inline-block;
    padding: 0.5rem 0.9rem;
    border: 2px solid black;
    border-radius: 0.75rem;
    text-decoration: none;
    color: hsl(0, 0%, 95%);
}

.quick-links a:hover {
    color: hsl(45, 100%, 65%);
}

a {
    color: hsl(0, 0%, 95%);
    text-decoration: none;
    font-weight: bold;
}

a:hover {
    color: hsl(45, 100%, 65%);
}

/* =========================
   SYNTAX HIGHLIGHTING
========================= */

/* Iterator method e.g. .forEach() */
.highlight-iterator {
    color: hsl(45, 100%, 65%);
    font-family: "Source Code Pro", monospace;
    font-weight: 700;
}

/* Callback function */
.highlight-callback {
    color: hsl(320, 80%, 75%);
    font-family: "Source Code Pro", monospace;
    font-weight: 700;
}

/* Function name */
.highlight-function {
    color: hsl(190, 80%, 65%);
    font-family: "Source Code Pro", monospace;
    font-weight: 700;
}

/* Parameters / arguments */
.highlight-param {
    color: hsl(25, 100%, 70%);
    font-family: "Source Code Pro", monospace;
    font-weight: 700;
}

/* =========================
   RESPONSIVE — SMALL SCREENS
========================= */

@media (max-width: 768px) {
    .layout-main {
        flex-direction: column;
    }

    .layout-main .sidebar-nav {
        position: sticky;
        top: 0;
        width: 100%;
        height: auto;
        overflow-y: visible;
        border-right: none;
        border-bottom: 1px solid black;
        z-index: 100;
    }

    .layout-main .sidebar-menu ul {
        display: flex;
        flex-direction: row;
        flex-wrap: nowrap;
        overflow-x: auto;
        padding: 0.5rem;
        gap: 0.75rem;
        white-space: nowrap;
    }

    .main-content,
    .intro-section,
    footer {
        margin-left: 0;
        padding: 1rem;
    }

    .site-search-results {
        position: fixed;
        left: 0.5rem;
        right: 0.5rem;
    }
}

/* =========================
   SITE SEARCH
========================= */

.site-search {
    position: relative;
    padding: 1rem 1rem 0 1rem;
}

.site-search input[type="search"] {
    width: 100%;
    box-sizing: border-box;
    padding: 0.5rem 0.6rem;
    border-radius: 0.5rem;
    border: 1px solid black;
    background-color: hsl(210, 75%, 20%);
    color: hsl(0, 0%, 95%);
    font-family: "Roboto", sans-serif;
}

.site-search input[type="search"]::placeholder {
    color: hsl(0, 0%, 75%);
}

.site-search-results {
    list-style: none;
    margin: 0.5rem 0 0 0;
    padding: 0;
    max-height: 60vh;
    overflow-y: auto;
    display: none;
    position: absolute;
    left: 1rem;
    right: 1rem;
    background-color: hsl(210, 75%, 30%);
    border: 1px solid black;
    border-radius: 0.5rem;
    z-index: 200;
}

.site-search-results.is-open {
    display: block;
}

.site-search-results li {
    border-bottom: 1px solid hsla(0, 0%, 100%, 0.15);
}

.site-search-results li:last-child {
    border-bottom: none;
}

.site-search-results a {
    display: block;
    padding: 0.5rem 0.6rem;
    color: hsl(0, 0%, 95%);
    font-weight: normal;
}

.site-search-results a:hover,
.site-search-results a:focus {
    background-color: hsl(210, 75%, 40%);
    color: hsl(45, 100%, 65%);
}

.site-search-result-heading {
    font-family: "Source Code Pro", monospace;
    font-weight: bold;
    display: block;
}

.site-search-result-page {
    font-size: 0.75rem;
    color: hsl(0, 0%, 75%);
    display: block;
}

.site-search-result-snippet {
    font-size: 0.8rem;
    color: hsl(0, 0%, 85%);
    display: block;
    margin-top: 0.15rem;
}

.site-search-no-results {
    padding: 0.5rem 0.6rem;
    color: hsl(0, 0%, 75%);
}
