/* StefanRoth.ch — modern civic layout */

:root {
  --color-primary: #b91c1c;
  --color-primary-dark: #991b1b;
  --color-primary-light: #fef2f2;
  --color-accent: #1e3a5f;
  --color-text: #1f2937;
  --color-text-muted: #6b7280;
  --color-border: #e5e7eb;
  --color-bg: #f8fafc;
  --color-surface: #ffffff;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 4px 16px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 12px 40px rgba(15, 23, 42, 0.1);
  --radius: 12px;
  --radius-sm: 8px;
  --font-sans: "Source Sans 3", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-display: "Libre Baskerville", Georgia, "Times New Roman", serif;
  --max-width: 1200px;
  --sidebar-width: 300px;
  --header-height: 64px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.7;
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: var(--color-primary);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color 0.15s ease;
}

a:hover {
  color: var(--color-primary-dark);
}

/* ── Header ── */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: linear-gradient(135deg, var(--color-accent) 0%, #0f2744 100%);
  box-shadow: var(--shadow-md);
}

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

.site-brand {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  text-decoration: none;
  color: #fff;
  flex-shrink: 0;
}

.site-brand:hover {
  color: #fff;
  opacity: 0.92;
}

.site-brand__name {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.2;
}

.site-brand__tagline {
  font-size: 0.78rem;
  font-weight: 400;
  opacity: 0.82;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-nav a,
.site-nav .site-nav__active {
  display: block;
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-decoration: none;
  color: rgba(255, 255, 255, 0.88);
  transition: background 0.15s ease, color 0.15s ease;
}

.site-nav a:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.site-nav .site-nav__active {
  background: var(--color-primary);
  color: #fff;
}

/* ── Layout ── */

.site-main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2rem 1.5rem 3rem;
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
  gap: 2rem;
  align-items: start;
}

/* ── Sidebar ── */

.site-sidebar {
  position: sticky;
  top: calc(var(--header-height) + 1.5rem);
}

.sidebar-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.sidebar-card__media {
  padding: 1.25rem 1.25rem 0;
  text-align: center;
}

.sidebar-card__media img {
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
}

.sidebar-card__divider {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: 1rem 1.25rem;
}

.sidebar-card__body {
  padding: 0 1.25rem 1.25rem;
  font-size: 0.9rem;
  line-height: 1.65;
}

.sidebar-card__body p {
  margin: 0 0 1rem;
}

.sidebar-card__body p:last-child {
  margin-bottom: 0;
}

.sidebar-card__body strong {
  font-weight: 700;
  color: var(--color-accent);
}

/* ── Content / entries ── */

.site-content {
  min-width: 0;
}

.content-intro {
  margin-bottom: 2rem;
  padding: 1.75rem 2rem;
  background: linear-gradient(135deg, var(--color-primary-light) 0%, #fff 60%);
  border: 1px solid #fecaca;
  border-left: 4px solid var(--color-primary);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.content-intro h1 {
  margin: 0 0 0.5rem;
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 700;
  color: var(--color-accent);
  line-height: 1.25;
}

.content-intro p {
  margin: 0;
  color: var(--color-text-muted);
  font-size: 1rem;
}

.serendipity_Entry_Date {
  margin-bottom: 2rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.serendipity_Entry_Date:hover {
  box-shadow: var(--shadow-md);
}

.serendipity_date {
  margin: 0;
  padding: 0.85rem 1.5rem;
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  background: #f1f5f9;
  border-bottom: 1px solid var(--color-border);
}

.serendipity_title {
  margin: 0;
  padding: 1.25rem 1.5rem 0;
  font-family: var(--font-display);
  font-size: clamp(1.15rem, 2.5vw, 1.5rem);
  font-weight: 700;
  color: var(--color-accent);
  line-height: 1.35;
}

.serendipity_entry {
  padding: 0 1.5rem 1.5rem;
}

.serendipity_entry_body {
  font-size: 1rem;
  line-height: 1.75;
}

.serendipity_entry_body p,
.serendipity_entry_body li {
  margin: 0 0 1rem;
}

.serendipity_entry_body ul {
  margin: 0 0 1rem;
  padding-left: 1.35rem;
}

.serendipity_entry_body li {
  margin-bottom: 0.5rem;
}

.serendipity_entry_body strong {
  color: var(--color-accent);
}

.serendipity_image_center {
  display: block;
  margin: 1rem auto;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
}

.entry-media {
  display: block;
  width: 100%;
  max-width: 520px;
  height: 320px;
  margin: 0 auto 1rem;
  object-fit: cover;
  object-position: center;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  background: #f1f5f9;
}

.entry-media--contain {
  object-fit: contain;
  padding: 0.75rem;
  background: #f8fafc;
}

.serendipity_entry_body iframe,
.serendipity_entry_body object {
  max-width: 100%;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
}

/* Override legacy inline/font styles */
.serendipity_entry_body font,
.serendipitySideBarContent font,
.sidebar-card__body font {
  font-family: inherit !important;
  font-size: inherit !important;
  color: inherit !important;
}

.serendipity_entry_body [style*="LINE-HEIGHT"],
.serendipity_entry_body [style*="line-height"] {
  line-height: inherit !important;
}

.serendipity_entryFooter {
  display: none;
}

/* ── Footer ── */

.site-footer {
  margin-top: auto;
  padding: 1.5rem;
  text-align: center;
  font-size: 0.85rem;
  color: var(--color-text-muted);
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
}

.site-footer a {
  color: var(--color-text-muted);
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--color-primary);
}

/* Legacy elements (if present on other pages) */
#dtheader,
#dtheadernav,
#mainpane,
#dtfooter {
  display: none !important;
}

/* ── Responsive ── */

@media (max-width: 900px) {
  .site-header__inner {
    flex-direction: column;
    align-items: flex-start;
    padding-top: 1rem;
    padding-bottom: 1rem;
  }

  .site-nav {
    width: 100%;
  }

  .site-main {
    grid-template-columns: 1fr;
    padding-top: 1.5rem;
  }

  .site-sidebar {
    position: static;
  }
}

@media (max-width: 520px) {
  .site-nav a,
  .site-nav .site-nav__active {
    padding: 0.4rem 0.65rem;
    font-size: 0.8rem;
  }

  .content-intro,
  .serendipity_entry {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .serendipity_title {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .serendipity_date {
    padding-left: 1rem;
    padding-right: 1rem;
  }
}
