/* ==========================================================================
   GUC Referenzen – Frontend Styles
   ========================================================================== */

/* --------------------------------------------------------------------------
   Filter Navigation
   -------------------------------------------------------------------------- */
.guc-ref-filter {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.75rem;
  margin-bottom: 3rem;
}

.guc-ref-filter__btn {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 0;
  font-size: 1rem;
  color: #555;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease;
  white-space: nowrap;
}

.guc-ref-filter__btn:hover {
  color: #000;
}

.guc-ref-filter__btn.is-active {
  color: #c0392b; /* red accent – adjust to brand colour */
  border-bottom-color: currentColor;
}

/* --------------------------------------------------------------------------
   Groups (show / hide)
   -------------------------------------------------------------------------- */
.guc-ref-group {
  display: none;
}

.guc-ref-group.is-active {
  display: block;
}

/* --------------------------------------------------------------------------
   Grid
   -------------------------------------------------------------------------- */
.guc-ref-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2.5rem 2rem;
}

@media (max-width: 1024px) {
  .guc-ref-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 600px) {
  .guc-ref-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
}

/* --------------------------------------------------------------------------
   Card
   -------------------------------------------------------------------------- */
.guc-ref-card {
  cursor: pointer;
  text-align: center;
  outline: none;
}

.guc-ref-card:focus-visible .guc-ref-card__photo-wrap {
  box-shadow: 0 0 0 3px #c0392b;
}

.guc-ref-card__photo-wrap {
  position: relative;
  width: 100%;
  padding-top: 100%; /* 1:1 aspect ratio */
  border-radius: 50%;
  overflow: hidden;
  background: #f0f0f0;
  margin-bottom: 1rem;
  transition: opacity 0.2s ease;
}

.guc-ref-card:hover .guc-ref-card__photo-wrap {
  opacity: 0.85;
}

.guc-ref-card__photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
}

/* Placeholder when no photo */
.guc-ref-card__photo-placeholder {
  position: absolute;
  inset: 0;
  background: #ddd url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23aaa' d='M12 12c2.7 0 4.8-2.1 4.8-4.8S14.7 2.4 12 2.4 7.2 4.5 7.2 7.2 9.3 12 12 12zm0 2.4c-3.2 0-9.6 1.6-9.6 4.8v2.4h19.2v-2.4c0-3.2-6.4-4.8-9.6-4.8z'/%3E%3C/svg%3E") center/50% no-repeat;
}

.guc-ref-card__info {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.guc-ref-card__title {
  font-size: 1rem;
  font-weight: 700;
  color: #111;
  display: block;
}

.guc-ref-card__client {
  font-size: 0.875rem;
  color: #666;
  display: block;
}

/* --------------------------------------------------------------------------
   Modal
   -------------------------------------------------------------------------- */
.guc-ref-modal {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.guc-ref-modal[hidden] {
  display: none;
}

.guc-ref-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  cursor: pointer;
}

.guc-ref-modal__container {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  max-width: 1100px;
  padding: 0 1rem;
  z-index: 1;
}

/* Prevent body scroll when modal is open */
body.guc-modal-open {
  overflow: hidden;
}

/* Close button */
.guc-ref-modal__close {
  position: absolute;
  top: -2.5rem;
  right: 0;
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  padding: 0.25rem;
  line-height: 1;
  opacity: 0.8;
  transition: opacity 0.2s;
  z-index: 2;
}

.guc-ref-modal__close:hover {
  opacity: 1;
}

/* Nav buttons (prev / next) */
.guc-ref-modal__nav {
  flex: 0 0 60px;
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem;
  transition: opacity 0.2s;
  opacity: 0.7;
}

.guc-ref-modal__nav:hover:not(:disabled) {
  opacity: 1;
}

.guc-ref-modal__nav:disabled {
  visibility: hidden;
}

/* Main content box */
.guc-ref-modal__content {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  gap: 2.5rem;
  background: #fff;
  border-radius: 2px;
  padding: 2.5rem;
  max-height: 90vh;
  overflow-y: auto;
}

.guc-ref-modal__photo {
  flex: 0 0 260px;
}

.guc-ref-modal__img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 2px;
  object-fit: cover;
}

.guc-ref-modal__body {
  flex: 1;
  min-width: 0;
}

.guc-ref-modal__name {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0 0 0.25rem;
  color: #111;
}

.guc-ref-modal__client {
  font-size: 1.375rem;
  color: #444;
  margin: 0 0 1.75rem;
  font-weight: 400;
}

.guc-ref-modal__links {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-bottom: 1.5rem;
}

.guc-ref-modal__contact-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: #333;
  text-decoration: none;
  padding: 0.75rem 0;
  border-top: 1px solid #e8e8e8;
  border-bottom: 1px solid #e8e8e8;
  transition: color 0.2s;
  word-break: break-all;
}

.guc-ref-modal__contact-link:hover {
  color: #c0392b;
}

.guc-ref-modal__quote {
  font-size: 1.0625rem;
  line-height: 1.6;
  color: #333;
  font-style: italic;
  margin: 0 0 1.5rem;
  padding-left: 1rem;
  border-left: 3px solid #c0392b;
}

.guc-ref-modal__description {
  font-size: 0.9375rem;
  line-height: 1.65;
  color: #444;
  margin-top: 1rem;
}

/*
 * Defensive typography for the WYSIWYG "Beschreibung" content.
 * Many themes reset default list/heading/paragraph styles globally
 * (e.g. "ul { list-style: none; margin:0; padding:0 }"), which makes
 * content coming from the editor (lists, headings, ...) look like
 * plain unstyled text. We restore sane defaults scoped to this
 * container only, with !important where needed to win over such
 * theme-level resets.
 */
.guc-ref-modal__description p {
  margin: 0 0 1em;
}

.guc-ref-modal__description p:last-child {
  margin-bottom: 0;
}

.guc-ref-modal__description ul,
.guc-ref-modal__description ol {
  margin: 0 0 1em 1.25em !important;
  padding: 0 !important;
}

.guc-ref-modal__description ul {
  list-style: disc outside !important;
}

.guc-ref-modal__description ol {
  list-style: decimal outside !important;
}

.guc-ref-modal__description ul ul {
  list-style-type: circle !important;
}

.guc-ref-modal__description li {
  display: list-item !important;
  margin: 0 0 0.4em;
}

.guc-ref-modal__description a {
  color: #c0392b;
  text-decoration: underline;
}

.guc-ref-modal__description strong,
.guc-ref-modal__description b {
  font-weight: 700;
}

.guc-ref-modal__description em,
.guc-ref-modal__description i {
  font-style: italic;
}

.guc-ref-modal__description h1,
.guc-ref-modal__description h2,
.guc-ref-modal__description h3,
.guc-ref-modal__description h4,
.guc-ref-modal__description h5,
.guc-ref-modal__description h6 {
  margin: 1.2em 0 0.5em;
  line-height: 1.3;
  color: #111;
}

.guc-ref-modal__description h1:first-child,
.guc-ref-modal__description h2:first-child,
.guc-ref-modal__description h3:first-child,
.guc-ref-modal__description h4:first-child,
.guc-ref-modal__description h5:first-child,
.guc-ref-modal__description h6:first-child {
  margin-top: 0;
}

.guc-ref-modal__description blockquote {
  margin: 0 0 1em;
  padding-left: 1rem;
  border-left: 3px solid #ddd;
  color: #666;
  font-style: italic;
}

/* Mobile modal adjustments */
@media (max-width: 768px) {
  /*
   * Layout on mobile (bottom sheet):
   *
   *  ┌──────────────────────────────┐  ← nav row (transparent, above white box)
   *  │  ‹ Prev Name  |  Next Name › │
   *  ├──────────────────────────────┤
   *  │                              │  ← white content box
   *  │  [photo]  Name / Function    │
   *  │  Phone / Email / Description │
   *  └──────────────────────────────┘
   *
   * DOM order: close | nav--prev | content | nav--next
   * We use flex-wrap + CSS order to put both nav buttons in one row above content.
   */

  .guc-ref-modal__container {
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: flex-start;
    padding: 0;
    max-width: 100%;
  }

  /* Close stays absolutely positioned, top-right of viewport */
  .guc-ref-modal__close {
    position: fixed;
    top: 1rem;
    right: 1rem;
    color: #fff;
  }

  /* Both nav buttons share a single row above the content box */
  .guc-ref-modal__nav--prev {
    order: 1;
    flex: 0 0 50%;
    max-width: 50%;
    justify-content: flex-start;
    padding: 0.75rem 1rem;
    opacity: 1;
  }

  .guc-ref-modal__nav--next {
    order: 2;
    flex: 0 0 50%;
    max-width: 50%;
    justify-content: flex-end;
    padding: 0.75rem 1rem;
    opacity: 1;
  }

  /* Content takes the full row below the nav buttons */
  .guc-ref-modal__content {
    order: 3;
    flex: 0 0 100%;
    flex-direction: column;
    padding: 1.5rem;
    max-height: 75vh;
    border-radius: 8px 8px 0 0;
    gap: 1.25rem;
    overflow-y: auto;
  }

  .guc-ref-modal__photo {
    flex: 0 0 auto;
    width: 160px;
    margin: 0 auto;
  }
}
