/*
 * Stylesheet of all pages of tankpirat.de (index, Bundesland, Kreis, Ort, Tankstelle, Impressum, 404).
 * One external file instead of the inline styles of tankpirat.at: 15,500 station pages would otherwise
 * carry the same 10 kB each. nginx caches css for 7 days, so the templates load it as seite.css?v=N;
 * raise N in all templates when this file changes.
 */
:root {
    --red: #cc0000;
    --red-light: #ff3333;
    --red-bg: #fff5f5;
    --gold: #ffce00;
    --text: #333333;
    --muted: #666666;
    --line: #e6e6e6;
    --bg-soft: #f7f7f7;
}

* { box-sizing: border-box; }

body {
    font-family: Arial, Helvetica, sans-serif;
    background-color: #ffffff;
    color: var(--text);
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    line-height: 1.45;
}

/* Header: logo and name, a thin black-red-gold line below */
.site-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    background: #111111;
    border-bottom: 4px solid var(--gold);
    box-shadow: inset 0 -8px 0 0 var(--red);
}
.site-header a {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #ffffff;
    font-weight: bold;
    font-size: 1.15em;
    text-decoration: none;
}
.site-header img { width: 36px; height: 36px; border-radius: 7px; }
.site-header .claim { color: #cccccc; font-size: 0.85em; margin-left: auto; }

.container {
    width: 95%;
    max-width: 860px;
    margin: 16px auto 24px auto;
    padding: 20px;
    background-color: #ffffff;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.08);
    flex-grow: 1;
    overflow-wrap: anywhere;
}

h1 {
    color: var(--red);
    font-size: clamp(24px, 5vw, 34px);
    margin: 4px 0 14px 0;
    line-height: 1.2;
}

h2 {
    color: var(--red);
    font-size: clamp(18px, 4vw, 23px);
    margin: 28px 0 10px 0;
}

h3 { font-size: 1.05em; margin: 16px 0 6px 0; }

a { color: var(--red); text-decoration: none; font-weight: bold; }
a:hover { color: var(--red-light); }

.intro { font-size: 1.05em; margin: 0 0 10px 0; }
.note { font-size: 0.9em; color: var(--muted); }

/* Breadcrumb */
.crumbs ol {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 0;
    margin: 0 0 10px 0;
    font-size: 0.9em;
}
.crumbs li { padding: 0; border: none; }
.crumbs li + li::before { content: "›"; color: var(--muted); margin: 0 6px 0 2px; }
.crumbs a { font-weight: normal; }
.crumbs span { color: var(--muted); }

/* Lists */
ul.plain { list-style: none; padding: 0; margin: 0; }
ul.plain > li { padding: 12px 6px; border-bottom: 1px solid var(--line); }
ul.plain > li:hover { background-color: #fafafa; }
li[hidden] { display: none !important; }
#gasStationList > li { content-visibility: auto; contain-intrinsic-size: auto 62px; }
.sub { display: block; font-size: 0.9em; color: var(--muted); margin-top: 4px; font-weight: normal; }

/* Top 10 lists: rank, station, price */
ol.top-list { padding-left: 28px; margin: 0; }
ol.top-list li {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 9px 6px;
    border-bottom: 1px solid var(--line);
    list-style-type: decimal;
}
ol.top-list li a { font-weight: normal; }
ol.top-list .top-price { font-weight: bold; white-space: nowrap; }
.top-grid { display: grid; grid-template-columns: 1fr; gap: 0 24px; }

/* Price tables */
table.stats, table.prices { width: 100%; border-collapse: collapse; margin: 12px 0; }
table.stats th, table.stats td, table.prices th, table.prices td { border: 1px solid #dddddd; padding: 10px; text-align: right; }
table.stats th:first-child, table.stats td:first-child, table.prices th:first-child, table.prices td:first-child { text-align: left; }
table.stats th, table.prices th { background-color: var(--red); color: #ffffff; }
table.prices td.price { font-weight: bold; font-size: 1.1em; white-space: nowrap; }
table.prices td.time { color: var(--muted); font-size: 0.9em; }

/* Search field over long lists */
#searchField {
    width: 100%;
    padding: 12px;
    font-size: 16px;
    border: 2px solid var(--red);
    border-radius: 5px;
    margin-bottom: 12px;
}

/* Chips (cities, nearby Orte) */
ul.chips { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 8px 0; }
ul.chips li { padding: 6px 12px; border: 1px solid var(--red); border-radius: 16px; background-color: #ffffff; font-size: 0.95em; }
ul.chips li:hover { background-color: var(--red-bg); }

.faq p { margin: 0 0 10px 0; }

/* Boxes of the station page */
.box { margin: 14px 0; padding: 15px; border: 1px solid #dddddd; border-radius: 8px; background-color: #fafafa; }
.box h2 { margin-top: 0; }
.box p { margin: 8px 0; }

.button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background-color: #2e7d32;
    color: #ffffff;
    border-radius: 5px;
    font-weight: bold;
}
.button:hover { background-color: #388e3c; color: #ffffff; }
.button svg { width: 16px; height: 16px; fill: currentColor; }

.map { text-align: center; margin-top: 20px; }
.map img { max-width: 100%; height: auto; border-radius: 8px; }

/* App call to action (Google Play). The rating line is maintained by hand, see README.md */
.app-cta {
    margin: 18px 0 0 0;
    padding: 14px;
    border: 2px solid var(--red);
    border-radius: 8px;
    background-color: var(--red-bg);
    text-align: center;
}
.app-cta p { margin: 0 0 12px 0; }
.app-button {
    display: inline-block;
    padding: 12px 22px;
    background-color: var(--red);
    color: #ffffff;
    font-weight: bold;
    border-radius: 6px;
}
.app-button:hover { background-color: var(--red-light); color: #ffffff; }
.app-rating { display: block; margin-top: 8px; font-size: 0.9em; color: var(--muted); }

/* Sticky app bar, shown by the script on Android only */
.app-bar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background-color: #ffffff;
    border-top: 2px solid var(--red);
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.15);
    font-size: 0.95em;
}
.app-bar[hidden] { display: none; }
.app-bar img { width: 40px; height: 40px; border-radius: 8px; flex-shrink: 0; }
.app-bar-text { flex: 1; min-width: 0; line-height: 1.3; }
.app-bar-text small { display: block; color: var(--muted); }
.app-bar-button { display: inline-block; padding: 10px 16px; background-color: var(--red); color: #ffffff; border-radius: 6px; white-space: nowrap; }
.app-bar-close { background: none; border: none; font-size: 24px; line-height: 1; color: #888888; padding: 4px 6px; cursor: pointer; }
body.has-app-bar { padding-bottom: 76px; }

footer {
    padding: 18px 10px;
    text-align: center;
    background-color: #f2f2f2;
    border-top: 2px solid #cccccc;
    margin-top: auto;
    font-size: 0.9em;
    color: var(--muted);
}
footer a { margin: 0 12px; display: inline-block; }
footer p { margin: 8px 0 0 0; }

/* 404 and Impressum */
.center { text-align: center; }
.icon-big { width: min(160px, 45%); height: auto; display: block; margin: 0 auto 16px auto; border-radius: 24px; }

@media (min-width: 760px) {
    .top-grid.two { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 600px) {
    .container { width: 100%; margin: 0 auto 12px auto; padding: 14px; box-shadow: none; }
    .site-header .claim { display: none; }
    ul.plain > li { padding: 10px 4px; }
    table.stats th, table.stats td, table.prices th, table.prices td { padding: 8px 6px; }
    .button { width: 100%; justify-content: center; }
    footer a { display: block; margin: 8px 0; }
}
