/* Grandliga homepage Debt Collection Guides premium block — v7
   Strictly aligned to the approved desktop prototype:
   compact card, approved visual image, HTML badge text, oval buttons, 7 rail items. */

.gl-home-guides {
  position: relative;
  overflow: visible;
  font-family: inherit;
  margin: -70px 0 0;
  padding: 12px 0 54px;
  background: #ffffff;
}

.gl-home-guides,
.gl-home-guides * {
  box-sizing: border-box;
}

.gl-home-guides-wrapper {
  width: min(1060px, calc(100% - 56px));
  margin: 0 auto;
}

.gl-hg-shell {
  position: relative;
  overflow: hidden;
  width: 100%;
  padding: 10px 28px 20px;
  border: 1px solid #d8e3ea;
  border-radius: 18px;
  background: #ffffff;
  box-shadow: 0 14px 38px rgba(12,34,68,0.09);
}

.gl-hg-shell::before {
  content: "";
  position: absolute;
  left: -230px;
  top: -245px;
  width: 390px;
  height: 390px;
  border: 1px solid rgba(31,138,122,0.11);
  border-radius: 999px;
  box-shadow:
    0 0 0 48px rgba(31,138,122,0.028),
    0 0 0 98px rgba(12,34,68,0.018);
  pointer-events: none;
}

.gl-hg-shell::after {
  content: "";
  position: absolute;
  right: -315px;
  bottom: -320px;
  width: 520px;
  height: 520px;
  border: 1px solid rgba(148,174,192,0.13);
  border-radius: 999px;
  pointer-events: none;
}

.gl-hg-header,
.gl-hg-main,
.gl-hg-footer {
  position: relative;
  z-index: 2;
}

.gl-hg-header {
  margin: 0 0 12px;
  text-align: center;
}

.gl-hg-title {
  margin: 0;
}

.gl-hg-subtitle {
  max-width: 640px;
  margin: 0 auto 0;
  color: #5f6f84;
  font-size: clamp(14px, 1vw, 16px);
  line-height: 1.35;
}

/* Desktop: compensate for the native homepage title decoration spacing.
   Keeps the site's title style/underline, but pulls the subtitle and content upward. */
@media (min-width: 768px) {
  .gl-hg-subtitle {
    margin-top: -32px;
  }
}

.gl-hg-main {
  display: grid;
  grid-template-columns: minmax(0, 1.24fr) minmax(420px, 0.92fr);
  gap: 18px;
  align-items: stretch;
}

.gl-hg-featured-card,
.gl-hg-rail,
.gl-hg-footer {
  border: 1px solid #d8e3ea;
  background: rgba(255,255,255,0.98);
  box-shadow: 0 8px 22px rgba(12,34,68,0.05);
}

.gl-hg-featured-card {
  overflow: hidden;
  border-radius: 16px;
}

.gl-hg-visual-link,
.gl-hg-featured-country,
.gl-hg-featured-title a,
.gl-hg-rail-row,
.gl-hg-btn {
  text-decoration: none;
}

.gl-hg-visual {
  position: relative;
  height: 320px;
  overflow: hidden;
  border-radius: 16px 16px 0 0;
  background: #f5f9fc;
}

.gl-hg-visual::after {
  content: "";
  position: absolute;
  z-index: 3;

  left: -6%;
  bottom: -74px;

  width: 112%;
  height: 96px;

  pointer-events: none;
  background: #ffffff;

  border-radius: 50% 50% 0 0 / 18px 18px 0 0;

  transform: rotate(6deg);
  transform-origin: 50% 100%;
}

.gl-hg-visual-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}

.gl-hg-visual-badge {
  position: absolute;
  z-index: 5;
  top: 16px;
  left: 16px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: calc(100% - 32px);
  min-height: 32px;
  padding: 4px 14px 4px 6px;
  border-radius: 999px;
  background: rgba(255,255,255,0.95);
  box-shadow: 0 6px 16px rgba(12,34,68,0.06);
  color: #157367;
  font-size: 12px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.gl-hg-badge-star {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  background: rgba(31,138,122,0.1);
  border-radius: 50%;
  border: none;
}

.gl-hg-badge-star::before {
  content: "★";
  color: #1f8a7a;
  font-size: 14px;
  line-height: 1;
}

.gl-hg-featured-body {
  position: relative;
  z-index: 4;

  min-height: 126px;

  margin-top: -44px;
  padding: 26px 22px 5px;

  background: transparent;
}

.gl-hg-featured-country {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  max-width: 100%;
  color: #0b1f3a;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(23px, 1.48vw, 26px);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.015em;
}

.gl-hg-flag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 31px;
  height: 22px;
  font-size: 21px;
  line-height: 1;
}

/* Featured card: align the visible flag with the text column and save title width. */
.gl-hg-featured-country > .gl-hg-flag {
  width: 21px;
  justify-content: flex-start;
}

.gl-hg-featured-title {
  max-width: 520px;
  margin: 6px 0 0;
  font-size: clamp(15px, 1vw, 16px);
  line-height: 1.4;
  font-weight: 400;
}

.gl-hg-featured-title a {
  color: #0b1f3a;
}

.gl-hg-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin: 14px 0 0;
  color: #53677c;
  font-size: 13px;
  line-height: 1.25;
}

.gl-hg-tags span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.gl-hg-tags svg,
.gl-hg-views svg,
.gl-hg-rail-icon svg,
.gl-hg-stat-icon svg {
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.gl-hg-tags svg {
  width: 16px;
  height: 16px;
  color: #1f8a7a;
}

.gl-hg-featured-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 15px;
}

.gl-hg-views {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 26px;
  padding: 3px 0;
  color: #7b8999;
  font-size: 12px;
  line-height: 1;
  white-space: nowrap;
}

.gl-hg-views svg {
  width: 15px;
  height: 15px;
}

/* Right rail */
.gl-hg-rail {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 21px 20px 19px;
  border-radius: 16px;
}

.gl-hg-rail-head {
  display: flex;
  align-items: flex-start;
  gap: 13px;
  margin: 0 0 18px;
}

.gl-hg-rail-head > div:not(.gl-hg-rail-icon) {
  min-width: 0;
  flex: 1 1 auto;
}

.gl-hg-rail-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  /* Keep the globe badge perfectly circular on every language/version */
  flex: 0 0 41px;
  width: 41px;
  min-width: 41px;
  max-width: 41px;
  height: 41px;
  min-height: 41px;
  max-height: 41px;
  aspect-ratio: 1 / 1;

  border-radius: 50%;
  background: rgba(31,138,122,0.10);
  color: #1f8a7a;
}

.gl-hg-rail-icon svg {
  width: 29px;
  height: 29px;
}

.gl-hg-rail h3 {
  margin: 0;
  color: #0b1f3a;
  font-size: clamp(18px, 1.08vw, 20px);
  line-height: 1.16;
  font-weight: 700;
  letter-spacing: -0.02em;
  white-space: normal;
  overflow-wrap: break-word;
}

.gl-hg-rail p {
  max-width: 390px;
  margin: 7px 0 0;
  color: #53677c;
  font-size: 14px;
  line-height: 1.4;
}

.gl-hg-rail-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 0;
}

.gl-hg-rail-row {
  display: grid;
  grid-template-columns: minmax(142px, 1fr) auto 22px;
  align-items: center;
  min-height: 43px;
  gap: 10px;
  padding: 8px 12px;
  border: 1px solid #d8e3ea;
  border-radius: 13px;
  background: rgba(255,255,255,0.98);
  color: #0d2c52;
  box-shadow: 0 5px 14px rgba(12,34,68,0.026);
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.gl-hg-rail-row:hover {
  border-color: rgba(31,138,122,0.45);
  box-shadow: 0 8px 20px rgba(12,34,68,0.07);
  transform: translateY(-1px);
}

.gl-hg-rail-country {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.gl-hg-rail-row .gl-hg-flag {
  width: 28px;
  height: 20px;
  font-size: 19px;
}

.gl-hg-rail-country strong {
  display: block;
  overflow: hidden;
  color: #0b1f3a;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gl-hg-rail-label {
  color: #53677c;
  font-size: 13px;
  line-height: 1.2;
  white-space: nowrap;
}

.gl-hg-rail-arrow {
  color: #1f8a7a;
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
  text-align: right;
}

/* Footer */
.gl-hg-footer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  margin-top: 16px;
  padding: 14px 20px;
  border-radius: 15px;
}

.gl-hg-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  min-width: 0;
}

.gl-hg-stat {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
  padding: 0 20px;
  border-right: 1px solid #d8e3ea;
}

.gl-hg-stat:first-child {
  padding-left: 0;
}

.gl-hg-stat:last-child {
  border-right: 0;
  padding-right: 0;
}

.gl-hg-stat-icon {
  flex: 0 0 auto;
  width: 33px;
  height: 33px;
  color: #1f8a7a;
}

.gl-hg-stat-icon svg {
  width: 33px;
  height: 33px;
}

.gl-hg-stat-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 2px;
  min-width: 0;
}

.gl-hg-stat-text strong {
  color: #0d2c52 !important;
  font-size: clamp(20px, 1.5vw, 24px);
  line-height: 1;
  font-weight: 800;
}

.gl-hg-stat-text span {
  color: #53677c;
  font-size: 13px;
  line-height: 1.2;
  font-weight: 500;
}

/* Buttons */
.gl-hg-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border-radius: 999px;
  font-weight: 800;
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: 0.025em;
  white-space: nowrap;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease, color .18s ease;
}

.gl-hg-btn:hover {
  transform: translateY(-1px);
}

.gl-hg-btn-outline {
  min-height: 38px;
  padding: 0 19px;
  border: 1.5px solid #1f8a7a;
  color: #1f8a7a;
  background: #ffffff;
  font-size: 14px;
  font-weight: 500;
}

.gl-hg-btn-outline:hover {
  color: #ffffff;
  background: #1f8a7a;
}

.gl-hg-btn-primary {
  min-height: 44px;
  min-width: 260px;
  padding: 0 24px;
  color: #ffffff;
  background: linear-gradient(180deg, #1f8a7a 0%, #157367 100%);
  box-shadow: 0 10px 22px rgba(31,138,122,0.16);
  font-size: 14px;
  font-weight: 500;
}

.gl-hg-btn-primary:hover {
  box-shadow: 0 14px 28px rgba(31,138,122,0.23);
}

.gl-hg-btn-arrow {
  font-size: 17px;
  line-height: 0.8;
}

/* Keep the desktop rail height compact when its heading wraps to 2+ lines.
   JS adds .gl-hg-rail--wrapped-title after measuring the rendered heading. */
@media (min-width: 981px) {
  .gl-hg-rail.gl-hg-rail--wrapped-title .gl-hg-rail-list .gl-hg-rail-row:nth-child(n+7) {
    display: none;
  }
}

/* Responsive */
@media (max-width: 1180px) {
  .gl-home-guides-wrapper {
    width: min(1020px, calc(100% - 44px));
  }

  .gl-hg-main {
    grid-template-columns: minmax(0, 1.18fr) minmax(405px, 0.96fr);
  }

  .gl-hg-rail h3 {
    font-size: 19px;
  }

  .gl-hg-btn-primary {
    min-width: 235px;
  }
}

@media (max-width: 980px) {
  .gl-hg-main {
    grid-template-columns: 1fr;
  }

  .gl-hg-rail h3 {
    white-space: normal;
  }

  .gl-hg-footer {
    grid-template-columns: 1fr;
  }

  .gl-hg-btn-primary {
    width: 100%;
    min-width: 0;
  }
}

@media (max-width: 767px) {
  .gl-home-guides {
    margin-top: -24px;
    padding: 22px 0 44px;
    background: #ffffff;
  }

  .gl-home-guides-wrapper {
    width: calc(100% - 22px);
  }

  .gl-hg-shell {
    padding: 22px 12px 16px;
    border-radius: 20px;
  }

  .gl-hg-header {
    margin-bottom: 16px;
  }

  .gl-hg-subtitle {
    margin-top: 8px;
    font-size: 15px;
  }

  .gl-hg-main {
    gap: 17px;
  }

  .gl-hg-featured-card,
  .gl-hg-rail {
    border-radius: 18px;
  }

  .gl-hg-visual {
    height: 235px;
    border-radius: 18px 18px 0 0;
  }

  .gl-hg-visual::after {
    left: -7%;
    bottom: -26px;
    width: 114%;
    height: 64px;
    border-radius: 50% 50% 0 0 / 16px 16px 0 0;
    transform: rotate(4deg);
    transform-origin:50% 100%;
  }

  .gl-hg-visual-img {
    object-position: center top;
  }

  .gl-hg-visual-badge {
    top: 13px;
    left: 13px;
    max-width: calc(100% - 26px);
    min-height: 30px;
    gap: 7px;
    padding: 4px 11px 4px 6px;
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.035em;
  }

  .gl-hg-badge-star {
    width: 21px;
    height: 21px;
  }

  .gl-hg-badge-star::before {
    font-size: 13px;
  }

  .gl-hg-featured-body {
    min-height: 0;
    margin-top: -10px;
    padding: 14px 16px 18px;
  }

  .gl-hg-featured-country {
    gap: 9px;
    font-size: 25px;
  }

  .gl-hg-flag {
    width: 31px;
    height: 22px;
    font-size: 21px;
  }

  .gl-hg-featured-title {
    font-size: 16px;
  }

  .gl-hg-tags {
    display: flex;
    gap: 10px 18px;
    margin-top: 14px;
    font-size: 13px;
  }

  .gl-hg-tags svg {
    width: 16px;
    height: 16px;
  }

  .gl-hg-featured-bottom {
    gap: 12px;
    margin-top: 17px;
  }

  .gl-hg-btn-outline {
    min-height: 44px;
    padding: 0 19px;
    font-size: 13px;
  }

  .gl-hg-views {
    font-size: 12px;
  }

  .gl-hg-rail {
    padding: 20px 12px;
  }

  .gl-hg-rail-head {
    gap: 11px;
    margin-bottom: 17px;
  }

  .gl-hg-rail-icon {
    width: 39px;
    height: 39px;
  }

  .gl-hg-rail-icon svg {
    width: 27px;
    height: 27px;
  }

  .gl-hg-rail h3 {
    font-size: 20px;
    line-height: 1.18;
    white-space: normal;
  }

  .gl-hg-rail p {
    margin-top: 8px;
    font-size: 14px;
  }

  .gl-hg-rail-list {
    gap: 9px;
  }

  .gl-hg-rail-row {
    grid-template-columns: minmax(118px, 1fr) auto 20px;
    min-height: 50px;
    gap: 8px;
    padding: 10px 12px;
    border-radius: 16px;
  }

  .gl-hg-rail-row .gl-hg-flag {
    width: 28px;
    height: 20px;
    font-size: 19px;
  }

  .gl-hg-rail-country {
    gap: 9px;
  }

  .gl-hg-rail-country strong {
    font-size: 15px;
    font-weight: 600;
  }

  .gl-hg-rail-label {
    font-size: 13px;
  }

  .gl-hg-rail-arrow {
    font-size: 19px;
  }

  .gl-hg-footer {
    margin-top: 17px;
    padding: 17px 12px;
    border-radius: 18px;
    gap: 17px;
  }

  .gl-hg-stats {
    grid-template-columns: repeat(3, 1fr);
  }

  .gl-hg-stat {
    display: block;
    padding: 0 7px;
    text-align: center;
  }

  .gl-hg-stat:first-child {
    padding-left: 0;
  }

  .gl-hg-stat:last-child {
    padding-right: 0;
  }

  .gl-hg-stat-icon {
    width: 29px;
    height: 29px;
    margin: 0 auto 7px;
  }

  .gl-hg-stat-icon svg {
    width: 29px;
    height: 29px;
  }

  .gl-hg-stat-text {
    display: block;
  }

  .gl-hg-stat-text strong {
    display: block;
    color: #0d2c52 !important;
    font-size: 21px;
  }

  .gl-hg-stat-text span {
    display: block;
    margin-top: 4px;
    font-size: 11.5px;
  }

  .gl-hg-btn-primary {
    min-height: 48px;
    padding: 0 18px;
    font-size: 13px;
  }
}

@media (max-width: 390px) {
  .gl-hg-visual {
    height: 220px;
  }

  .gl-hg-featured-country {
    font-size: 23px;
  }

  .gl-hg-tags {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .gl-hg-rail-row {
    grid-template-columns: minmax(108px, 1fr) 20px;
  }

  .gl-hg-rail-label {
    display: none;
  }

  .gl-hg-stat-text strong {
    font-size: 19px;
  }

  .gl-hg-stat-text span {
    font-size: 10px;
  }
}
