/* Brf Stadion – publik stil */
:root {
  --paper: #f6f3ec;
  --surface: #ffffff;
  --ink: #1a2230;
  --muted: #5a6475;
  --line: #e2dccf;
  --accent: #33373d;
  --accent-dark: #1f2226;
  --accent-soft: #faf3d3;
  --clay: #9a4f2c;
  --clay-soft: #f6e7dd;
  --ochre: #dcae3f;
  --stone: #e8e6e0;
  --stone-deep: #e3e1da;
  --stone-line: #cfccc3;
  --graphite: #33373d;
  --graphite-soft: #55534b;
  --radius: 10px;
  --wrap: 1120px;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 17px/1.6 var(--sans);
  display: flex; flex-direction: column; min-height: 100vh;
}
main { flex: 1; }
img { max-width: 100%; height: auto; }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--accent-dark); }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.2; letter-spacing: -0.01em; }
:focus-visible { outline: 3px solid var(--clay); outline-offset: 2px; border-radius: 3px; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }
.muted { color: var(--muted); }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 12px; top: 12px; background: var(--surface); color: var(--graphite); padding: 8px 12px; z-index: 10; }

/* Knappar */
.btn {
  display: inline-block; padding: 11px 20px; border-radius: 999px; border: 2px solid var(--accent);
  background: var(--accent); color: #fff; font: 600 15px/1.2 var(--sans); text-decoration: none; cursor: pointer;
}
.btn:hover { background: var(--accent-dark); border-color: var(--accent-dark); color: #fff; }
.btn-light { background: #fff; border-color: #fff; color: var(--accent-dark); }
.btn-light:hover { background: var(--accent-soft); border-color: var(--accent-soft); color: var(--graphite); }
.btn-ghost { background: transparent; border-color: rgba(255,255,255,.55); color: #fff; }
.btn-ghost:hover { background: rgba(255,255,255,.12); border-color: #fff; }

/* Sidhuvud */
.site-header { background: var(--surface); color: var(--graphite); border-bottom: 1px solid var(--line); position: relative; z-index: 5; }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 72px; }
.brand { display: flex; white-space: nowrap; align-items: center; gap: 10px; text-decoration: none; color: var(--graphite); font: 600 21px/1 var(--serif); }
.brand:hover { color: var(--graphite); }
.brand-mark { width: 44px; height: 40px; flex: none; }
.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 4px; flex-wrap: wrap; }
.site-nav a {
  display: block; padding: 8px 10px; border-radius: 8px; text-decoration: none; color: var(--graphite); font-weight: 500; font-size: 16px;
}
.site-nav a:hover { background: rgba(51,55,61,.08); color: var(--graphite); }
.site-nav a[aria-current="page"] { color: var(--graphite); font-weight: 600; box-shadow: inset 0 -3px 0 var(--clay); border-radius: 8px 8px 0 0; }
.nav-toggle { display: none; }

@media (max-width: 1080px) {
  .nav-toggle {
    display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--graphite-soft); background: transparent;
    padding: 8px 14px; border-radius: 999px; font: 600 15px var(--sans); color: var(--graphite); cursor: pointer;
  }
  .nav-toggle-bars, .nav-toggle-bars::before, .nav-toggle-bars::after {
    display: block; width: 16px; height: 2px; background: currentColor; position: relative; content: "";
  }
  .nav-toggle-bars::before { position: absolute; top: -5px; }
  .nav-toggle-bars::after { position: absolute; top: 5px; }
  .site-nav { display: none; position: absolute; left: 0; right: 0; top: 100%; background: var(--surface); border-bottom: 1px solid var(--line); box-shadow: 0 12px 24px rgba(0,0,0,.06); }
  .site-nav.open { display: block; }
  .site-nav ul { flex-direction: column; padding: 8px 12px 16px; }
  .site-nav a { padding: 12px; }
  .site-nav a[aria-current="page"] { box-shadow: inset 3px 0 0 var(--clay); border-radius: 0 8px 8px 0; }
}

/* Startsidans topp */
.hero { position: relative; background: var(--stone); color: var(--graphite); overflow: hidden; }
/* Två radhuslängor i hörnet: en grå längre bort och en gul i förgrunden */
.hero::before, .hero::after { content: ""; position: absolute; bottom: 0; background-repeat: no-repeat; background-position: right bottom; background-size: contain; pointer-events: none; }
.hero::before { right: max(340px, calc((100vw - 1120px) / 2 + 340px)); width: 330px; height: 110px; background-image: url("langa-gra.svg?v=3"); }
.hero::after { right: max(20px, calc((100vw - 1120px) / 2 + 20px)); width: 460px; height: 153px; background-image: url("langa-gul.svg?v=3"); }
@media (max-width: 1000px) { .hero::before { right: 300px; width: 210px; height: 70px; } .hero::after { width: 390px; height: 130px; } }
@media (max-width: 760px) { .hero::before { width: 150px; height: 50px; right: 190px; } .hero::after { width: 220px; height: 73px; right: 20px; } .hero-inner { padding-bottom: 110px; } }
.hero-inner { position: relative; padding: 72px 20px 80px; }
.eyebrow { margin: 0 0 8px; text-transform: uppercase; letter-spacing: .14em; font-size: 13px; font-weight: 600; color: #7a4a1c; }
.hero h1 { margin: 0; font-size: clamp(40px, 7vw, 68px); }
.lead { font-size: clamp(18px, 2.2vw, 21px); max-width: 36ch; margin: 14px 0 28px; color: #4d4b45; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* Startsidans innehåll */
.home-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 40px; padding-top: 44px; padding-bottom: 64px; }
@media (max-width: 860px) { .home-grid { grid-template-columns: 1fr; gap: 24px; } }
.welcome h2 { font-size: 30px; margin-top: 8px; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin: 40px 0 16px; border-bottom: 1px solid var(--line); padding-bottom: 8px; }
.section-head h2 { margin: 0; font-size: 26px; }
.news-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.news-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 22px; }
.news-card time, .news-feed time { color: var(--clay); font-size: 14px; font-weight: 600; }
.news-card h3 { margin: 4px 0 6px; font-size: 21px; }
.news-card h3 a { color: var(--ink); text-decoration: none; }
.news-card h3 a:hover { color: var(--accent); text-decoration: underline; }
.news-card p { margin: 0; color: var(--muted); }

.box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; margin-bottom: 18px; }
.box h2 { font-size: 20px; margin: 0 0 10px; }
.box p { margin: 0 0 8px; }
.box-accent { background: var(--clay-soft); border-color: #ecd2c2; }
.box-accent h2 { color: #8a4424; }
.mini-files { list-style: none; margin: 0 0 12px; padding: 0; }
.mini-files li { border-top: 1px solid var(--line); }
.mini-files li:first-child { border-top: 0; }
.mini-files a { display: flex; gap: 10px; align-items: center; padding: 9px 0; text-decoration: none; color: var(--ink); }
.mini-files a:hover { color: var(--accent); }

/* Undersidor */
.page-head { background: var(--surface); border-bottom: 1px solid var(--line); padding: 44px 0 30px; }
.page-head h1 { margin: 0; font-size: clamp(32px, 5vw, 46px); }
.page-head p { margin: 8px 0 0; color: var(--muted); }
.page-head .crumbs { margin: 0 0 10px; }
.page { padding-top: 32px; padding-bottom: 72px; }

.prose { max-width: 70ch; line-height: 1.5; }
.prose p, .prose ul, .prose ol { margin: 0 0 .75em; }
.prose h2 { font-size: 26px; margin: 1.3em 0 .2em; }
.prose h3 { font-size: 21px; margin: 1.1em 0 .15em; }
.prose h2 + *, .prose h3 + * { margin-top: 0; }
.prose h2 + p > br:first-child, .prose h3 + p > br:first-child { display: none; }
.prose > :first-child { margin-top: 0; }
.prose blockquote { margin: 1.2em 0; padding: 4px 0 4px 18px; border-left: 4px solid var(--clay); color: var(--muted); }
.prose li { margin: .15em 0; }
.updated { color: var(--muted); font-size: 14px; margin-top: 40px; border-top: 1px solid var(--line); padding-top: 14px; }

/* Nyhetsflöde */
.news-feed { list-style: none; margin: 0; padding: 0; max-width: 820px; }
.news-feed li { display: grid; grid-template-columns: 150px 1fr; gap: 24px; padding: 26px 0; border-bottom: 1px solid var(--line); }
.news-feed li:first-child { padding-top: 0; }
.news-feed time { padding-top: 6px; }
.news-feed h2 { margin: 0 0 6px; font-size: 24px; }
.news-feed h2 a { color: var(--ink); text-decoration: none; }
.news-feed h2 a:hover { color: var(--accent); text-decoration: underline; }
.news-feed p { margin: 0 0 8px; color: var(--muted); }
.more { font-weight: 600; font-size: 15px; }
@media (max-width: 640px) { .news-feed li { grid-template-columns: 1fr; gap: 4px; } }
.pager { display: flex; justify-content: space-between; align-items: center; max-width: 820px; margin-top: 28px; color: var(--muted); }

/* Filer */
.file-group { margin-bottom: 36px; max-width: 860px; }
.file-group h2 { font-size: 22px; margin: 0 0 12px; }
.file-list { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.file-list li + li { border-top: 1px solid var(--line); }
.file-list a { display: flex; align-items: center; gap: 16px; padding: 16px 20px; text-decoration: none; color: var(--ink); }
.file-list a:hover { background: var(--accent-soft); }
.ftext { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ftext span { color: var(--muted); font-size: 15px; }
.fmeta { color: var(--muted); font-size: 14px; white-space: nowrap; display: flex; align-items: center; gap: 10px; }
.dl { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--accent); color: #fff; font-weight: 700; }
.ftype {
  flex: none; display: inline-grid; place-items: center; min-width: 52px; height: 24px; padding: 0 6px; border-radius: 5px;
  font: 700 11px/1 var(--sans); letter-spacing: .04em; text-transform: uppercase; background: #ece7dc; color: #5a5242;
}
.ftype-pdf { background: #f6dcd3; color: #8f2f12; }
.ftype-word { background: #dbe6f5; color: #1f4a86; }
.ftype-excel { background: #d9eedf; color: #1d6a3a; }
.mini-files .ftype { min-width: 44px; height: 20px; font-size: 10px; }

/* Sidfot */
.site-footer { background: var(--stone-deep); color: var(--graphite); border-top: 6px solid var(--ochre); margin-top: auto; }
.footer-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; padding-top: 44px; padding-bottom: 32px; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr; gap: 20px; } }
.site-footer h2 { font-size: 18px; color: var(--graphite); margin: 0 0 10px; }
.site-footer p { margin: 0 0 6px; font-size: 15px; }
.site-footer a { color: var(--graphite); }
.site-footer a:hover { color: #000; }
.footer-bottom { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; border-top: 1px solid var(--stone-line); padding-top: 16px; padding-bottom: 22px; font-size: 14px; color: var(--graphite-soft); }
.footer-bottom a { color: var(--graphite-soft); }

/* Meddelanden (används även i admin) */
.notice { padding: 12px 16px; border-radius: 8px; margin: 0 0 16px; font-size: 15px; border: 1px solid; }
.notice-ok { background: #e6f2ea; border-color: #b9dbc5; color: #1d4d33; }
.notice-error { background: #fbe9e5; border-color: #f0c2b6; color: #84260f; }

/* Bokning av föreningslokalen */
.booking-layout { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 36px; align-items: start; }
@media (max-width: 960px) { .booking-layout { grid-template-columns: 1fr; } }
.cal-nav { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; min-height: 36px; }
.cal-nav a { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--surface); border: 1px solid var(--line); text-decoration: none; font-weight: 700; }
.cal-nav a:hover { border-color: var(--accent); }
.cal-months { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 28px; }
.cal-month { min-width: 0; }
@media (max-width: 640px) { .cal-months { grid-template-columns: 1fr; } }
.cal-month h2 { font-size: 21px; text-align: center; margin: 4px 0 12px; }
.cal { width: 100%; table-layout: fixed; border-collapse: separate; border-spacing: 4px; margin: -4px; width: calc(100% + 8px); }
.cal th { text-align: center; font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; padding: 0 0 2px; }
.cal td { padding: 0; }
.cal-day {
  aspect-ratio: 1 / 1; min-height: 36px; min-width: 0; width: 100%; border-radius: 8px; border: 1px solid transparent; background: transparent;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; font: 500 15px/1 var(--sans); color: var(--ink); padding: 0;
}
.cal-empty { visibility: hidden; }
.cal-day.is-off { color: #b6b0a4; }
.cal-day.is-free { background: var(--surface); border-color: #948c7b; cursor: pointer; }
.cal-day.is-free:hover { border-color: var(--accent); background: var(--accent-soft); }
.cal-day.is-pending { background: #f7d3c9; color: #7a2410; border: 1px dashed #b5462a; }
.cal-day.is-approved { background: #e59c88; color: #4a1407; text-decoration: line-through; }
.cal-day.is-blocked { background: repeating-linear-gradient(45deg, #ece7dc 0 6px, #f6f3ec 6px 12px); color: #5f594d; }
.cal-day.is-today .cal-num { box-shadow: inset 0 -2px 0 var(--clay); }
.cal-day.is-selected, .cal-day.is-selected:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.cal-day.is-selected.is-clash { background: #c9472b; border-color: #c9472b; text-decoration: none; }
.booking-info-body { max-width: none; }
.booking-info-body h2, .booking-info-body h3 { font: 700 17px/1.3 var(--sans); margin: 1em 0 .2em; }
.booking-info-body > :last-child { margin-bottom: 0; }
.req { color: #9a4f2c; font-weight: 700; }
.req-note { margin: 0 0 12px; font-size: 14px; color: var(--muted); }
.cal-hint { margin: 10px 0 0; font-size: 14px; color: var(--muted); }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.hero .btn-light { background: var(--graphite); border-color: var(--graphite); color: #fff; }
.hero .btn-light:hover { background: #1f2226; border-color: #1f2226; color: #fff; }
.hero .btn-ghost { border-color: var(--graphite); color: var(--graphite); background: rgba(255,255,255,.5); }
.hero .btn-ghost:hover { background: rgba(51,55,61,.08); border-color: var(--graphite); color: var(--graphite); }
.sw-blocked { background: repeating-linear-gradient(45deg, #ece7dc 0 3px, #f6f3ec 3px 6px); }
.cal-legend { list-style: none; padding: 0; margin: 18px 0 0; display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 14px; color: var(--muted); }
.cal-legend li { display: flex; align-items: center; gap: 6px; }
.sw { width: 14px; height: 14px; border-radius: 4px; display: inline-block; border: 1px solid var(--line); }
.sw-free { background: var(--surface); }
.sw-pending { background: #f7d3c9; border: 1px dashed #b5462a; }
.sw-approved { background: #e59c88; border-color: #e59c88; }
.sw-selected { background: var(--accent); border-color: var(--accent); }
.booking-info { margin-top: 24px; }

.booking-form { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; position: sticky; top: 16px; }
@media (max-width: 960px) { .booking-form { position: static; } }
.booking-form h2 { font-size: 22px; margin: 0 0 14px; }
.pform { display: grid; gap: 14px; }
.pform label { display: grid; gap: 5px; font-weight: 600; font-size: 15px; }
.pform input, .pform select, .pform textarea {
  font: 400 16px/1.4 var(--sans); padding: 10px 12px; border: 1px solid #8a8273; border-radius: 8px; background: #fff; color: var(--ink); width: 100%;
}
.pform input:focus, .pform select:focus, .pform textarea:focus { outline: 3px solid rgba(37,64,106,.35); border-color: var(--accent); }
.pform [aria-invalid="true"], .form [aria-invalid="true"] { border-color: #b3261e; border-width: 2px; }
.field-error { display: block; color: #a3241b; font-weight: 600; font-size: 14px; }
.field-error::before { content: "⚠ "; }
.error-summary { outline: none; }
.error-summary:focus { box-shadow: 0 0 0 3px #a3241b; }
.error-summary ul { margin: 6px 0 0; padding-left: 20px; }
.error-summary a { color: #84260f; font-weight: 600; }
.pform label.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 500; }
.pform label.check input { width: 18px; height: 18px; margin-top: 3px; flex: none; accent-color: var(--accent); }
.pform .btn { justify-self: start; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.b-summary { margin: 0; padding: 10px 12px; border-radius: 8px; background: #faf8f4; border: 1px dashed var(--line); color: var(--muted); font-size: 15px; }
.b-summary.is-ok { background: var(--accent-soft); border: 1px solid #e8d98f; color: var(--accent-dark); font-weight: 600; }
.b-summary.is-bad { background: #fbe9e5; border: 1px solid #f0c2b6; color: #84260f; }
.booking-done { max-width: 620px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 32px; }
.booking-done h2 { margin: 8px 0 12px; font-size: 26px; }
.done-icon { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 22px; font-weight: 700; }
.box-book { background: var(--accent-soft); border-color: #e8d98f; }
.small { font-size: 14px; }

.older { margin: 16px 0 0; font-weight: 600; }
#nyheter { scroll-margin-top: 16px; }

/* Kontaktformulär */
.contact-form { margin-top: 36px; padding: 24px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.contact-form h2 { margin-top: 0; }
.contact-form .pform .btn { justify-self: start; }
@media (max-width: 560px) { .row2 { grid-template-columns: 1fr; } }

/* Kontrast: mörk topp och sidfot, tydligare kort */
.site-header { border-bottom: 0; }
.hero { background:#50565e; color:#fff; border-bottom:6px solid var(--ochre); }
.hero .eyebrow { color:#f2d65e; }
.hero .lead { color:#d9d6ce; }
.hero .btn-light { background:#f2d65e; border-color:#f2d65e; color:#2b2e33; }
.hero .btn-light:hover { background:#f7e48f; border-color:#f7e48f; color:#2b2e33; }
.hero .btn-ghost { background:transparent; border-color:rgba(255,255,255,.65); color:#fff; }
.hero .btn-ghost:hover { background:rgba(255,255,255,.1); color:#fff; }
.hero :focus-visible { outline-color:#f2d65e; }
.site-footer { background:#50565e; color:#e6e3da; border-top:6px solid var(--ochre); }
.site-footer h2 { color:#fff; }
.site-footer a, .site-footer a:hover { color:#f2d65e; }
.footer-bottom { border-top-color:rgba(255,255,255,.18); color:#dedbd3; }
.footer-bottom a { color:#dedbd3; }
body { background: #ece9e2; color: #22252a; }
.news-card, .box, .file-list { border-color: #d3cec3; box-shadow: 0 1px 2px rgba(0,0,0,.05); }
.news-card p { color: #4d4b45; }
.section-head { border-bottom: 2px solid var(--graphite); }
.page-head { border-bottom: 1px solid #d3cec3; }
