/* Routenplaner24 – site styles (on top of Bootstrap 5). */

body {
  font-size: 18px;
  line-height: 28px;
  background: #fff;
}

h2, .h2 {
  font-size: 20px;
  line-height: 30px;
}

.container { max-width: 1002px; }

.site-logo { width: 32px; height: 32px; }

/* Language switcher (flag + native name, far right of the navbar) */
.flag {
  width: 24px;
  height: 16px;
  object-fit: cover;
  border-radius: 2px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .15);
  flex-shrink: 0;
}
.lang-switch .btn { border: 0; font-size: inherit; line-height: inherit; color: rgba(0, 0, 0, .55); }
.lang-switch .btn:hover, .lang-switch .btn.show { color: rgba(0, 0, 0, .7); }
.lang-switch .btn:focus { box-shadow: none; }
.lang-switch .dropdown-menu { min-width: 0; font-size: 14px; line-height: 20px; }
.lang-switch .dropdown-item { padding: 6px 14px; }
.lang-switch .dropdown-item.lang-country { padding-left: 36px; font-size: 13px; }
.lang-switch .lang-country .flag { width: 21px; height: 14px; }
.lang-switch .btn:focus-visible { outline: 2px solid #0d6efd; outline-offset: 2px; }

.skip-link {
  position: absolute;
  left: 8px;
  top: 8px;
  z-index: 2000;
  background: #fff;
  padding: 4px 8px;
}

.form-control { border: 1px solid #ced4da; }
.form-control:focus, .btn:focus { box-shadow: 0 0 0 .2rem rgba(13, 110, 253, .2); }

@media (max-width: 767.98px) {
  body { overflow-x: hidden; }
}

/* Route planner ---------------------------------------------------------- */
.route-map {
  position: relative;
  width: 100%;
  min-width: 290px;
  height: 600px;
  background: #e9ecef;
  border-radius: .25rem;
}
.route-map.has-route { height: 390px; }   /* 35% less once a route is shown */
/* Desktop: form column a bit wider than col-lg-4 (33.3%) so the form and a 336px-wide side ad fit */
@media (min-width: 992px) {
  .rp-layout > .col-lg-4 { flex: 0 0 auto; width: 37%; }
  .rp-layout > .col-lg-8 { flex: 0 0 auto; width: 63%; display: flex; flex-direction: column; }
  /* Before a route: the map is as tall as the left column (form + side ad) */
  .rp-layout .route-map:not(.has-route) { flex: 1 1 auto; height: auto; min-height: 420px; }
  .rp-layout #directionsItinerary:empty { margin-top: 0 !important; }
}
@media (max-width: 767.98px) {
  .route-map { height: 420px; }
  .route-map.has-route { height: 273px; }
}

#found { font-size: .9em; }
.rp-avoid { border: 0; padding: 0; margin: 0; min-width: 0; }
.rp-avoid-title { float: none; width: auto; font-size: .85rem; color: #6c757d; margin-bottom: .25rem; }
.rp-avoid-toggle { text-decoration: none; }
.rp-avoid-chevron { font-size: .7em; transition: transform .2s; }
.rp-avoid-toggle:not(.collapsed) .rp-avoid-chevron { transform: rotate(180deg); }
.rp-avoid-count { display: inline-block; margin-left: .3em; padding: 0 .45em; border-radius: 1em; background: #0d6efd; color: #fff; font-size: .75em; font-weight: 600; }
.rp-avoid-count[hidden] { display: none; }
.rp-avoid-list { padding-top: .25rem; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 1rem; font-size: .9rem; }
.rp-avoid-list .form-check { margin-bottom: .15rem; }
.rp-avoid-list .form-check:last-child:nth-child(odd) { grid-column: 1 / -1; } /* long last label ("Unbefestigte Straßen") on its own row */
.rp-avoid-list .form-check-input, .rp-avoid-list .form-check-label { cursor: pointer; }
.rp-live-badge { background: #d1e7dd; color: #0f5132; font-weight: 600; font-size: .72rem; padding: .35em .6em; }
#found:empty { padding-top: 0 !important; }

/* Form: A / stops / B fields with letter badges */
.rp-field { margin-bottom: .5rem; }
.rp-field .form-label { font-size: .85em; }
.rp-input { display: flex; align-items: center; gap: .5rem; }
.rp-input .form-control { flex: 1 1 auto; min-width: 0; }
.rp-badge, .rp-marker span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 26px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
}
.rp-badge-start, .rp-marker-start span { background: #198754; }
.rp-badge-end, .rp-marker-end span { background: #dc3545; }
.rp-badge-stop, .rp-marker-stop span { background: #0d6efd; }
.rp-remove { flex: 0 0 34px; padding: .25rem 0; color: #6c757d; }
/* With stops present, keep A/B fields as wide as the stop fields (which have a remove button). */
#rpform.has-stops .rp-field:not(.rp-stop) .rp-input::after { content: ''; flex: 0 0 34px; }
.rp-remove:hover { color: #dc3545; }
.rp-add-stop { text-decoration: none; }
.rp-add-stop[hidden] { display: none; }

/* Leaflet markers (L.divIcon) */
.rp-marker { background: none; border: 0; }
.rp-marker span {
  width: 28px;
  height: 28px;
  border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .4);
}

.route-summary { text-align: left; }
.rp-traffic { display: block; font-weight: 600; }
.rp-traffic-ok { color: #198754; }
.rp-traffic-delay { color: #d63384; }
.route-summary.active .rp-traffic, .route-summary.active .text-muted { color: #fff !important; }

.rp-legend { display: flex; flex-wrap: wrap; gap: .25rem 1rem; }
.rp-legend[hidden] { display: none; }

/* Bar under the map: traffic legend (left), Print button (right) */
.rp-map-bar { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem .75rem; }
.rp-map-bar[hidden] { display: none; }
.rp-map-bar .rp-print-status { margin-left: auto; } /* pushes status + Print button to the right */
.rp-print-btn { white-space: nowrap; }
.rp-print-title { display: none; }

/* Printing a route: only the map and the directions (route-planner.js adds body.rp-print) */
@media print {
  body.rp-print *:not(.rp-print-path):not(#rp-print-area):not(#rp-print-area *) { display: none !important; }
  body.rp-print .rp-print-path, body.rp-print #rp-print-area { margin: 0 !important; padding: 0 !important; width: auto !important; max-width: none !important; }
  body.rp-print #rp-print-area .rp-print-btn,
  body.rp-print #rp-print-area .rp-print-status,
  body.rp-print #rp-print-area .leaflet-control-zoom { display: none !important; }
  body.rp-print .rp-print-title { display: block; font-size: 16pt; font-weight: 600; margin-bottom: 8px; }
  body.rp-print .route-map { page-break-inside: avoid; break-inside: avoid; border-radius: 0; }
  body.rp-print #directionsItinerary .list-group-item { break-inside: avoid; padding: 4px 8px; }
  body.rp-print #directionsItinerary .list-group-item-action:hover { background: none; }
}
.rp-legend-swatch {
  display: inline-block;
  width: 18px;
  height: 5px;
  margin-right: .35rem;
  border-radius: 3px;
  vertical-align: middle;
}

.rp-leg {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: .25rem 1rem;
  background: #f1f5fb;
  font-size: .9em;
}
.rp-leg-title { font-weight: 600; }
.rp-leg-meta { color: #6c757d; }

.step-instruction { cursor: pointer; font-size: .95em; }
.step-icon { width: 25px; text-align: center; margin-right: 10px; }

@media (min-width: 768px) {
  .sticky-side { position: sticky; top: 20px; }
}

@keyframes rp-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(13, 110, 253, .6); }
  100% { box-shadow: 0 0 0 14px rgba(13, 110, 253, 0); }
}
.rp-pulse { animation: rp-pulse 1s ease-out 3; }

/* Landing page content (home + country pages) ---------------------------- */
.landing-text h2 { margin-top: 2rem; }
.popular-routes { font-size: 16px; }
.popular-routes td, .popular-routes th { padding: .45rem .5rem; }
.rules-table { font-size: 16px; }
.rules-table th { width: 38%; font-weight: 600; }
.steps .card { border-top: 3px solid #0d6efd; }
.step-number {
  width: 36px;
  height: 36px;
  margin-bottom: .5rem;
  border-radius: 50%;
  background: #0d6efd;
  color: #fff;
  font-weight: 700;
  line-height: 36px;
  text-align: center;
}
.faq-item { border: 1px solid #dee2e6; border-radius: .375rem; margin-bottom: .5rem; background: #fff; }
.faq-item summary {
  padding: .75rem 1rem;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  position: relative;
  padding-right: 2.5rem;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: '+';
  position: absolute;
  right: 1rem;
  top: .6rem;
  font-size: 1.3em;
  color: #0d6efd;
}
.faq-item[open] summary::after { content: '\2212'; }
.faq-item summary:focus-visible { outline: 2px solid #0d6efd; outline-offset: -2px; }
.faq-answer { padding: 0 1rem .25rem; }

/* Articles / text pages -------------------------------------------------- */
.feature-list span { display: inline-block; margin: 0 .5rem; }
.entry-content img { max-width: 100%; height: auto; }
.sitemap-list li { margin-bottom: .25rem; }

/* Footer ----------------------------------------------------------------- */
.site-footer { font-size: .8em; }
.footer-menu { list-style: none; margin: 0; padding: 0; }
.footer-menu li { display: inline-block; margin-left: 1rem; }
.footer-menu li:first-child { margin-left: 0; }
.footer-menu a { color: #6c757d; text-decoration: none; }
.footer-menu a:hover { text-decoration: underline; }

/* Ads (Assertive Yield) -------------------------------------------------- */
.ad-slot:empty { display: none; }
.ad-slot { margin: 1rem 0; text-align: center; }

#aymStickyFooter {
  position: fixed;
  bottom: 0;
  right: 0;
  z-index: 1040;
  background: #fff;
  border-top: 1px solid #efefef;
  border-left: 1px solid #efefef;
}
#aymStickyFooter.empty { border-top: 0; border-left: 0; }
#aymStickyFooter.empty #aymStickyFooterClose { display: none; }
#aymStickyFooterClose {
  position: absolute;
  top: -22px;
  right: 5px;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, .5);
  color: #fff;
  font: 16px/22px sans-serif;
  cursor: pointer;
}

/* Rewarded ad modal ------------------------------------------------------ */
.rp-modal-body { padding: 20px; }
.rp-modal-icon { font-size: 4em; color: #4caf50; }
.rp-modal-title { font-size: 30px; line-height: 1.3; margin-bottom: 8px; }
.rp-modal-text { font-size: 14px; margin-bottom: 0; }
.watch-ad-btn { width: 90%; margin: 0 auto 20px; }
.no-ad-btn { opacity: .3; }
@media (min-width: 900px) {
  .rp-modal-content { margin: 3% auto 5%; }
}
@media (max-width: 575.98px) {
  .rp-modal-title { font-size: 22px; }
}
