:root {
  --font-sans-serif: "Lexend", sans-serif;
  --font-monospace: "Roboto Mono", monospace;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
 }

html {
    overflow-y: scroll;
    height: 100%;
    font-family: var(--font-sans-serif);
    font-style: normal;
    font-weight: 400;
    word-wrap: break-word;
    margin: 0 auto;
    padding: 1.5em;
 }

@media (min-width: 768px) {
    html {
        font-size: 125%;
        max-width: 42em;
 } }

h1, h2, h3, h4 {
    margin: 2.5rem 0 1.5rem 0;
    line-height: 1.25;
    color: #333;
 }

a {
    color: #fa6432;
    text-decoration: none;
 }
a:hover, a:focus, a:active {
    text-decoration: underline;
 }

p {
    font-weight: 300;
    margin: 1em 0;
    line-height: 1.5;
 }
p code {
    background-color: #eee;
    padding-left: 3px;
    border: 1px solid #ccc;
 }

ol, ul {
    margin: 1em;
}

ol li ol, ol li ul, ul li ol, ul li ul {
    margin: 0 2em;
}

ol li p, ul li p {
    margin: 0 0.5em;
}
 
ol li::marker {
    font-weight: bold;
}

dl {
    font-family: var(--font-monospace);
 }
dl dt {
    font-weight: bold;
 }
dl dd {
    margin: -1em 0 1em 1em;
 }

img {
    max-width: 100%;
    margin: 0 auto;
    padding: 0.5em;
 }

iframe {
    max-width: 100%;
    margin: 0 auto;
 }

blockquote {
    padding-left: 1em;
    font-style: italic;
    border-left: solid 1px #fa6432;
 }

table {
    font-size: 1rem;
    text-align: left;
    caption-side: bottom;
    margin-bottom: 2em;
 }
table * {
    border: none;
 }
table thead, table tr {
    display: table;
    table-layout: fixed;
    width: 100%;
 }
table tr:nth-child(even) {
    background-color: rgba(200, 200, 200, 0.2);
 }
table tbody {
    display: block;
    max-height: 70vh;
    overflow-y: auto;
 }
table td, table th {
    padding: 0.25em;
 }

table, .highlight > pre, pre.example {
    max-height: 70vh;
    margin: 1em 0;
    padding: 1em;
    overflow: auto;
    font-size: 0.85rem;
    font-family: var(--font-monospace);
    font-weight: 400;
    font-style: normal;
    border: 1px dashed rgba(250, 100, 50, 0.5);
}

.title {
    font-size: 2.5em;
}

.subtitle {
    font-weight: normal;
    font-size: 0.75em;
    color: #666;
}

.tags {
    margin-top: -1.5rem;
    padding-bottom: 1.5em;
}
.tags li {
    display: inline;
    margin-right: 0.5em;
}

figure {
    margin: 1em 0;
}
figure figcaption {
    font-family: var(--font-monospace);
    font-size: 0.75em;
    text-align: center;
    color: grey;
}

.footnote-definition sup {
    margin-left: -1.5em;
    float: left;
}

.footnote-definition .footnote-body {
    margin: 1em 0;
    padding: 0 1em;
    border: 1px dashed rgba(250, 100, 50, 0.3);
    background-color: rgba(200, 200, 200, 0.2);
}
.footnote-definition .footnote-body p:only-child {
    margin: 0.2em 0;
}

header {
    display: flex;
    justify-content: space-between;
}
header nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
header a + a {
    margin-left: 1rem;
}

.code {
    background: rgba(200, 200, 200, 0.2);
    border: 1px dashed rgba(250, 100, 50, 0.5);
    padding-left: 3px;
}

.posts {
    margin: 0;
    list-style: none;
}

.posts .post {
    /* Add some padding to the post itself for more breathing room */
    margin-bottom: 0.5em; /* Space between list items */
}

.posts .post a {
    display: flex;
    justify-content: space-between; /* Aligns date and text to opposite ends */
    align-items: center; /* Vertically centers content */
    padding: 1em; /* More padding for a larger clickable area */
    color: black;
    text-decoration: none; /* Ensure no underline by default */
    border-radius: 8px; /* Slightly rounded corners for a modern look */
    transition: background-color 0.2s ease-in-out, transform 0.2s ease-in-out; /* Smooth transitions */
    box-shadow: 0 2px 5px rgba(0,0,0,0.1); /* Subtle shadow for depth */
}

.posts .post a:hover,
.posts .post a:focus,
.posts .post a:active {
    background: rgba(250, 100, 50, 0.1); /* Lighter version of your brand color on hover */
    text-decoration: none; /* No underline on hover */
    transform: translateY(-2px); /* Slight lift effect on hover */
    box-shadow: 0 4px 10px rgba(0,0,0,0.15); /* More pronounced shadow on hover */
}
.posts .post date {
    font-family: var(--font-monospace);
    font-weight: 400;
    font-size: 0.9rem; /* Slightly larger date font */
    vertical-align: middle;
    padding-right: 1.5rem; /* Space between date and text */
    color: #666; /* Slightly darker grey for better readability */
    flex-shrink: 0; /* Prevent date from shrinking */
}

.posts .post .post-rank {
    font-weight: bold;
    font-size: 1.2em; /* Larger font size for rank */
    color: #fa6432; /* Use your brand color for the rank */
    margin-right: 0.8em; /* Space between rank and title */
}

.posts .post .post-title {
    flex-grow: 1; /* Allows the title to take up remaining space */
    font-size: 1.1em; /* Slightly larger font for the title */
    color: #333;
}

/* Responsive adjustments if needed for smaller screens */
@media (max-width: 767px) {
    .posts .post a {
        flex-direction: column; /* Stack date and title on small screens */
        align-items: flex-start; /* Align items to the start when stacked */
        padding: 0.8em;
    }
    .posts .post date {
        padding-right: 0;
        margin-top: 0.5em; /* Space above date when stacked */
    }
    .posts .post .post-rank {
        margin-bottom: 0.5em;
    }
}

button {
    background-color: #fa6432; /* Matches the link color */
    color: white; /* Contrasting text color for readability */
    border: 1px solid #fa6432; /* Solid border matching background */
    padding: 0.75em 1.5em; /* Ample padding for a good click target */
    border-radius: 3px; /* Slightly rounded corners for a softer look */
    cursor: pointer; /* Indicates it's clickable */
    font-size: 1rem; /* Consistent font size */
    line-height: 1.5; /* Matches paragraph line height */
    text-decoration: none; /* No underline by default */
    display: inline-block; /* Allows padding and alignment */
    margin: 1em 0; /* Matches paragraph margin for vertical spacing */
}

button:hover,
button:focus,
button:active {
    background-color: #e05c2a; /* Slightly darker shade on hover/focus/active */
    border-color: #e05c2a;
    text-decoration: underline; /* Underline on hover/focus/active, similar to links */
}

button:disabled {
    background-color: #ccc;
    border-color: #ccc;
    color: #666;
    cursor: not-allowed;
}

label {
    display: block; /* Makes labels appear on their own line */
    margin-bottom: 0.5em; /* Spacing below the label */
    font-weight: bold; /* Makes labels stand out, similar to dt in dl */
    color: #333; /* Matches heading color for consistency */
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="search"],
textarea {
    width: 100%; /* Full width for better layout */
    padding: 0.75em; /* Consistent padding with the suggested button */
    margin-bottom: 1em; /* Spacing below the input, matching paragraph margin */
    border: 1px solid #ccc; /* Subtle border, similar to p code and table borders */
    border-radius: 3px; /* Slightly rounded corners, consistent with button */
    font-size: 1rem; /* Consistent font size */
    line-height: 1.5; /* Matches paragraph line height */
    box-sizing: border-box; /* Ensures padding is included in the width */
    font-family: var(--font-monospace);
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
input[type="search"]:focus,
textarea:focus {
    outline: none; /* Removes default browser outline */
    border-color: #fa6432; /* Highlights with the accent color on focus */
    box-shadow: 0 0 5px rgba(250, 100, 50, 0.5); /* Subtle glow on focus */
}

input[type="checkbox"],
input[type="radio"] {
    margin-right: 0.5em; /* Spacing for checkboxes and radio buttons */
    vertical-align: middle; /* Aligns with text */
}

/* Optional: Placeholder styling */
input::placeholder,
textarea::placeholder {
    color: #999;
    opacity: 1; /* Ensures placeholder is visible across browsers */
}
