/* ==========================================================================
   FLIESEN STELZER – RESPONSIVE & MEDIA QUERIES (Unified @ 768px Breakpoint)
   ========================================================================== */

/* --- Sticky Header Logic --- */

/* Sticky Header on Desktop (>=769px) */
@media (min-width: 769px) {
  body.sticky-header-desktop header.header {
    position: sticky;
    top: 0;
  }
}

/* Sticky Header on Mobile (<=768px) */
@media (max-width: 768px) {
  body.sticky-header-mobile header.header {
    position: sticky;
    top: 0;
  }
  
  body:not(.sticky-header-mobile) header.header {
    position: relative;
    top: auto;
  }
}

/* --- Mobile Styles (<=768px) --- */
@media (max-width: 768px) {
  
  /* Header & Branding Scaling */
  .brand-logo-img {
    max-height: 90px;
    margin: 0 auto;
    display: block;
  }

  .brand-site-title {
    font-size: 1.8rem;
    margin-top: 10px;
    margin-bottom: 5px;
    text-align: center;
  }

  .brand-site-description {
    font-size: 0.85rem;
    text-align: center;
    margin-bottom: 12px;
  }

  .header-contact-bar {
    justify-content: center;
    text-align: center;
    font-size: 0.82rem;
    padding: 0.5rem;
    gap: 12px;
  }

  /* Navigation on Mobile */
  .navbar-toggler {
    display: inline-flex;
  }

  .navbar-collapse {
    display: none;
    width: 100%;
    background-color: var(--color-secondary-dark);
    padding: 0.5rem 0;
  }

  .navbar-collapse.show {
    display: block;
  }

  .navbar-nav,
  .mod-menu,
  .metismenu {
    flex-direction: column;
    width: 100%;
  }

  .navbar-nav .nav-link,
  .mod-menu .nav-link,
  .metismenu .nav-link,
  .mod-menu a,
  .metismenu a {
    font-size: 1rem;
    padding: 0.85rem 1rem;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  }

  /* Submenus in Mobile Navigation */
  .navbar-nav .dropdown-menu,
  .mod-menu ul,
  .metismenu ul {
    position: static;
    box-shadow: none;
    background-color: rgba(0, 0, 0, 0.25);
    width: 100%;
    border-radius: 0;
  }

  .navbar-nav .dropdown-item,
  .mod-menu ul a,
  .metismenu ul a {
    text-align: center;
    padding: 0.65rem 1rem;
    font-size: 0.9rem;
  }

  /* Article Content Card for Mobile */
  .com-content-article,
  article,
  main .view-article,
  .phoca-gallery-view,
  .container-component > main {
    padding: 1.5rem 1.15rem;
    margin-top: 1rem;
    margin-bottom: 2rem;
    border-radius: var(--border-radius-medium);
  }

  /* Mobile Floated Images Reset */
  .float-start,
  .float-end,
  .float-left,
  .float-right,
  .alignleft,
  .alignright,
  figure.float-start,
  figure.float-end,
  .item-image.float-start,
  .item-image.float-end,
  img.float-start,
  img.float-end,
  img[align="left"],
  img[align="right"] {
    float: none;
    display: block;
    margin: 0 auto 1.25rem auto;
    max-width: 100%;
  }

  .site-grid {
    margin-top: 1rem;
    margin-bottom: 2.5rem;
    padding: 0 0.75rem;
    gap: 1rem;
  }

  /* Typography Adjustments */
  h1 { font-size: 1.6rem; }
  h2 { font-size: 1.35rem; }
  h3 { font-size: 1.15rem; }

  /* Phoca Gallery: Mobile Grid (2 columns per row) */
  .phoca-gallery-view,
  #pg-msnr-container-a1-p1,
  .pg-category-view {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 8px;
  }

  .pg-item-box,
  .pg-cv-box {
    max-width: 48%;
    flex: 1 1 45%;
    padding: 0.3rem;
    box-sizing: border-box;
  }

  /* Buttons expand to full width on mobile for touch optimization */
  .premium-btn {
    display: block;
    text-align: center;
    width: 100%;
    padding: 0.9rem 1rem;
    font-size: 0.95rem;
  }

  .custom-card {
    margin-bottom: 1rem;
    padding: 1.25rem;
  }
  
  .cta-banner {
    padding: 1.75rem 1.25rem;
  }
}
