/* ==========================================================================
   kim.lussy.ch/lernen/ — Lernportal Stylesheet
   Harmonized with the warm Red Panda woodland meadow palette
   ========================================================================== */

:root {
  --color-brand-primary: #cb521d;         /* Red Panda Terracotta */
  --color-brand-primary-hover: #aa3f10;
  --color-brand-accent: #f59e1b;          /* Sunny Honey Amber */
  --color-brand-accent-hover: #d9850e;
  --color-brand-leaf: #5e8f2e;            /* Sunlit Meadow Green */
  --color-brand-leaf-hover: #4a7322;
  --color-brand-sky: #4a8db7;
  --color-brand-purple: #9a6bb3;
  --color-brand-rose: #ea6569;

  --bg-page: #fdfbf6;                     /* Soft Sunlit Cream */
  --bg-card: #ffffff;
  --bg-surface-tint: #f6eee0;
  --bg-card-warm: #fff9f0;
  --bg-green-soft: #f2f7ec;

  --text-main: #2f1d14;                   /* Treebark Brown */
  --text-muted: #6b5344;
  --text-subtle: #988070;
  --text-inverse: #ffffff;

  --border-light: #eddcc8;
  --border-accent: #f8cf95;
  --border-focus: #cb521d;

  --shadow-sm: 0 2px 8px rgba(66, 38, 22, 0.06);
  --shadow-md: 0 8px 24px rgba(66, 38, 22, 0.09);
  --shadow-hover: 0 12px 28px rgba(66, 38, 22, 0.15);

  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-pill: 999px;

  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-page);
  color: var(--text-main);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ==========================================================================
   SVG Icons
   ========================================================================== */
.svg-icon {
  display: inline-block;
  width: 22px;
  height: 22px;
  stroke-width: 2;
  stroke: currentColor;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  vertical-align: middle;
  flex-shrink: 0;
}

.svg-icon.sm {
  width: 18px;
  height: 18px;
}

.svg-icon.lg {
  width: 28px;
  height: 28px;
}

/* ==========================================================================
   Header & Navigation Bar
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  background: rgba(253, 251, 246, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1.5px solid var(--border-light);
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.header-container {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0.85rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--text-main);
}

.brand-icon-wrapper {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, var(--bg-surface-tint) 0%, #fae6cb 100%);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-brand-primary);
  border: 1.5px solid var(--border-accent);
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-size: 1.25rem;
  font-weight: 900;
  color: var(--color-brand-primary);
  line-height: 1.1;
}

.brand-subtitle {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 600;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 1rem;
  border-radius: var(--radius-pill);
  text-decoration: none;
  color: var(--text-main);
  font-size: 0.92rem;
  font-weight: 700;
  transition: all 0.2s ease;
  cursor: pointer;
  border: none;
  background: transparent;
}

.nav-link:hover {
  background: var(--bg-surface-tint);
  color: var(--color-brand-primary);
}

.nav-btn-share {
  background: #ffffff;
  border: 1.5px solid var(--border-light);
}

.nav-btn-share:hover {
  border-color: var(--color-brand-primary);
  color: var(--color-brand-primary);
}

/* ==========================================================================
   Hero Banner
   ========================================================================== */
.portal-hero {
  background: linear-gradient(180deg, #faf3e5 0%, #fdfbf6 100%);
  padding: 2.75rem 1.25rem 2rem;
  border-bottom: 1.5px solid var(--border-light);
}

.portal-hero-inner {
  max-width: 1160px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 2rem;
  align-items: center;
}

.breadcrumb-nav {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.breadcrumb-nav a {
  color: var(--color-brand-primary);
  text-decoration: none;
  font-weight: 700;
}

.breadcrumb-nav a:hover {
  text-decoration: underline;
}

.portal-title {
  font-size: 2.3rem;
  font-weight: 900;
  color: var(--text-main);
  line-height: 1.2;
  margin-bottom: 0.75rem;
}

.portal-subtitle {
  font-size: 1.1rem;
  color: var(--text-muted);
  max-width: 620px;
}

.portal-banner-img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  border: 3px solid #ffffff;
}

/* ==========================================================================
   Filter & Search Toolbar
   ========================================================================== */
.toolbar-wrap {
  max-width: 1160px;
  margin: 2rem auto 1.5rem;
  padding: 0 1.25rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.filter-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.filter-btn {
  background: #ffffff;
  border: 1.5px solid var(--border-light);
  color: var(--text-muted);
  padding: 0.5rem 1.1rem;
  border-radius: var(--radius-pill);
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.filter-btn:hover {
  border-color: var(--color-brand-primary);
  color: var(--color-brand-primary);
}

.filter-btn.active {
  background: var(--color-brand-primary);
  border-color: var(--color-brand-primary);
  color: var(--text-inverse);
  box-shadow: 0 3px 8px rgba(203, 82, 29, 0.25);
}

.search-box {
  position: relative;
  min-width: 260px;
}

.search-icon {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-subtle);
  pointer-events: none;
}

.search-input {
  width: 100%;
  padding: 0.6rem 1rem 0.6rem 2.4rem;
  border-radius: var(--radius-pill);
  border: 1.5px solid var(--border-light);
  background: #ffffff;
  font-size: 0.92rem;
  color: var(--text-main);
  outline: none;
  transition: border-color 0.2s ease;
}

.search-input:focus {
  border-color: var(--color-brand-primary);
  box-shadow: 0 0 0 3px rgba(203, 82, 29, 0.15);
}

/* ==========================================================================
   Topics Grid & Cards
   ========================================================================== */
.topics-wrap {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 1.25rem 3.5rem;
  flex: 1;
}

.topics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1.75rem;
}

.topic-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1.5px solid var(--border-light);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  transition: all 0.25s ease;
  position: relative;
}

.topic-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
  border-color: var(--color-brand-primary);
}

.topic-card.featured-card {
  border-color: var(--color-brand-leaf);
  background: linear-gradient(180deg, #ffffff 0%, #f7faf2 100%);
}

.topic-card-header {
  padding: 1.5rem 1.5rem 0.75rem;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.topic-icon-wrap {
  width: 50px;
  height: 50px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.topic-badge-status {
  font-size: 0.75rem;
  font-weight: 800;
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius-pill);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.status-active {
  background: #eef6e6;
  color: var(--color-brand-leaf);
  border: 1px solid #cbe3b4;
}

.status-upcoming {
  background: #fbf5ea;
  color: var(--text-muted);
  border: 1px solid var(--border-light);
}

.topic-card-body {
  padding: 0 1.5rem 1.5rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.topic-subject {
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--color-brand-leaf);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.35rem;
}

.topic-title {
  font-size: 1.35rem;
  font-weight: 900;
  color: var(--text-main);
  line-height: 1.3;
  margin-bottom: 0.75rem;
}

.topic-desc {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.55;
  margin-bottom: 1.25rem;
  flex: 1;
}

.topic-meta-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.topic-meta-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--bg-surface-tint);
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 700;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-pill);
}

.topic-card-footer {
  padding-top: 1rem;
  border-top: 1px solid var(--border-light);
}

.btn-card {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.75rem 1.25rem;
  font-size: 0.95rem;
  font-weight: 700;
  border-radius: var(--radius-pill);
  text-decoration: none;
  transition: all 0.2s ease;
  border: none;
  cursor: pointer;
}

.btn-card.active-btn {
  background: var(--color-brand-primary);
  color: #ffffff;
  box-shadow: 0 3px 10px rgba(203, 82, 29, 0.25);
}

.btn-card.active-btn:hover {
  background: var(--color-brand-primary-hover);
  transform: translateY(-1px);
}

.btn-card.disabled-btn {
  background: #fbf5ea;
  color: var(--text-subtle);
  border: 1px solid var(--border-light);
  cursor: not-allowed;
}

/* ==========================================================================
   Callout Box
   ========================================================================== */
.portal-callout {
  max-width: 1160px;
  margin: 0 auto 3rem;
  padding: 0 1.25rem;
}

.callout-box {
  background: #ffffff;
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 1.75rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.callout-text h3 {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 0.25rem;
}

.callout-text p {
  color: var(--text-muted);
  font-size: 0.92rem;
}

.no-results-msg {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-muted);
  font-size: 1.1rem;
  grid-column: 1 / -1;
  display: none;
}

/* ==========================================================================
   Toast Notification
   ========================================================================== */
.toast-msg {
  position: fixed;
  bottom: 25px;
  left: 50%;
  transform: translateX(-50%) translateY(50px);
  background: #2f1d14;
  color: #ffffff;
  padding: 12px 24px;
  border-radius: var(--radius-pill);
  font-size: 0.95rem;
  font-weight: 700;
  box-shadow: var(--shadow-lg);
  z-index: 999;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.toast-msg.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
  background: #ffffff;
  border-top: 1.5px solid var(--border-light);
  padding: 2.25rem 1.25rem;
  margin-top: auto;
}

.footer-container {
  max-width: 1160px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
}

.footer-brand {
  font-weight: 900;
  color: var(--color-brand-primary);
}

.footer-note {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.footer-links {
  display: flex;
  gap: 1.25rem;
}

.footer-link {
  text-decoration: none;
  color: var(--text-muted);
  font-size: 0.88rem;
  font-weight: 700;
}

.footer-link:hover {
  color: var(--color-brand-primary);
}

@media (max-width: 860px) {
  .portal-hero-inner {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .header-container {
    flex-direction: column;
    align-items: stretch;
  }
  .header-nav {
    justify-content: space-between;
  }
  .toolbar-wrap {
    flex-direction: column;
    align-items: stretch;
  }
  .callout-box {
    flex-direction: column;
    text-align: center;
  }
}
