/*
 * Development Blog pages (site/development/...), generated by blog/build.mjs.
 *
 * The page sits on the same scroll artwork as the home page. The artwork is
 * 1500x1055: its top 880px and bottom 155px are drawn at natural size and the
 * thin band between them is stretched, so the scroll grows with the content.
 * A dark shade over the map area keeps text readable.
 */

@font-face {
    font-family: 'CabinRegular';
    src: url('../fonts/cabin-regular-webfont.woff') format('woff');
    font-weight: normal;
    font-style: normal;
}

:root {
    --rw-text: #eadfc4;
    --rw-muted: #b9a77f;
    --rw-yellow: #FFFF00;
    --rw-yellow-hover: #ffc400;
    --rw-line: rgba(234, 223, 196, 0.2);
}

html { background: #2c1f10; }
body.scroll-page {
    margin: 0;
    overflow-x: hidden;
    color: var(--rw-text);
    font: 17px/1.6 Arial, Helvetica, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }

/* ---------- The scroll ---------- */
.scroll {
    position: relative;
    min-height: 1055px;
    overflow: hidden;
}
.scroll-bg {
    position: absolute;
    top: 0;
    bottom: 0;
    left: calc(50% - 750px);
    width: 1500px;
    border-style: solid;
    border-width: 880px 0 155px;
    border-image: url(../images/background-filled.jpg) 880 0 155 0 fill / 880px 0 155px stretch;
}
/* Darkens the map between the two rolls; fades out over the torn top and bottom edges. */
.scroll-shade {
    position: absolute;
    top: 50px;
    bottom: 46px;
    left: calc(50% - 537px);
    width: 1079px;
    background: linear-gradient(to bottom, rgba(22, 13, 5, 0.8) 0, rgba(22, 13, 5, 0.8) 500px, rgba(22, 13, 5, 0.93) 880px);
    -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 70px, #000 calc(100% - 70px), transparent 100%);
    mask-image: linear-gradient(to bottom, transparent 0, #000 70px, #000 calc(100% - 70px), transparent 100%);
}
.scroll-content {
    position: relative;
    width: min(970px, 100%);
    margin: 0 auto;
    padding: 96px 16px 150px;
}

/* ---------- Shared pieces ---------- */
a { color: var(--rw-yellow); }
a:hover { color: var(--rw-yellow-hover); }
a:focus-visible { outline: 2px solid var(--rw-yellow); outline-offset: 2px; }

h1, h2, h3 {
    margin: 0;
    color: var(--rw-yellow);
    font-family: 'CabinRegular', Arial, Helvetica, sans-serif;
    font-weight: normal;
    line-height: 1.2;
    text-wrap: balance;
}
h1 {
    margin: 18px 0 30px;
    font-size: 46px;
    text-align: center;
    text-shadow: 0 2px 0 #000, 0 0 14px rgba(0, 0, 0, 0.8);
}
h2 a, h3 a { text-decoration: none; }
h2 a:hover, h3 a:hover { text-decoration: underline; }

.date {
    margin: 6px 0 0;
    color: var(--rw-muted);
    font-size: 13px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}
.excerpt { margin: 10px 0 0; }

/* Back link: a small tag in the corner of the scroll. */
.back {
    display: inline-block;
    padding: 7px 16px 6px 12px;
    border: 1px solid rgba(255, 255, 0, 0.6);
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.45);
    color: var(--rw-yellow);
    font-family: 'CabinRegular', Arial, Helvetica, sans-serif;
    font-size: 15px;
    letter-spacing: 0.06em;
    text-decoration: none;
    text-transform: uppercase;
    white-space: nowrap;
}
.back:hover { background: var(--rw-yellow); color: #2c1f10; }

.topbar {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 12px;
}
.topbar .back { justify-self: start; }
.topbar-logo img {
    display: block;
    width: 176px;
    height: auto;
}

.bottombar {
    margin-top: 36px;
    padding-top: 24px;
    border-top: 1px solid var(--rw-line);
    text-align: center;
}

.thumb {
    display: block;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border: 1px solid var(--rw-line);
    border-radius: 4px;
    background: #120b04;
}
.thumb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.2s ease;
}
.thumb:hover img { transform: scale(1.04); }

.button {
    display: inline-block;
    margin-top: 16px;
    padding: 9px 18px 8px;
    border-radius: 3px;
    background: var(--rw-yellow);
    color: #2c1f10;
    font-family: 'CabinRegular', Arial, Helvetica, sans-serif;
    font-size: 16px;
    text-decoration: none;
}
.button:hover { background: var(--rw-yellow-hover); color: #2c1f10; }

/* ---------- Front page: newest entry ---------- */
.post-featured {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
    gap: 28px;
    align-items: start;
}
.post-featured h2 { font-size: 30px; }

/* ---------- Front page: row of four ---------- */
.post-row {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 22px;
    margin: 36px 0 8px;
    padding: 24px;
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.32);
}
.post-card h3 { margin-top: 14px; font-size: 20px; }
.post-card .excerpt { font-size: 15px; line-height: 1.5; }

/* ---------- Front page: older entries ---------- */
.post-item {
    display: grid;
    grid-template-columns: 230px minmax(0, 1fr);
    gap: 24px;
    align-items: start;
    padding: 24px 0;
    border-top: 1px solid var(--rw-line);
}
.post-list .post-item:first-child { border-top: 0; }
.post-item h3 { font-size: 23px; }
.post-item .excerpt { font-size: 16px; }
.post-item .date { margin-top: 10px; }

/* ---------- Entry page ---------- */
.entry {
    max-width: 760px;
    margin: 0 auto;
}
.entry h1 { margin-bottom: 0; font-size: 40px; }
.entry > .date { text-align: center; }
.entry-content { margin-top: 30px; overflow-wrap: break-word; }
.entry-content::after { content: ""; display: block; clear: both; }
.entry-content p { margin: 0 0 1.1em; }
.entry-content h2 { margin: 1.6em 0 0.5em; font-size: 26px; }
.entry-content h3, .entry-content h4 { margin: 1.4em 0 0.4em; font-size: 21px; color: var(--rw-yellow); }
.entry-content ul, .entry-content ol { margin: 0 0 1.1em; padding-left: 1.4em; }
.entry-content li { margin-bottom: 0.3em; }
.entry-content img {
    max-width: 100%;
    height: auto;
    border-radius: 3px;
}
.entry-content figure { margin: 1.6em 0; }
.entry-content figcaption {
    margin-top: 6px;
    color: var(--rw-muted);
    font-size: 14px;
    font-style: italic;
    text-align: center;
}
.entry-content .aligncenter { display: block; margin-left: auto; margin-right: auto; text-align: center; }
.entry-content figure.aligncenter img { display: block; margin: 0 auto; }
.entry-content .alignleft  { float: left;  max-width: 48%; margin: 4px 22px 12px 0; }
.entry-content .alignright { float: right; max-width: 48%; margin: 4px 0 12px 22px; }
.entry-content .center { text-align: center; }
.entry-content .video {
    aspect-ratio: 16 / 9;
    margin: 1.6em 0;
}
.entry-content .video iframe { display: block; width: 100%; height: 100%; border: 0; }
.entry-content pre {
    margin: 0 0 1.1em;
    padding: 12px 14px;
    overflow-x: auto;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.5);
    font: 14px/1.5 Consolas, 'Courier New', monospace;
}
.entry-content hr { height: 1px; margin: 2em 0; border: 0; background: var(--rw-line); }
.entry-content blockquote { margin: 0 0 1.1em; padding-left: 16px; border-left: 3px solid var(--rw-line); }

.entry-nav {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 16px;
    align-items: start;
    text-align: left;
}
.entry-nav-newer, .entry-nav-older { font-family: 'CabinRegular', Arial, Helvetica, sans-serif; text-decoration: none; }
.entry-nav-newer .date, .entry-nav-older .date { display: block; margin: 0 0 2px; }
.entry-nav-older { text-align: right; }

/* ---------- Tablets and phones ---------- */
@media (max-width: 820px) {
    body.scroll-page { font-size: 16px; }
    .scroll-content { padding: 84px 14px 130px; }
    h1 { font-size: 36px; }
    .entry h1 { font-size: 32px; }
    .topbar-logo img { width: 130px; }
    .post-featured { grid-template-columns: minmax(0, 1fr); gap: 16px; }
    .post-row { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 16px; gap: 20px 16px; }
    .post-item { grid-template-columns: 150px minmax(0, 1fr); gap: 16px; }
}
@media (max-width: 520px) {
    .topbar { grid-template-columns: auto 1fr; }
    .topbar-logo { justify-self: end; }
    .topbar-logo img { width: 104px; }
    .back { font-size: 13px; padding: 6px 12px 5px 9px; }
    .post-row { grid-template-columns: minmax(0, 1fr); }
    .post-item { grid-template-columns: minmax(0, 1fr); }
    .post-item .thumb { max-width: 320px; }
    .entry-content .alignleft, .entry-content .alignright { float: none; max-width: 100%; margin: 1.2em auto; display: block; }
    .entry-nav { grid-template-columns: minmax(0, 1fr); text-align: center; }
    .entry-nav-older { text-align: center; }
    .entry-nav .back { justify-self: center; order: 3; }
}
