/* Site header */
.site-header {
  .bar {
    display: flex;
    justify-content: center;
    border-bottom: 2px solid var(--color-brand-500);
    @media (min-width: 1536px) { border-bottom: none; }

    .bar-inner {
      max-width: var(--max-content);
      width: 100%;
      display: flex;
      justify-content: space-between;
      padding: var(--space-5) var(--space-3);
      @media (min-width: 1536px) {
        padding-left: 0;
        padding-right: 0;
      }

      .logo img {
        height: 3rem;
        @media (min-width: 1024px) { height: 4rem; }
        @media (min-width: 1536px) { height: 5rem; }
      }

      .actions {
        display: flex;
        gap: var(--space-8);

        .info {
          display: none;
          flex-direction: column;
          align-items: flex-end;
          gap: var(--space-2);
          align-self: flex-start;
          @media (min-width: 1024px) { display: flex; }
          @media (min-width: 1536px) {
            flex-direction: row;
            align-items: center;
            gap: var(--space-5);
          }

          .info-row {
            display: flex;
            align-items: center;
            gap: var(--space-2);

            img { height: 1.5rem; }
            img.icon-phone {
              height: 1.25rem;
              margin-left: var(--space-3);
            }
          }

          .phone {
            font-size: var(--text-lg);
            line-height: var(--leading-lg);
            font-weight: 700;
            color: var(--color-neutral-500);
          }
        }
      }
    }
  }
}

/* Mobile nav */
.mobile-nav {
  display: block;
  @media (min-width: 1536px) { display: none; }

  .toggle {
    padding: var(--space-1);
    border: 2px solid var(--color-brand-500);
    background: none;
    cursor: pointer;

    svg {
      width: 1.5rem;
      height: 1.5rem;
      stroke-width: 2;
      stroke: var(--color-brand-500);
      fill: transparent;
    }
  }

  .overlay {
    display: none;
    position: fixed;
    z-index: 30;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.5);

    &.is-open { display: block; }
  }

  .panel {
    display: none;
    position: fixed;
    z-index: 40;
    top: 0;
    right: 0;
    max-width: 320px;
    width: 100%;
    height: 100vh;
    overflow-y: auto;
    background-color: var(--color-brand-500);

    &.is-open { display: block; }
  }

  .list {
    display: flex;
    flex-direction: column;
    gap: var(--space-px);
    background-color: var(--color-white);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
  }

  .item {
    display: flex;
    gap: var(--space-px);
    align-items: stretch;
    background-color: var(--color-brand-300);
  }

  .link {
    display: block;
    flex-grow: 1;
    color: var(--color-white);
    background-color: var(--color-brand-500);
    transition: background-color 0.15s ease;
    padding: var(--space-4) var(--space-6);

    &.is-active { background-color: var(--color-black); }

    span {
      text-transform: uppercase;
      font-weight: 600;
    }
  }

  .expander {
    background-color: var(--color-brand-500);
    display: flex;
    align-items: center;
    padding: 0 var(--space-3);
    cursor: pointer;

    svg {
      width: 2rem;
      height: 2rem;
      stroke-width: 2;
      stroke: var(--color-white);
      fill: transparent;
    }
  }

  .submenu {
    display: none;
    flex-direction: column;
    gap: var(--space-px);
    background-color: var(--color-white);

    &.is-open { display: flex; }
  }

  .sublink {
    display: block;
    color: var(--color-white);
    background-color: var(--color-neutral-400);
    transition: background-color 0.15s ease;
    padding: var(--space-4) var(--space-6);

    &.is-active { background-color: var(--color-black); }

    span { font-weight: 600; }
  }
}

body.no-scroll {
  overflow: hidden;
}

/* Desktop nav */
.desktop-nav {
  display: none;
  justify-content: center;
  background-color: var(--color-neutral-600);
  @media (min-width: 1536px) { display: flex; }

  .list {
    max-width: var(--max-content);
    width: 100%;
    display: flex;
    gap: var(--space-px);
  }

  .link {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    color: var(--color-white);
    transition: background-image 0.2s ease;
    padding: var(--space-5) var(--space-7);

    &:hover,
    &.is-active {
      background-image: linear-gradient(to bottom, var(--color-brand-500), var(--color-brand-700));
    }

    &:hover .subtitle { color: var(--color-white); }
  }

  .title {
    font-family: var(--font-heading);
    text-transform: uppercase;
    font-size: 1.25rem;
    line-height: 1.25rem;
  }

  .subtitle {
    white-space: pre-wrap;
    line-height: 1rem;
    font-size: 0.875rem;
    color: var(--color-neutral-300);

    &.is-active { color: var(--color-white); }
  }
}

/* Site footer */
.site-footer {
  display: flex;
  justify-content: center;
  color: var(--color-white);
  background-image: linear-gradient(to bottom, var(--color-brand-500), var(--color-brand-700));

  .inner {
    max-width: var(--max-content);
    width: 100%;
    padding: var(--space-7) var(--space-5);
  }

  .columns {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-10);
    margin-bottom: var(--space-4);
    @media (min-width: 768px) { grid-template-columns: repeat(2, 1fr); }
    @media (min-width: 1280px) { grid-template-columns: repeat(4, 1fr); }
  }

  .heading-wrap {
    border-bottom: 1px solid var(--color-brand-400);
    margin-bottom: var(--space-6);
  }

  .heading {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: var(--text-lg);
    line-height: var(--leading-lg);
    padding-bottom: var(--space-2);
    border-bottom: 1px solid var(--color-brand-700);
  }

  .doctor {
    display: flex;
    gap: var(--space-4);
    margin-bottom: var(--space-6);

    .photo { width: 4rem; flex-shrink: 0; }
    .name { font-weight: 700; }
    .subtitle { white-space: pre-wrap; line-height: 1.25rem; }
  }

  .address-name { font-weight: 700; }
  .address-lines { margin-bottom: var(--space-4); }

  .hours-grid { display: grid; grid-template-columns: repeat(2, 1fr); }
  .hours-note { font-size: var(--text-sm); line-height: var(--leading-sm); }

  .nav {
    display: none;
    align-items: center;
    margin-bottom: var(--space-8);
    @media (min-width: 1280px) { display: flex; }

    .link {
      display: flex;
      flex-direction: column;
      font-weight: 600;
      text-transform: uppercase;
      font-size: var(--text-sm);
      line-height: var(--leading-sm);
      color: var(--color-white);
      transition: color 0.15s ease;
      padding: 0 var(--space-4);

      &:hover { color: var(--color-black); }
      &.divided { border-left: 1px solid var(--color-white); }
    }
  }

  .copyright {
    font-size: var(--text-sm);
    line-height: var(--leading-sm);
    margin-left: var(--space-4);
    margin-bottom: var(--space-4);
  }
}

/* Page shell */
.page {
  background-color: var(--color-neutral-100);
  display: flex;
  justify-content: center;
}

.page-panel {
  max-width: var(--max-content);
  width: 100%;
  background-color: var(--color-white);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.page-banner {
  img {
    object-fit: cover;
    width: 100%;
    height: auto;
    @media (min-width: 1280px) { height: 540px; }
  }
}

.page-content {
  display: flex;
  gap: var(--space-12);
  padding: var(--space-16) var(--space-12);
}

.content {
  flex: 1;
  min-width: 0;
}

.content-text {
  margin-bottom: var(--space-8);
}

.heading-page {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: var(--text-3xl);
  line-height: var(--leading-3xl);
  color: var(--color-brand-500);
  margin-bottom: var(--space-6);
}

/* Sidebar navigation (default, appointment, prescription templates) */
.sidebar-nav {
  display: none;
  width: 25%;
  flex-shrink: 0;
  @media (min-width: 1536px) { display: block; }

  .list {
    display: flex;
    flex-direction: column;
    gap: var(--space-px);
  }

  .link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-3);
    color: var(--color-neutral-700);
    background-color: var(--color-neutral-100);
    transition: background-color 0.15s ease, color 0.15s ease;
    padding: var(--space-3) var(--space-5);

    &:hover,
    &.is-active {
      background-color: var(--color-neutral-400);
      color: var(--color-white);

      .link-icon { stroke: var(--color-white); }
    }

    .link-title {
      line-height: 1.25rem;
      margin-bottom: var(--space-1);

      &.bold { font-weight: 600; }
    }

    .link-subtitle {
      line-height: 1.25rem;
      white-space: pre-wrap;
    }

    .link-icon {
      flex-shrink: 0;
      fill: transparent;
      stroke-width: 2;
      stroke: var(--color-neutral-300);
      width: 2rem;
      height: 2rem;
    }
  }
}

/* Sidebar download box (contact template) */
.sidebar-download {
  display: none;
  width: 25%;
  flex-shrink: 0;
  @media (min-width: 1024px) { display: block; }
}

/* Home page hero */
.home-hero {
  position: relative;

  img {
    object-fit: cover;
    width: 100%;
    height: 540px;
  }

  .intro {
    position: absolute;
    padding: var(--space-8);
    font-size: var(--text-lg);
    line-height: var(--leading-lg);
    @media (min-width: 768px) { width: 66.6667%; }
    @media (min-width: 1024px) {
      width: 40%;
      padding: var(--space-12);
      font-size: var(--text-xl);
      line-height: var(--leading-xl);
    }
    @media (min-width: 1280px) {
      padding: var(--space-16) var(--space-20);
      font-size: var(--text-2xl);
      line-height: var(--leading-2xl);
    }
  }

  .hint {
    position: absolute;
    bottom: 0;
    margin: var(--space-6);
    padding: var(--space-4) var(--space-6) var(--space-2);
    background-color: rgba(255, 255, 255, 0.7);
    border: 2px solid var(--color-brand-500);
    @media (min-width: 768px) {
      font-size: var(--text-xl);
      line-height: var(--leading-xl);
    }
    @media (min-width: 1024px) {
      bottom: auto;
      right: 0;
      width: 40%;
      margin: var(--space-12);
    }
  }
}

/* Home services sidebar */
.home-content {
  flex-direction: column;
  @media (min-width: 1280px) { flex-direction: row; }
}

.home-services {
  width: 100%;
  @media (min-width: 1280px) {
    width: 25%;
    flex-shrink: 0;
  }

  .heading {
    font-size: var(--text-2xl);
    line-height: var(--leading-2xl);
    text-transform: uppercase;
    font-family: var(--font-heading);
    font-weight: 700;
    color: var(--color-brand-500);
    margin-bottom: var(--space-4);
  }

  .list {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-px);
    @media (min-width: 768px) { grid-template-columns: repeat(2, 1fr); }
    @media (min-width: 1280px) {
      display: flex;
      flex-direction: column;
    }
  }

  .link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-3);
    color: var(--color-neutral-700);
    background-color: var(--color-neutral-100);
    transition: background-color 0.15s ease, color 0.15s ease;
    padding: var(--space-3) var(--space-5);

    &:hover {
      background-color: var(--color-neutral-400);
      color: var(--color-white);

      .icon { stroke: var(--color-white); }
    }

    .title { line-height: 1.25rem; }

    .icon {
      flex-shrink: 0;
      fill: transparent;
      stroke-width: 2;
      stroke: var(--color-neutral-300);
      width: 2rem;
      height: 2rem;
    }
  }
}

/* Home schwerpunkte / diagnostik columns */
.home-columns {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  @media (min-width: 1024px) { flex-direction: row; }

  .schwerpunkte {
    margin-bottom: var(--space-8);
    @media (min-width: 1024px) { margin-bottom: 0; }
    @media (min-width: 1536px) {
      width: 33.3333%;
      flex-shrink: 0;
    }
  }

  .diagnostik {
    flex: 1;
    min-width: 0;
    @media (min-width: 1536px) { width: 66.6667%; }

    .columns {
      display: flex;
      flex-direction: column;
      @media (min-width: 1536px) { flex-direction: row; }
    }
  }
}

.home-section-heading {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: var(--text-2xl);
  line-height: var(--leading-2xl);
  text-transform: uppercase;
  color: var(--color-black);
  margin-bottom: var(--space-6);
}

/* Reusable link item (linkitem snippet) */
.linkitem {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: var(--space-3);
  color: var(--color-neutral-700);
  padding: var(--space-2) 0;

  &:hover .icon { stroke: var(--color-brand-100); }

  .icon {
    flex-shrink: 0;
    fill: transparent;
    stroke-width: 2;
    stroke: var(--color-brand-500);
    width: 2rem;
    height: 2rem;
    transition: stroke 0.15s ease;
  }

  .title {
    line-height: 1.25rem;
    margin-bottom: var(--space-1);
  }
}

/* Shared sidebar heading (sidebar-nav, sidebar-download, home-services) */
.sidebar-heading {
  font-size: var(--text-2xl);
  line-height: var(--leading-2xl);
  font-family: var(--font-heading);
  font-weight: 700;
  margin-bottom: var(--space-4);
}
