/* lowmileage.com — Charlie Stein's Photoblog
   Shared stylesheet for static HTML site on Cloudflare */

/* ─── Reset & Base ─────────────────────────────────────────── */
*, *::before, *::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    background-color: #e8e8e8;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 16px;
    line-height: 1.6;
    color: #222;
}

a {
    color: #0000EE;
    text-decoration: underline;
}

a:visited {
    color: #551A8B;
}

a:hover {
    color: #0000AA;
}

/* ─── Page Wrapper ──────────────────────────────────────────── */
#wrapper {
    max-width: 1200px;
    margin: 0 auto;
    background-color: #fff;
    padding: 0 20px 40px 20px;
}

/* ─── Header ────────────────────────────────────────────────── */
#header {
    border-bottom: 4px solid #7a9e7e;
    padding-bottom: 10px;
    margin-bottom: 20px;
}

#branding {
    display: flex;
    flex-direction: column;
}

/* Title and description on same line */
#site-title-bar {
    display: flex;
    align-items: baseline;
    gap: 16px;
    margin-bottom: 8px;
}

#site-title {
    font-size: 1.5em;
    font-weight: bold;
    margin: 0;
}

#site-title a {
    text-decoration: none;
    color: #222;
}

#site-title a:visited {
    color: #222;
}

#site-description {
    font-size: 1em;
    color: #555;
    font-style: italic;
    margin: 0;
}

/* ─── Navigation ────────────────────────────────────────────── */
#access {
    margin-top: 6px;
}

#access .menu-header ul,
#access .menu-header ul .sub-menu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 6px 20px;
}

#access .menu-header ul li {
    margin: 0;
    padding: 0;
}

#access .menu-header ul li a {
    text-decoration: none;
    color: #0000EE;
    font-size: 0.95em;
}

#access .menu-header ul li a:hover {
    text-decoration: underline;
}

/* ─── Main Content Area ─────────────────────────────────────── */
#main {
    display: flex;
    gap: 30px;
    align-items: flex-start;
}

#container {
    flex: 1;
    min-width: 0; /* prevents flex overflow */
}

#content {
    width: 100%;
}

/* ─── Post / Entry ──────────────────────────────────────────── */
h1.entry-title {
    font-size: 1.5em;
    margin-bottom: 6px;
}

.entry-meta {
    font-size: 0.9em;
    color: #555;
    margin-bottom: 16px;
}

.entry-content p {
    margin: 0 0 1em 0;
}

/* ─── Images (figure/img/figcaption) ─────────────────────────
   Images size themselves against a fixed width/height cap
   rather than their native resolution, so display size is
   consistent across posts regardless of source export size.
   The figure shrink-wraps to the image's rendered size so the
   caption hugs the photo; portrait shots are capped by height,
   landscape shots by width, automatically. ──────────────────── */
.entry-content figure {
    display: inline-block;
    max-width: 100%;
    margin: 1.5em 0;
    text-align: center;
    vertical-align: top;
}

.entry-content figure img {
    display: block;
    max-width: min(800px, 100%);
    max-height: 700px;
    width: auto;
    height: auto;
    margin: 0 auto;
}

.entry-content figcaption {
    text-align: center;
    font-size: 0.9em;
    color: #555;
    margin-top: 0.4em;
}

/* ─── Navigation Links (prev/next post) ─────────────────────── */
.navigation {
    display: flex;
    justify-content: space-between;
    margin: 16px 0;
    font-size: 0.9em;
}

/* ─── Sidebar ───────────────────────────────────────────────── */
#primary {
    width: 200px;
    flex-shrink: 0;
    font-size: 0.9em;
}

#primary ul.xoxo {
    list-style: none;
    margin: 0;
    padding: 0;
}

#primary ul.xoxo li {
    margin-bottom: 10px;
}

/* Archive sidebar (loaded via fetch from sidebar.html) */
.lm-archive__heading {
    font-size: 1em;
    font-weight: bold;
    margin: 0 0 8px 0;
    padding: 0;
}

.lm-archive__years {
    list-style: none;
    margin: 0;
    padding: 0;
}

.lm-archive__year-item {
    margin: 0;
    padding: 0;
}

.lm-archive__year-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1em;
    font-family: inherit;
    color: #0000EE;
    padding: 2px 0;
    text-align: left;
    width: 100%;
}

.lm-archive__year-btn:hover {
    text-decoration: underline;
}

.lm-archive__months {
    list-style: none;
    margin: 0 0 4px 1em;
    padding: 0;
}

.lm-archive__months a {
    font-size: 0.95em;
    text-decoration: none;
    color: #0000EE;
}

.lm-archive__months a:hover {
    text-decoration: underline;
}

/* ─── Monthly Archive Page Title ────────────────────────────── */
h1.page-title {
    font-size: 1.4em;
    margin-bottom: 16px;
}

/* ─── Post summaries on archive/index pages ─────────────────── */
h2.entry-title {
    font-size: 1.2em;
    margin-bottom: 4px;
}

h2.entry-title a {
    text-decoration: none;
    color: #222;
}

h2.entry-title a:hover {
    text-decoration: underline;
    color: #0000EE;
}

.entry-summary {
    margin-bottom: 8px;
    color: #333;
}

.entry-summary p {
    margin: 0 0 0.5em 0;
}

/* "Continue reading" link */
.entry-summary a {
    font-size: 0.9em;
}

/* Separator between posts on archive pages */
div[id^="post-"] {
    border-bottom: 1px solid #ddd;
    margin-bottom: 20px;
    padding-bottom: 20px;
}

div[id^="post-"]:last-of-type {
    border-bottom: none;
}

/* ─── Contact Form ──────────────────────────────────────────── */
.lm-contact-form {
    max-width: 500px;
    margin-top: 1em;
}

.lm-contact-form label {
    font-weight: bold;
    font-size: 0.95em;
}

.lm-contact-form input[type="text"],
.lm-contact-form input[type="email"],
.lm-contact-form textarea {
    width: 100%;
    font-family: inherit;
    font-size: 1em;
    padding: 8px;
    margin-top: 4px;
    border: 1px solid #ccc;
    border-radius: 3px;
    box-sizing: border-box;
}

.lm-contact-form textarea {
    resize: vertical;
}

.lm-contact-form button {
    background-color: #7a9e7e;
    color: #fff;
    border: none;
    padding: 10px 24px;
    font-size: 1em;
    border-radius: 3px;
    cursor: pointer;
}

.lm-contact-form button:hover {
    background-color: #688a6c;
}

/* Honeypot field - hidden from real visitors, catches simple bots */
.lm-hp-field {
    position: absolute;
    left: -9999px;
}

/* ─── Footer ────────────────────────────────────────────────── */
#footer {
    border-top: 1px solid #ccc;
    margin-top: 30px;
    padding-top: 10px;
    font-size: 0.85em;
    color: #555;
    text-align: center;
}

#site-info a {
    color: #555;
    text-decoration: none;
}

/* ─── Screen Reader / Accessibility ─────────────────────────── */
.screen-reader-text {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
}

/* ─── Responsive (mobile) ───────────────────────────────────── */
@media (max-width: 700px) {
    #main {
        flex-direction: column;
    }

    #primary {
        width: 100%;
    }

    #access .menu-header ul {
        flex-direction: column;
        gap: 4px;
    }

    #site-title-bar {
        flex-direction: column;
        gap: 4px;
    }
}
