/*
Theme Name: MVZ Rheingaupraxis
Theme URI: https://www.mvz-rheingaupraxis.de
Description: Barrierefreies Theme für die MVZ Rheingaupraxis — Hausarztpraxis in Eltville am Rhein.
Author: Wolfgang Steinberg
Author URI: https://artellics.com
Template: generatepress
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: rheingaupraxis
Requires at least: 6.9
Tested up to: 6.9.1
Requires PHP: 8.3
*/

/* ─── Custom Properties ───────────────────────── */
:root {
  --rp-primary: #7A9E7E;
  --rp-primary-dark: #4A6B4E;
  --rp-primary-light: #C5D8C7;
  --rp-accent: #C4973B;
  --rp-accent-dark: #8B6D2A;
  --rp-accent-light: #F5EDD6;
  --rp-doctolib: #0596DE;
  --rp-doctolib-dark: #0477B3;
  --rp-text: #2D2D2D;
  --rp-text-secondary: #555555;
  --rp-bg: #FAFAF7;
  --rp-surface: #FFFFFF;
  --rp-border: #E8E8E8;
  --rp-radius: 6px;
  --rp-radius-lg: 12px;
  --rp-max-width: 1200px;
  --rp-text-width: 720px;
  --rp-transition: 0.2s ease;
}

/* ─── Basis ───────────────────────────────────── */
body {
  background-color: var(--rp-bg);
  color: var(--rp-text);
  font-family: 'Lora', Georgia, 'Times New Roman', serif;
}

.entry-content,
.entry-content p,
.entry-content li,
.entry-content td,
.entry-content dd,
.entry-content blockquote {
  font-family: 'Lora', Georgia, 'Times New Roman', serif;
}

h1, h2, h3, h4, h5, h6,
.wp-block-heading,
.entry-title {
  font-family: 'Poppins', system-ui, -apple-system, sans-serif;
  font-weight: 600;
}

/* ─── Barrierefreiheit ────────────────────────── */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 10000;
  padding: 0.75rem 1.5rem;
  background: var(--rp-accent);
  color: var(--rp-surface);
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  text-decoration: none;
  border-radius: 0 0 var(--rp-radius) 0;
}

.skip-link:focus {
  left: 0;
  outline: 3px solid var(--rp-accent);
  outline-offset: 2px;
}

*:focus-visible {
  outline: 3px solid var(--rp-accent);
  outline-offset: 2px;
}

/* ─── Header / Navigation ─────────────────────── */
.rp-header {
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--rp-border);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.rp-header__inner {
  max-width: var(--rp-max-width);
  margin: 0 auto;
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.rp-logo {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
}

.rp-logo img,
.rp-logo svg {
  height: 48px;
  width: auto;
}

.rp-logo__text {
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  font-size: 1.125rem;
  color: var(--rp-primary-dark);
  line-height: 1.2;
  white-space: nowrap;
}

.rp-nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  font-family: 'Poppins', sans-serif;
  font-weight: 500;
  font-size: 1rem;
}

.rp-nav a {
  color: var(--rp-text);
  text-decoration: none;
  padding: 0.25rem 0;
  border-bottom: 2px solid transparent;
  transition: border-color var(--rp-transition), color var(--rp-transition);
}

.rp-nav a:hover,
.rp-nav a[aria-current="page"] {
  color: var(--rp-primary-dark);
  border-bottom-color: var(--rp-primary);
}

.rp-nav__cta {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1.75rem;
  background: var(--rp-doctolib);
  color: var(--rp-surface) !important;
  border: none;
  border-radius: var(--rp-radius);
  font-weight: 600;
  text-decoration: none !important;
  border-bottom: none !important;
  transition: background var(--rp-transition);
}

.rp-nav__cta:hover {
  background: var(--rp-doctolib-dark);
}

/* ─── Suche ──────────────────────────────────── */
.rp-nav__search {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.25rem;
  color: var(--rp-text);
  display: flex;
  align-items: center;
  transition: color var(--rp-transition);
}

.rp-nav__search:hover {
  color: var(--rp-primary-dark);
}

.rp-nav__search svg {
  width: 22px;
  height: 22px;
}

.rp-search-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  align-items: flex-start;
  justify-content: center;
  padding-top: 6rem;
}

.rp-search-overlay.is-open {
  display: flex;
}

.rp-search-overlay__inner {
  background: var(--rp-surface);
  border-radius: var(--rp-radius-lg);
  padding: 1.5rem;
  width: 90%;
  max-width: 560px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.rp-search-overlay__inner form {
  display: flex;
  gap: 0.5rem;
}

.rp-search-overlay__inner input[type="search"] {
  flex: 1;
  padding: 0.75rem 1rem;
  border: 2px solid var(--rp-border);
  border-radius: var(--rp-radius);
  font-family: 'Poppins', sans-serif;
  font-size: 1rem;
  color: var(--rp-text);
  background: var(--rp-bg);
  outline: none;
  transition: border-color var(--rp-transition);
}

.rp-search-overlay__inner input[type="search"]:focus {
  border-color: var(--rp-primary);
}

.rp-search-overlay__inner button[type="submit"] {
  padding: 0.75rem 1.25rem;
  background: var(--rp-primary);
  color: var(--rp-surface);
  border: none;
  border-radius: var(--rp-radius);
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--rp-transition);
}

.rp-search-overlay__inner button[type="submit"]:hover {
  background: var(--rp-primary-dark);
}

/* ─── Mobile Navigation ───────────────────────── */
.rp-hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  color: var(--rp-text);
}

.rp-hamburger svg {
  width: 28px;
  height: 28px;
}

@media (max-width: 768px) {
  .rp-logo__text {
    display: none;
  }

  .rp-nav {
    display: none;
  }

  .rp-nav.is-open {
    display: flex;
    flex-direction: column;
    position: fixed;
    inset: 0;
    background: var(--rp-surface);
    z-index: 200;
    padding: 5rem 2rem 2rem;
    align-items: flex-start;
    gap: 1.5rem;
    font-size: 1.25rem;
  }

  .rp-nav.is-open .rp-nav__cta {
    width: 100%;
    justify-content: center;
    margin-top: 1rem;
    padding: 1rem;
    font-size: 1.125rem;
  }

  .rp-hamburger {
    display: block;
  }
}

/* ─── Doctolib-Widget (fixiert, offizielle Spezifikation) ── */
.rp-doctolib-widget {
  position: fixed;
  right: 0;
  top: 200px;
  z-index: 999;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  width: auto;
  background: var(--rp-doctolib);
  color: #fff;
  border-radius: 4px 0 0 4px;
  box-shadow: 1px 2px 4px rgba(0, 0, 0, 0.2);
  padding: 5px;
  font-family: 'Poppins', sans-serif;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.4;
  opacity: 0.8;
}

.rp-doctolib-widget__logo {
  display: inline-block;
  height: 18px;
  width: auto;
  margin: 3px 0;
  vertical-align: middle;
}

.rp-doctolib-widget a {
  display: block;
  width: 100%;
  padding: 6px;
  margin-top: 5px;
  background: #fff;
  color: var(--rp-doctolib) !important;
  text-decoration: none !important;
  border-radius: 4px;
  font-size: 16px;
  font-weight: 700;
  transition: background var(--rp-transition), color var(--rp-transition);
}

.rp-doctolib-widget a:hover {
  background: #e8f4fb;
  opacity: 0.9;
}

@media (max-width: 768px) {
  .rp-doctolib-widget {
    top: auto;
    bottom: 0;
    right: 0;
    left: 0;
    width: 100%;
    flex-direction: row;
    border-radius: 0;
    justify-content: center;
    gap: 8px;
    padding: 8px 16px;
  }

  .rp-doctolib-widget__logo {
    margin-bottom: 0;
    font-size: 12px;
  }

  .rp-doctolib-widget a {
    margin-top: 0;
    padding: 6px 12px;
    width: auto;
  }

  body {
    padding-bottom: 3rem;
  }
}

/* ─── GeneratePress Overrides ────────────────── */
.inside-article {
  background: transparent !important;
  padding: 0 !important;
}

body:not(.home) .inside-article {
  padding-top: 24px !important;
}

.site-main {
  margin-top: 0 !important;
  margin-bottom: 0 !important;
}

/* ─── Sektionen ───────────────────────────────── */
.rp-section {
  padding: 3rem 1rem;
}

.rp-section--alt {
  background: var(--rp-primary-light);
}

.rp-section--warm {
  background: var(--rp-accent-light);
}

.rp-section__inner {
  max-width: var(--rp-max-width);
  margin: 0 auto;
}

/* Hero / Cover inner container: align text with page content */
.wp-block-cover.alignfull .wp-block-cover__inner-container {
  max-width: var(--rp-max-width);
  margin: 0 auto;
}

.rp-section__narrow {
  max-width: var(--rp-text-width);
  margin: 0 auto;
}

/* ─── Karten (Arzt, Leistung) ─────────────────── */
.rp-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

.rp-card {
  background: var(--rp-surface);
  border: 1px solid var(--rp-border);
  border-radius: var(--rp-radius-lg);
  padding: 1.5rem;
  transition: box-shadow var(--rp-transition);
}

.rp-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.rp-card__photo {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: var(--rp-radius);
  margin-bottom: 1rem;
}

.rp-card__title {
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  font-size: 1.25rem;
  margin: 0 0 0.25rem;
  color: var(--rp-text);
}

.rp-card__subtitle {
  font-family: 'Poppins', sans-serif;
  font-weight: 500;
  font-size: 0.875rem;
  color: var(--rp-primary-dark);
  margin: 0 0 0.75rem;
}

.rp-card__text {
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--rp-text-secondary);
}

.rp-card__avatar {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  margin: 0 auto 1rem;
  display: block;
  object-fit: cover;
}

.rp-card--centered {
  text-align: center;
}

.rp-card__icon {
  width: 48px;
  height: 48px;
  margin-bottom: 0.75rem;
  color: var(--rp-primary-dark);
}

/* ─── Links ──────────────────────────────────── */
.entry-content a:not(.wp-block-button__link):not(.rp-nav__cta) {
  color: var(--rp-primary-dark);
  text-decoration: underline;
  text-decoration-color: var(--rp-primary-light);
  text-underline-offset: 2px;
  transition: text-decoration-color var(--rp-transition);
}

.entry-content a:not(.wp-block-button__link):not(.rp-nav__cta):hover {
  text-decoration-color: var(--rp-primary-dark);
}

/* ─── Listen ─────────────────────────────────── */
.entry-content ul {
  list-style: none;
  padding-left: 1.5rem;
}

.entry-content ul li::before {
  content: "▸";
  color: var(--rp-primary);
  font-weight: 600;
  margin-left: -1.5rem;
  margin-right: 0.5rem;
}

.entry-content ol {
  padding-left: 1.5rem;
}

.entry-content ol li::marker {
  color: var(--rp-primary-dark);
  font-weight: 600;
}

/* ─── Trennlinien ────────────────────────────── */
.entry-content hr,
.wp-block-separator {
  border: none;
  border-top: 2px solid var(--rp-primary-light);
  opacity: 1;
  max-width: var(--rp-text-width);
  margin: 2rem auto;
}

/* ─── Buttons (Konsistenz) ───────────────────── */
.wp-block-button__link {
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  transition: background var(--rp-transition), opacity var(--rp-transition);
}

.wp-block-button__link:hover {
  opacity: 0.9;
}

.wp-block-button.is-style-outline .wp-block-button__link {
  border: 2px solid currentColor;
  background: transparent !important;
  color: var(--rp-primary-dark) !important;
}

.wp-block-button.is-style-outline .wp-block-button__link:hover {
  background: rgba(74, 107, 78, 0.08) !important;
  opacity: 1;
}

/* Outline buttons inside cover blocks: white text + border */
.wp-block-cover .wp-block-button.is-style-outline .wp-block-button__link {
  color: #fff !important;
  border-color: #fff;
}

.wp-block-cover .wp-block-button.is-style-outline .wp-block-button__link:hover {
  background: rgba(255, 255, 255, 0.15) !important;
}

/* Fix WP has-text-color !important override inside cover blocks */
.wp-block-cover .has-text-color[style*="color:#ffffff"],
.wp-block-cover .has-text-color[style*="color: #ffffff"] {
  color: #fff !important;
}

/* ─── Tabellen ───────────────────────────────── */
.rp-hours table,
.wp-block-table.rp-hours table {
  width: 100%;
  border-collapse: collapse;
  font-family: 'Poppins', sans-serif;
  font-size: 0.95rem;
  border: none;
}

.rp-hours th,
.rp-hours td,
.wp-block-table.rp-hours th,
.wp-block-table.rp-hours td {
  padding: 0.75rem 1rem;
  text-align: left;
  border: none;
  border-bottom: 1px solid var(--rp-border);
}

.rp-hours thead th,
.wp-block-table.rp-hours thead th {
  font-weight: 600;
  color: var(--rp-primary-dark);
  border-bottom: 2px solid var(--rp-primary-dark);
  background: transparent;
}

.rp-hours tbody tr:nth-child(even),
.wp-block-table.rp-hours tbody tr:nth-child(even) {
  background: var(--rp-bg);
}

.rp-hours tbody tr:last-child td,
.wp-block-table.rp-hours tbody tr:last-child td {
  border-bottom: none;
}

.rp-hours tr.is-today {
  background: var(--rp-accent-light) !important;
  font-weight: 600;
}

/* WordPress table figure wrapper reset */
.wp-block-table.rp-hours {
  border: none;
}

.wp-block-table.rp-hours figcaption {
  font-size: 0.85rem;
  color: var(--rp-text-secondary);
  text-align: center;
  margin-top: 0.5rem;
}

/* ─── Hinweisbalken ───────────────────────────── */
.rp-notice {
  background: var(--rp-accent-light);
  border-left: 4px solid var(--rp-accent);
  padding: 1rem 1.5rem;
  border-radius: 0 var(--rp-radius) var(--rp-radius) 0;
  font-family: 'Poppins', sans-serif;
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
}

.rp-notice--important {
  background: #fef2f2;
  border-left-color: var(--rp-accent);
}

/* ─── Footer ──────────────────────────────────── */
.rp-footer {
  background: var(--rp-primary-dark);
  color: var(--rp-surface);
  padding: 3rem 1rem 1.5rem;
  font-family: 'Poppins', sans-serif;
  font-size: 0.9rem;
}

.rp-footer__inner {
  max-width: var(--rp-max-width);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 2rem;
}

.rp-footer__heading {
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 1rem;
}

.rp-footer a {
  color: var(--rp-primary-light);
  text-decoration: none;
}

.rp-footer a:hover {
  color: var(--rp-surface);
  text-decoration: underline;
}

.rp-footer__legal {
  max-width: var(--rp-max-width);
  margin: 2rem auto 0;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.7);
}

.rp-footer__legal a {
  color: rgba(255, 255, 255, 0.7);
}

.rp-footer__legal a:hover {
  color: var(--rp-surface);
}

/* ─── Reduced Motion ──────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ─── Print ───────────────────────────────────── */
@media print {
  .rp-doctolib-widget,
  .rp-hamburger,
  .rp-nav__search,
  .rp-search-overlay,
  .wp-block-button,
  .wp-block-buttons,
  #cmplz-cookiebanner-container {
    display: none !important;
  }

  .rp-header {
    position: static;
    box-shadow: none;
  }

  body {
    background: #fff !important;
    color: #000 !important;
  }

  a[href]::after {
    content: " (" attr(href) ")";
    font-size: 0.85em;
    color: #555;
  }

  a[href^="#"]::after,
  a[href^="javascript"]::after,
  a[href^="tel"]::after {
    content: none;
  }
}
