/* ====== Bas ====== */
:root{
  --text: #111;
  --muted: #666;
  --border: #d9d9d9;
  --link: #0b66c3;
  --bg-head: #f3f3f3;
  --bg-head-active: #e0e0e0;
  --bg-th: #f9f9f9;
}

/* ====== Typografi (snabbt + tydligare text) ====== */
body{
  margin: 0;
  color: var(--text);
  background: #fff;

  /* Snabb systemfont, ingen extern font */
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial,
               "Apple Color Emoji", "Segoe UI Emoji";
  font-size: 17px;       /* ökar “trycket” direkt */
  line-height: 1.6;
  font-weight: 400;

  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Rubriker: lite mer pondus */
h1{
  font-size: 44px;
  line-height: 1.1;
  margin: 12px 0 10px 0;
  font-weight: 800;
  letter-spacing: -0.02em;
}

h2{
  font-size: 20px;
  margin: 0 0 12px 0;
  font-weight: 700;
}

/* Lite bättre läsradlängd för textblock (utan att påverka kartor/tabeller) */
main p, main ul{
  max-width: 72ch;
}

/* Listor lite tajtare */
main ul{ padding-left: 18px; }
main li{ margin: 4px 0; }




/* Länkar */
a, a:visited{
  color: var(--link);
}
a:hover{
  text-decoration: underline;
}

/* ====== Layout (main + sidebar) ====== */
.layout{
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px;
  display: flex;
  gap: 24px;
  align-items: flex-start;
}

.layout > main{
  flex: 1;
  min-width: 0;
}

.layout > aside{
  width: 280px;
  flex: 0 0 280px;
  align-self: flex-start;
  position: sticky;
  top: 16px;
}

@media (max-width: 900px){
  .layout{
    flex-direction: column;
    padding: 16px;
  }

  .layout > aside{
    width: 100%;
    position: static;
  }
}

/* ====== Sidebar navigation ====== */
.nav-section{
  margin:14px 0 6px;
  font-size:12px;
  font-weight:700;
  color: var(--muted);
  text-transform:uppercase;
  letter-spacing:.06em;
}

.nav a{
  display:block;
  padding:10px 12px;
  border-radius:10px;
  border:1px solid var(--border);
  background: var(--bg-head);
  color: var(--link);
  text-decoration:none;
  margin-bottom:8px;
}

.nav a:hover{
  background:#ececec;
}

.nav a:visited{
  color: var(--link);
}

.nav a.active{
  background: var(--bg-head-active);
  font-weight:700;
  color: var(--text);
}

.nav a.disabled{
  opacity:.55;
  pointer-events:none;
  cursor:default;
}

/* ====== Tabeller ====== */
table{
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0 18px 0;
  font-size: 15px;
}

th, td{
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

th{
  background: var(--bg-th);
  font-weight: 700;
}

tbody tr:hover td{
  background: #fafafa;
}

/* Små texter (t.ex. GPX-filnamn) */
.small{
  font-size: 13px;
  color: var(--muted);
  margin-top: 2px;
}
.muted{
  color: var(--muted);
}

/* ====== Klickbar kart-länk (om du vill använda thumbnail) ====== */
.map-thumb{
  display: inline-block;
  text-decoration: none;
  color: inherit;
  margin: 12px 0 18px 0;
}

.map-thumb img{
  width: 100%;
  max-width: 1200px;
  height: auto;
  border: 1px solid var(--border);
  border-radius: 12px;
  display: block;
  cursor: zoom-in;
}

/* ====== Modal (popup-bild) ====== */
.modal{
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 9999;
}

.modal.is-open{
  display: flex;
}

.modal__backdrop{
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.65);
}

.modal__content{
  position: relative;
  max-width: min(1200px, 96vw);
  max-height: 90vh;
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 10px 40px rgba(0,0,0,0.35);
}

.modal__content img{
  display: block;
  width: 100%;
  height: auto;
  max-height: 90vh;
  object-fit: contain;
  background: #000;
}

.modal__close{
  position: absolute;
  top: 10px;
  right: 10px;
  border: 0;
  border-radius: 999px;
  width: 42px;
  height: 42px;
  font-size: 26px;
  line-height: 42px;
  cursor: pointer;
  background: rgba(0,0,0,0.6);
  color: #fff;
}
/* Mindre avstånd mellan "Meny" och länken under menyn */
.layout > aside h2{
  margin: 0 0 4px 0;
}

.layout > aside #openMapImage{
  display: inline-block;
  margin: 0 0 12px 0;
}

