/* Shared styling for generated pages (places index, era pages, place pages).
   Palette and type match about.html so generated and hand-written pages read
   as one site. */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Palatino Linotype', 'Book Antiqua', Palatino, Georgia, serif;
    background: #1a1a1a;
    color: #d4c5a9;
    overflow-x: hidden;
    line-height: 1.7;
}

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #8b7355; border-radius: 3px; }

.visually-hidden {
    position: absolute;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border: 0;
}

/* ── Nav Bar ───────────────────────────── */
#nav-bar {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 44px;
    z-index: 1100;
    background: rgba(26, 26, 26, 0.92);
    border-bottom: 1px solid #5a4a36;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    padding: 0 20px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}
.nav-link {
    color: #8b7355;
    text-decoration: none;
    font-size: 13px;
    padding: 6px 14px;
    border-radius: 4px;
    transition: color 0.2s, background 0.2s;
    white-space: nowrap;
}
.nav-link:hover, .nav-link.active {
    color: #e8d9b0;
    background: rgba(139, 115, 85, 0.2);
}
.nav-title {
    font-size: 15px;
    color: #e8d9b0;
    letter-spacing: 2px;
}
#nav-bar > .nav-link:first-child { justify-self: start; }
.nav-right { justify-self: end; display: flex; align-items: center; gap: 2px; }
@media (max-width: 700px) {
    #nav-bar { padding: 0 10px; }
    .nav-title { display: none; }
    .nav-link { padding: 6px 9px; font-size: 12px; }
}

/* ── Article ───────────────────────────── */
#article {
    max-width: 820px;
    margin: 0 auto;
    padding: 92px 24px 96px 24px;
}
.page-title {
    font-size: 34px;
    color: #e8d9b0;
    line-height: 1.25;
    letter-spacing: 0.5px;
    margin-bottom: 14px;
}
.standfirst {
    font-size: 17px;
    color: #b0a086;
    font-style: italic;
    margin-bottom: 10px;
}
.byline {
    font-size: 13px;
    color: #8b7355;
    border-bottom: 1px solid #5a4a36;
    padding-bottom: 22px;
    margin-bottom: 34px;
}
h2 {
    font-size: 24px;
    color: #e8d9b0;
    margin: 46px 0 8px 0;
    letter-spacing: 0.5px;
}
h2 .num {
    display: block;
    font-size: 12px;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: #8b7355;
    margin-bottom: 4px;
}
h3 { font-size: 18px; color: #d4c5a9; margin: 30px 0 6px 0; }
p { margin-bottom: 16px; }
a { color: #c8b48a; }
a:hover { color: #e8d9b0; }
strong { color: #e8d9b0; font-weight: normal; }
ul, ol { margin: 0 0 16px 22px; }
li { margin-bottom: 7px; }
code {
    font-family: 'SF Mono', 'Menlo', 'Consolas', monospace;
    font-size: 0.86em;
    background: #2c2418;
    border: 1px solid #5a4a36;
    border-radius: 3px;
    padding: 1px 5px;
    color: #d8c9a5;
    white-space: nowrap;
}

/* ── Figures ───────────────────────────── */
figure {
    margin: 28px 0;
    background: #221c14;
    border: 1px solid #5a4a36;
    border-radius: 6px;
    padding: 16px;
}
/* The crop is wrapped in a link, so match both shapes. Without width:100%
   a 640px crop overflows a 375px screen. */
figure img,
figure a img {
    display: block;
    width: 100%;
    height: auto;
    border: 1px solid #5a4a36;
    border-radius: 3px;
}
figcaption {
    font-size: 13px;
    color: #a8987c;
    line-height: 1.55;
    margin-top: 10px;
}

/* ── Age jump links ────────────────────── */
.age-jump {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 4px 0 34px;
}
.age-jump a {
    display: inline-flex;
    align-items: baseline;
    gap: 7px;
    border: 1px solid #5a4a36;
    border-radius: 20px;
    padding: 6px 15px;
    font-size: 13px;
    color: #c8b48a;
    text-decoration: none;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.age-jump a:hover {
    background: rgba(139, 115, 85, 0.18);
    border-color: #8b7355;
    color: #e8d9b0;
}
.age-jump span { color: #8b7355; font-size: 12px; }

/* The nav bar is fixed, so an anchor jump would otherwise land with the
   heading hidden underneath it. */
#article section[id] { scroll-margin-top: 62px; }

/* ── Place rows ────────────────────────── */
/* A grid rather than a table so the columns can restack on a phone instead
   of forcing the whole page sideways. */
.place-list { list-style: none; margin: 0 0 8px; padding: 0; }
.place-row {
    display: grid;
    grid-template-columns: 144px minmax(0, 1fr) auto;
    gap: 18px;
    align-items: start;
    padding: 14px 10px;
    margin: 0 -10px;
    border-bottom: 1px solid #322b21;
    border-radius: 6px;
    transition: background 0.15s;
}
.place-row:last-child { border-bottom: none; }
.place-row:hover { background: rgba(139, 115, 85, 0.09); }

.place-thumb { display: block; line-height: 0; }
.place-thumb img {
    width: 144px;
    height: 81px;
    object-fit: cover;
    border: 1px solid #5a4a36;
    border-radius: 3px;
    transition: border-color 0.15s, filter 0.15s;
    filter: saturate(0.92);
}
.place-row:hover .place-thumb img { border-color: #8b7355; filter: saturate(1.05); }

.place-name {
    color: #e8d9b0;
    font-size: 17px;
    text-decoration: none;
    border-bottom: 1px solid transparent;
}
.place-name:hover { color: #fff; border-bottom-color: #c9a435; }
.place-event {
    color: #a8987c;
    font-style: italic;
    font-size: 14px;
    margin-left: 9px;
}
.place-snippet {
    font-size: 13.5px;
    color: #a2947a;
    line-height: 1.55;
    margin: 5px 0 0;
}

.place-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    min-width: 148px;
    font-size: 12px;
    color: #8b7355;
    padding-top: 3px;
}
.place-book { display: inline-flex; align-items: center; gap: 7px; color: #b0a086; }
.place-book i {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    flex: none;
}
.place-coords {
    font-family: 'SF Mono', 'Menlo', 'Consolas', monospace;
    font-size: 11px;
    color: #7d6c52;
}

@media (max-width: 720px) {
    .place-row { grid-template-columns: 96px minmax(0, 1fr); gap: 13px; }
    .place-thumb img { width: 96px; height: 54px; }
    .place-name { font-size: 16px; }
    .place-event { display: block; margin-left: 0; }
    .place-meta {
        grid-column: 1 / -1;
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        justify-content: flex-start;
        gap: 6px 14px;
        min-width: 0;
        padding-top: 2px;
    }
}

/* ── Tables ────────────────────────────── */
.table-wrap { overflow-x: auto; margin: 20px 0 24px 0; }
table { border-collapse: collapse; width: 100%; font-size: 14px; min-width: 460px; }
th, td {
    text-align: left;
    padding: 10px 14px 10px 0;
    border-bottom: 1px solid #3a3227;
    vertical-align: top;
}
th {
    color: #8b7355;
    font-weight: normal;
    font-size: 12px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    border-bottom-color: #5a4a36;
}
td.place { padding-right: 22px; }
td.place a { color: #e8d9b0; text-decoration: none; border-bottom: 1px solid #5a4a36; }
td.place a:hover { color: #fff; border-bottom-color: #c9a435; }
td.place .snippet {
    display: block;
    font-size: 13px;
    color: #a8987c;
    line-height: 1.5;
    margin-top: 3px;
    font-style: italic;
}
td.meta { color: #b0a086; white-space: nowrap; font-size: 13px; }
td.coords {
    color: #8b7355;
    white-space: nowrap;
    font-family: 'SF Mono', 'Menlo', 'Consolas', monospace;
    font-size: 12px;
}

/* ── Place page details ────────────────── */
h2 .event-date {
    display: block;
    font-size: 12px;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: #8b7355;
    margin-top: 3px;
}
.event-figures { font-size: 13.5px; color: #a2947a; }
.event-figures strong { color: #b0a086; }
.page-walk {
    margin-top: 44px;
    padding-top: 18px;
    border-top: 1px solid #5a4a36;
    font-size: 13px;
    color: #8b7355;
    line-height: 2;
}

/* ── Footer ────────────────────────────── */
.page-footer {
    margin-top: 56px;
    padding-top: 20px;
    border-top: 1px solid #5a4a36;
    font-size: 12px;
    color: #8b7355;
}
.page-footer p { margin-bottom: 8px; }
