/* -----------------------------------------------
   neidenmark.se – clean modern Swedish family site
   ----------------------------------------------- */

:root {
  --sky: #b8d4e8;
  --sky-dark: #8fb8d4;
  --white: #ffffff;
  --text: #2c3e50;
  --text-muted: #6b7c8d;
  --accent: #8b1a1a;
  --accent-hover: #a52020;
  --card-bg: #ffffff;
  --card-shadow: 0 2px 16px rgba(44, 62, 80, 0.10);
  --nav-bg: #1e3a4f;
  --nav-link: #e8f4f8;
  --nav-link-hover: #ffffff;
  --nav-active: #f0c040;
  --border: #d0dde8;
  --footer-bg: #1e3a4f;
  --footer-text: #a8c4d8;
  --max-width: 960px;
  --font-sans: 'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-serif: Georgia, 'Times New Roman', serif;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.7;
  color: var(--text);
  background: linear-gradient(160deg, #ddeef8 0%, #eef6fb 60%, #f5f8fb 100%);
  min-height: 100vh;
}

/* ---- NAV ---- */
header {
  background: var(--nav-bg);
  box-shadow: 0 2px 8px rgba(0,0,0,0.18);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 64px;
}

.site-title {
  text-decoration: none;
}
.site-title h1 {
  font-family: var(--font-serif);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--nav-active);
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.site-title span {
  display: block;
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: 400;
  color: var(--footer-text);
  letter-spacing: 0.04em;
  margin-top: -2px;
}

nav ul {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.15rem;
  flex-wrap: wrap;
}

nav a {
  display: block;
  padding: 0.45rem 0.85rem;
  border-radius: 6px;
  color: var(--nav-link);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 500;
  transition: background 0.18s, color 0.18s;
}
nav a:hover {
  background: rgba(255,255,255,0.10);
  color: var(--nav-link-hover);
}
nav a.active {
  color: var(--nav-active);
  background: rgba(240,192,64,0.10);
}

/* dropdown */
nav li { position: relative; }
nav li ul {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  flex-direction: column;
  background: #163347;
  border-radius: 8px;
  box-shadow: 0 6px 24px rgba(0,0,0,0.22);
  min-width: 150px;
  padding: 0.4rem 0;
  gap: 0;
  z-index: 200;
}
nav li ul a {
  border-radius: 0;
  padding: 0.5rem 1.1rem;
  font-size: 0.88rem;
  white-space: nowrap;
}
nav li:hover ul,
nav li:focus-within ul { display: flex; }

/* ---- HERO / HOME ---- */
.hero {
  max-width: var(--max-width);
  margin: 3rem auto 0;
  padding: 0 1.5rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem;
  align-items: center;
}

.hero-text h2 {
  font-family: var(--font-serif);
  font-size: 2.4rem;
  line-height: 1.2;
  color: var(--text);
  margin-bottom: 1rem;
}
.hero-text p {
  color: var(--text-muted);
  font-size: 1.05rem;
}

.hero-image {
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--card-shadow);
}
.hero-image img {
  width: 100%;
  height: 280px;
  object-fit: cover;
  display: block;
}
.hero-image figcaption {
  padding: 0.55rem 0.9rem;
  background: rgba(255,255,255,0.85);
  font-size: 0.82rem;
  color: var(--text-muted);
  font-style: italic;
  text-align: center;
}

/* ---- CARDS GRID ---- */
.section {
  max-width: var(--max-width);
  margin: 3.5rem auto;
  padding: 0 1.5rem;
}

.section-title {
  font-family: var(--font-serif);
  font-size: 1.6rem;
  color: var(--text);
  margin-bottom: 1.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--border);
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.25rem;
}

.card {
  background: var(--card-bg);
  border-radius: 10px;
  box-shadow: var(--card-shadow);
  padding: 1.4rem 1.6rem;
  border: 1px solid var(--border);
  transition: transform 0.18s, box-shadow 0.18s;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 24px rgba(44,62,80,0.14);
}
.card h3 {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  color: var(--accent);
}
.card p {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.5;
}
.card .arrow {
  margin-top: auto;
  padding-top: 0.6rem;
  font-size: 0.83rem;
  color: var(--accent);
  font-weight: 600;
}

/* ---- ABOUT INTRO ---- */
.intro-card {
  background: var(--card-bg);
  border-radius: 12px;
  box-shadow: var(--card-shadow);
  border: 1px solid var(--border);
  padding: 2rem 2.5rem;
  max-width: var(--max-width);
  margin: 0 auto 3rem;
}
.intro-card p {
  color: var(--text-muted);
  font-size: 1rem;
  margin-bottom: 0.6rem;
}
.intro-card p:last-child { margin-bottom: 0; }

/* ---- PERSON PAGE ---- */
.page-container {
  max-width: var(--max-width);
  margin: 3rem auto;
  padding: 0 1.5rem;
}

.page-card {
  background: var(--card-bg);
  border-radius: 12px;
  box-shadow: var(--card-shadow);
  border: 1px solid var(--border);
  padding: 2.5rem 3rem;
}

.breadcrumb {
  font-size: 0.84rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}
.breadcrumb a {
  color: var(--accent);
  text-decoration: none;
}
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb span { margin: 0 0.35rem; }

.page-card h2 {
  font-family: var(--font-serif);
  font-size: 2rem;
  color: var(--text);
  margin-bottom: 1.2rem;
}

.page-card p {
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 1.5rem;
  padding: 0.7rem 1.5rem;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  border-radius: 7px;
  font-size: 0.95rem;
  font-weight: 600;
  transition: background 0.18s, transform 0.14s;
}
.btn:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
}
.btn svg {
  width: 16px; height: 16px;
  flex-shrink: 0;
}

/* person nav bar */
.person-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}
.person-nav a {
  padding: 0.35rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 0.84rem;
  color: var(--text-muted);
  text-decoration: none;
  background: #f7fafc;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.person-nav a:hover,
.person-nav a.active {
  border-color: var(--accent);
  color: var(--accent);
  background: #fff5f5;
}

/* coat of arms sidebar widget */
.coat-wrap {
  float: right;
  margin: 0 0 1.5rem 2rem;
  text-align: center;
}
.coat-wrap img {
  width: 140px;
  border-radius: 8px;
  box-shadow: var(--card-shadow);
}
.coat-wrap figcaption {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.4rem;
  font-style: italic;
}

/* ---- FOOTER ---- */
footer {
  background: var(--footer-bg);
  color: var(--footer-text);
  text-align: center;
  padding: 2rem 1.5rem;
  margin-top: 4rem;
  font-size: 0.85rem;
}
footer a {
  color: var(--footer-text);
  text-decoration: underline;
}
footer a:hover { color: #fff; }

/* ---- RESPONSIVE ---- */
@media (max-width: 680px) {
  .hero {
    grid-template-columns: 1fr;
  }
  .hero-text h2 { font-size: 1.8rem; }
  .page-card { padding: 1.5rem 1.25rem; }
  .intro-card { padding: 1.4rem 1.2rem; }
  .coat-wrap {
    float: none;
    margin: 0 auto 1.5rem;
  }
  .header-inner { min-height: 56px; }
  nav a { padding: 0.4rem 0.6rem; font-size: 0.85rem; }
}
