/* ==========================================================================
   Padelinn — country explorer: home atlas + "clubs by country" mega menu.
   ========================================================================== */

.pdl-mega, .pdl-atlas {
	--pdl-court: #1F4E9E; --pdl-ink: #14213D; --pdl-ball: #E4F222; --pdl-turf: #2E7A57;
	--pdl-court-deep: color-mix(in srgb, var(--pdl-court) 78%, #000);
	--pdl-court-soft: color-mix(in srgb, var(--pdl-court) 10%, #fff);
	--pdl-mist: #F1F4F9; --pdl-muted: #59647A;
	--pdl-line: rgba(20, 33, 61, .12); --pdl-line-strong: rgba(20, 33, 61, .22);
	font-family: var(--pdl-font, inherit);
}
.pdl-mega *, .pdl-atlas * { box-sizing: border-box; }
.pdl-mega ul, .pdl-atlas ul { list-style: none; margin: 0; padding: 0; }
.pdl-mega li, .pdl-atlas li { margin: 0; padding: 0; }
.pdl-mega .pdl-icon, .pdl-atlas .pdl-icon { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.pdl-mega [hidden], .pdl-atlas [hidden] { display: none !important; }

/* Shared: region chips + country code badge */
.pdl-mega .mg-regions button, .pdl-atlas .at-regions button {
	border: 0; background: transparent; padding: 7px 12px; border-radius: 999px; font: inherit; font-size: .86rem; font-weight: 700;
	color: var(--pdl-muted); cursor: pointer; white-space: nowrap; box-shadow: inset 0 0 0 1px var(--pdl-line);
}
.pdl-mega .mg-regions button:hover, .pdl-atlas .at-regions button:hover { color: var(--pdl-ink); box-shadow: inset 0 0 0 1px var(--pdl-line-strong); }
.pdl-mega .mg-regions button.is-on, .pdl-atlas .at-regions button.is-on { background: var(--pdl-ink); color: #fff; box-shadow: none; }
.pdl-mega .mg-iso, .pdl-atlas .at-iso { display: inline-grid; place-items: center; min-width: 32px; height: 22px; padding: 0 5px; border-radius: 6px; background: var(--pdl-court-soft); color: var(--pdl-court); font-size: .72rem; font-weight: 800; letter-spacing: .04em; flex: none; }

/* ==========================================================================
   Home atlas
   ========================================================================== */
.pdl-atlas {
	display: grid; grid-template-columns: minmax(280px, .85fr) minmax(0, 1.15fr); min-height: 440px;
	border-radius: 24px; overflow: hidden; background: #fff; box-shadow: inset 0 0 0 1px var(--pdl-line), 0 40px 80px -60px rgba(20, 33, 61, .5);
}
.pdl-atlas .at-list { display: flex; flex-direction: column; height: 0; min-height: 100%; /* as tall as the card, list scrolls */ border-right: 1px solid var(--pdl-line); background: var(--pdl-mist); }
.pdl-atlas .at-tools { display: grid; gap: 10px; padding: 16px; border-bottom: 1px solid var(--pdl-line); }
.pdl-atlas .at-filter { display: flex; align-items: center; gap: 8px; padding: 0 12px; height: 44px; border-radius: 12px; background: #fff; box-shadow: inset 0 0 0 1px var(--pdl-line); color: var(--pdl-muted); }
.pdl-atlas .at-filter:focus-within { box-shadow: inset 0 0 0 2px var(--pdl-court); color: var(--pdl-court); }
.pdl.pdl-home .pdl-atlas .at-filter input { flex: 1; min-width: 0; border: 0; background: transparent; outline: 0; box-shadow: none; font: inherit; font-size: .98rem; color: var(--pdl-ink); padding: 0; height: 100%; }
.pdl-atlas .at-regions { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.pdl-atlas .at-regions::-webkit-scrollbar { display: none; }
.pdl-atlas .at-countries { flex: 1; overflow-y: auto; padding: 8px; scrollbar-width: thin; }
.pdl-atlas .at-countries a, .pdl-atlas .at-countries a:visited {
	position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 4px 12px;
	padding: 11px 12px; border-radius: 12px; color: var(--pdl-ink); text-decoration: none; transition: background .15s;
}
.pdl-atlas .at-countries a:hover { background: #fff; }
.pdl-atlas .at-countries a[aria-current="true"] { background: var(--pdl-ink); color: #fff; }
.pdl-atlas .at-countries a[aria-current="true"] .at-iso { background: var(--pdl-ball); color: var(--pdl-ink); }
.pdl-atlas .at-name { font-weight: 750; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pdl-atlas .at-n { font-variant-numeric: tabular-nums; font-weight: 700; font-size: .9rem; color: var(--pdl-muted); }
.pdl-atlas a[aria-current="true"] .at-n { color: rgba(255, 255, 255, .75); }
.pdl-atlas .at-bar { grid-column: 2 / -1; height: 3px; border-radius: 3px; background: var(--pdl-line); overflow: hidden; }
.pdl-atlas .at-bar i { display: block; height: 100%; border-radius: 3px; background: var(--pdl-court); }
.pdl-atlas a[aria-current="true"] .at-bar { background: rgba(255, 255, 255, .15); }
.pdl-atlas a[aria-current="true"] .at-bar i { background: var(--pdl-ball); }
.pdl-atlas .at-none { padding: 16px; color: var(--pdl-muted); }

.pdl-atlas .at-detail { position: relative; min-width: 0; }
.pdl-atlas .at-card { display: flex; flex-direction: column; gap: 22px; min-height: 100%; padding: clamp(22px, 3vw, 40px); }
.pdl-atlas .at-card__head { display: flex; align-items: center; gap: 14px; }
.pdl-atlas .at-card__iso { display: inline-grid; place-items: center; width: 56px; height: 40px; border-radius: 10px; background: var(--pdl-court); color: #fff; font-weight: 850; letter-spacing: .05em; }
.pdl-atlas .at-card h3 { margin: 0; font-size: clamp(1.7rem, 3vw, 2.5rem); line-height: 1.05; font-weight: 850; letter-spacing: -.035em; }
.pdl-atlas .at-card h3 a, .pdl-atlas .at-card h3 a:visited { color: var(--pdl-ink); text-decoration: none; }
.pdl-atlas .at-card h3 a:hover { color: var(--pdl-court); }
.pdl.pdl-home .pdl-atlas dl.at-card__stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 0; padding: 0; }
.pdl.pdl-home .pdl-atlas dl.at-card__stats > div { padding: 0 16px; border-left: 1px solid var(--pdl-line); }
.pdl.pdl-home .pdl-atlas dl.at-card__stats > div:first-child { padding-left: 0; border-left: 0; }
.pdl.pdl-home .pdl-atlas dl.at-card__stats dd { margin: 0; padding: 0; font-size: clamp(1.6rem, 2.8vw, 2.3rem); font-weight: 850; letter-spacing: -.035em; font-variant-numeric: tabular-nums; line-height: 1; color: var(--pdl-ink); }
.pdl.pdl-home .pdl-atlas dl.at-card__stats dt { margin: 6px 0 0; padding: 0; color: var(--pdl-muted); font-size: .88rem; font-weight: 600; }
.pdl-atlas .at-card__h { margin: 0 0 -10px; font-weight: 750; font-size: .92rem; color: var(--pdl-muted); }
.pdl-atlas .at-card__cities { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 6px 10px; }
.pdl-atlas .at-card__cities a, .pdl-atlas .at-card__cities a:visited { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 10px 12px; border-radius: 10px; background: var(--pdl-mist); color: var(--pdl-ink); text-decoration: none; font-weight: 650; transition: background .15s, color .15s; }
.pdl-atlas .at-card__cities a:hover { background: var(--pdl-court); color: #fff; }
.pdl-atlas .at-card__cities span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pdl-atlas .at-card__cities small { color: var(--pdl-muted); font-variant-numeric: tabular-nums; }
.pdl-atlas .at-card__cities a:hover small { color: rgba(255, 255, 255, .8); }
.pdl-atlas .at-card__cta { margin-top: auto; align-self: flex-start; }

@media (max-width: 860px) {
	.pdl-atlas { grid-template-columns: minmax(0, 1fr); min-height: 0; }
	.pdl-atlas .at-list, .pdl-atlas .at-detail { min-width: 0; }
	.pdl-atlas .at-list { height: auto; min-height: 0; border-right: 0; border-bottom: 1px solid var(--pdl-line); }
	.pdl-atlas .at-countries { display: flex; overflow-x: auto; overflow-y: hidden; gap: 6px; padding: 10px 12px; scroll-snap-type: x proximity; }
	.pdl-atlas .at-countries li { flex: none; scroll-snap-align: start; }
	.pdl-atlas .at-countries a, .pdl-atlas .at-countries a:visited { display: flex; padding: 9px 12px; background: #fff; box-shadow: inset 0 0 0 1px var(--pdl-line); white-space: nowrap; }
	.pdl-atlas .at-countries a[aria-current="true"] { background: var(--pdl-ink); color: #fff; box-shadow: none; }
	.pdl-atlas .at-bar { display: none; }
	.pdl-atlas .at-card { padding: 20px 16px 22px; gap: 18px; }
	.pdl-atlas .at-card__cities { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.pdl-atlas .at-card__cities li:nth-child(n+7) { display: none; }
	.pdl.pdl-home .pdl-atlas dl.at-card__stats > div { padding: 0 10px; }
	.pdl-atlas .at-card__cta { align-self: stretch; }
}

/* ==========================================================================
   Mega menu: continents (left) → countries (right)
   ========================================================================== */
.pdl-mega { position: fixed; inset: 0; z-index: 100000; display: none; }
.pdl-mega.is-open { display: block; }
.pdl-mega .mg-scrim { position: absolute; inset: var(--mg-top, 80px) 0 0; background: rgba(20, 33, 61, .32); }
.pdl-mega .mg-panel {
	position: absolute; top: var(--mg-top, 80px); left: 0; right: 0; max-height: calc(100vh - var(--mg-top, 80px) - 24px); overflow: hidden;
	background: #fff; border-top: 1px solid var(--pdl-line); box-shadow: 0 30px 60px -30px rgba(20, 33, 61, .45);
}
.pdl-mega .mg-inner { width: min(95%, calc(100% - 32px)); margin: 0 auto; display: grid; grid-template-columns: 300px minmax(0, 1fr); max-height: inherit; }

/* Rail */
.pdl-mega .mg-rail { display: flex; flex-direction: column; gap: 6px; margin: 20px 0; padding: 22px 14px 18px; border-radius: 18px; background: var(--pdl-ink); color: #fff; }
.pdl-mega .mg-h { margin: 0 10px 10px; font-size: 1.25rem; font-weight: 850; letter-spacing: -.02em; color: #fff; }
.pdl-mega .mg-tabs { display: grid; gap: 2px; }
#pdl-mega .mg-tabs button {
	display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; margin: 0; padding: 12px 12px; border: 0; border-radius: 12px;
	background: transparent; color: rgba(255, 255, 255, .78); font: inherit; font-size: 1rem; font-weight: 700; text-align: left; cursor: pointer; box-shadow: none;
}
#pdl-mega .mg-tabs button .pdl-icon { width: 16px; height: 16px; opacity: 0; transform: translateX(-4px); transition: opacity .12s, transform .12s; }
#pdl-mega .mg-tabs button:hover { color: #fff; background: rgba(255, 255, 255, .07); }
#pdl-mega .mg-tabs button[aria-selected="true"] { background: #fff; color: var(--pdl-ink); }
#pdl-mega .mg-tabs button[aria-selected="true"] .pdl-icon { opacity: 1; transform: none; color: var(--pdl-court); }
.pdl-mega .mg-rail__foot { margin-top: auto; padding: 16px 10px 0; display: grid; gap: 12px; justify-items: start; border-top: 1px solid rgba(255, 255, 255, .12); }
#pdl-mega .mg-near { display: inline-flex; align-items: center; gap: 8px; margin: 0; padding: 8px 12px; border: 0; border-radius: 999px; background: var(--pdl-ball); color: var(--pdl-ink); font: inherit; font-weight: 750; font-size: .9rem; cursor: pointer; box-shadow: none; }
.pdl-mega .mg-msg { margin: 0; color: var(--pdl-ball); font-size: .86rem; }
.pdl-mega .mg-all, .pdl-mega .mg-all:visited { color: #fff; font-weight: 700; font-size: .92rem; text-decoration: underline; text-underline-offset: 4px; text-decoration-color: rgba(255, 255, 255, .4); }
.pdl-mega .mg-all:hover { text-decoration-color: var(--pdl-ball); }

/* Countries */
.pdl-mega .mg-main { display: flex; flex-direction: column; min-height: 0; padding: 20px 0 22px 32px; max-height: calc(100vh - var(--mg-top, 80px) - 24px); overflow-x: hidden; overflow-y: auto; }
.pdl-mega .mg-tools { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.pdl-mega .mg-filter { display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px; border-radius: 12px; background: var(--pdl-mist); color: var(--pdl-muted); width: min(320px, 100%); }
.pdl-mega .mg-filter:focus-within { box-shadow: inset 0 0 0 2px var(--pdl-court); color: var(--pdl-court); }
.pdl.pdl-mega .mg-filter input { border: 0; outline: 0; background: transparent; box-shadow: none; font: inherit; font-size: .95rem; color: var(--pdl-ink); width: 100%; padding: 0; height: 100%; }
#pdl-mega button.mg-close { margin: 0 0 0 auto; display: inline-grid; place-items: center; width: 40px; min-width: 0; height: 40px; padding: 0; border: 0; border-radius: 50%; background: var(--pdl-mist); color: var(--pdl-ink); cursor: pointer; box-shadow: none; }
#pdl-mega button.mg-close:hover { background: var(--pdl-ink); color: #fff; }
.pdl-mega .mg-pane { padding-top: 10px; }
.pdl-mega .mg-pane__h { margin: 0 0 10px; font-size: 1.05rem; font-weight: 850; color: var(--pdl-ink); letter-spacing: -.01em; }
.pdl-mega .mg-list { columns: 4 180px; column-gap: 28px; padding: 0 10px 0 0; }
.pdl-mega .mg-list li { break-inside: avoid; }
.pdl-mega .mg-list a, .pdl-mega .mg-list a:visited { display: block; padding: 7px 10px; margin: 0 0 0 -10px; border-radius: 8px; color: var(--pdl-ink); font-size: .97rem; font-weight: 550; text-decoration: none; }
.pdl-mega .mg-list a:hover, .pdl-mega .mg-list a:focus-visible { background: var(--pdl-mist); color: var(--pdl-court); }
.pdl-mega .mg-none { color: var(--pdl-muted); padding: 12px 0; margin: 0; }
.pdl-mega.is-searching .mg-pane { padding-top: 14px; }

/* Menu item that opens it */
#top-menu li.pdl-mega-item > .sub-menu { display: none !important; }
#top-menu li.pdl-mega-item:not(.menu-item-has-children) > a::after { content: ""; display: inline-block; width: 7px; height: 7px; margin-left: 7px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: translateY(-3px) rotate(45deg); }
#top-menu li.pdl-mega-item.pdl-mega-on:not(.menu-item-has-children) > a::after { transform: translateY(1px) rotate(-135deg); }
#top-menu li.pdl-mega-item.pdl-mega-on > a { color: var(--pdl-court, #1F4E9E) !important; opacity: 1 !important; }

/* Mobile: full-height sheet, continents as a row of tabs */
@media (max-width: 980px) {
	.pdl-mega .mg-scrim { inset: 0; }
	.pdl-mega .mg-panel { top: auto; bottom: 0; max-height: 90vh; border-radius: 20px 20px 0 0; overflow-y: auto; }
	.pdl-mega .mg-inner { grid-template-columns: minmax(0, 1fr); width: 100%; }
	.pdl-mega .mg-rail { margin: 0; padding: 18px 16px 14px; border-radius: 0; }
	.pdl-mega .mg-h { margin: 0 0 10px; }
	.pdl-mega .mg-tabs { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
	#pdl-mega .mg-tabs button { width: auto; white-space: nowrap; padding: 9px 14px; border-radius: 999px; font-size: .92rem; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .2); }
	#pdl-mega .mg-tabs button .pdl-icon { display: none; }
	.pdl-mega .mg-rail__foot { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-top: 12px; padding: 12px 0 0; }
	.pdl-mega .mg-main { padding: 14px 16px 28px; max-height: none; overflow: visible; }
	.pdl-mega .mg-filter { flex: 1; width: auto; }
	.pdl-mega .mg-list { columns: 2; column-gap: 16px; }
}

/* Keep the chosen country dark even when themes style a:focus. */
.pdl.pdl-home .pdl-atlas .at-countries a[aria-current="true"],
.pdl.pdl-home .pdl-atlas .at-countries a[aria-current="true"]:focus { background: var(--pdl-ink); color: #fff; box-shadow: none; text-decoration: none; }
.pdl.pdl-home .pdl-atlas .at-countries a:focus-visible { outline: 2px solid var(--pdl-court); outline-offset: 2px; }
