/* Via Rheni – site styles */

/* Fonts
   ----- */

/* Roboto variable font (latin subset), SIL Open Font License, see /fonts/OFL.txt */
@font-face {
    font-family: "Roboto";
    src: url("/fonts/roboto.woff2") format("woff2");
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Roboto";
    src: url("/fonts/roboto-italic.woff2") format("woff2");
    font-weight: 100 900;
    font-style: italic;
    font-display: swap;
}

/* Tokens
   ------ */

:root {
    --red: #d90000;
    --red-dark: #a30000;
    --heading: #303030;
    --text: #4a4a4a;
    --muted: #666666;
    --border: #e5e5e5;
    --page: #ffffff;
    --cream: #fffef7;
    --footer: #1b1b1b;
    --footer-text: #c4c4c4;

    --font: "Roboto", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
    --content: 46rem;
    --wide: 70rem;
    --gutter: clamp(1rem, 4vw, 2rem);
    --radius: 4px;
}

/* Base
   ---- */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    margin: 0;
    background: var(--page);
    color: var(--text);
    font-family: var(--font);
    font-size: 1.0625rem;
    line-height: 1.65;
}

main {
    flex: 1;
    width: 100%;
    padding: clamp(1.5rem, 5vw, 3rem) var(--gutter) clamp(2.5rem, 6vw, 4rem);
}

h1,
h2,
h3,
h4 {
    margin: 2em 0 0.6em;
    color: var(--heading);
    font-weight: 600;
    line-height: 1.25;
}

h1 {
    margin-top: 0;
    font-size: clamp(1.5rem, 1.2rem + 1.4vw, 2rem);
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

/* Short bar under the page title, as in the original design */
h1::after {
    content: "";
    display: block;
    width: 1.5rem;
    height: 3px;
    margin-top: 0.6rem;
    background: var(--red);
}

h2 {
    font-size: 1.35rem;
}

h3 {
    font-size: 1.15rem;
}

h4 {
    font-size: 1rem;
}

p,
ul,
ol,
dl,
figure,
table {
    margin: 0 0 1rem;
}

a {
    color: var(--red);
    text-decoration-thickness: 1px;
    text-underline-offset: 0.15em;
}

a:hover {
    color: var(--red-dark);
}

:focus-visible {
    outline: 3px solid var(--red);
    outline-offset: 2px;
}

img {
    max-width: 100%;
    height: auto;
}

/* Skip link
   --------- */

.skip-link {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    z-index: 10;
    padding: 0.5rem 1rem;
    background: var(--heading);
    color: #ffffff;
    transform: translateY(-200%);
}

.skip-link:focus {
    transform: none;
}

/* Header
   ------ */

.site-header {
    padding: clamp(1rem, 3vw, 1.75rem) var(--gutter) 0;
    border-bottom: 1px solid var(--border);
    text-align: center;
}

.site-logo {
    display: inline-block;
}

.site-logo img {
    display: block;
    width: clamp(9rem, 30vw, 13rem);
}

.site-nav ul {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0 clamp(0.75rem, 2.5vw, 2rem);
    margin: clamp(0.75rem, 2vw, 1.25rem) 0 0;
    padding: 0;
    list-style: none;
}

.site-nav a {
    display: block;
    padding: 0.6rem 0 0.7rem;
    border-bottom: 3px solid transparent;
    color: var(--muted);
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-decoration: none;
    text-transform: uppercase;
}

.site-nav a:hover {
    color: var(--heading);
}

.site-nav a[aria-current] {
    border-bottom-color: var(--red);
    color: var(--heading);
}

/* Footer
   ------ */

.site-footer {
    padding: 1.5rem var(--gutter);
    background: var(--footer);
    color: var(--footer-text);
    font-size: 0.875rem;
    line-height: 1.6;
    text-align: center;
}

.site-footer p {
    margin: 0 0 0.5rem;
}

.site-footer strong {
    color: #ffffff;
    font-weight: 500;
}

.site-footer a {
    color: #ffffff;
}

.site-footer a:hover {
    color: var(--footer-text);
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0 1.5rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

/* Content layout
   -------------- */

main > article,
.tafel-nav {
    max-width: var(--content);
    margin-inline: auto;
}

main > article.wide {
    max-width: var(--wide);
}

.prose ul {
    padding-left: 1.25rem;
}

.prose li + li {
    margin-top: 0.25rem;
}

.subtitle {
    margin-bottom: 1.5rem;
    color: var(--heading);
    font-size: 1.2rem;
    font-weight: 500;
    line-height: 1.4;
}

.source {
    color: var(--muted);
    font-size: 0.9375rem;
    font-style: italic;
}

.signature {
    margin-top: 2rem;
}

/* Figures
   ------- */

figure {
    margin: 2rem 0;
    text-align: center;
}

figure img {
    display: block;
    margin-inline: auto;
}

figcaption {
    margin-top: 0.6rem;
    color: var(--muted);
    font-size: 0.9375rem;
    line-height: 1.5;
}

.map img {
    border: 1px solid var(--border);
}

/* Narrow portrait images float beside the text on wider screens */
@media (min-width: 40rem) {
    figure.narrow {
        float: right;
        max-width: 40%;
        margin: 0.25rem 0 1rem 2rem;
    }
}

/* Coordinates table (home page)
   ----------------------------- */

.standorte {
    width: 100%;
    margin: 2.5rem 0 2rem;
    border-collapse: collapse;
    font-size: 0.9375rem;
}

.standorte caption {
    margin-bottom: 0.75rem;
    color: var(--heading);
    font-size: 1.15rem;
    font-weight: 600;
    text-align: left;
}

.standorte th,
.standorte td {
    padding: 0.55rem 0.5rem;
    border-bottom: 1px solid var(--border);
    text-align: left;
    vertical-align: top;
}

.standorte th {
    color: var(--heading);
    font-weight: 600;
}

.standorte th:first-child,
.standorte td:first-child {
    width: 2.5rem;
    padding-left: 0;
    font-variant-numeric: tabular-nums;
}

.standorte td:last-child {
    font-variant-numeric: tabular-nums;
}

.standorte td:last-child a {
    color: var(--text);
}

.standorte td:last-child a:hover {
    color: var(--red);
}

/* Prominent link, e.g. to the board overview */
.more a {
    display: inline-block;
    padding: 0.6rem 1.25rem;
    border: 2px solid var(--red);
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-decoration: none;
    text-transform: uppercase;
}

.more a::before {
    content: "› ";
}

.more a:hover {
    background: var(--red);
    color: #ffffff;
}

/* Cards (board overview, Radtouren)
   --------------------------------- */

.tafel-grid,
.tour-cards {
    display: grid;
    gap: 1.5rem;
    margin: 2rem 0 0;
    padding: 0;
    list-style: none;
}

.tafel-grid {
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 18rem), 1fr));
}

.tour-cards {
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 16rem), 1fr));
}

.tafel-grid a,
.tour-cards a {
    display: block;
    height: 100%;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--cream);
    color: var(--heading);
    text-decoration: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.tafel-grid img,
.tour-cards img {
    display: block;
    width: 100%;
}

.tafel-grid span,
.tour-cards span {
    display: block;
    padding: 0.85rem 1rem;
    border-top: 3px solid transparent;
    transition: border-color 0.2s, color 0.2s;
}

.tafel-grid span {
    font-weight: 600;
}

.tour-cards span {
    color: var(--muted);
    font-size: 0.875rem;
}

.tafel-grid a:hover,
.tafel-grid a:focus-visible,
.tour-cards a:hover,
.tour-cards a:focus-visible {
    border-color: var(--red);
    box-shadow: 0 4px 14px rgb(0 0 0 / 0.08);
}

.tafel-grid a:hover span,
.tafel-grid a:focus-visible span {
    border-top-color: var(--red);
    color: var(--red);
}

/* Board pages
   ----------- */

.credits {
    clear: both;
    margin-top: 2.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
    color: var(--muted);
    font-size: 0.9375rem;
}

.credits dl {
    margin: 0 0 0.75rem;
}

.credits dt {
    display: inline;
    color: var(--heading);
    font-weight: 500;
}

.credits dt::after {
    content: ": ";
}

.credits dd {
    display: inline;
    margin: 0;
}

.standort {
    margin: 0;
}

.tafel-nav {
    margin-top: 2.5rem;
}

.tafel-nav ul {
    display: grid;
    gap: 0.75rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.tafel-nav a {
    display: block;
    height: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--heading);
    font-weight: 600;
    line-height: 1.35;
    text-decoration: none;
}

.tafel-nav a:hover {
    border-color: var(--red);
    color: var(--red);
}

.tafel-nav span {
    display: block;
    margin-bottom: 0.2rem;
    color: var(--muted);
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.tafel-nav .prev a::before {
    content: "‹ ";
}

.tafel-nav .next a::after {
    content: " ›";
}

/* Previous on the left, overview in the middle, next on the right */
@media (min-width: 40rem) {
    .tafel-nav ul {
        grid-template-columns: 1fr auto 1fr;
        align-items: stretch;
    }

    .tafel-nav .prev {
        grid-column: 1;
    }

    .tafel-nav .overview {
        grid-column: 2;
    }

    .tafel-nav .overview a {
        display: flex;
        align-items: center;
    }

    .tafel-nav .next {
        grid-column: 3;
        text-align: right;
    }
}

/* Motion
   ------ */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        transition: none !important;
    }
}
