/* PostSort – stil i linje med 21grams.se (Montserrat, mörk petrol, orange accent, rundade knappar) */

:root {
  --petrol:       #012b2b;  /* 21grams primärfärg (knappar, rubriker) */
  --petrol-dark:  #011616;  /* sidfot */
  --petrol-hover: #024040;
  --teal:         #058880;  /* länkar / sekundär accent */
  --orange:       #ff4e10;  /* 21grams orange accent */
  --grey-bg:      #f2f2f2;
  --grey-line:    #e0e0df;
  --text:         #000;
  --text-muted:   #555;
  --white:        #fff;
  --ok:           #157539;
  --error:        #c42525;
  --radius-pill:  4rem;
  --max-width:    1140px;
}

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

html { font-size: 100%; }

body {
  margin: 0;
  background: var(--white);
  color: var(--text);
  font-family: Montserrat, Calibri, sans-serif;
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

main { flex: 1; }

a { color: var(--teal); }
a:hover, a:focus { color: var(--petrol); }

h1, h2, h3 { color: var(--petrol); line-height: 1.2; font-weight: 700; }
h1 { font-size: 2.25rem; margin: 0 0 1rem; }
h2 { font-size: 1.5rem;  margin: 2.5rem 0 1rem; }
h3 { font-size: 1.15rem; margin: 0 0 .5rem; }

.wrap {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 16px;
}

/* ---------- Sidhuvud ---------- */

.site-header {
  background: var(--white);
  border-bottom: 1px solid var(--grey-line);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 80px;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: .9rem;
  text-decoration: none;
  color: var(--petrol);
}

.brand-mark {
  width: 56px;
  height: 56px;
  background: var(--orange);
  display: block;
  object-fit: cover;
}

.brand-name {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -.01em;
}

.brand-name small {
  display: block;
  font-size: .75rem;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0;
}

.main-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  gap: .25rem;
}

.main-nav a {
  display: block;
  padding: .55rem 1.1rem;
  border-radius: var(--radius-pill);
  color: var(--petrol);
  font-weight: 600;
  text-decoration: none;
  transition: background-color .2s ease, color .2s ease;
}

.main-nav a:hover,
.main-nav a:focus { background: var(--grey-bg); }

.main-nav a[aria-current="page"] {
  background: var(--petrol);
  color: var(--white);
}

.main-nav .lang {
  margin-left: .75rem;
  padding-left: .75rem;
  border-left: 1px solid var(--grey-line);
  display: flex;
  gap: .25rem;
}

.main-nav .lang a {
  padding: .35rem .6rem;
  font-size: .8rem;
  font-weight: 700;
}

.main-nav .lang a[aria-current="true"] { color: var(--orange); background: none; }

/* ---------- Toppbanner ---------- */

.hero {
  background: var(--petrol);
  color: var(--white);
  padding: 3.5rem 0;
}

.hero p {
  margin: 0;
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.2;
}

.hero em {
  font-style: normal;
  color: var(--orange);
}

/* ---------- Innehåll ---------- */

.content { padding-top: 3rem; padding-bottom: 4rem; }

.ingress {
  font-size: 1.15rem;
  max-width: 46rem;
}

.content p { max-width: 46rem; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr));
  align-items: start;
  gap: 1.5rem;
  margin-top: 2rem;
}

.card {
  background: var(--grey-bg);
  padding: 2rem;
}

.card--accent { border-top: 4px solid var(--orange); }

.card p:last-child { margin-bottom: 0; }

.phone {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--petrol);
  text-decoration: none;
  white-space: nowrap;
}

dl.facts { margin: 0; }
dl.facts dt { font-weight: 700; color: var(--petrol); margin-top: 1rem; }
dl.facts dt:first-child { margin-top: 0; }
dl.facts dd { margin: 0; }

/* ---------- Formulär ---------- */

.field { margin-bottom: 1rem; }

.field label {
  display: block;
  font-weight: 600;
  margin-bottom: .35rem;
}

.field input {
  width: 100%;
  max-width: 18rem;
  font: inherit;
  font-size: 1.25rem;
  letter-spacing: .1em;
  padding: .6rem .9rem;
  border: 1px solid #b5b5b5;
  border-radius: 6px;
  background: var(--white);
}

.field input:focus {
  outline: 2px solid var(--teal);
  outline-offset: 1px;
  border-color: var(--teal);
}

.button {
  display: inline-block;
  font: inherit;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1;
  padding: .85rem 2.5rem;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  background: var(--petrol);
  color: var(--white);
  cursor: pointer;
  text-decoration: none;
  transition: background-color .25s ease-out;
}

.button:hover,
.button:focus { background: var(--petrol-hover); color: var(--white); }

.button:disabled { opacity: .6; cursor: wait; }

.feedback { margin-top: 1rem; min-height: 1.6em; font-weight: 600; }
.feedback.codeok { color: var(--ok); }
.feedback.error  { color: var(--error); }

/* ---------- Klickbara kort ---------- */

a.card--link {
  display: block;
  color: inherit;
  text-decoration: none;
  border-top: 4px solid transparent;
  transition: border-color .2s ease, background-color .2s ease;
}

a.card--link:hover,
a.card--link:focus { border-top-color: var(--orange); background: #ebebea; }

.card-links { display: flex; flex-wrap: wrap; gap: .25rem 1.25rem; font-weight: 600; color: var(--teal); }

/* ---------- Nedladdning ---------- */

.narrow { max-width: 760px; }

.breadcrumb { margin: 0 0 1rem; font-size: .9rem; }
.breadcrumb a { text-decoration: none; font-weight: 600; }

.small { font-size: .875rem; color: var(--text-muted); }

.dl-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 2.5rem;
  align-items: start;
  margin-top: 2.5rem;
}

.dl-layout h2 { margin-top: 0; }

.dl-layout aside { display: flex; flex-direction: column; gap: 1rem; }

.table-wrap {
  overflow-x: auto;
  background: var(--white);
  border: 1px solid var(--grey-line);
  border-radius: 8px;
}

table.files tbody tr:last-child td { border-bottom: 0; }

table.files {
  width: 100%;
  border-collapse: collapse;
  font-size: .95rem;
}

table.files th {
  text-align: left;
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--text-muted);
  background: var(--grey-bg);
  border-bottom: 1px solid var(--grey-line);
  padding: .75rem 1rem;
  white-space: nowrap;
}

table.files td {
  border-bottom: 1px solid var(--grey-line);
  padding: .9rem 1rem;
  vertical-align: middle;
}

table.files td a { text-decoration: none; }
table.files td a:hover { text-decoration: underline; }

table.files tbody tr:hover { background: var(--grey-bg); }
table.files td a { font-weight: 600; }
table.files .num { text-align: right; }
.nowrap { white-space: nowrap; }

.badge {
  display: inline-block;
  margin-left: .4rem;
  padding: .1rem .55rem;
  border-radius: var(--radius-pill);
  background: #fde6dc;
  color: #882300;
  font-size: .72rem;
  font-weight: 600;
  vertical-align: .1em;
  white-space: nowrap;
}

form.older {
  margin-top: 1.5rem;
  padding: 1.25rem 1.5rem;
  background: var(--grey-bg);
  border-radius: 8px;
}

form.older + form.older { margin-top: 1rem; }
form.older label { display: block; font-weight: 700; color: var(--petrol); margin-bottom: .5rem; }

.older-row { display: flex; gap: .75rem; flex-wrap: wrap; align-items: stretch; }

.older-row select {
  flex: 1 1 18rem;
  min-width: 0;
  font: inherit;
  padding: .6rem .75rem;
  border: 1px solid #b5b5b5;
  border-radius: 6px;
  background: var(--white);
}

.login-form .field input { max-width: none; font-size: 1rem; letter-spacing: 0; }

.login-status { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; }
.login-status p { margin: 0; }

.button--light { background: var(--white); color: var(--petrol); border-color: var(--petrol); }
.button--light:hover,
.button--light:focus { background: var(--petrol); color: var(--white); }

.notice {
  background: #e3f3ec;
  border-left: 4px solid var(--ok);
  padding: 1rem 1.25rem;
  max-width: none !important;
}

.notice--error { background: #f9e5e5; border-left-color: var(--error); }

.filename { font-weight: 700; font-size: 1.1rem; color: var(--petrol); }

/* ---------- Nedladdningslogg (admin_log.php) ---------- */

.log-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.log-head h1 { margin: 0; }

.log-reserve { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.5rem; }
.log-reserve p { margin: 0; }

.log-filter {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
  gap: 0 1rem;
  align-items: end;
  background: var(--grey-bg);
  padding: 1.25rem 1.25rem .25rem;
  border-radius: 6px;
  margin: 1.5rem 0 1rem;
}
.log-filter .field input,
.log-filter .field select {
  width: 100%;
  max-width: none;
  font: inherit;
  font-size: 1rem;
  letter-spacing: 0;
  padding: .5rem .7rem;
  border: 1px solid #b5b5b5;
  border-radius: 6px;
  background: var(--white);
}
.log-filter-buttons { display: flex; gap: .5rem; margin-bottom: 1rem; }

.log-summary { max-width: none !important; display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; }
.log-table td { font-size: .9rem; }
.log-pages { display: flex; gap: 1.5rem; align-items: center; justify-content: center; margin-top: 1.5rem; font-weight: 600; }

.content .card p { max-width: none; }

@media (max-width: 900px) {
  .dl-layout { grid-template-columns: 1fr; }
}

/* ---------- Sidfot ---------- */

.site-footer {
  background: var(--petrol-dark);
  color: #c8c8c8;
  font-size: .9rem;
  padding: 2.5rem 0;
}

.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 3rem;
  justify-content: space-between;
}

.site-footer strong { color: var(--white); }
.site-footer a { color: #c8c8c8; }
.site-footer a:hover { color: var(--white); }
.site-footer p { margin: 0; }

/* ---------- Mobil ---------- */

@media (max-width: 640px) {
  h1 { font-size: 1.75rem; }
  .hero { padding: 2.5rem 0; }
  .hero p { font-size: 1.5rem; }
  .site-header .wrap { padding-top: .75rem; padding-bottom: .75rem; }
  .main-nav ul { flex-wrap: wrap; }
  .main-nav .lang { margin-left: 0; }
  .card { padding: 1.5rem; }
}
