/* ==========================================================================
   FWAPB Digitales Schulportal — Design System & Styles
   ========================================================================== */

/* 1. Typography Setup */
@font-face {
  font-family: 'Stickczyk Rund';
  src: url('../fonts/stickczykrund-a-webfont.woff2') format('woff2'),
       url('../fonts/StickczykRund-B.woff') format('woff');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Klavika';
  src: url('../fonts/Klavika-Regular.otf') format('opentype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Klavika';
  src: url('../fonts/Klavika-Medium.otf') format('opentype');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Klavika';
  src: url('../fonts/Klavika-Italic.otf') format('opentype');
  font-weight: normal;
  font-style: italic;
  font-display: swap;
}

/* 2. Color Variables (Strictly from Brief) */
:root {
  /* Base colors */
  --page-bg: #E7E5E0;
  --surface: #F7F5EF;
  --surface-soft: #F2F0EA;
  --text: #303234;
  --text-muted: #5F6264;
  --line: #B8B5AD;

  /* Service colors (softened desaturated values) */
  --anmeldung-bg: #F7E8C8;
  --anmeldung-border: #DAC280;
  --anmeldung-accent: #D2AA33;

  --schulchat-bg: #DCEEEA;
  --schulchat-border: #B2D2CB;
  --schulchat-accent: #639C93;

  --dateien-bg: #E6ECE0;
  --dateien-border: #BECAB5;
  --dateien-accent: #758866;

  --klassenbuch-bg: #DAEAF0;
  --klassenbuch-border: #B4CBD8;
  --klassenbuch-accent: #6E98AE;

  --hilfe-bg: #F4F2EC;
  --hilfe-border: #D6D2C8;
  --hilfe-accent: #77746D;
}

/* 3. Base Layout Rules */
* {
  box-sizing: border-box;
}

body {
  background-color: var(--page-bg);
  color: var(--text);
  font-family: 'Klavika', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  margin: 0;
  padding: 0;
  line-height: 1.5;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* 4. Header Bar Styles */
.site-header {
  background-color: #ffffff;
  border-bottom: 1px solid var(--line);
  padding: 12px 56px 12px 40px; /* Left spacing (40px) and right spacing (56px) on desktop */
  width: 100%;
}

.header-container {
  max-width: 100%; /* Stretch full width */
  width: 100%;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.header-left {
  font-family: 'Klavika', sans-serif;
  font-weight: 500;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text);
}

.header-nav {
  display: flex;
  gap: 24px;
}

.header-nav a {
  color: var(--text-muted);
  text-decoration: none;
  font-family: 'Klavika', sans-serif;
  font-weight: normal;
  font-size: 14px;
  transition: color 0.2s ease;
}

.header-nav a:hover {
  color: var(--text);
}

/* 5. Main Content Styles */
.portal-main {
  width: 100%;
  flex-grow: 1;
  padding-bottom: 60px;
}

/* 6. Hero / Banner Area with Overlay Logo */
.hero-section {
  position: relative;
  width: 100%;
  height: 315px; /* Subtly adjusted hero height */
  background-color: var(--surface-soft);
}

.hero-banner {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 70%; /* Focus on wooden table and natural materials */
  display: block;
}

.logo-outer {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  height: 0;
}

/* Center logo cutout integrated into page background with slanted top edge */
.logo-container {
  width: 116px; /* Reduced by ~12% */
  height: 156px; /* Reduced by ~12% */
  background-color: var(--page-bg); /* Match the page grey background color */
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 22px 8px 12px 8px; /* Scaled padding for smaller container */
  /* Asymmetric slant on the top edge only (slanted down from left to right - 5% slant) */
  clip-path: polygon(0 0, 100% 5%, 100% 100%, 0 100%);
  position: relative;
  bottom: -34px; /* Slightly adjusted bottom overlap for more integration and breathing room */
  left: 4px; /* Shifted very slightly (4px) to the right */
  z-index: 10;
  box-shadow: none; /* Keep holder subtle, integrated, no strong shadow */
}

.school-logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

/* 7. Portal Intro */
.portal-intro {
  max-width: 900px;
  margin: 0 auto;
  padding: 76px 20px 0 20px; /* adjusted top padding for more compact logo overlap */
  text-align: center;
}

.portal-title {
  font-family: 'Stickczyk Rund', sans-serif;
  font-weight: normal;
  font-size: 44px; /* Reduced by ~8% */
  margin: 0 0 16px 0;
  color: var(--text);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.title-divider {
  border: none;
  border-top: 2px solid var(--line); /* More visible thicker line */
  width: 65px; /* Slightly wider */
  margin: 0 auto 16px auto;
}

.portal-subtitle {
  font-family: 'Klavika', sans-serif;
  font-size: 18px;
  color: var(--text-muted);
  margin: 0 0 40px 0;
}

/* 8. Service Grid & Cards Wrapper */
.portal-cards-wrapper {
  max-width: 1000px;
  width: 100%;
  margin: 0 auto;
  padding: 0 20px;
}

.services-section,
.utilities-section {
  max-width: 100%;
  width: 100%;
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

/* Base Card Styling */
.service-card {
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding: 32px 24px; /* Reduced horizontal padding from 36px to 24px to give text more room */
  min-height: 146px; /* Increased card height slightly */
  border-radius: 0px; /* Rectangular shape per rules */
  border: 1px solid var(--card-border);
  background-color: var(--card-bg);
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease, color 0.2s ease;
}

.service-card h2 {
  font-family: 'Klavika', sans-serif;
  font-weight: 500;
  font-size: 20px; /* Reduced from 22px to prevent awkward title wrapping */
  margin: 0 0 10px 0;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.03em; /* Reduced from 0.05em */
}

.service-card p {
  font-family: 'Klavika', sans-serif;
  font-size: 16px;
  margin: 0;
  color: var(--text-muted);
  line-height: 1.45;
}

.card-note {
  font-family: 'Klavika', sans-serif;
  font-style: italic;
  font-size: 14px;
  color: var(--text-muted);
  margin-top: 8px;
  display: block;
}

/* Interaction Effects */
.service-card:focus,
.service-card:focus-visible,
.service-card:active {
  outline: none;
}

.service-card:hover,
.service-card:focus-visible {
  transform: translateY(-2px);
  /* Very soft, calm, non-dominant shadow for tactile feel */
  box-shadow: 0 4px 14px rgba(48, 50, 52, 0.05);
}

.service-card:active {
  transform: translateY(1px);
  box-shadow: none;
}

/* Service Card Color Mapping */
.card-anmeldung {
  --card-bg: var(--anmeldung-bg);
  --card-border: var(--anmeldung-border);
  --card-accent: var(--anmeldung-accent);
}
.card-anmeldung:hover,
.card-anmeldung:focus-visible {
  --card-bg: #FDF6E8; /* Slightly brighter warm sand */
  --card-border: var(--anmeldung-accent); /* Strengthened to accent */
}

.card-schulchat {
  --card-bg: var(--schulchat-bg);
  --card-border: var(--schulchat-border);
  --card-accent: var(--schulchat-accent);
}
.card-schulchat:hover,
.card-schulchat:focus-visible {
  --card-bg: #ECF7F5; /* Slightly brighter mint */
  --card-border: var(--schulchat-accent); /* Strengthened to accent */
}

.card-dateien {
  --card-bg: var(--dateien-bg);
  --card-border: var(--dateien-border);
  --card-accent: var(--dateien-accent);
}
.card-dateien:hover,
.card-dateien:focus-visible {
  --card-bg: #F2F6EF; /* Slightly brighter sage */
  --card-border: var(--dateien-accent); /* Strengthened to accent */
}

.card-klassenbuch {
  --card-bg: var(--klassenbuch-bg);
  --card-border: var(--klassenbuch-border);
  --card-accent: var(--klassenbuch-accent);
}
.card-klassenbuch:hover,
.card-klassenbuch:focus-visible {
  --card-bg: #EBF4F7; /* Slightly brighter blue-grey */
  --card-border: var(--klassenbuch-accent); /* Strengthened to accent */
}


/* 9. Footer Bar Styles */
.site-footer {
  background-color: var(--surface-soft);
  border-top: 1px solid var(--line);
  padding: 24px 20px;
  width: 100%;
}

.footer-container {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer-left {
  font-family: 'Klavika', sans-serif;
  color: var(--text-muted);
  font-size: 13px;
}

.footer-right {
  display: flex;
  gap: 20px;
}

.footer-right a {
  color: var(--text-muted);
  text-decoration: none;
  font-family: 'Klavika', sans-serif;
  font-size: 13px;
  transition: color 0.2s ease;
}

.footer-right a:hover {
  color: var(--text);
}

/* ==========================================================================
   10. Responsiveness Rules
   ========================================================================== */

/* Tablet & Smaller Layout */
@media (max-width: 768px) {
  .site-header {
    padding: 16px 20px;
  }
  
  .hero-section {
    height: 245px; /* Subtly adjusted hero height for mobile screens */
  }

  .hero-banner {
    object-position: center 72%; /* Clear focus on table materials on mobile screens */
  }

  .logo-container {
    width: 94px;
    height: 126px;
    bottom: -35px;
    left: 3px; /* Shifted slightly right on mobile too */
    padding: 16px 6px 10px 6px;
  }

  .portal-intro {
    padding-top: 60px;
  }

  .portal-title {
    font-size: 38px;
  }

  .portal-subtitle {
    font-size: 16px;
    margin-bottom: 30px;
  }

  .services-grid,
  .utilities-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .services-section,
  .utilities-section {
    max-width: 100%;
  }

  .utilities-section {
    margin-top: 16px;
  }

  .service-card {
    padding: 20px 24px;
    min-height: auto;
  }

  .service-card h2 {
    font-size: 19px;
  }

  .service-card p {
    font-size: 15px;
  }

  .utility-card {
    padding: 16px 20px;
    min-height: auto;
  }

  .utility-card h3 {
    font-size: 17px;
  }

  .utility-card p {
    font-size: 14px;
  }
}

/* Mobile Stacking Layout */
@media (max-width: 600px) {
  .header-container {
    flex-direction: column;
    gap: 12px;
    text-align: center;
  }

  .header-nav {
    gap: 16px;
  }

  .footer-container {
    flex-direction: column;
    gap: 12px;
    text-align: center;
  }

  .footer-right {
    gap: 16px;
  }
}

/* ==========================================================================
   11. Secondary Utility Grid
   ========================================================================== */
.utilities-section {
  margin-top: 12px; /* Pull closer and feel connected but secondary */
}

.utilities-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  max-width: 634px; /* Centered and matches 2-column width perfectly with desktop layout */
  margin: 0 auto;
}

/* Base Utility Card Styling */
.utility-card {
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding: 12px 20px; /* Visibly smaller padding than primary cards */
  min-height: 90px; /* Visibly smaller height than primary cards */
  border-radius: 0px; /* Rectangular corners matching Option B style */
  border: 1px solid var(--card-border);
  background-color: var(--card-bg);
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease, color 0.2s ease;
}

/* Prevent outline focus rings */
.utility-card:focus,
.utility-card:focus-visible,
.utility-card:active {
  outline: none;
}

.utility-card:hover,
.utility-card:focus-visible {
  transform: translateY(-2px);
  /* Soft, calm shadow matching primary cards */
  box-shadow: 0 4px 14px rgba(48, 50, 52, 0.05);
}

.utility-card:active {
  transform: translateY(1px);
  box-shadow: none;
}

.utility-card h3 {
  font-family: 'Klavika', sans-serif;
  font-weight: 500;
  font-size: 18px; /* Visibly smaller than primary h2 (22px) */
  margin: 0 0 6px 0;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.utility-card p {
  font-family: 'Klavika', sans-serif;
  font-size: 14.5px; /* Visibly smaller than primary p (16px) */
  margin: 0;
  color: var(--text-muted);
  line-height: 1.4;
}

/* Card Color Mapping for Hilfe card in Option B */
.card-hilfe {
  --card-bg: var(--hilfe-bg);
  --card-border: var(--hilfe-border);
  --card-accent: var(--hilfe-accent);
}
.card-hilfe:hover,
.card-hilfe:focus-visible {
  --card-bg: #FCFAF6; /* Slightly brighter stone grey */
  --card-border: var(--hilfe-accent); /* Strengthened to accent border */
}

/* Calm, neutral override for Konto & Sicherheit utility card to reduce yellow prominence */
.utility-card.card-anmeldung {
  --card-bg: var(--hilfe-bg);
  --card-border: var(--hilfe-border);
  --card-accent: var(--hilfe-accent);
}
.utility-card.card-anmeldung:hover,
.utility-card.card-anmeldung:focus-visible {
  --card-bg: #FCFAF6;
  --card-border: var(--hilfe-accent);
}



