/* gåture.dk – hand-written, no build step. */

:root {
    --green-900: #1f3d27;
    --green-700: #2f5d3a;
    --green-500: #6a994e;
    --green-300: #a7c957;
    --green-100: #e7efdc;
    --sand: #f4f1e8;
    --paper: #fffdf8;
    --ink: #1d2420;
    --muted: #5f6b63;
    --line: #dcd8cb;
    --red: #b23a2b;
    --amber: #b7791f;
    --radius: 10px;
    --shadow: 0 1px 2px rgb(0 0 0 / .05), 0 4px 14px rgb(0 0 0 / .05);
    --font: "Helvetica Neue", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

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

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

body {
    margin: 0;
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.55;
    color: var(--ink);
    background: var(--sand);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

a { color: var(--green-700); }
a:hover { color: var(--green-900); }

h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; color: var(--green-900); }
h1 { font-size: clamp(1.7rem, 4vw, 2.4rem); }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.1rem; }
p { margin: 0 0 1em; }

img { max-width: 100%; }

.container { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 20px; }
.main { flex: 1; padding-top: 28px; padding-bottom: 48px; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.lead { font-size: 1.12rem; color: var(--muted); }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.inline { display: inline; }

/* Header / footer */
.site-header { background: var(--green-700); color: #fff; }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; flex-wrap: wrap; }
.logo { color: #fff; font-weight: 800; font-size: 2.45rem; text-decoration: none; letter-spacing: -.02em; }
.logo span { color: var(--green-300); }
.logo small { font-weight: 500; font-size: .8rem; opacity: .8; margin-left: 4px; }
.logo:hover { color: #fff; }
.nav { display: flex; align-items: center; gap: 6px 18px; flex-wrap: wrap; }
.nav a, .nav .btn-link { color: #fff; text-decoration: none; opacity: .88; font-weight: 500; }
.nav a:hover, .nav a.active, .nav .btn-link:hover { opacity: 1; text-decoration: underline; text-underline-offset: 4px; }
.nav a.btn { opacity: 1; text-decoration: none; color: var(--green-900); }
.nav .count { display: inline-block; min-width: 1.4em; padding: 0 .4em; border-radius: 99px; background: var(--amber); color: #fff; font-size: .75rem; text-align: center; }

.site-footer { background: var(--green-900); color: #d9e2d5; padding: 28px 0; font-size: .92rem; }
.site-footer .muted { color: #a9b8a6; }
.site-footer a { color: #d9e2d5; }
.footer-inner p:last-child { margin: 0; }

/* Buttons */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .4em;
    padding: .62em 1.1em; border-radius: 8px; border: 1px solid transparent;
    font: inherit; font-weight: 600; line-height: 1.2; cursor: pointer; text-decoration: none;
    transition: background .15s, border-color .15s;
}
.btn-primary { background: var(--green-300); color: var(--green-900); }
.btn-primary:hover { background: #b9d86d; color: var(--green-900); }
.admin .btn-primary, .form .btn-primary { background: var(--green-700); color: #fff; }
.admin .btn-primary:hover, .form .btn-primary:hover { background: var(--green-900); color: #fff; }
.btn-secondary { background: var(--paper); color: var(--green-700); border-color: var(--line); }
.btn-secondary:hover { border-color: var(--green-500); }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { background: #8f2c20; color: #fff; }
.btn-small { padding: .38em .75em; font-size: .88rem; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-link { background: none; border: 0; padding: 0; font: inherit; color: var(--green-700); text-decoration: underline; cursor: pointer; }

/* Flash */
.flash { padding: 12px 16px; border-radius: var(--radius); margin-bottom: 20px; font-weight: 500; }
.flash-success { background: var(--green-100); border: 1px solid #c3d6ad; color: var(--green-900); }
.flash-error { background: #f8e3df; border: 1px solid #e7b9b0; color: #7c261b; }

/* Hero */
.hero { background: linear-gradient(135deg, var(--green-100), #f7f4e9); border-radius: 16px; padding: clamp(24px, 5vw, 20px); margin-bottom: 36px; }
.hero h1 { font-size: clamp(2rem, 5vw, 3rem); }
.hero-search { display: flex; gap: 10px; flex-wrap: wrap; max-width: 760px; margin: 22px 0 18px; }
.hero-search input[type=search] { flex: 1 1 280px; font-size: 1.08rem; padding: .75em 1em; }
.hero-search .btn { font-size: 1.02rem; }

/* Chips */
.chips { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 0 0 20px; }
.chip { display: inline-block; padding: .35em .85em; background: var(--paper); border: 1px solid var(--line); border-radius: 99px; text-decoration: none; font-size: .92rem; color: var(--green-900); }
.chip:hover { border-color: var(--green-500); }
.chip-active { background: var(--green-700); border-color: var(--green-700); color: #fff; }
.chip-active:hover { color: #fff; }

/* Sections */
.section { margin-top: 40px; }
.section-header { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; flex-wrap: wrap; margin-bottom: 12px; }
.page-header { margin-bottom: 24px; }
.page-header .lead, .page-header p:last-child { margin-bottom: 0; }
.breadcrumbs { font-size: .9rem; color: var(--muted); margin-bottom: 12px; }
.breadcrumbs a { color: var(--muted); }

.regions { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.region-tile { display: flex; flex-direction: column; padding: 16px 18px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; color: var(--ink); box-shadow: var(--shadow); }
.region-tile:hover { border-color: var(--green-500); }

.cta { background: var(--green-700); color: #fff; border-radius: 16px; padding: 32px; }
.cta h2 { color: #fff; }

/* Cards */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 16px; }
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); display: flex; flex-direction: column; }
.card-title { margin-bottom: 2px; }
.card-title a { text-decoration: none; color: var(--green-900); }
.card-title a:hover { text-decoration: underline; }
.card-place { font-size: .92rem; color: var(--muted); margin-bottom: 10px; }
.card-place a { color: var(--muted); }
.card-stats { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: .95rem; margin-bottom: 10px; }
.distance { color: var(--green-700); font-weight: 600; }

.difficulty::before { content: ""; display: inline-block; width: .6em; height: .6em; border-radius: 50%; margin-right: .35em; vertical-align: .05em; }
.difficulty-1::before { background: var(--green-500); }
.difficulty-2::before { background: var(--amber); }
.difficulty-3::before { background: var(--red); }

.badges { list-style: none; padding: 0; margin: 0 0 6px; display: flex; flex-wrap: wrap; gap: 6px; }
.badge { font-size: .8rem; padding: .18em .6em; border-radius: 99px; background: var(--green-100); color: var(--green-900); white-space: nowrap; }

/* Search layout */
.layout-search { display: grid; grid-template-columns: 270px 1fr; gap: 28px; align-items: start; }
.filters { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; position: sticky; top: 16px; }
.filter-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.empty { background: var(--paper); border: 1px dashed var(--line); border-radius: var(--radius); padding: 28px; text-align: center; }

@media (max-width: 820px) {
    .layout-search { grid-template-columns: 1fr; }
    .filters { position: static; }
}

/* Forms */
.field { margin: 0 0 16px; border: 0; padding: 0; min-width: 0; }
label, legend { display: block; font-weight: 600; margin-bottom: 5px; padding: 0; }
label.small { font-weight: 500; font-size: .85rem; color: var(--muted); }
input[type=text], input[type=search], input[type=email], input[type=url], input[type=number], input[type=password], select, textarea {
    width: 100%; font: inherit; padding: .55em .7em; color: var(--ink);
    background: #fff; border: 1px solid #c9c4b4; border-radius: 8px;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--green-300); outline-offset: 1px; border-color: var(--green-500); }
textarea { resize: vertical; }
.checkbox { display: flex; align-items: center; gap: .5em; font-weight: 400; margin-bottom: 6px; cursor: pointer; }
.checkbox input { width: 1.1em; height: 1.1em; accent-color: var(--green-700); }
.checks-inline { display: flex; flex-wrap: wrap; gap: 4px 22px; }
.checks-inline legend { width: 100%; }
.help { font-size: .88rem; color: var(--muted); margin: 4px 0 8px; }
.error { color: var(--red); font-size: .9rem; margin: 4px 0 0; font-weight: 500; }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
@media (max-width: 560px) { .row-2 { grid-template-columns: 1fr; } }

.form { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(18px, 3vw, 28px); }
.form-wide { max-width: 820px; }
.form-narrow { max-width: 420px; margin: 40px auto; }
.form-section + .form-section { border-top: 1px solid var(--line); margin-top: 22px; padding-top: 22px; }
.new-place { background: var(--sand); border-radius: var(--radius); padding: 16px 16px 2px; }

.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.captcha-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.captcha-row img { border-radius: 6px; border: 1px solid var(--line); }
.captcha-input { max-width: 200px; text-transform: uppercase; letter-spacing: .15em; }

/* Trail page */
.trail-layout { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 32px; align-items: start; }
@media (max-width: 900px) { .trail-layout { grid-template-columns: 1fr; } }
.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin: 0 0 24px; }
.facts div { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px; }
.facts dt { font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.facts dd { margin: 2px 0 0; font-weight: 600; }
.prose { max-width: 70ch; font-size: 1.04rem; }
.box { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-bottom: 18px; }
.box h2 { font-size: 1.1rem; }
.plain-list { list-style: none; padding: 0; margin: 0; }
.plain-list li { padding: 6px 0; border-bottom: 1px solid var(--line); }
.plain-list li:last-child { border-bottom: 0; }
.map-links { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }

.place-list { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.place-list li { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px; display: flex; flex-direction: column; }

/* Maps */
.map { width: 100%; border-radius: var(--radius); border: 1px solid var(--line); background: var(--green-100); z-index: 0; }
.map-results { height: 320px; margin-bottom: 18px; }
.map-home { height: clamp(320px, 55vh, 520px); margin-top: 8px; }
.map-trail { height: 300px; margin-bottom: 10px; }
.map-picker { height: 320px; margin-bottom: 10px; cursor: crosshair; }

/* Comments */
.comments { max-width: 760px; }
.comment { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 18px; margin-bottom: 10px; }
.comment header { margin-bottom: 4px; }
.comment p { margin: 0; overflow-wrap: anywhere; }
.comment-form { margin-top: 24px; }

/* Ratings */
.stars { color: #d6d1c2; letter-spacing: .05em; white-space: nowrap; }
.stars .star-on { color: #e0a31b; }
.card-rating { margin: auto 0 0; padding-top: 8px; font-size: .92rem; }
.rating-summary { margin: 6px 0 0; }
.rating-summary a { text-decoration: none; color: inherit; }
.rating-summary .stars { font-size: 1.2rem; }
.comment header { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }

/* Star picker: radios in reverse order so ":checked ~ label" fills the stars to the left. */
.star-input { display: inline-flex; flex-direction: row-reverse; gap: 2px; }
.star-input input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.star-input label { font-size: 2rem; line-height: 1; color: #d6d1c2; cursor: pointer; margin: 0; padding: 0 2px; font-weight: 400; }
.star-input label:hover, .star-input label:hover ~ label,
.star-input input:checked ~ label { color: #e0a31b; }
.star-input input:focus-visible + label { outline: 2px solid var(--green-300); outline-offset: 2px; border-radius: 4px; }

/* Pagination */
.pagination { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 24px; }
.pagination a, .pagination span { padding: .4em .8em; border-radius: 8px; border: 1px solid var(--line); background: var(--paper); text-decoration: none; }
.pagination .current { background: var(--green-700); color: #fff; border-color: var(--green-700); }
.pagination .disabled { color: var(--muted); opacity: .6; }

/* Admin */
.admin .site-header { background: var(--green-900); }
.stats { list-style: none; padding: 0; margin: 0 0 20px; display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.stats li { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 18px; color: var(--muted); }
.stats strong { display: block; font-size: 1.8rem; color: var(--green-900); }
.table { width: 100%; border-collapse: collapse; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.table th, .table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table th { background: var(--green-100); font-size: .85rem; text-transform: uppercase; letter-spacing: .03em; color: var(--green-900); }
.table tr:last-child td { border-bottom: 0; }
.comment-cell p { margin: 4px 0 0; max-width: 60ch; overflow-wrap: anywhere; }
.actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.toolbar input, .toolbar select { width: auto; flex: 0 1 260px; }
.status { display: inline-block; padding: .15em .6em; border-radius: 99px; font-size: .8rem; font-weight: 600; white-space: nowrap; }
.status-approved { background: var(--green-100); color: var(--green-900); }
.status-pending { background: #fbecd2; color: #7a4d0b; }
.status-rejected { background: #f8e3df; color: #7c261b; }
.danger-zone { margin-top: 28px; display: flex; gap: 12px; align-items: center; }
.diff td, .diff th[scope=row] { white-space: normal; }
.diff th[scope=row] { background: none; text-transform: none; letter-spacing: 0; font-size: .95rem; width: 160px; }
.diff-old { background: #fbeeee; max-width: 420px; overflow-wrap: anywhere; }
.diff-new { background: #edf6e6; max-width: 420px; overflow-wrap: anywhere; }

@media (max-width: 700px) {
    .table thead { display: none; }
    .table, .table tbody, .table tr, .table td { display: block; width: 100%; }
    .table tr { border-bottom: 1px solid var(--line); }
    .table td { border: 0; padding: 6px 12px; }
}
