/* Small layout fixes that apply site-wide. */

/* Sections reached from the menu stop below the sticky header instead of under it. */
main [id] { scroll-margin-top: 90px; }
@media (max-width: 880px) {
  main [id] { scroll-margin-top: 80px; }
}

/* Card grids use auto-fit with 260-320 px minimum columns (style.css and inline styles in the
   templates). On phones narrower than that minimum the single column overflowed the screen;
   below 480 px these grids are one column anyway, so let that column shrink to fit. */
@media (max-width: 480px) {
  .country-grid,
  .diseases-grid,
  [style*="minmax(260px"],
  [style*="minmax(280px"],
  [style*="minmax(300px"],
  [style*="minmax(320px"] {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  /* Long words in large headings (e.g. "Wohnsitzbescheinigung") are wider than a narrow phone. */
  :is(h1, h2, h3) {
    overflow-wrap: break-word;
    hyphens: auto;
  }

  /* Some templates force buttons onto one line inline; let them wrap instead of overflowing. */
  .button[style*="nowrap"] {
    white-space: normal !important;
  }
}

/* Recommended badge sits 12px above the card: the spotlight card must not clip it (the glow layer is inset:0 and already stays inside the card) */
.comparison-card--vip.spotlight-card { overflow: visible; }
.comparison-card--vip .popular-badge { z-index: 3; }

/* pdl-layout-fix-2: found by the full-site layout scan */
/* Breadcrumb: the current page title wraps instead of ending in an ellipsis */
.pdl-breadcrumb__item[aria-current="page"] span { overflow: visible; text-overflow: clip; white-space: normal; }
@media (max-width: 640px) {
  .pdl-breadcrumb__list { flex-wrap: wrap; white-space: normal; overflow: visible; row-gap: 2px; }
  .pdl-breadcrumb__item { flex-shrink: 1; min-width: 0; }
}
/* Package buttons: long labels (FR/RU/DE) wrap instead of being cut */
.package-card .button { white-space: normal; line-height: 1.3; text-align: center; padding-left: 16px; padding-right: 16px; }
/* Comparison tables on phones: tighter cells so less has to scroll sideways */
@media (max-width: 480px) {
  .comparison-table th, .comparison-table td { padding: 10px 8px; font-size: 13px; }
  .table-responsive { -webkit-overflow-scrolling: touch; }
}

/* WCAG 2.5.8: stand-alone footer, card and attribution links get a 24px minimum target. */
.footer-links a,
.footer-contact-item a,
.footer-legal__links a,
.pdl-route__credit a {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
}
.package-footer a {
  display: flex;
  align-items: center;
  min-height: 24px;
}

/* Country cards: when title and badge do not fit on one line (RU/FR at 320px) the badge wraps below the title instead of sticking out of the card. */
.country-card__header {
  flex-wrap: wrap;
  gap: 8px 12px;
}
.country-card__title {
  min-width: 0;
}

/* Related guides: three to six next steps at the end of every content page. */
.pdl-related {
  padding: 44px 0 36px;
  background: #ffffff;
  border-top: 1px solid #e2e8f0;
}
.pdl-related__title {
  margin: 0 0 20px;
  font-size: 1.35rem;
  line-height: 1.25;
  color: #0a0f1a;
}
.pdl-related__list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}
@media (min-width: 640px) {
  .pdl-related__list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1024px) {
  .pdl-related__list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.pdl-related__list li {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 18px 20px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}
.pdl-related__list li:hover,
.pdl-related__list li:focus-within {
  border-color: #047857;
  box-shadow: 0 6px 18px rgba(4, 120, 87, 0.12);
}
.pdl-related__link {
  font-weight: 700;
  font-size: 1rem;
  line-height: 1.35;
  color: #047857;
  text-decoration: none;
}
.pdl-related__link:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}
.pdl-related__link:focus-visible {
  outline: 2px solid #047857;
  outline-offset: 3px;
  border-radius: 3px;
}
.pdl-related__text {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 0.875rem;
  line-height: 1.55;
  color: #475569;
}
.pdl-related__all {
  margin: 18px 0 0;
  font-weight: 600;
}
.pdl-related__all a {
  display: inline-block;
  padding: 3px 0;
  color: #047857;
}

/* Overview page: every guide, grouped by the customer's journey. */
.pdl-guides {
  padding-bottom: 24px;
}
.pdl-guides .section-header {
  text-align: left;
}
.pdl-guides .section-subtitle {
  margin: 12px 0 0;
  max-width: 62ch;
}
.pdl-guides__group {
  margin-top: 44px;
}
.pdl-guides__title {
  margin: 0 0 18px;
  font-size: 1.35rem;
  line-height: 1.25;
  color: #0a0f1a;
}

/* Author, review date and official sources at the end of every content page. */
.pdl-author {
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
  padding: 28px 0;
  color: #334155;
  font-size: 0.9rem;
  line-height: 1.6;
}
.pdl-author__inner p {
  margin: 0 0 6px;
}
.pdl-author__inner p:last-child {
  margin-bottom: 0;
}
.pdl-author a {
  display: inline-block;
  padding: 3px 0;
  color: #047857;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.pdl-author a:hover {
  color: #065f46;
}
.pdl-author a:focus-visible {
  outline: 2px solid #047857;
  outline-offset: 2px;
  border-radius: 2px;
}
.pdl-author__label {
  font-weight: 700;
  color: #0f172a;
}
.pdl-author__sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* Contrast: inline text colors on light table cells that sat just under 4.5:1 (3.6:1 and 4.4:1). */
.conversion-table td[style*="#059669" i] {
  color: #047857 !important;
}
td[style*="#DC2626" i] {
  color: #b91c1c !important;
}

/* Brand mark (ID card + check) inside the dark logo tile; the tile keeps its square size when the title wraps. */
.brand-icon {
  flex: none;
}
.brand-icon img {
  display: block;
  width: 70%;
  height: auto;
}
