:root {
    --theme-color: #1d4ed8;
    --theme-color-text: #fff;
    --theme-color-border: rgba(255,255,255,.32);
    --bg: #f5f5f5;
    --surface: #fff;
    --text: #171717;
    --muted: #666;
    --border: #cfcfcf;
    --max-width: 860px;
    --header-height: 68px;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body {
    min-height: 100vh;
    margin: 0;
    display: flex;
    flex-direction: column;
    background: var(--bg);
    color: var(--text);
    font-family: Arial, Helvetica, sans-serif;
    font-size: 16px;
    line-height: 1.65;
}
img { max-width: 100%; height: auto; }
a { color: var(--theme-color); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
.theme-container { width: min(calc(100% - 32px), var(--max-width)); margin: 0 auto; }

.site-header {
    position: relative;
    z-index: 20;
    height: var(--header-height);
    flex: 0 0 var(--header-height);
    background: var(--theme-color);
    color: var(--theme-color-text);
    border-bottom: 1px solid var(--theme-color-border);
}
.site-header-inner { height: 100%; display: flex; align-items: center; gap: 20px; }
.brand {
    flex: 0 1 auto;
    color: var(--theme-color-text);
    font-weight: 700;
    letter-spacing: .07em;
    text-decoration: none;
    white-space: nowrap;
}
.site-nav { margin-left: auto; display: flex; align-items: center; justify-content: flex-end; gap: 18px; }
.site-nav a { color: var(--theme-color-text); text-decoration: none; font-weight: 400; }
.site-nav a:hover,
.site-nav a[aria-current="page"] { opacity: .66; text-decoration: none; font-weight: 400; }
.menu-toggle {
    display: none;
    margin-left: auto;
    padding: 7px 10px;
    border: 1px solid var(--theme-color-border);
    border-radius: 0;
    background: transparent;
    color: var(--theme-color-text);
    font: inherit;
    cursor: pointer;
}

.site-main { flex: 1 0 auto; padding: 42px 0 64px; }
.site-content { padding: 28px; background: var(--surface); border: 1px solid var(--border); }
.site-footer { flex: 0 0 auto; padding: 20px 0 34px; background: var(--surface); border-top: 1px solid var(--border); color: var(--muted); font-size: .9rem; }
.site-footer a { color: var(--theme-color); }

h1, h2, h3, h4, h5, h6 { line-height: 1.25; color: var(--theme-color); }
h1 { margin: 0 0 .8em; }
h2, h3, h4, h5, h6 { margin: 1.55em 0 .6em; }
p, ul, ol, blockquote, pre, table { margin: 1em 0; }
hr { border: 0; border-top: 1px solid var(--border); }
blockquote { margin-left: 0; padding-left: 16px; border-left: 4px solid var(--theme-color); color: var(--muted); }
pre { overflow: auto; padding: 14px; border: 1px solid var(--border); background: var(--bg); }
code { font-family: Consolas, Monaco, "Lucida Console", monospace; background: var(--bg); padding: .1em .3em; }
pre code { padding: 0; background: transparent; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 9px 8px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--border); }
.meta, .small { color: var(--muted); font-size: .9rem; }
.site-status { min-height: 34vh; display: flex; flex-direction: column; justify-content: center; }
.site-status h1 { margin-bottom: .75rem; }
.site-status p { max-width: 620px; margin: 0; }

/* Public forms and reusable plugin UI. */
.field { margin-bottom: 18px; }
label { display: block; margin-bottom: 6px; font-weight: 700; }
input[type="text"], input[type="email"], input[type="search"], input[type="url"], input[type="number"], textarea, select {
    width: 100%; padding: 10px 11px; border: 1px solid var(--border); border-radius: 0; background: var(--surface); color: var(--text); font: inherit;
}
textarea { min-height: 180px; resize: vertical; }
button, .button { display: inline-block; padding: 8px 12px; border: 1px solid var(--theme-color); border-radius: 0; background: var(--theme-color); color: var(--theme-color-text); font: inherit; text-decoration: none; cursor: pointer; }
button.secondary, .button.secondary { background: var(--surface); color: var(--text); border-color: var(--border); }
.notice { margin: 0 0 20px; padding: 12px 14px; border: 1px solid var(--border); background: var(--surface); }
.notice.error { border-color: #991b1b; }
.contact-hp { position: absolute !important; left: -10000px !important; width: 1px !important; height: 1px !important; overflow: hidden !important; }

/* Editor image classes. */
img.image-left { float: left; margin: 0 1.25rem 1rem 0; }
img.image-right { float: right; margin: 0 0 1rem 1.25rem; }
img.image-center { display: block; float: none; margin: 1rem auto; }
img.image-normal { float: none; }

/* Blog. */
.blog-list-item { padding: 0 0 24px; margin: 0 0 24px; border-bottom: 1px solid var(--border); }
.blog-list-item:last-child { margin-bottom: 0; padding-bottom: 0; border-bottom: 0; }
.blog-list-item h2 { margin: 0 0 4px; }
.blog-post > .meta { margin: -.5rem 0 2rem; }

/* Portfolio. */
.portfolio-list-item { padding: 0 0 22px; margin: 0 0 22px; border-bottom: 1px solid var(--border); }
.portfolio-list-item:last-child { margin-bottom: 0; padding-bottom: 0; border-bottom: 0; }
.portfolio-list-head { display: flex; align-items: baseline; justify-content: space-between; gap: 18px; }
.portfolio-list-head h2 { margin: 0; font-size: 1rem; font-weight: 400; }
.portfolio-date, .portfolio-excerpt { color: var(--muted); font-size: .9rem; }
.portfolio-date { white-space: nowrap; }
.portfolio-image { display: block; max-width: 100%; height: auto; border: 1px solid var(--border); }
.portfolio-summary { margin: .55rem 0 .35rem; font-size: .95rem; }
.portfolio-excerpt { margin: .35rem 0 0; }
.portfolio-links { margin-top: 1.5rem; font-size: .9rem; }

/* Downloads. */
.download-item { padding: 0 0 24px; margin: 0 0 24px; border-bottom: 1px solid var(--border); }
.download-item:last-child { margin-bottom: 0; padding-bottom: 0; border-bottom: 0; }
.download-head { display: flex; align-items: baseline; justify-content: space-between; gap: 18px; }
.download-head h2 { margin: 0; }
.download-description > :first-child { margin-top: .6rem; }
.download-meta { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 14px; }

/* Search. */
.site-search-form { margin: 0 0 28px; }
.search-row { display: flex; align-items: stretch; gap: 8px; }
.search-row input { flex: 1 1 auto; min-width: 0; }
.search-result { padding: 0 0 22px; margin: 0 0 22px; border-bottom: 1px solid var(--border); }
.search-result:last-child { margin-bottom: 0; padding-bottom: 0; border-bottom: 0; }
.search-result h2 { margin: .1rem 0 .35rem; }

/* Cookie notice. */
.cookie-notice { position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 100; width: min(calc(100% - 32px), 760px); margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 14px 16px; border: 1px solid var(--border); background: var(--surface); color: var(--text); }
.cookie-notice[hidden] { display: none; }
.cookie-notice button { flex: 0 0 auto; }

@media (max-width: 900px) {
    .menu-toggle { display: inline-block; }
    .site-header-inner { position: relative; width: 100%; padding: 0 16px; }
    .site-nav { display: none; position: absolute; top: 100%; left: 0; right: 0; width: 100%; margin: 0; flex-direction: column; gap: 0; align-items: stretch; background: var(--theme-color); border-top: 1px solid var(--theme-color-border); }
    .site-nav.is-open { display: flex; }
    .site-nav a { display: block; width: 100%; padding: 12px 16px; border-bottom: 1px solid var(--theme-color-border); }
    .site-nav a:last-child { border-bottom: 0; }
}

@media (max-width: 640px) {
    .theme-container { width: min(calc(100% - 22px), var(--max-width)); }
    .site-header-inner { width: 100%; padding: 0 11px; }
    .site-nav a { padding-left: 11px; padding-right: 11px; }
    .site-main { padding-top: 30px; }
    .site-content { padding: 20px; }
    .portfolio-list-head, .download-head { align-items: flex-start; flex-direction: column; gap: 4px; }
    img.image-left, img.image-right { display: block; float: none; margin: 1rem auto; }
    .cookie-notice { align-items: stretch; flex-direction: column; }
}
