/* ===========================================================================
   Ensta Östra Villaförening — shared stylesheet
   Modern, responsive, dependency-free.
   =========================================================================== */

:root {
  /* Brand palette (natural / residential greens + warm accent) */
  --brand:        #2e7d55;
  --brand-dark:   #1b5e3f;
  --brand-darker: #123f2a;
  --brand-050:    #eef6f0;
  --brand-100:    #dcecE1;
  --accent:       #e0a232;
  --accent-dark:  #c2861c;

  --ink:      #16241d;
  --body:     #2b3a32;
  --muted:    #5d6f65;
  --line:     #e2e9e3;

  --bg:       #ffffff;
  --bg-soft:  #f5f8f6;

  --white:    #ffffff;

  --radius:   14px;
  --radius-lg: 22px;
  --radius-pill: 999px;

  --shadow-sm: 0 1px 2px rgba(18, 63, 42, .06), 0 1px 3px rgba(18, 63, 42, .08);
  --shadow-md: 0 6px 18px -6px rgba(18, 63, 42, .18);
  --shadow-lg: 0 24px 48px -18px rgba(18, 63, 42, .28);

  --container: 1120px;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
          Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji", sans-serif;
}

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

* { margin: 0; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  font-family: var(--font);
  color: var(--body);
  background: var(--bg);
  line-height: 1.65;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--brand-dark); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 {
  color: var(--ink);
  line-height: 1.2;
  font-weight: 750;
  letter-spacing: -.02em;
}

h1 { font-size: clamp(2rem, 4.5vw, 3.1rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); }
h3 { font-size: 1.2rem; }

p { color: var(--body); }

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

/* --------------------------------------------------------------- layout -- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: clamp(18px, 4vw, 32px);
}

.section { padding-block: clamp(48px, 7vw, 88px); }
.section--soft { background: var(--bg-soft); }
.section__head { max-width: 720px; margin-bottom: 36px; }
.section__head.center { margin-inline: auto; text-align: center; }
.eyebrow {
  display: inline-block;
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--brand);
  margin-bottom: 12px;
}
.lead { font-size: 1.12rem; color: var(--muted); }

/* skip link */
.skip-link {
  position: absolute;
  left: 12px; top: -60px;
  background: var(--brand-dark);
  color: #fff;
  padding: 10px 16px;
  border-radius: 8px;
  z-index: 200;
  transition: top .2s ease;
}
.skip-link:focus { top: 12px; text-decoration: none; }

/* --------------------------------------------------------------- header -- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, .82);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 72px;
}

.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 42px; height: 42px;
  border-radius: 12px;
  background: linear-gradient(150deg, var(--brand), var(--brand-dark));
  color: #fff;
  box-shadow: var(--shadow-sm);
  flex-shrink: 0;
}
.brand-mark svg { width: 24px; height: 24px; }
.brand-text { font-weight: 800; letter-spacing: -.02em; line-height: 1.05; font-size: 1.02rem; }
.brand-text small { display: block; font-weight: 600; font-size: .78rem; color: var(--muted); letter-spacing: .02em; }

/* nav */
.site-nav { display: flex; }
.nav-list {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0;
}
.nav-list a {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 9px 13px;
  border-radius: 10px;
  color: var(--body);
  font-weight: 600;
  font-size: .95rem;
  transition: background .15s, color .15s;
}
.nav-list a:hover { background: var(--brand-050); color: var(--brand-dark); text-decoration: none; }
.nav-list a[aria-current="page"] { color: var(--brand-dark); background: var(--brand-050); }
.nav-ext::after { content: ""; }

.nav-cta.btn { margin-left: 6px; padding: 9px 16px; }

/* hamburger */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px; height: 44px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
}
.nav-toggle-bar {
  width: 20px; height: 2px;
  background: var(--ink);
  border-radius: 2px;
  transition: transform .2s, opacity .2s;
}
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* --------------------------------------------------------------- buttons -- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 22px;
  border-radius: var(--radius-pill);
  font-weight: 700;
  font-size: 1rem;
  line-height: 1;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: transform .12s ease, box-shadow .2s ease, background .2s ease, color .2s;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary { background: var(--brand); color: #fff; box-shadow: var(--shadow-md); }
.btn-primary:hover { background: var(--brand-dark); color: #fff; }
.btn-accent { background: var(--accent); color: #23180a; }
.btn-accent:hover { background: var(--accent-dark); color: #23180a; }
.btn-outline { background: transparent; color: var(--brand-dark); border-color: var(--brand); }
.btn-outline:hover { background: var(--brand-050); }
.btn-ghost { background: rgba(255,255,255,.14); color: #fff; border-color: rgba(255,255,255,.5); }
.btn-ghost:hover { background: rgba(255,255,255,.24); color:#fff; }

/* ---------------------------------------------------------------- hero --- */
.hero {
  position: relative;
  color: #fff;
  background:
    radial-gradient(1100px 500px at 85% -10%, rgba(224,162,50,.28), transparent 60%),
    radial-gradient(900px 500px at 0% 120%, rgba(255,255,255,.14), transparent 55%),
    linear-gradient(150deg, var(--brand) 0%, var(--brand-dark) 55%, var(--brand-darker) 100%);
  overflow: hidden;
  isolation: isolate;
}
.hero::before {
  content: "";
  position: absolute; inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='60'%3E%3Cpath d='M0 59h60M59 0v60' fill='none' stroke='%23ffffff' stroke-opacity='0.05' stroke-width='1'/%3E%3C/svg%3E");
  z-index: -1;
}
.hero-inner {
  padding-block: clamp(64px, 11vw, 128px);
  max-width: 760px;
}
.hero .badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,.14);
  border: 1px solid rgba(255,255,255,.28);
  color: #fff;
  padding: 7px 14px;
  border-radius: var(--radius-pill);
  font-size: .82rem;
  font-weight: 600;
  letter-spacing: .02em;
  margin-bottom: 22px;
}
.hero h1 { color: #fff; }
.hero p { color: rgba(255,255,255,.92); font-size: 1.22rem; margin-top: 18px; max-width: 620px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 34px; }
.hero-wave { position: absolute; left: 0; right: 0; bottom: -1px; width: 100%; height: auto; display: block; z-index: -1; }

/* ---------------------------------------------------------------- cards -- */
.grid { display: grid; gap: 22px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 26px;
  box-shadow: var(--shadow-sm);
  transition: transform .16s ease, box-shadow .2s ease, border-color .2s;
}
.card h3 { margin-bottom: 8px; }
.card p { color: var(--muted); font-size: .98rem; }
a.card { color: inherit; display: block; }
a.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: var(--brand-100); text-decoration: none; }
.card-ico {
  display: grid; place-items: center;
  width: 48px; height: 48px;
  border-radius: 12px;
  background: var(--brand-050);
  color: var(--brand-dark);
  margin-bottom: 16px;
}
.card-ico svg { width: 26px; height: 26px; }
.card-more { display: inline-block; margin-top: 14px; font-weight: 700; color: var(--brand-dark); }
a.card:hover .card-more { text-decoration: underline; }

/* ----------------------------------------------------------- page hero --- */
.page-hero {
  background:
    radial-gradient(800px 380px at 90% -30%, rgba(224,162,50,.18), transparent 60%),
    linear-gradient(160deg, var(--brand-dark), var(--brand-darker));
  color: #fff;
}
.page-hero .container { padding-block: clamp(48px, 7vw, 84px); }
.page-hero h1 { color: #fff; }
.page-hero p { color: rgba(255,255,255,.9); margin-top: 12px; max-width: 640px; font-size: 1.1rem; }
.breadcrumbs { font-size: .85rem; color: rgba(255,255,255,.7); margin-bottom: 14px; }
.breadcrumbs a { color: rgba(255,255,255,.9); }

/* --------------------------------------------------------------- prose --- */
.prose { max-width: 760px; }
.prose > * + * { margin-top: 1.1em; }
.prose h2 { margin-top: 1.6em; }
.prose h3 { margin-top: 1.3em; }
.prose p, .prose li { font-size: 1.06rem; color: var(--body); }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li + li { margin-top: .4em; }

/* content split (text + aside) */
.split { display: grid; grid-template-columns: 1.6fr 1fr; gap: 40px; align-items: start; }
.aside-card {
  background: var(--brand-050);
  border: 1px solid var(--brand-100);
  border-radius: var(--radius-lg);
  padding: 26px;
}
.aside-card h3 { margin-bottom: 10px; }
.aside-card ul { list-style: none; padding: 0; }
.aside-card li { padding: 7px 0; border-bottom: 1px dashed var(--brand-100); color: var(--body); }
.aside-card li:last-child { border-bottom: 0; }

/* --------------------------------------------------------------- people -- */
.people { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 16px; }
.person {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.avatar {
  width: 46px; height: 46px; border-radius: 50%;
  display: grid; place-items: center;
  background: linear-gradient(150deg, var(--brand), var(--brand-dark));
  color: #fff; font-weight: 700; font-size: 1rem;
  flex-shrink: 0;
}
.person .name { font-weight: 700; color: var(--ink); line-height: 1.2; }
.person .role { font-size: .85rem; color: var(--muted); }

/* --------------------------------------------------------- documents ----- */
.doc-list { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(280px,1fr)); }
.doc {
  display: flex; align-items: center; gap: 16px;
  background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px 20px;
  box-shadow: var(--shadow-sm);
}
.doc .doc-ico {
  width: 46px; height: 46px; border-radius: 10px; flex-shrink: 0;
  display: grid; place-items: center;
  background: #fdecdc; color: var(--accent-dark);
}
.doc .doc-body { flex: 1; }
.doc .doc-body strong { display: block; color: var(--ink); }
.doc .doc-body span { font-size: .85rem; color: var(--muted); }

/* --------------------------------------------------------------- blog ---- */
.post-list { display: grid; gap: 18px; }
.post {
  background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: 26px;
  box-shadow: var(--shadow-sm);
}
.post .post-meta { font-size: .82rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.post h2 { font-size: 1.35rem; margin-top: 6px; }
.post p { color: var(--muted); margin-top: 10px; }
.empty-state {
  text-align: center; padding: 40px 24px;
  border: 1.5px dashed var(--line); border-radius: var(--radius-lg);
  color: var(--muted); background: var(--bg-soft);
}

/* callout */
.callout {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px;
  background: linear-gradient(150deg, var(--brand), var(--brand-dark));
  color: #fff; border-radius: var(--radius-lg);
  padding: 32px clamp(24px, 4vw, 44px);
}
.callout h2 { color: #fff; }
.callout p { color: rgba(255,255,255,.9); margin-top: 6px; }

/* --------------------------------------------------------------- footer -- */
.site-footer { background: var(--brand-darker); color: rgba(255,255,255,.82); margin-top: 0; }
.footer-grid {
  display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 32px;
  padding-block: 56px;
}
.site-footer h3 { color: #fff; font-size: .95rem; text-transform: uppercase; letter-spacing: .08em; margin-bottom: 14px; }
.site-footer a { color: rgba(255,255,255,.82); }
.site-footer a:hover { color: #fff; }
.footer-col ul { list-style: none; padding: 0; display: grid; gap: 9px; }
.footer-col p { color: rgba(255,255,255,.72); }
.footer-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; color: #fff; }
.footer-brand .brand-text, .footer-brand .brand-text small { color: #fff; }
.footer-brand .brand-text small { color: rgba(255,255,255,.7); }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.12); }
.footer-bottom .container {
  display: flex; flex-wrap: wrap; gap: 8px 20px; justify-content: space-between;
  padding-block: 20px; font-size: .88rem; color: rgba(255,255,255,.66);
}

/* --------------------------------------------------------------- utils --- */
.text-center { text-align: center; }
.mt-0 { margin-top: 0; }
.hide { display: none !important; }

/* --------------------------------------------------------- responsive ---- */
@media (max-width: 900px) {
  .split { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 760px) {
  .nav-toggle { display: flex; }
  .site-nav {
    position: fixed;
    inset: 72px 0 auto 0;
    background: #fff;
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow-lg);
    transform: translateY(-8px);
    opacity: 0;
    visibility: hidden;
    transition: opacity .18s ease, transform .18s ease, visibility .18s;
    max-height: calc(100vh - 72px);
    overflow-y: auto;
  }
  .site-nav.open { transform: translateY(0); opacity: 1; visibility: visible; }
  .nav-list {
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    padding: 14px clamp(18px, 4vw, 32px) 22px;
  }
  .nav-list a { padding: 13px 14px; font-size: 1.05rem; }
  .nav-cta.btn { margin: 8px 0 0; width: 100%; }
}

@media (max-width: 560px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 28px; }
  .hero-actions .btn { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}

/* -------------------------------------------------- bli medlem (embed) -- */
/* Full-height embed of the live habitDB registration page, with the site
   header kept visible on top for full site integration. */
body.member-page { margin: 0; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; overflow: hidden; }
body.member-page #member { flex: 1 1 auto; min-height: 0; display: flex; }
.member-embed { flex: 1 1 auto; width: 100%; min-height: 0; border: 0; background: #f5f7fa; display: block; }
