/* ===== STERNÖ VILLAFÖRENING ===== */

@import url('https://fonts.googleapis.com/css2?family=Inter:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;1,300&family=Playfair+Display:wght@400;700&display=swap');

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

:root {
  --navy: #0d2137;
  --navy-mid: #163352;
  --blue: #1e5f9b;
  --blue-light: #2d7dd2;
  --accent: #f0a500;
  --accent-light: #ffc740;
  --bg: #f5f7fa;
  --surface: #ffffff;
  --border: #e2e8f0;
  --text: #1a202c;
  --text-secondary: #4a5568;
  --text-muted: #718096;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow: 0 4px 16px rgba(0,0,0,0.08), 0 1px 4px rgba(0,0,0,0.04);
  --radius: 12px;
  --max-width: 1040px;
  --transition: 0.2s ease;
  --header-h: 70px;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

/* ==============================
   HEADER
============================== */

header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 200;
  height: var(--header-h);
  transition: background 0.35s ease, box-shadow 0.35s ease, backdrop-filter 0.35s ease;
}

/* Transparent på hero */
body.has-hero header {
  background: transparent;
}

/* Solid när man scrollat eller är på undersida */
body.has-hero header.scrolled,
body:not(.has-hero) header {
  background: var(--navy);
  box-shadow: 0 2px 20px rgba(0,0,0,0.25);
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 32px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand-logo {
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, var(--accent), var(--accent-light));
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 13px;
  color: var(--navy);
  flex-shrink: 0;
}

.brand-name {
  font-size: 0.92rem;
  font-weight: 700;
  color: white;
  display: block;
  line-height: 1.2;
}

.brand-sub {
  font-size: 0.7rem;
  color: rgba(255,255,255,0.5);
  display: block;
}

nav ul {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 2px;
}

nav ul li a {
  display: block;
  padding: 8px 14px;
  color: rgba(255,255,255,0.75);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: 8px;
  transition: color var(--transition), background var(--transition);
  letter-spacing: 0.01em;
}

nav ul li a:hover,
nav ul li a.active {
  color: white;
  background: rgba(255,255,255,0.1);
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  flex-direction: column;
  gap: 5px;
}
.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: white;
  border-radius: 2px;
  transition: var(--transition);
}

/* ==============================
   HERO — FULL BLEED
============================== */

.hero-fullbleed {
  position: relative;
  height: 100svh;
  min-height: 560px;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center 40%;
  background-repeat: no-repeat;
  /* Fallback om foto saknas */
  background-color: var(--navy-mid);
  transform: scale(1.04);
  transition: transform 8s ease-out;
}

.hero-fullbleed.loaded .hero-bg {
  transform: scale(1);
}

/* Gradient overlay — ljus nedtill, mörk upptill */
.hero-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to bottom,
      rgba(10, 22, 40, 0.55) 0%,
      rgba(10, 22, 40, 0.15) 45%,
      rgba(10, 22, 40, 0.7) 100%
    );
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 32px 80px;
  width: 100%;
}

.hero-eyebrow {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.55);
  margin-bottom: 16px;
}

.hero-title {
  font-family: 'Inter', sans-serif;
  font-size: clamp(4.5rem, 12vw, 9rem);
  font-weight: 800;
  color: white;
  line-height: 0.9;
  letter-spacing: -0.03em;
  margin-bottom: 8px;
}

.hero-tagline {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.2rem, 3vw, 2rem);
  font-weight: 400;
  font-style: italic;
  color: rgba(255,255,255,0.75);
  letter-spacing: 0.04em;
  margin-bottom: 20px;
}

.hero-desc {
  font-size: 0.9rem;
  color: rgba(255,255,255,0.55);
  font-weight: 400;
  letter-spacing: 0.02em;
}

/* Scroll-hint */
.hero-scroll-hint {
  position: absolute;
  bottom: 28px;
  right: 36px;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  opacity: 0.5;
}

.hero-scroll-hint span {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: white;
  writing-mode: vertical-rl;
}

.scroll-line {
  width: 1px;
  height: 48px;
  background: linear-gradient(to bottom, white, transparent);
  animation: scrollPulse 2s ease-in-out infinite;
}

@keyframes scrollPulse {
  0%, 100% { opacity: 0.4; transform: scaleY(1); }
  50% { opacity: 1; transform: scaleY(0.6); }
}

/* ==============================
   PAGE HERO (undersidor)
============================== */

.page-hero {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-mid) 100%);
  color: white;
  padding: 108px 32px 40px; /* toppad för sticky header */
}

.page-hero-inner {
  max-width: var(--max-width);
  margin: 0 auto;
}

.page-hero h1 {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  margin-bottom: 4px;
}

.page-hero p {
  color: rgba(255,255,255,0.55);
  font-size: 0.875rem;
}

/* ==============================
   MAIN
============================== */

main {
  flex: 1;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 40px 32px 64px;
  width: 100%;
}

/* ==============================
   NEWS CARDS
============================== */

.news-grid {
  display: grid;
  gap: 14px;
}

.news-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 24px 28px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  transition: transform var(--transition), box-shadow var(--transition);
  position: relative;
  overflow: hidden;
}

.news-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--blue), var(--blue-light));
  opacity: 0;
  transition: opacity var(--transition);
}

.news-card.featured::before {
  opacity: 1;
  background: linear-gradient(90deg, var(--accent), var(--accent-light));
}

.news-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.news-card:hover::before { opacity: 1; }

.news-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.badge {
  font-size: 0.67rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 3px 9px;
  border-radius: 20px;
}

.badge-new  { background: #fef3c7; color: #92400e; border: 1px solid #fde68a; }
.badge-info { background: #eff6ff; color: #1e40af; border: 1px solid #bfdbfe; }

.news-date {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 500;
}

.news-card h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
  line-height: 1.3;
}

.news-card p {
  color: var(--text-secondary);
  font-size: 0.875rem;
  line-height: 1.7;
}

/* ==============================
   PROTOKOLL
============================== */

.year-group { margin-bottom: 28px; }

.year-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  margin-bottom: 10px;
  padding-left: 2px;
}

.protokoll-list {
  list-style: none;
  display: grid;
  gap: 8px;
}

.protokoll-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: box-shadow var(--transition), border-color var(--transition);
}

.protokoll-item:hover { box-shadow: var(--shadow); border-color: #cbd5e0; }

.protokoll-item a {
  display: flex;
  align-items: center;
  padding: 15px 20px;
  text-decoration: none;
  color: var(--text);
  gap: 14px;
}

.protokoll-icon-wrap {
  width: 38px; height: 38px;
  background: #eff6ff;
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}

.protokoll-details strong {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 2px;
}

.protokoll-details span { font-size: 0.78rem; color: var(--text-muted); }
.protokoll-arrow { margin-left: auto; color: var(--text-muted); flex-shrink: 0; }
.protokoll-item.unavailable { opacity: 0.5; }

/* ==============================
   INFO GRID (Om föreningen)
============================== */

.info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.info-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

.info-card.full { grid-column: 1 / -1; }

.info-card-icon { font-size: 1.3rem; margin-bottom: 10px; }

.info-card h3 {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.info-card p {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 8px;
}
.info-card p:last-child { margin-bottom: 0; }

.info-card ul { list-style: none; padding: 0; }
.info-card ul li {
  font-size: 0.875rem;
  color: var(--text-secondary);
  padding: 5px 0 5px 16px;
  position: relative;
  border-bottom: 1px solid var(--border);
}
.info-card ul li:last-child { border-bottom: none; }
.info-card ul li::before { content: '→'; position: absolute; left: 0; color: var(--blue); font-size: 0.78rem; top: 7px; }

.fact-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.875rem;
}
.fact-row:last-child { border-bottom: none; }
.fact-label { color: var(--text-muted); font-size: 0.78rem; min-width: 110px; flex-shrink: 0; }
.fact-value { color: var(--text); font-weight: 600; }

/* ==============================
   STYRELSE
============================== */

.styrelse-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(275px, 1fr));
  gap: 12px;
}

.styrelse-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: 14px;
  transition: box-shadow var(--transition), transform var(--transition);
}

.styrelse-card:hover { box-shadow: var(--shadow); transform: translateY(-1px); }

.styrelse-avatar {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--blue), var(--blue-light));
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.9rem;
  color: white; flex-shrink: 0;
}

.styrelse-info .roll {
  font-size: 0.67rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.09em;
  color: var(--blue); margin-bottom: 1px;
}
.styrelse-info .namn { font-size: 0.93rem; font-weight: 700; color: var(--text); margin-bottom: 3px; }
.styrelse-info .kontakt { font-size: 0.78rem; color: var(--text-muted); line-height: 1.5; }
.styrelse-info .kontakt a { color: var(--blue); text-decoration: none; }
.styrelse-info .kontakt a:hover { text-decoration: underline; }

/* ==============================
   UTILS
============================== */

.info-box {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: var(--radius);
  padding: 14px 18px;
  font-size: 0.875rem;
  color: #1e40af;
  margin-bottom: 22px;
  line-height: 1.6;
}
.info-box a { color: #1d4ed8; }

.loading {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-muted);
  font-size: 0.875rem;
  display: flex; flex-direction: column; align-items: center; gap: 12px;
}
.loading::before {
  content: '';
  width: 26px; height: 26px;
  border: 2.5px solid var(--border);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.error-msg {
  background: #fff7ed; border: 1px solid #fed7aa;
  border-radius: var(--radius); padding: 14px 18px;
  color: #9a3412; font-size: 0.875rem;
}

/* ==============================
   KALENDER
============================== */

.kal-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 20px;
  align-items: start;
}

/* Månadsvy */
.kal-left {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

.kal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.kal-månad-titel {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
}

.kal-nav-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  width: 34px; height: 34px;
  cursor: pointer;
  font-size: 1.2rem;
  color: var(--text-secondary);
  display: flex; align-items: center; justify-content: center;
  transition: background var(--transition), color var(--transition);
}
.kal-nav-btn:hover { background: var(--bg); color: var(--text); }

.kal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
}

.kal-dag-namn {
  text-align: center;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  padding: 6px 0 10px;
}

.kal-dag {
  aspect-ratio: 1;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  cursor: default;
  transition: background var(--transition);
  position: relative;
}

.kal-dag.tom { background: none; }

.kal-dag-nr {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-secondary);
  line-height: 1;
}

.kal-dag.idag {
  background: var(--navy);
}
.kal-dag.idag .kal-dag-nr { color: white; font-weight: 700; }

.kal-dag.har-event {
  cursor: pointer;
  background: #f0f6ff;
}
.kal-dag.har-event:hover { background: #dbeafe; }
.kal-dag.idag.har-event { background: var(--navy); }

.kal-dots {
  display: flex;
  gap: 3px;
}

.kal-dot {
  width: 5px; height: 5px;
  border-radius: 50%;
}
.kat-mote { background: var(--blue); }
.kat-aktivitet { background: var(--accent); }
.kal-dag.idag .kal-dot { opacity: 0.9; }

/* Popup */
.kal-popup {
  margin-top: 12px;
  background: var(--navy);
  border-radius: var(--radius);
  padding: 16px 18px;
  color: white;
}
.kal-popup.hidden { display: none; }

.kal-popup-event + .kal-popup-event {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(255,255,255,0.1);
}

.kal-popup-titel {
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 4px;
}
.kal-popup-meta {
  font-size: 0.78rem;
  color: rgba(255,255,255,0.6);
  margin-bottom: 6px;
}
.kal-popup-desc {
  font-size: 0.82rem;
  color: rgba(255,255,255,0.75);
  line-height: 1.5;
}

/* Kommande-lista */
.kal-right {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: calc(var(--header-h) + 20px);
}

.kal-kommande-titel {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.kal-kommande-list { list-style: none; }

.kal-kommande-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.kal-kommande-item:last-child { border-bottom: none; padding-bottom: 0; }

.kal-event-datum {
  width: 38px;
  text-align: center;
  flex-shrink: 0;
  background: var(--bg);
  border-radius: 8px;
  padding: 6px 4px;
}
.kal-event-dag {
  display: block;
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--navy);
  line-height: 1;
}
.kal-event-man {
  display: block;
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-top: 2px;
}

.kal-event-info { flex: 1; min-width: 0; }

.kal-event-kategori {
  font-size: 0.67rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 1px;
}
.kat-mote-text { color: var(--blue); }
.kat-aktivitet-text { color: #b45309; }

.kal-event-titel {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.kal-event-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.kal-recurring {
  font-size: 0.75rem;
  color: var(--text-muted);
  flex-shrink: 0;
  margin-top: 16px;
}

.kal-kommande-empty {
  color: var(--text-muted);
  font-size: 0.875rem;
  padding: 16px 0;
  text-align: center;
}

/* Kalender responsiv */
@media (max-width: 720px) {
  .kal-layout {
    grid-template-columns: 1fr;
  }
  .kal-right {
    position: static;
    order: -1;
  }
}

/* ==============================
   FOOTER
============================== */

footer {
  background: var(--navy);
  color: rgba(255,255,255,0.4);
  padding: 28px 32px;
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex; align-items: center;
  justify-content: space-between;
  flex-wrap: wrap; gap: 14px;
}

.footer-brand { font-size: 0.875rem; font-weight: 600; color: rgba(255,255,255,0.65); }

.footer-links { display: flex; gap: 20px; flex-wrap: wrap; }
.footer-links a { color: rgba(255,255,255,0.35); text-decoration: none; font-size: 0.8rem; transition: color var(--transition); }
.footer-links a:hover { color: rgba(255,255,255,0.8); }

/* ==============================
   RESPONSIVE
============================== */

@media (max-width: 720px) {
  .header-inner { padding: 0 20px; }
  .brand-sub { display: none; }

  .nav-toggle { display: flex; }

  nav {
    position: absolute;
    top: var(--header-h);
    left: 0; right: 0;
    background: var(--navy-mid);
    padding: 8px 16px 16px;
    display: none;
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
  }
  nav.open { display: block; }
  nav ul { flex-direction: column; gap: 2px; }
  nav ul li a { padding: 11px 14px; font-size: 0.925rem; }

  .hero-content { padding: 0 20px 64px; }
  .hero-scroll-hint { display: none; }

  .page-hero { padding: 96px 20px 32px; }

  main { padding: 28px 20px 48px; }

  .info-grid { grid-template-columns: 1fr; }
  .info-card.full { grid-column: 1; }
  .styrelse-grid { grid-template-columns: 1fr; }

  .footer-inner { flex-direction: column; text-align: center; }
  .footer-links { justify-content: center; }
}

@media (max-width: 480px) {
  .hero-title { letter-spacing: -0.04em; }
}
