/*
Theme Name: Grieble Pflegedienst
Theme URI: https://2code.de
Author: 2code
Author URI: https://2code.de
Description: Custom Theme für Grieble Pflegedienst
Version: 1.2.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: grieble
Tags: custom-theme, pflege, care
*/

/* 	==========================================================================
	Fonts
   	========================================================================== */

@font-face {
  font-family: "Quicksand";
  src: url("assets/fonts/Quicksand-VariableFont_wght.ttf") format("truetype");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Roboto";
  src: url("assets/fonts/Roboto-VariableFont_wdth,wght.ttf") format("truetype");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Roboto";
  src: url("assets/fonts/Roboto-Italic-VariableFont_wdth,wght.ttf")
    format("truetype");
  font-weight: 100 900;
  font-style: italic;
  font-display: swap;
}

/* 	==========================================================================
	Bootstrap-Overrides: Markenfarben & Typografie
   	========================================================================== */

:root {
  --bs-primary: #003087;
  --bs-primary-rgb: 6, 46, 127;
  --bs-secondary: #003087;
  --bs-secondary-rgb: 39, 77, 153;
  --bs-link-color: #003087;
  --bs-link-hover-color: #003087;
  --bs-body-font-family: "Roboto", Arial, sans-serif;
  --bs-body-bg: #fafafa;
  --bs-body-color: #000000;

  /* Eigene Tokens */
  --grieble-primary: #003087;
  --grieble-secondary: #003087;
  --grieble-h1-color: #706f6f;
  --grieble-h3-color: #878787;
  --grieble-topbar-bg: #e0e0e0;
}

* {
  box-sizing: border-box;
}

html {
  scrollbar-color: var(--bs-primary) white;
  scrollbar-width: thin;
}

body {
  display: block;
  position: relative;
  margin: 0;
  font-family: "Roboto";
  font-weight: 400;
  background-color: var(--bs-body-bg);
  letter-spacing: 0.5px;
}

/* 	==========================================================================
	Typografie
   	========================================================================== */

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: "Quicksand", Arial, sans-serif;
  font-weight: bold;
  letter-spacing: 0.5px;
  line-height: normal;
}

:is(h1, h2, h3, h4, h5, h6) :is(strong, b) {
  font-weight: inherit;
}

h1 {
  color: var(--grieble-h1-color);
  font-weight: bold;
  font-size: 34px;
  margin-bottom: 10px;
}
h2 {
  color: var(--grieble-h1-color);
  font-weight: bold;
  font-size: 24px;
  margin-bottom: 10px;
}
h2 strong {
  color: var(--grieble-primary);
}
h3 {
  color: var(--grieble-h3-color);
  font-weight: bold;
  font-size: 20px;
}

a {
  display: inline-block;
  color: inherit;
}

p:last-of-type {
  margin-bottom: 0;
}

p + ul,
p + ol {
  margin-top: 16px;
}

hr {
  opacity: 1;
  color: #706f6f;
  margin: 10px 0;
}
h1 + hr {
  border-width: 2px;
}
h2 + hr {
  color: var(--grieble-primary);
}

img {
  max-width: 100%;
  height: auto;
}

input[type="submit"],
input.wpcf7-submit,
button,
.button {
  border: 1px solid var(--bs-primary);
  background-color: var(--bs-primary);
  color: white;
  padding: 8px 14px;
  border-radius: 4px;
  text-decoration: none;
  text-align: center;
  transition: all 0.2s ease-in-out;

  &:hover {
    background-color: white;
    color: var(--bs-primary);
  }
}

.button-unstyled {
  border: none;
  background-color: transparent;
  padding: 0;
}

.entry-title,
.page-title {
  color: var(--grieble-h1-color);
  font-size: 2rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid #dee2e6;
  margin-bottom: 1.25rem;
}

/* Bootstrap .btn-primary / .btn-outline-primary auf Markenfarbe */
.btn-primary {
  --bs-btn-bg: var(--grieble-primary);
  --bs-btn-border-color: var(--grieble-primary);
  --bs-btn-hover-bg: var(--grieble-secondary);
  --bs-btn-hover-border-color: var(--grieble-secondary);
  --bs-btn-active-bg: var(--grieble-primary);
}

.btn-outline-primary {
  --bs-btn-color: var(--grieble-primary);
  --bs-btn-border-color: var(--grieble-primary);
  --bs-btn-hover-bg: var(--grieble-primary);
  --bs-btn-hover-border-color: var(--grieble-primary);
}

.bi-flip-horizontal {
  transform: scaleX(-1);
  display: inline-block;
}

.bi-flip-vertical {
  transform: scaleY(-1);
  display: inline-block;
}

.container {
  max-width: 1024px;
  margin: 0 auto;
  padding: 0 20px;
}

.textcontent a {
  color: var(--bs-primary);
  text-decoration: none;

  &:hover {
    text-decoration: underline;
  }
}

form {
  background-color: white;
  padding: 24px;
  border: 1px solid var(--grieble-h3-color);
  border-radius: 4px;
  accent-color: var(--bs-primary);

  a {
    color: var(--bs-primary);
    text-decoration: none;

    &:hover {
      text-decoration: underline;
    }
  }

  > div {
    display: flex;
    gap: 15px;
  }
  > div > * {
    flex: 1;
    min-width: 0;
  }
  span.wpcf7-list-item {
    margin: 0;
  }
  span.wpcf7-list-item label {
    display: flex;
    align-items: start;
    gap: 10px;
  }
  span.wpcf7-list-item label input {
    margin-top: 5px;
  }
  fieldset {
    width: 100%;
    margin-bottom: 16px;
    display: inline-block;
  }
  legend {
    font-size: 16px;
  }
  legend,
  label {
    width: 100%;
    margin-bottom: 12px;
    display: inline-block;
  }
  .wpcf7-form-control-wrap {
    width: 100%;
    display: inline-block;
    margin-top: 4px;
  }
  input[type="text"],
  input[type="tel"],
  input[type="number"],
  input[type="email"],
  textarea {
    width: 100%;
    padding: 8px 14px;
    border: 1px solid var(--grieble-h3-color);
    border-radius: 4px;
  }
  input.wpcf7-submit {
    margin-left: auto;
    display: block;
  }
}

.contact-card {
  display: flex;
  flex-direction: column;
  background-color: white;
  min-height: 405px;

  box-shadow:
    0 1px 3px rgba(0, 0, 0, 0.12),
    0 1px 2px rgba(0, 0, 0, 0.24);

  h2 {
    color: var(--grieble-primary);
  }

  > img {
    display: block;
    width: 100%;
    height: auto;
    flex-shrink: 0;
  }

  .card-body {
    display: flex;
    flex: 1;
    flex-direction: column;

    padding: 24px 0 0;
  }

  .mail-wrap {
    margin-top: auto;
  }

  button {
    width: 100%;
  }

  h2 {
    padding: 0 16px;
    margin-bottom: 5px;
    font-size: 20px;
    line-height: normal;
  }

  h3 {
    padding: 0 16px;
    margin-bottom: 16px;
  }

  p{
    padding: 0 16px;
    margin-bottom: 16px;
  }

  i {
    font-size: 18px;
  }

  .icon-text {
    padding: 12px 8px;
    font-size: 14px;
  }

  .icon-text button,
  .icon-text a {
    color: var(--bs-primary);
    gap: 5px;
  }

  .icon-wrap {
    width: 36px;
    height: 36px;
  }

  button:hover,
  a:hover {
    color: var(--bs-secondary);
  }

  button:hover .icon-wrap,
  a:hover .icon-wrap {
    background-color: rgba(6, 46, 127, 0.26);
  }
}

.slick-slider {
  .slick-next {
    right: 12px;
    z-index: 1;
  }
  .slick-prev {
    left: 12px;
    z-index: 1;
  }
  .slick-next::before,
  .slick-prev::before {
    font-family: "bootstrap-icons";
    font-style: normal;
    font-weight: normal;
    color: var(--grieble-h1-color);
    opacity: 1;
  }
  .slick-prev::before {
    content: "\F284";
  }
  .slick-next::before {
    content: "\F285";
  }
  &.slick-dotted {
    margin-bottom: 0;
  }
  .slick-dots {
    bottom: 30px;
    display: flex;
    justify-content: center;
    gap: 10px;
  }
  .slick-dots li {
    width: 8px;
    height: 8px;
    margin: 0;
  }
  .slick-dots li button:before {
    display: none;
  }
  .slick-dots li.slick-active button {
    opacity: 1;
  }
  .slick-dots li button {
    width: 8px;
    height: 8px;
    padding: 0;
    border-radius: 50%;
    background-color: #274d99;
    opacity: 0.5;
  }
}

form.searchform {
  input[type="submit"] {
    flex: 0 1 auto;
  }
}

/* 	==========================================================================
	Header, Footer
   	========================================================================== */

header,
footer {
  display: block;
  position: relative;
  a {
    text-decoration: none;
  }
}

header {
  position: sticky;
  top: 0;
  z-index: 10;
  font-family: "Quicksand", Arial, sans-serif;
  font-weight: bold;

  .submenu-toggle {
    display: none;
  }

  .dropdown-menu {
    padding-top: 0;
    padding-bottom: 0;
  }

  .dropdown-menu a {
    display: flex;
    justify-content: space-between;
    -webkit-justify-content: space-between;
    align-items: center;
    padding: 8px 16px;
  }

  .nav-item.dropdown {
    position: relative;
  }

  button.navbar-toggler {
    padding: 0;
    border: none;
    background-color: transparent;

    &:hover {
      background-color: transparent;
    }

    &:focus {
      box-shadow: none;
    }

    .navbar-toggler-icon {
      position: relative;
      width: 30px;
      height: 30px;
      background-image: none;
    }

    .navbar-toggler-icon::before,
    .navbar-toggler-icon::after {
      content: "";
      position: absolute;
      left: 2px;

      width: 26px;
      height: 2px;

      background-color: currentColor;
      border-radius: 2px;

      transition:
        top 0.2s ease,
        transform 0.2s ease,
        box-shadow 0.2s ease;
    }

    /* Obere und mittlere Linie */
    .navbar-toggler-icon::before {
      top: 7px;
      box-shadow: 0 7px 0 currentColor;
    }

    /* Untere Linie */
    .navbar-toggler-icon::after {
      top: 21px;
    }

    /* Geöffnet: X */
    &[aria-expanded="true"] .navbar-toggler-icon::before {
      top: 14px;
      transform: rotate(45deg);
      box-shadow: none;
    }

    &[aria-expanded="true"] .navbar-toggler-icon::after {
      top: 14px;
      transform: rotate(-45deg);
    }
  }

  img.menu-item__icon-image {
    width: 24px;
    height: auto;
  }
  .hover-menu-wrap {
    .secondary {
      position: absolute;
      right: 0;
      top: 0;
      width: max-content;
      display: none;
    }
    .secondary span.menu-item__icon {
      flex-shrink: 0;
    }
    .secondary a {
      display: flex;
      align-items: center;
      gap: 20px;
      flex-direction: row-reverse;
      justify-content: start;
      padding: 12px 24px;
    }
    &:hover .secondary {
      display: flex;
    }
  }

  .header-top-bar {
    background-color: var(--grieble-topbar-bg);
  }

  .header-bottom-bar {
    background-color: white;
    padding: 10px 0;

    .container-fluid {
      align-items: end;
    }
  }

  .header-top-bar a {
    color: rgba(0, 0, 0, 0.54);
    width: 24px;
    height: 24px;
    margin: 4px;
    font-size: 18px;
  }

  /* Suchfeld im Header (wird per custom.js ein-/ausgeblendet) */
  .header-top-bar-content {
    position: relative;
  }

  .header-search {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 20;
    width: min(420px, calc(100% - 24px));
    margin-inline: auto;
    padding: 12px;
    background-color: white;
    border-radius: 0 0 6px 6px;
    box-shadow:
      0 4px 12px rgba(0, 0, 0, 0.15),
      0 1px 3px rgba(0, 0, 0, 0.12);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition:
      opacity 0.2s ease,
      transform 0.2s ease,
      visibility 0.2s;

    &.is-open {
      opacity: 1;
      visibility: visible;
      transform: none;
    }

    /* Globale Formular-Styles (Rahmen, Padding, flex: 1) zurücksetzen */
    form {
      padding: 0;
      border: 0;
      background-color: transparent;
    }

    .input-group {
      /* Mobil-Regel "form > div { flex-direction: column }" überschreiben */
      flex-direction: row;
      flex-wrap: nowrap;
      gap: 0;
      margin-bottom: 0;
      border: 1px solid #ced4da;
      border-radius: 6px;
      overflow: hidden;
      transition:
        border-color 0.15s ease,
        box-shadow 0.15s ease;

      &:focus-within {
        border-color: var(--grieble-primary);
        box-shadow: 0 0 0 3px rgba(0, 48, 135, 0.15);
      }
    }

    .form-control {
      flex: 1 1 auto;
      min-width: 0;
      height: 44px;
      padding: 0 14px;
      border: 0;
      border-radius: 0;
      font-weight: normal;
      font-size: 16px; /* verhindert Auto-Zoom auf iOS */
      box-shadow: none;
    }

    .btn {
      flex: 0 0 44px;
      width: 44px;
      height: 44px;
      margin: 0;
      padding: 0;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      border: 0;
      border-radius: 0;
      background-color: var(--grieble-primary);
      color: white;
      font-size: 18px;

      &:hover,
      &:focus-visible {
        background-color: #002266;
        color: white;
      }
    }

    @media (min-width: 992px) {
      left: auto;
      width: min(420px, 100%);
      margin-inline: 0;
    }

    @media (prefers-reduced-motion: reduce) {
      transition: none;
    }
  }
  .navbar-nav {
    position: relative;
  }

  .navbar-nav .current_page_item .nav-link {
    font-weight: bold;
    color: var(--grieble-primary);
  }

  .magic-line {
    position: absolute;
    bottom: -10px;
    left: 0;
    height: 5px;
    background-color: #1c4b82;
    transition: all 0.3s ease-in-out;
    pointer-events: none;
    z-index: 10;
  }
  .navbar-nav .dropdown-toggle::after {
    display: none !important;
  }
  .dropdown-item.active,
  .dropdown-item:active {
    color: var(--grieble-primary);
    background-color: white;
  }
}

footer {
  img.menu-item__icon-image {
    height: 24px;
    width: auto;
  }
  .footer-bar {
    background-color: var(--grieble-topbar-bg);
    padding: 10px 0;
  }
  .socials a {
    color: rgba(0, 0, 0, 0.54);
    width: 24px;
    height: 24px;
    margin: 4px;
    font-size: 18px;
  }
  ul a {
    font-size: 13px;
    line-height: normal;
    display: flex;
    flex-direction: row-reverse;
    gap: 10px;
    align-items: center;
  }
  ul li {
    display: flex;
    align-items: center;
  }
  ul li:not(li:first-of-type)::before {
    content: "|";
    margin-right: 8px;
    margin-left: 8px;
  }
}

/* 	==========================================================================
	Templates
   	========================================================================== */

body.error404 {
  main {
    padding: 100px 0;
  }
  form {
    margin: 48px 0;
  }
}

body.search {
  section {
    padding: 100px 0;
  }
  section + section {
    padding-top: 0;
  }
  .search-form-section form {
    margin-top: 48px;

    > div {
      gap: 10px;
      margin-bottom: 0;
    }
  }

  article h2 {
    color: var(--bs-primary);
    margin-bottom: 24px;
  }
  .articles {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 48px;
  }
  article a {
    width: 100%;
    text-decoration: none;

    &:hover h3 {
      text-decoration: underline;
    }

    &:only-child {
      height: 100%;
    }
  }
  article {
    background-color: white;
    box-shadow:
      0 1px 3px rgba(0, 0, 0, 0.12),
      0 1px 2px rgba(0, 0, 0, 0.24);
    margin-bottom: 0;
    height: 100%;
  }
  article img {
    aspect-ratio: 2 / 1;
    object-fit: cover;
    width: 100%;
    height: auto;
  }
  .article-body {
    padding: 24px;
    width: 100%;

    h3:only-child {
      margin-bottom: 0;
    }
  }
}

/* 	==========================================================================
	Template Parts
   	========================================================================== */

section.block-text-kontakt {
  .row {
    row-gap: 45px;
  }
}

section.block-bannerslider {
  img {
    width: 100%;
    height: auto;
  }
}

section.block-team {
  .row {
    row-gap: 45px;
  }
}

section.block-text-zweispaltig {
  h2 {
    color: var(--grieble-h1-color);
  }
  .row {
    row-gap: 48px;
  }
}

section.block-bild-text-karte {
  .image-text-card {
    box-shadow:
      0 1px 3px rgba(0, 0, 0, 0.12),
      0 1px 2px rgba(0, 0, 0, 0.24);
    height: 100%;
    background-color: white;
  }
  .card-body {
    padding: 24px;
  }
  img {
    width: 100%;
    height: auto;
    aspect-ratio: 2/1;
    object-fit: cover;
  }
  .row {
    row-gap: 48px;
  }
}

section.block-kontakt {
  .row {
    row-gap: 48px;
  }
  .address {
    gap: 10px;
  }
}

@media (min-width: 1199.99px) {
  section.block-text-kontakt {
    .row {
      --bs-gutter-x: 40px;
    }
  }
  section.block-team {
    .row {
      --bs-gutter-x: 48px;
    }
  }
  section.block-text-zweispaltig {
    .row {
      --bs-gutter-x: 40px;
    }
  }
  section.block-bild-text-karte {
    .row {
      --bs-gutter-x: 48px;
    }
  }
}

@media (min-width: 992px) {
  header {
    .navbar-brand,
    .navbar-nav .nav-item {
      flex: 0 0 auto;
      width: 204.8px;
      max-width: 100%;
      margin-right: 0px;
      display: flex;
      justify-content: center;
      align-items: center;
    }

    .navbar-brand {
      width: 50px;
      margin-right: 10px;
    }

    .navbar-nav a {
      width: 100%;
      text-align: center;
      font-size: 18px;
      color: rgba(0, 0, 0, 0.38);
    }

    .dropdown-item{
      background-color: white;
    }

    .dropdown-item:focus, .dropdown-item:hover{
      background-color: white;
      color: var(--grieble-primary);
    }

    .dropdown-menu{
      border-radius: 0;
    }

    .menu-item__header {
    width: 100%;
}

    .nav-link {
      padding-top: 0;
      padding-bottom: 0;
    }

    .nav-link:focus,
    .nav-link:hover {
      color: var(--grieble-primary);
    }

    .navbar-brand img {
      max-width: 100%;
      height: auto;
      max-height: 48px;
    }

    .nav-item.dropdown:hover .dropdown-menu {
      display: block;
      position: absolute;
      top: 100%;
      left: 0;
      margin-top: 9px;
    }

    .nav-item.dropdown .dropdown-menu::before {
      content: "";
      position: absolute;
      top: -20px;
      left: 0;
      width: 100%;
      height: 20px;
      background: transparent;
    }
  }
}

@media (max-width: 1199.98px) {
}

@media (max-width: 991.98px) {
  main {
    margin-top: 92px;
  }
  header {
    position: fixed;
    width: 100%;
    left: 0;
    top: 0;
    box-shadow:
      0 1px 3px rgba(0, 0, 0, 0.12),
      0 1px 2px rgba(0, 0, 0, 0.24);

    .submenu-toggle {
      display: inline-block;
      background-color: transparent;
      border: none;
    }

    .submenu-toggle {
      color: #333;
    }

    .submenu-toggle span {
      display: block;
      transition: transform 0.2s ease;
    }

    .submenu-toggle[aria-expanded="true"] span {
      transform: rotate(180deg);
    }

    li.menu-item-has-children .menu-item__header {
      display: flex;
      justify-content: space-between;
      -webkit-justify-content: space-between;
      gap: 10px;
      align-items: center;
    }

    ul.dropdown-menu {
      position: relative;
      margin-bottom: 15px;
    }

    .magic-line {
      display: none;
    }

    .header-bottom-bar {
        .container-fluid {
            align-items: center;
        }
    }

    a.navbar-brand img {
      width: 50px;
    }
    nav.navbar.navbar-expand-lg {
      width: 100%;
      justify-content: space-between;
      -webkit-justify-content: space-between;
    }
    div#navbarNav {
      position: fixed;
      top: 92px;
      left: 0;
      width: 100%;
      background-color: white;
      box-shadow:
        0 1px 3px rgba(0, 0, 0, 0.12),
        0 1px 2px rgba(0, 0, 0, 0.24);
      padding: 20px;
      max-height: calc(100vh - 92px);
      overflow: auto;
    }
  }
  .contact-card {
    min-height: unset;
    height: 100%;
  }

  section.block-bannerslider {
    .slick-slide {
      aspect-ratio: 2 / 1;
      object-fit: cover;
    }
  }
}

@media (max-width: 767.98px) {
  h1 {
    hyphens: auto;
  }
  form {
    > div {
      flex-direction: column;
      gap: 0;
      margin-bottom: 16px;
    }
  }
  body.search {
    .articles {
      grid-template-columns: 1fr;
    }
  }
}

@media (max-width: 575.98px) {
  footer {
    ul li:not(li:first-of-type)::before {
      display: none;
    }
    .navbar-nav {
      gap: 10px;
      padding: 10px 0;
      width: 100%;
      border-bottom: 1px solid var(--grieble-h1-color);
    }
  }
}
