/* site.css - shared by index.html and usage.html */

* {
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    color: #24292e;
    background-color: #fff;
    line-height: 1.5;
}

.header, .footer {
    width: 100%;
    text-align: center;
    padding: 10px 16px;
    background-color: #f8f9fa;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.header h1 {
    margin: 12px 0 4px;
    font-size: clamp(1.5rem, 5vw, 2rem);
}

.clock {
    font-size: clamp(1.4rem, 7vw, 3rem);
    font-family: monospace;
    font-weight: bold;
    color: #24292e;
    margin: 10px 0;
}

/* ---- navigation ---------------------------------------------------------------------- */

.site-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin: 12px 0 8px;
}

.nav-link {
    display: inline-block;
    padding: 10px 20px;
    background-color: #24292e;
    color: white;
    text-decoration: none;
    border-radius: 5px;
}

.nav-link:hover,
.nav-link:focus-visible {
    background-color: #444d56;
}

.nav-link[aria-current="page"] {
    background-color: #fff;
    color: #24292e;
    box-shadow: inset 0 0 0 2px #24292e;
}

@media (max-width: 420px) {
    .site-nav .nav-link {
        padding: 8px 14px;
    }
}

/* ---- home ---------------------------------------------------------------------------- */

.content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px 16px;
}

.display {
    margin: 10px 0;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    width: 100%;
    max-width: 600px;
    text-align: center;
    background-color: #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.display .level {
    display: block;
    margin-bottom: 4px;
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #6a737d;
}

.navigation {
    padding: 20px;
    margin: 20px auto;
    border-radius: 5px;
    width: calc(100% - 32px);
    max-width: 600px;
    text-align: center;
    background-color: #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.navigation h2 {
    margin-top: 0;
}

.navigation .nav-link {
    margin: 5px;
}

/* ---- usage --------------------------------------------------------------------------- */

.doc {
    flex: 1;
    width: 100%;
    max-width: 760px;
    margin: 0 auto;
    padding: 20px 16px 40px;
}

.doc section {
    margin: 0 0 20px;
    padding: 4px 20px 16px;
    border: 1px solid #ddd;
    border-radius: 5px;
    background-color: #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.doc h2 {
    margin: 16px 0 8px;
    font-size: 1.3rem;
}

.doc h3 {
    margin: 16px 0 6px;
    font-size: 1.05rem;
}

.doc p,
.doc li {
    max-width: 68ch;
}

.toc {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 14px;
    padding: 0;
    list-style: none;
}

.toc a,
.doc a {
    color: #0366d6;
}

pre {
    margin: 10px 0;
    padding: 12px 14px;
    overflow-x: auto;
    background-color: #f6f8fa;
    border: 1px solid #e1e4e8;
    border-radius: 5px;
    font-size: 0.9rem;
    line-height: 1.45;
}

code {
    font-family: Consolas, "SFMono-Regular", Menlo, monospace;
    font-size: 0.9em;
}

:not(pre) > code {
    padding: 0.1em 0.35em;
    background-color: #f6f8fa;
    border-radius: 3px;
}

.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

th,
td {
    padding: 8px;
    text-align: left;
    vertical-align: top;
    border-bottom: 1px solid #e1e4e8;
}

th {
    white-space: nowrap;
}

.note {
    color: #6a737d;
    font-size: 0.9rem;
}

/* ---- playground ---------------------------------------------------------------------- */

.controls {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 10px 14px;
    margin: 12px 0;
}

.controls label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 0.85rem;
    color: #586069;
}

.controls select,
.controls input {
    padding: 6px 8px;
    font: inherit;
    font-size: 0.95rem;
    color: #24292e;
    border: 1px solid #d1d5da;
    border-radius: 4px;
    background-color: #fff;
}

.result {
    margin: 10px 0;
    padding: 14px;
    font-size: 1.15rem;
    text-align: center;
    background-color: #f8f9fa;
    border: 1px solid #e1e4e8;
    border-radius: 5px;
    overflow-wrap: anywhere;
}

.result.error {
    color: #b31d28;
}

.tokens {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 0;
    list-style: none;
}

.tokens li {
    padding: 3px 8px;
    font-size: 0.85rem;
    background-color: #f1f8ff;
    border: 1px solid #c8e1ff;
    border-radius: 4px;
}

.tokens li span {
    color: #6a737d;
}
