/* Index-Seite — MD3 Component Styles (Mobile-First) */

/* Logo-Sektion */
.md3-index-logo {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: var(--space-4);
  background: var(--app-background);
}

.md3-index-logo__img {
  width: 100%;
  max-width: 600px; /* Reduziert auf 600px statt 700px */
  height: auto;
  display: block;
}

/* Ab 600px: Logo kann auf bis zu 700px wachsen */
@media (min-width: 600px) {
  .md3-index-logo__img {
    max-width: 740px;
  }
}

/* Cards-Container (Mobile-First Grid) */
.md3-index-cards {
  display: grid;
  grid-template-columns: 1fr; /* Mobile: 1 Spalte */
  gap: var(--space-4);
  padding: var(--space-4);
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
  box-sizing: border-box;
  min-width: 300px; /* Nicht unter 300px schrumpfen */
}

/* Tablet: 2 Spalten ab 600px (MD3 breakpoint 600px–839px)
   Drawer ist noch MODAL (nicht permanent), volle Breite verfügbar */
@media (min-width: 600px) and (max-width: 839px) {
  .md3-index-cards {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-4);
    padding: var(--space-4);
  }
}

/* Desktop: 2 Spalten ab 840px bis ~1100px (Drawer wird PERMANENT 280px)
   Available space: 840px - 280px = 560px (tight für 3 Spalten)
   2 Spalten bei 840px–1099px */
@media (min-width: 840px) and (max-width: 1099px) {
  .md3-index-cards {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-6);
    padding: var(--space-6);
  }
}

/* Large Desktop: 3 Spalten ab 1100px (max-width MD3 = 1440px)
   Available space: 1100px - 280px = 820px (gut für 3 Spalten) */
@media (min-width: 1100px) {
  .md3-index-cards {
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-6);
    padding: var(--space-6);
  }
}

/* ============================================================================
   Index Card Styling - Extends MD3 Landing Card
   ============================================================================ */

/* Icon styling */
.md3-index-card__icon {
  font-size: 2rem;
  color: var(--md-sys-color-primary);
  margin-bottom: var(--space-3);
  display: block;
}

/* Title styling */
.md3-index-card__title {
  margin: var(--space-2) 0;
  color: var(--md-sys-color-primary);
  font-size: var(--md-sys-typescale-title-large-font-size);
  font-weight: var(--md-sys-typescale-title-large-font-weight);
  line-height: var(--md-sys-typescale-title-large-line-height);
  letter-spacing: var(--md-sys-typescale-title-large-letter-spacing);
}

.md3-index-card__text {
  margin: 0;
  color: var(--md-sys-color-on-surface-variant);
}

/* ============================================
   Index Page Specific Overrides
   ============================================
   These !important rules are necessary to override
   the app-shell layout specifically for the index page.
   NEEDS_IMPORTANT: app-shell layout override
   
   MOBILE: Burger-Icon und Modal Drawer werden angezeigt (konsistent mit anderen Seiten)
   DESKTOP: Permanenter Drawer wird ausgeblendet für volle Breite
   ============================================ */

/* Hide Standard (permanent) Drawer on Index Page (Desktop only) */
@media (min-width: 840px) {
  body[data-page="index"] #navigation-drawer .md3-navigation-drawer--standard {
    /* NEEDS_IMPORTANT: app-shell layout override */
    display: none !important;
  }
}

/* Adjust Grid Layout on Index Page (Desktop) - Full width without drawer */
@media (min-width: 840px) {
  body[data-page="index"].app-shell {
    /* NEEDS_IMPORTANT: app-shell layout override */
    grid-template-areas:
      "main"
      "footer" !important;
    grid-template-columns: 1fr !important;
  }
  
  /* Hide burger icon only on desktop (where we hide the drawer) */
  body[data-page="index"] .md3-top-app-bar__navigation-icon {
    /* Burger stays hidden on desktop since there's no drawer to open */
    display: none !important;
  }
}

/* MOBILE (<840px): Burger icon remains visible for modal drawer access */
@media (max-width: 839px) {
  body[data-page="index"] .md3-top-app-bar__navigation-icon {
    /* Explicitly show burger on mobile for index page */
    display: flex !important;
  }
}
