/* Universal Styles */

* {
    box-sizing: border-box;
}

html {
    font-family: "Fira Code", monospace;
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    background-color: black;
    color: seashell;
    margin:0;
    line-height: 1.5;
}

.main-content {
    position: relative;
    padding-top: 1rem;
    padding-bottom: 2rem;
}

footer {
    position: relative;
    width: 100%;
    border-top: solid 1px #B22222;
    font-size: 1rem;
    text-align: right;
}

/* Header */

header {
  position: relative;
  width: 100%;
  border-bottom: solid 1px #B22222;
}

header .content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 6rem;
    padding: 0.75rem 1rem;
    gap: 1rem;
    
}

header .logo {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0;
    font-size: 1.375rem;
    flex-shrink: 0;
}

.logo-text {
    display: inline-flex;
    align-items: baseline;
    gap: 0.1rem;
}

header .logo img {
    height: 5rem;
    width: auto;
    display: block;
}

.logo .sheet {
    color: #B22222;
}

header nav ul {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    list-style-type: none;
    margin: 0;
    padding: 0;
    gap: 1rem;
}

nav li {
    padding: 0;
}

nav a {
    font-size: 1.125rem;
    color: seashell;
    text-decoration: none;
    transition: color 0.2s ease;
}

nav a:hover {
    color: #B22222;
    cursor: pointer;
}

/* Main Content */

/* Sections */

.section1, .section2, .section3 {
    width: 100%;
}

.description {
    width: 100%;
    padding: 0 1rem 1rem;
}

.description h1, .description h2 {
    font-size: 2rem;
    color:#B22222;
    margin: 0;
    padding-bottom: 1rem;
}

.description p {
    font-size: 1.125rem;
    margin: 0;
    padding-bottom: 1rem;
}

.table {
    width: 100%;
    padding: 0 1rem 2rem;
    overflow-x: auto;
}

.html-css-table, .box_model, .positioning-display {
    width: 100%;
    border-collapse: collapse;
    table-layout: auto; 
    min-width: 700px;
}

.html-css-table thead, .box_model thead, .positioning-display thead {
    background-color: #1f2937;   /* dark modern header */
    color: seashell;
}

td, th {
    border: 1px solid seashell;
    padding: 0.65rem 0.75rem;
    text-align: left;
    vertical-align: middle;
}

th img {
    width: 2rem;
    height: 2rem;
    vertical-align: middle;
    margin-right: 0.375rem;
}

code {
    background-color: #008B8B;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-family: "Fira Code", monospace;
    font-size: 0.85rem;
    word-break: break-word;
}

/* pre inside table: prevent huge padding/margins */
td pre {
  margin: 0;
  white-space: nowrap; /* keeps the basic structure on one line */
}

.blank {
    text-align: center;
}

/* Body cells */
.html-css-table td, .box_model td, .positioning-display td {
    border-bottom: 1px solid #e5e7eb;  /* soft divider */
}

.html-css-table tbody tr, .box_model tbody tr, .positioning-display tbody tr {
    transition: background-color 0.2s ease;
}

/* Zebra striping */
.html-css-table tbody tr:nth-child(even), .box_model tbody tr:nth-child(even), .positioning-display tbody tr:nth-child(even) {
    background-color: #111827;
}

/* Hover effect */
.html-css-table tbody tr:hover, .box_model tbody tr:hover, .positioning-display tbody tr:hover {
    background-color: #1f2937;
}

/* Footer */
footer .content {
    padding: 1rem;
}

/* Responsive Design */

@media (max-width: 900px) {

    header .content {
        flex-direction: column;
        align-items: center;
        gap: 0.5rem;
        height: auto;
    }

    header nav {
        width: 100%;
    }

    header nav ul {
        width: 100%;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 0.75rem;
    }

    .description h1, .description h2 {
        font-size: 1.75rem;
    }

    .description p {
        font-size: 1rem;
    }

    nav a {
        font-size: 1rem;
    }

}

@media (max-width: 600px) {
    header .logo {
        font-size: 1rem;
    }

    header .logo img {
        height: 3.75rem;
    }

    .description {
        padding: 0 0.75rem 1rem;
    }

    .table {
        padding: 0 0.75rem 2rem;
    }

    .description h1, .description h2 {
        font-size: 1.5rem;
    }

    .description p {
        font-size: 0.95rem;
    }

    th, td {
        padding: 0.5rem;
        font-size: 0.9rem;
    }

    code {
        font-size: 0.75rem;
    }

    footer {
        text-align: center;
    }
}