/* Mobile-specific styles - breakpoint at 800px width OR 500px height to match global site breakpoint */

@media (max-width: 799px) {
  /* MOBILE: Hide desktop menu, show hamburger */
  .hamburger {
    display: flex;
    z-index: 1001;
  }

  .menu {
    display: none;
    position: fixed;
    top: var(--appbar-h); /* 50px from Flutter */
    left: 0;
    right: 0;
    height: auto;
    flex-direction: column;
    gap: 0;
    background-color: var(--mid);
    border-bottom: 1px solid var(--rule);
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  }

  .menu-inner {
    display: flex;
    flex-direction: column;
    width: 100%;
  }

  .menu.mobile-active {
    display: flex;
  }

  .menu a {
    padding: 18px 24px;
    border-bottom: 1px solid var(--rule);
    width: 100%;
    text-align: left;
    font-size: var(--mobile-title-font-size);  /* 16px from tokens */
  }

  .menu a:last-child {
    border-bottom: none;
  }

  .menu a:hover {
    background-color: #f0ede8;
  }

  .content-wrapper {
    width: 100%;
    max-width: 100%;
    height: 100%;
    min-height: 0;
    justify-content: flex-start;
    align-items: stretch;
  }

  .logo-section {
    height: var(--logo-h);
    padding: 0;
    align-items: center;
    justify-content: center;
  }

  .logo-top {
    font-size: var(--fs-logo);
  }

  .logo-top .first-letter {
    font-size: 1.15em;
  }

  .logo-bottom {
    font-size: calc(var(--fs-logo) * 0.6);
    letter-spacing: 3px;  /* Flutter: letterSpacing 3.0 (same as desktop) */
    line-height: 1.4;  /* Flutter: height 1.4 */
  }

  .logo-divider {
    width: 100%;
    margin: 5px auto 8px;  /* Flutter: SizedBox(5) above, SizedBox(8) below */
  }

  .content-container {
    /* Dynamic height: fills remaining viewport after appbar + logo.
       Uses dvh (dynamic viewport height) for mobile browsers where address bar
       appears/disappears; falls back to vh for older browsers. */
    height: calc(100vh - var(--appbar-h) - var(--logo-h) - var(--mobile-footer-h));
    height: calc(100dvh - var(--appbar-h) - var(--logo-h) - var(--mobile-footer-h));
    flex: 0 0 auto;
    min-height: 0;   /* Allow flex shrinking below natural size */
    align-items: stretch;
    justify-content: center;
    padding: 0;
    overflow: hidden;
  }

  /* Startseite: avoid edge-to-edge text on mobile and keep scroll */
  .spacer {
    display: none;
  }

  .bottom-container {
    display: block;
    background-color: #fff;
    height: var(--mobile-footer-h);
    flex: 0 0 var(--mobile-footer-h);
    min-height: var(--mobile-footer-h);
    max-height: var(--mobile-footer-h);
  }

  /* Fachgebiete mobile layout is defined in css/fachgebiete.css */

  /* Kanzlei: mobile title/scroll split is styled in page-specific rules */
}

/* NOTE:
 * Tile/font sizing is defined globally in css/styles.css (tokens + unified mobile tile system).
 * Keep this file focused on layout/navigation tweaks and avoid overriding typography with
 * broad `!important` rules that can diverge across pages.
 */
