/* ============================
   Färger & grundvariabler
   – Central theme tokens you can tweak to rebrand the site fast
   ============================ */
:root{
  --red:   #D90012;   /* primary brand red (buttons, highlights) */
  --blue:  #0033A0;   /* accent blue (focus, links) */
  --amber: #F2A800;   /* warm accent (tags/badges if needed) */

  --bg:    #f7f7f8;   /* page background */
  --card:  #ffffff;   /* card background */

  --text:  #1f2328;   /* base body text */
  --muted: #6b7280;   /* secondary text */

  --border:#e5e7eb;   /* light borders/dividers */
  --shadow: 0 8px 30px rgba(0,0,0,.06); /* soft card shadow */
  --radius: 14px;     /* global rounded corners */

  --maxw: 1100px;     /* site content max-width */
  --gap:  1.25rem;    /* default grid gap */
}

/* ============================
   Bas
   – Resets, layout frame, containers
   ============================ */
*{ box-sizing:border-box; }

html, body{
  height: 100%;        /* enables full-height layouts */
  line-height: 1.6;    /* comfortable default line height */
  margin: 0;

  /* Safety net against accidental horizontal scroll.
     Keep commented unless you still see sideways drag. */
  /* overflow-x: hidden; */
}

/* Make all media responsive by default */
img, video{
  max-width: 100%;
  height: auto;
  display: block;
}

body{
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);

  /* Page skeleton: sticky header, flexible main, footer at bottom */
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: 100vh;
}

.container{ max-width: var(--maxw); margin-inline: auto; padding-inline: 1rem; }
.section{ padding-block: 2.5rem; }
.section-title{ font-size: clamp(1.3rem, 1rem + 1.2vw, 2rem); margin: 0 0 .75rem; }
.section-lead{ color: var(--muted); margin: 0 0 1.25rem; }

/* ============================
   Cards
   – Generic card, media bleed, links
   ============================ */
.cards{
  display: grid;
  gap: var(--gap);
  grid-template-columns: repeat(auto-fit, minmax(260px,1fr));
}

.card{
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1rem 1.1rem;
}

.event-card { overflow: hidden; }
.card-img { width:100%; aspect-ratio:16/11; object-fit:cover; display:block; }
.card-title-link { text-decoration:none; color:inherit; }
.card-title-link:hover { text-decoration:underline; }
.cta-hint { color: var(--muted); margin:.25rem 0 .75rem; }
.card-media{
  /* Creates a “full-bleed” image by cancelling the card’s padding.
     MUST match .card padding exactly to avoid horizontal overflow. */
  margin: -1rem -1.1rem .75rem;
  overflow: hidden;
}
/* Nice hover focus */
.card:hover .card-img { transform: scale(1.02); transition: transform .2s ease; }
.card a:focus-visible { outline:2px solid var(--blue); outline-offset:2px; border-radius:10px; }
.card-media .card-img{ border-radius: 0; }

/* Smooth scroll & sticky header offset */
html { scroll-behavior:smooth; }
#tickets { scroll-margin-top: 90px; }

/* ============================
   Header & navigering
   ============================ */
.site-header{
  position: sticky; top: 0; z-index: 50;
  background: #fff;
  border-bottom: 1px solid var(--border);
  box-shadow: 0 2px 12px rgba(0,0,0,.03);
}

.brand-row{
  display:flex;
  align-items:center;
  gap:1rem;
  /* instead of space-between, let the nav push itself right */
  justify-content:flex-start;
  flex-wrap:nowrap;
}

.brand{ 
  display:inline-flex; 
  align-items:center;
  gap:12px;
  text-decoration:none;
  color:inherit; 
}
.brand-logo{ 
  width: 44px; height: 44px; border-radius: 50%; 
  background: #f8fafc;         /* light neutral */
  box-shadow: 0 0 0 2px #e5e7eb inset; /* subtle ring */
  object-fit:cover;         /* keeps circle tidy even if source isn’t square */
  display:block;            /* removes extra inline spacing */
}

.brand-name{
  font-size:18px;
  font-weight:700;
  letter-spacing:.2px;
}

.nav{
  display:flex;
  align-items:center;
  gap:1rem;
  margin-left: auto;
  flex-wrap: wrap;
}

.nav a:focus-visible{
  outline: 2px solid var(--blue);
  outline-offset: 2px;
  border-radius: 10px;
}

.nav a{ text-decoration:none; color: #111827; font-weight:600; padding:.5rem .75rem; border-radius:10px; }
.nav a:hover, .nav a:focus-visible{ background: #f2f4f7; outline:2px solid transparent; }

/* Mobilmeny */
.menu-toggle{ display:none; border:1px solid var(--border); background:#fff; border-radius:10px; padding:.5rem .75rem; }
.menu-toggle:focus-visible{ outline:2px solid var(--blue); outline-offset:2px; }

@media (max-width: 760px){
  .menu-toggle{ display:inline-flex; align-items:center; gap:.5rem; }
  .nav{ display:none; width:100%; margin-top:.5rem; }
  .nav.open{ display:grid; grid-template-columns: 1fr; }
  .nav a{ padding:.6rem .75rem; }
  .brand-row{ align-items:flex-start; }

    /* brand sizing on mobile */
  .brand{ gap:8px; }
  .brand-logo{ width:32px; height:32px; }
  .brand-name{ font-size:16px; }
}

/* ============================
   Hero
   ============================ */
.hero{ background: linear-gradient(180deg, rgba(0,51,160,.08), transparent 60%); padding-block: 2.2rem 1rem; }
.hero-inner{ display:grid; gap:1rem; grid-template-columns:1fr; align-items:center; }
.hero h1{ font-size: clamp(1.6rem, 1.1rem + 2.2vw, 2.6rem); margin:0; line-height:1.2; }
.hero p{ color: var(--muted); margin:.5rem 0 1rem; max-width: 70ch; }
.actions{ display:flex; gap:.75rem; flex-wrap:wrap; }
.btn{ appearance:none; border:0; cursor:pointer; font-weight:700; border-radius: 999px; padding:.8rem 1.25rem; text-decoration:none; display:inline-flex; align-items:center; justify-content:center; }
.btn-primary{ background: var(--red); color:#fff; }
.btn-primary:hover{ filter: brightness(.95); }
.btn-outline{ background:#fff; color:#111; border:1px solid var(--border); }
.btn-outline:hover{ background:#f9fafb; }

/* ============================
   Sektioner
   ============================ */
.about-grid{ display:grid; gap: var(--gap); grid-template-columns: 1.2fr 1fr; }
@media (max-width: 900px){ .about-grid{ grid-template-columns: 1fr; } }

.event-meta{ color: var(--muted); font-size:.95rem; margin:.25rem 0 .5rem; }
.tag{ display:inline-block; padding:.2rem .5rem; border-radius:999px; background:#eef2ff; color:#3730a3; font-weight:700; font-size:.8rem; }


/* ============================
  Evenemangsbiljetter
   ============================ */
#tickets .section { background: linear-gradient(180deg, #fafafa 0%, #ffffff 100%); padding: 3rem 0; }


/* Ticket form layout */
.ticket-form{ display:grid; gap:1rem; }

/* keep only ONE definition of .form-grid */
.ticket-form .form-grid{
  display:grid;
  gap:.75rem 1rem;
  grid-template-columns: repeat(2, 1fr);
}

/* Your existing label grid */
/* Label: single source of spacing, no baseline quirks */
.ticket-form label{
  display: flex;
  flex-direction: column;
  row-gap: .35rem;
  line-height: 1.2;
  font-weight: 500;
  font-size: .9rem;
  color: #555;
}

/* Controls inside label: no stray margins/baselines */
.ticket-form label > :is(input, select, textarea){
  display: block;
  margin: 0;
}


/* (optional) ensure the controls themselves don’t add extra “visual” space */
.ticket-form :is(input, select, textarea){
  box-sizing: border-box;
}

/* Unified control sizing */
:root{ --control-h: 48px; }

.ticket-form :is(
  input[type="text"],
  input[type="email"],
  input[type="tel"],
  input[type="number"],
  select
){
  box-sizing:border-box;
  width:100%;
  height:var(--control-h);
  padding:0 1rem;
  border:1px solid #e5e7eb;
  border-radius:.5rem;
  font:inherit;
  color:inherit;
  line-height:normal; /* helps some browsers */
}

.ticket-form :is(input, select, textarea):focus-visible{
  outline: none !important;                 /* no outside outline */
  border-color: var(--blue) !important;     /* blue border on focus */
  box-shadow: 0 0 0 2px rgba(0,51,160,.18) inset !important; /* INSIDE glow */
}


.ticket-form input[type="text"],
.ticket-form input[type="email"],
.ticket-form input[type="tel"],
/* Chrome/Safari */
.ticket-form input[type="number"]::-webkit-outer-spin-button,
.ticket-form input[type="number"]::-webkit-inner-spin-button{
  -webkit-appearance:none;
  margin:0;
}
/* Firefox */
.ticket-form input[type="number"]{
  -moz-appearance: textfield;
}

.ticket-form select{
  /* base sizing */
  box-sizing: border-box;
  width: 100%;
  height: var(--control-h);
  padding: 0 1rem;
  padding-right: 2rem;              /* room for arrow */
  margin: 0;
  line-height: normal;

  /* look & reset */
  font: inherit;
  color: inherit;
  border: 1px solid #e5e7eb;
  border-radius: .5rem;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;

  /* arrow position (add a background-image if you use a custom chevron) */
  background-repeat: no-repeat;
  background-position: right .75rem center;
  background-size: .75rem;
}

/* Textarea */
.ticket-form textarea{
  padding:.9rem 1rem;
  border:1px solid #e5e7eb;
  border-radius:.5rem;
  min-height:140px;
  resize:vertical;
  font:inherit;
}

#buyBtn{
  color: white;
  background-color: #D90012;
}

/* ---------- ACTION ROWS (fixes awkward buttons) ---------- */

/* Ticket form action row: button + note on one line, no stretching */
.ticket-form .form-actions{
  display:flex;
  align-items:center;
  gap:.75rem;
  margin-top:1rem;
  grid-column:1 / -1;       /* span both columns */
}
.ticket-form .form-actions .btn{ width:auto; }  /* stop full-width pills */
.ticket-form .form-actions .small{ margin:0; color:#6b7280; }

/* If you still use the old grid wrapper, make sure the button doesn't stretch */
.ticket-form .form-actions-grid .btn{ width:auto; }

/* Mobile stack */
@media (max-width:760px){
  .ticket-form .form-grid{ grid-template-columns:1fr; }
  .ticket-form .form-actions{
    flex-direction:column; align-items:stretch; gap:.5rem;
  }
  .ticket-form .form-actions .btn{ width:100%; }
}

/* Tickets section – stronger, visible background */
#tickets.section {
  background: linear-gradient(180deg, #f3f4f6 0%, #ffffff 100%);
  padding: 3rem 0;           /* let container handle side padding */
}

/* Ensure some air so the bg is visible around the card */
#tickets .container { padding-inline: 1rem; }

#tickets .card {
  margin-block: .75rem 1.25rem;  /* space so gradient shows */
  border-radius: 16px;
  box-shadow: 0 6px 20px rgba(0,0,0,.05);
}

/* ============================
   Swish functionlaity
   ============================ */
/* Modal + QR */
.modal[hidden]{ display:none; }

/* --- Swish modal: size & scrolling --- */
.modal {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,.5);
  padding: 1rem; z-index: 1000;
}

.modal-card {
  width: min(92vw, 520px);         /* narrower on small screens */
  max-height: 80vh;                /* visible on laptops; change to 50vh if you prefer */
  background: #fff;
  border-radius: 14px;
  padding: 1rem 1.25rem;
  overflow: auto;                  /* inner content scrolls if it’s taller than max-height */
}

.modal-card h3{ margin:0 0 .5rem; }
.modal-card ol{ margin:.5rem 0 1rem; }
/* Keep action buttons visible while scrolling the modal content */
.modal-actions {
  position: sticky;
  bottom: 0;
  background: #fff;
  padding-top: .5rem;
  margin-top: .5rem;
}

/* Use the id you gave the link */
#openSwishBtn[aria-disabled="true"] {
  opacity: .5;
  pointer-events: none;
  cursor: not-allowed;
}

/* QR image inside modal (responsive, capped width) */
/* Tame the QR size so it never pushes buttons off-screen */
.swish-qr {
  display: block;
  margin: .5rem auto 1rem;
  width: 100%;
  max-width: clamp(220px, 40vh, 320px);  /* scales with viewport height; caps at 320px */
  height: auto;
}

/* ============================
   Medlemskap & Kontakt (global forms)
   – If you want ticket form styles to win, keep this block ABOVE .ticket-form,
     or scope it away from .ticket-form (e.g., form:not(.ticket-form){...})
   ============================ */
form{ display:grid; gap:.75rem; }
label{ font-weight:600; font-size:.95rem; }
input, select, textarea{
  width:100%; padding:.65rem .75rem; border-radius:10px; border:1px solid var(--border); background:#fff; font: inherit;
}
textarea{ min-height: 120px; resize: vertical; }

/* Donation card QR – smaller, centered */
.donation-card .swish-qr{
  display:block; max-width:250px; height:auto; margin:.5rem auto 0;
  border-radius:12px; box-shadow:0 6px 18px rgba(0,0,0,.12);
}

/* ============================
   Footer
   ============================ */
footer{ background:#0b0c0f; color:#fff; }
.footer-inner{ display:grid; gap: var(--gap); grid-template-columns: repeat(3,1fr); padding-block: 1.5rem; }
.footer-col h3{ margin:.25rem 0 .5rem; font-size:1rem; }
.muted{ color:#cfd3db; }
.footnote{ border-top: 1px solid rgba(255,255,255,.12); padding-block: .9rem; font-size:.95rem; color:#dadde3; }
@media (max-width: 900px){ .footer-inner{ grid-template-columns: 1fr; } }

/* Extra-tight laptops: shrink a bit more */
@media (max-height: 700px) {
  .modal-card { max-height: 70vh; }
  .swish-qr   { max-width: clamp(200px, 36vh, 300px); }
}
/* Footer länkar (flyttat från inline style) */
footer a { color:#fff; text-decoration: underline; }

/* Hjälpklass */
.visually-hidden{ position:absolute !important; height:1px; width:1px; overflow:hidden; clip:rect(1px,1px,1px,1px); white-space:nowrap; }
