/* ==========================================================================
   Group Directory - public stylesheet
   Mobile-first, no framework, light theme by default with optional dark mode.
   ========================================================================== */

:root {
  --primary: #0a7d6e;
  --primary-dark: #075e54;
  --primary-soft: #e3f4f0;
  --accent: #25d366;
  --accent-ink: #053b1c;
  --bg: #f5f8f7;
  --surface: #ffffff;
  --surface-2: #f0f4f3;
  --border: #dde6e3;
  --text: #15241f;
  --muted: #55665f;
  --danger: #b42318;
  --danger-soft: #fdecea;
  --warning: #8a5a00;
  --warning-soft: #fff5db;
  --success: #0b7a3e;
  --success-soft: #e5f6ec;
  --shadow-sm: 0 1px 2px rgba(16, 40, 33, .06);
  --shadow: 0 4px 14px rgba(16, 40, 33, .08);
  --shadow-lg: 0 12px 32px rgba(16, 40, 33, .12);
  --radius: 14px;
  --radius-sm: 9px;
  --container: 1180px;
  --focus: 0 0 0 3px rgba(37, 211, 102, .55);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}

[data-theme="dark"] {
  --primary: #3cc4a8;
  --primary-dark: #7fdcc8;
  --primary-soft: #143630;
  --accent: #25d366;
  --accent-ink: #032412;
  --bg: #0d1513;
  --surface: #15201d;
  --surface-2: #1b2925;
  --border: #2a3b36;
  --text: #e5efec;
  --muted: #9fb3ad;
  --danger: #ff8a80;
  --danger-soft: #3a1c1a;
  --warning: #ffcc66;
  --warning-soft: #3a2f12;
  --success: #6ee7a0;
  --success-soft: #133222;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow: 0 4px 14px rgba(0, 0, 0, .35);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, .45);
  color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { transition: none !important; animation: none !important; } }
body { margin: 0; font-family: var(--font); font-size: 16px; line-height: 1.6; color: var(--text); background: var(--bg); overflow-x: hidden; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--primary); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--primary-dark); }
h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: clamp(1.6rem, 4vw, 2.3rem); }
h2 { font-size: clamp(1.25rem, 3vw, 1.6rem); }
h3 { font-size: 1.1rem; }
p { margin: 0 0 1em; }
code { font-size: .9em; background: var(--surface-2); padding: .1em .35em; border-radius: 5px; word-break: break-all; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 6px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--primary); color: #fff; padding: 10px 16px; border-radius: 8px; }
.skip-link:focus { top: 12px; color: #fff; }
main:focus { outline: none; }
.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 760px; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.icon { width: 1.15em; height: 1.15em; flex: none; vertical-align: -.2em; }
.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .45em; min-height: 44px; padding: .6em 1.1em; border-radius: 999px; border: 1px solid transparent; font: inherit; font-weight: 600; font-size: .95rem; line-height: 1.2; text-decoration: none; cursor: pointer; transition: background .15s, border-color .15s, color .15s, transform .1s; white-space: nowrap; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); color: #fff; }
[data-theme="dark"] .btn-primary { color: #04201b; }
[data-theme="dark"] .btn-primary:hover { color: #04201b; }
.btn-join { background: var(--accent); color: var(--accent-ink); border-color: #1fb457; }
.btn-join:hover { background: #1ebe5a; color: var(--accent-ink); }
.btn-outline { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-ghost { background: transparent; color: var(--muted); }
.btn-ghost:hover { color: var(--danger); background: var(--danger-soft); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-lg { min-height: 52px; padding: .8em 1.6em; font-size: 1.05rem; }
.btn-sm { min-height: 34px; padding: .35em .8em; font-size: .85rem; }
.btn-block { width: 100%; }
.btn[aria-disabled="true"], .btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.is-loading { position: relative; color: transparent !important; pointer-events: none; }
.btn.is-loading::after { content: ""; position: absolute; width: 18px; height: 18px; border: 2px solid currentColor; border-color: #fff #fff transparent transparent; border-radius: 50%; animation: spin .7s linear infinite; }
.btn-outline.is-loading::after { border-color: var(--primary) var(--primary) transparent transparent; }
@keyframes spin { to { transform: rotate(360deg); } }
.icon-btn { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer; }
.icon-btn:hover { color: var(--primary); border-color: var(--primary); }

/* ---------- Header ---------- */
.site-header { position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--border); }
.header-inner { display: flex; align-items: center; gap: 12px; min-height: 66px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); font-weight: 800; font-size: 1.1rem; min-width: 0; }
.brand:hover { color: var(--text); }
.brand-mark { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 11px; background: linear-gradient(135deg, var(--accent), var(--primary)); color: #fff; flex: none; }
.brand-mark .icon { width: 22px; height: 22px; }
.brand-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-logo { height: 36px; width: auto; }
.main-nav { display: none; gap: 4px; }
.main-nav a { padding: 8px 12px; border-radius: 999px; color: var(--muted); text-decoration: none; font-weight: 600; font-size: .95rem; }
.main-nav a:hover, .main-nav a[aria-current="page"] { color: var(--primary); background: var(--primary-soft); }
.header-search { display: none; flex: 1; max-width: 360px; position: relative; }
.header-search input { width: 100%; height: 42px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface-2); padding: 0 44px 0 16px; font: inherit; color: var(--text); }
.header-search button { position: absolute; right: 4px; top: 4px; width: 34px; height: 34px; border-radius: 50%; border: 0; background: transparent; color: var(--muted); cursor: pointer; display: grid; place-items: center; }
.header-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.btn-add span { display: none; }
.btn-add { padding: .6em .8em; }
.js-theme-toggle .icon-sun { display: none; }
[data-theme="dark"] .js-theme-toggle .icon-sun { display: block; }
[data-theme="dark"] .js-theme-toggle .icon-moon { display: none; }
.mobile-menu { border-top: 1px solid var(--border); background: var(--surface); padding: 12px 0 16px; }
.mobile-menu nav { display: grid; gap: 2px; margin-top: 10px; }
.mobile-menu nav a { display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 10px; color: var(--text); text-decoration: none; font-weight: 600; }
.mobile-menu nav a:hover { background: var(--primary-soft); }
.mobile-menu .header-search { display: block; max-width: none; }
@media (min-width: 640px) { .btn-add span { display: inline; } .btn-add { padding: .6em 1.1em; } }
@media (min-width: 1200px) {
  .main-nav, .header-search { display: flex; }
  .nav-toggle, .mobile-menu { display: none !important; }
}

/* ---------- Flash / alerts ---------- */
.flash-wrap { margin-top: 16px; }
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 16px; border-radius: var(--radius-sm); border: 1px solid; margin-bottom: 12px; }
.alert .icon { margin-top: .2em; }
.alert-success { background: var(--success-soft); border-color: color-mix(in srgb, var(--success) 30%, transparent); color: var(--success); }
.alert-error { background: var(--danger-soft); border-color: color-mix(in srgb, var(--danger) 30%, transparent); color: var(--danger); }
.alert-info { background: var(--primary-soft); border-color: color-mix(in srgb, var(--primary) 25%, transparent); color: var(--text); }
.alert-warning { background: var(--warning-soft); border-color: color-mix(in srgb, var(--warning) 30%, transparent); color: var(--text); }
.alert p:last-child { margin: 0; }

/* ---------- Hero ---------- */
.hero { position: relative; padding: 44px 0 36px; background: radial-gradient(1200px 400px at 85% -10%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 60%), radial-gradient(900px 380px at -10% 10%, color-mix(in srgb, var(--primary) 16%, transparent), transparent 60%); }
.hero h1 { max-width: 760px; }
.hero-sub { color: var(--muted); max-width: 680px; font-size: 1.05rem; }
.hero-search { display: grid; gap: 8px; margin-top: 20px; background: var(--surface); padding: 8px; border-radius: 18px; box-shadow: var(--shadow-lg); border: 1px solid var(--border); max-width: 760px; }
.hero-search input, .hero-search select { height: 50px; border: 0; background: transparent; font: inherit; color: var(--text); padding: 0 12px; min-width: 0; }
.hero-search input { font-size: 1.05rem; }
.hero-search select { border-top: 1px solid var(--border); border-radius: 0; }
.hero-stats { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-top: 16px; color: var(--muted); font-size: .92rem; }
.hero-stats strong { color: var(--text); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); color: var(--text); text-decoration: none; font-size: .88rem; font-weight: 600; }
.chip:hover { border-color: var(--primary); color: var(--primary); }
.chip .count { color: var(--muted); font-weight: 500; }
@media (min-width: 720px) {
  .hero { padding: 64px 0 52px; }
  .hero-search { grid-template-columns: 1fr 200px auto; align-items: center; border-radius: 999px; padding: 6px 6px 6px 12px; }
  .hero-search select { border-top: 0; border-left: 1px solid var(--border); }
}

/* ---------- Sections ---------- */
.section { padding: 28px 0; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.section-head h2 { margin: 0; display: flex; align-items: center; gap: 10px; }
.section-head h2 .icon { color: var(--primary); }
.section-head p { margin: 4px 0 0; color: var(--muted); }
.link-more { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; text-decoration: none; }
.page-head { padding: 24px 0 8px; }
.page-head p { color: var(--muted); max-width: 760px; }

/* ---------- Cards / listing grid ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.grid { display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 560px) { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 900px) { .grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1140px) { .grid-4 { grid-template-columns: repeat(4, 1fr); } }
.listing-card { display: flex; flex-direction: column; padding: 16px; transition: transform .15s, box-shadow .15s, border-color .15s; position: relative; }
.listing-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: color-mix(in srgb, var(--primary) 35%, var(--border)); }
.listing-card__head { display: flex; gap: 12px; align-items: center; margin-bottom: 10px; }
.listing-card__title { font-size: 1.02rem; margin: 0; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; word-break: break-word; }
.listing-card__title a { color: var(--text); text-decoration: none; }
.listing-card__title a::after { content: ""; position: absolute; inset: 0; border-radius: var(--radius); }
.listing-card__title a:focus-visible { box-shadow: none; }
.listing-card:focus-within { box-shadow: var(--focus); }
.listing-card__desc { color: var(--muted); font-size: .92rem; margin: 0 0 12px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; word-break: break-word; }
.listing-card__meta { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.listing-card__foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.listing-card__foot .btn { position: relative; z-index: 1; }
.listing-card__stats { color: var(--muted); font-size: .82rem; display: inline-flex; align-items: center; gap: 4px; }
.avatar { width: 56px; height: 56px; border-radius: 16px; object-fit: cover; flex: none; background: var(--surface-2); border: 1px solid var(--border); }
.avatar--lg { width: 96px; height: 96px; border-radius: 24px; }
.avatar--sm { width: 44px; height: 44px; border-radius: 12px; }
.avatar--initials { display: grid; place-items: center; font-weight: 800; color: #fff; font-size: 1.2rem; background: linear-gradient(135deg, hsl(var(--h, 160) 55% 42%), hsl(calc(var(--h, 160) + 40) 60% 34%)); border: 0; }
.avatar--lg.avatar--initials { font-size: 2rem; }
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 999px; font-size: .75rem; font-weight: 700; background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); white-space: nowrap; }
.badge .icon { width: 13px; height: 13px; }
.badge-group { background: var(--primary-soft); color: var(--primary); border-color: transparent; }
.badge-channel { background: #e8eefc; color: #2f4fb3; border-color: transparent; }
[data-theme="dark"] .badge-channel { background: #1d2745; color: #a8bbff; }
.badge-featured { background: var(--warning-soft); color: var(--warning); border-color: transparent; }
.badge-sponsored { background: #f3e8ff; color: #6b21a8; border-color: transparent; }
[data-theme="dark"] .badge-sponsored { background: #2c1b3d; color: #d8b4fe; }

/* ---------- Category cards ---------- */
.cat-grid { display: grid; gap: 12px; grid-template-columns: repeat(2, 1fr); }
@media (min-width: 720px) { .cat-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1000px) { .cat-grid { grid-template-columns: repeat(4, 1fr); } }
.cat-card { display: flex; align-items: center; gap: 12px; padding: 14px; text-decoration: none; color: var(--text); transition: border-color .15s, transform .15s; }
.cat-card:hover { border-color: var(--primary); color: var(--text); transform: translateY(-1px); }
.cat-icon { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; background: var(--primary-soft); color: var(--primary); flex: none; }
.cat-card strong { display: block; line-height: 1.25; }
.cat-card span.count { font-size: .82rem; color: var(--muted); }
.cat-card--full { align-items: flex-start; padding: 18px; }
.cat-card--full p { margin: 4px 0 0; color: var(--muted); font-size: .88rem; }

/* ---------- Filters / browse ---------- */
.filters { display: grid; gap: 10px; padding: 14px; margin-bottom: 18px; }
.filters .row { display: grid; gap: 10px; grid-template-columns: 1fr 1fr; }
.filters .row > :first-child.full { grid-column: 1 / -1; }
@media (min-width: 820px) { .filters .row { grid-template-columns: 2fr repeat(4, 1fr) auto; align-items: end; } .filters .row > :first-child.full { grid-column: auto; } }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.tabs a { padding: 7px 14px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); text-decoration: none; color: var(--muted); font-weight: 600; font-size: .9rem; }
.tabs a[aria-current="true"] { background: var(--primary); color: #fff; border-color: var(--primary); }
[data-theme="dark"] .tabs a[aria-current="true"] { color: #04201b; }
.result-count { color: var(--muted); margin-bottom: 12px; }
.empty-state { text-align: center; padding: 48px 20px; }
.empty-state .icon { width: 48px; height: 48px; color: var(--muted); margin: 0 auto 12px; display: block; }

/* ---------- Forms ---------- */
.form-card { padding: 20px; }
@media (min-width: 720px) { .form-card { padding: 28px; } }
.field { margin-bottom: 18px; }
.field label, .field .label { display: block; font-weight: 600; margin-bottom: 6px; }
.field .hint { color: var(--muted); font-size: .85rem; margin: 6px 0 0; }
.optional { color: var(--muted); font-weight: 400; font-size: .85rem; }
input[type="text"], input[type="email"], input[type="url"], input[type="search"], input[type="password"], input[type="number"], input[type="date"], select, textarea {
  width: 100%; min-height: 46px; padding: 10px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); font: inherit; transition: border-color .15s, box-shadow .15s;
}
textarea { min-height: 130px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: var(--focus); }
[aria-invalid="true"] { border-color: var(--danger) !important; }
.field-error { color: var(--danger); font-size: .87rem; margin: 6px 0 0; font-weight: 600; }
.field-row { display: grid; gap: 0 16px; }
@media (min-width: 640px) { .field-row { grid-template-columns: 1fr 1fr; } }
.choice-cards { display: grid; gap: 10px; grid-template-columns: 1fr 1fr; }
.choice-card { position: relative; }
.choice-card input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; cursor: pointer; margin: 0; }
.choice-card .choice-body { display: flex; flex-direction: column; gap: 4px; padding: 14px; border: 2px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); height: 100%; }
.choice-card .choice-body strong { display: flex; align-items: center; gap: 8px; }
.choice-card .choice-body span { color: var(--muted); font-size: .85rem; }
.choice-card input:checked + .choice-body { border-color: var(--primary); background: var(--primary-soft); }
.choice-card input:focus-visible + .choice-body { box-shadow: var(--focus); }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 500 !important; cursor: pointer; }
.check input { width: 20px; height: 20px; margin-top: 3px; accent-color: var(--primary); flex: none; }
.counter { float: right; font-weight: 400; color: var(--muted); font-size: .8rem; }
.image-preview { display: flex; align-items: center; gap: 12px; margin-top: 10px; }
.image-preview img { width: 64px; height: 64px; object-fit: cover; border-radius: 14px; border: 1px solid var(--border); }
fieldset { border: 0; padding: 0; margin: 0 0 8px; min-width: 0; }
legend { font-weight: 700; font-size: 1.05rem; margin-bottom: 12px; padding: 0; }
.form-section { border-top: 1px solid var(--border); padding-top: 20px; margin-top: 8px; }

/* ---------- Breadcrumbs ---------- */
.breadcrumbs { padding: 14px 0 0; font-size: .87rem; }
.breadcrumbs ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.breadcrumbs li { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); min-width: 0; }
.breadcrumbs li + li::before { content: "›"; color: var(--muted); padding: 0 2px; }
.breadcrumbs a { color: var(--muted); text-decoration: none; }
.breadcrumbs a:hover { color: var(--primary); text-decoration: underline; }
.breadcrumbs [aria-current] { color: var(--text); max-width: 60vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Detail page ---------- */
.detail-layout { display: grid; gap: 20px; padding-top: 16px; padding-bottom: 32px; }
@media (min-width: 1000px) { .detail-layout { grid-template-columns: minmax(0, 1fr) 340px; align-items: start; } }
.detail-main { padding: 20px; }
@media (min-width: 720px) { .detail-main { padding: 28px; } }
.detail-head { display: flex; gap: 16px; align-items: flex-start; margin-bottom: 18px; }
.detail-head h1 { margin: 6px 0 4px; word-break: break-word; }
.detail-head .badges { display: flex; gap: 6px; flex-wrap: wrap; }
.detail-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; color: var(--muted); font-size: .9rem; }
.detail-meta span { display: inline-flex; align-items: center; gap: 5px; }
.detail-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 10px; }
.detail-actions .btn-join { flex: 1 1 100%; }
@media (min-width: 560px) { .detail-actions .btn-join { flex: 0 0 auto; } }
.join-note { display: flex; gap: 8px; align-items: flex-start; font-size: .88rem; color: var(--muted); background: var(--surface-2); border-radius: var(--radius-sm); padding: 10px 12px; }
.join-note .icon { color: var(--primary); margin-top: .15em; }
.description { white-space: pre-line; word-break: break-word; }
.detail-section { margin-top: 26px; }
.detail-section h2 { font-size: 1.15rem; }
.facts { display: grid; grid-template-columns: 1fr; gap: 0; margin: 0; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.facts div { display: grid; grid-template-columns: 140px 1fr; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--border); }
.facts div:last-child { border-bottom: 0; }
.facts dt { color: var(--muted); font-weight: 600; font-size: .9rem; }
.facts dd { margin: 0; word-break: break-word; }
.na { color: var(--muted); font-style: italic; }
.tag-list { display: flex; flex-wrap: wrap; gap: 6px; }
.safety { margin-top: 26px; padding: 14px 16px; border-radius: var(--radius-sm); background: var(--warning-soft); }
.safety h2 { font-size: 1rem; display: flex; gap: 8px; align-items: center; }
.safety ul { margin: 0; padding-left: 20px; font-size: .9rem; }
.side-card { padding: 18px; }
.side-card h2 { font-size: 1.05rem; }
.mini-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.mini-list a { display: flex; gap: 10px; align-items: center; padding: 8px; border-radius: 10px; text-decoration: none; color: var(--text); }
.mini-list a:hover { background: var(--surface-2); }
.mini-list strong { display: block; font-size: .92rem; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.mini-list small { color: var(--muted); }
.preview-banner { margin-bottom: 16px; }

/* ---------- Transition page ---------- */
.transition-card { padding: 24px; margin: 24px auto; text-align: center; }
@media (min-width: 720px) { .transition-card { padding: 40px; } }
.transition-card .avatar { margin: 0 auto 12px; }
.transition-card h1 { font-size: clamp(1.35rem, 3.5vw, 1.8rem); }
.checklist { text-align: left; list-style: none; padding: 0; margin: 20px auto; max-width: 560px; display: grid; gap: 10px; }
.checklist li { display: flex; gap: 10px; align-items: flex-start; }
.checklist .icon { color: var(--primary); margin-top: .2em; }
.countdown { font-weight: 600; color: var(--muted); min-height: 1.6em; }
.transition-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin: 16px 0; }
.destination { font-size: .85rem; color: var(--muted); }

/* ---------- Pagination ---------- */
.pagination { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px; margin: 28px 0 8px; }
.pagination a, .pagination span { display: inline-grid; place-items: center; min-width: 42px; height: 42px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); text-decoration: none; color: var(--text); font-weight: 600; }
.pagination a:hover { border-color: var(--primary); color: var(--primary); }
.pagination [aria-current="page"] { background: var(--primary); border-color: var(--primary); color: #fff; }
[data-theme="dark"] .pagination [aria-current="page"] { color: #04201b; }
.pagination .gap { border: 0; background: transparent; min-width: 20px; }
.load-more-wrap { text-align: center; margin-top: 22px; }

/* ---------- Ads ---------- */
.ad-slot { margin: 22px auto; padding: 8px; border: 1px dashed var(--border); border-radius: var(--radius-sm); background: var(--surface-2); text-align: center; max-width: 100%; overflow: hidden; }
.ad-label { display: block; font-size: .7rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.ad-body { display: flex; justify-content: center; min-height: 50px; }
.ad-direct img { max-height: 280px; width: auto; margin: 0 auto; border-radius: 6px; }
.ad-slot--sidebar { display: none; }
@media (min-width: 1000px) { .ad-slot--sidebar { display: block; margin-top: 0; } }

/* ---------- Prose (static pages) ---------- */
.prose { padding: 22px; }
@media (min-width: 720px) { .prose { padding: 34px; } }
.prose h2 { margin-top: 1.4em; }
.prose h2:first-child { margin-top: 0; }
.prose ul { padding-left: 22px; }
.prose li { margin-bottom: 6px; }

/* ---------- Steps / how it works ---------- */
.steps { display: grid; gap: 14px; counter-reset: step; }
@media (min-width: 760px) { .steps { grid-template-columns: repeat(3, 1fr); } }
.step { padding: 18px; position: relative; }
.step::before { counter-increment: step; content: counter(step); display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--primary); color: #fff; font-weight: 800; margin-bottom: 10px; }
[data-theme="dark"] .step::before { color: #04201b; }
.step p { margin: 0; color: var(--muted); font-size: .93rem; }
.cta { padding: 28px; text-align: center; background: linear-gradient(135deg, var(--primary-dark), var(--primary)); color: #fff; border: 0; }
.cta h2 { color: #fff; }
.cta p { color: rgba(255, 255, 255, .88); }
.cta .btn { background: #fff; color: var(--primary-dark); }
[data-theme="dark"] .cta { background: linear-gradient(135deg, #0f4d43, #136b5d); }

/* ---------- Footer ---------- */
.site-footer { margin-top: 40px; background: var(--surface); border-top: 1px solid var(--border); padding: 36px 0 20px; font-size: .92rem; }
.footer-grid { display: grid; gap: 24px; grid-template-columns: 1fr 1fr; }
.footer-grid > :first-child { grid-column: 1 / -1; }
@media (min-width: 860px) { .footer-grid { grid-template-columns: 2fr 1fr 1fr 1fr; } .footer-grid > :first-child { grid-column: auto; } }
.site-footer h2 { font-size: .95rem; margin-bottom: 10px; }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.site-footer a { color: var(--muted); text-decoration: none; }
.site-footer a:hover { color: var(--primary); text-decoration: underline; }
.footer-bottom { border-top: 1px solid var(--border); margin-top: 26px; padding-top: 16px; color: var(--muted); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; font-size: .85rem; }
.social { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.social a { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border: 1px solid var(--border); border-radius: 999px; }

/* ---------- Toast ---------- */
.toast { position: fixed; left: 50%; bottom: 20px; transform: translate(-50%, 20px); background: var(--text); color: var(--bg); padding: 10px 18px; border-radius: 999px; font-weight: 600; box-shadow: var(--shadow-lg); opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 200; max-width: calc(100% - 32px); text-align: center; }
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Errors ---------- */
.error-page { text-align: center; padding: 60px 16px; }
.error-code { font-size: 4rem; font-weight: 900; color: var(--primary); line-height: 1; margin-bottom: 10px; }

/* ---------- Install / minimal layout ---------- */
.minimal-body { display: grid; place-items: start center; min-height: 100vh; padding: 32px 16px; }
.minimal-wrap { width: 100%; max-width: 640px; }
.minimal-brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.15rem; margin-bottom: 18px; justify-content: center; }
.req-list { list-style: none; padding: 0; margin: 0 0 18px; display: grid; gap: 6px; font-size: .92rem; }
.req-list li { display: flex; gap: 8px; align-items: flex-start; }
.req-ok { color: var(--success); }
.req-fail { color: var(--danger); }
.req-warn { color: var(--warning); }

/* ==========================================================================
   v1.1 redesign: green header, filter bar, discovery sections, green footer
   ========================================================================== */
[hidden] { display: none !important; }
:root { --brand-1: #075e54; --brand-2: #0b7d6b; --brand-3: #128c7e; --tint: #e6f5f0; }
[data-theme="dark"] { --brand-1: #06302b; --brand-2: #0a4a40; --brand-3: #0f5c50; --tint: #13211e; }

/* Header */
.site-header { background: linear-gradient(90deg, var(--brand-1), var(--brand-2) 60%, var(--brand-3)); border-bottom: 0; backdrop-filter: none; color: #fff; box-shadow: 0 2px 12px rgba(0, 0, 0, .14); }
.site-header .brand, .site-header .brand:hover { color: #fff; }
.site-header .brand-mark { background: rgba(255, 255, 255, .16); }
.site-header .main-nav { gap: 2px; align-items: center; }
.site-header .main-nav > a, .nav-dropdown > summary { color: rgba(255, 255, 255, .9); padding: 8px 10px; border-radius: 8px; font-weight: 600; font-size: .92rem; text-decoration: none; background: none; white-space: nowrap; }
.site-header .main-nav > a:hover, .site-header .main-nav > a[aria-current="page"], .nav-dropdown > summary:hover, .nav-dropdown[open] > summary, .nav-dropdown > summary.is-active { color: #fff; background: rgba(255, 255, 255, .15); }
.nav-dropdown { position: relative; }
.nav-dropdown > summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; }
.nav-dropdown > summary::-webkit-details-marker { display: none; }
.icon-sm { width: .9em; height: .9em; }
.dropdown-menu { position: absolute; top: calc(100% + 8px); left: 0; min-width: 240px; background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 6px; z-index: 70; display: grid; }
.dropdown-menu--right { left: auto; right: 0; }
.dropdown-menu a { display: flex; gap: 10px; align-items: center; padding: 9px 10px; border-radius: 8px; color: var(--text); text-decoration: none; font-weight: 600; font-size: .92rem; }
.dropdown-menu a .icon { color: var(--primary); }
.dropdown-menu a:hover, .dropdown-menu a:focus-visible { background: var(--primary-soft); color: var(--primary); }
.btn-discover { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); min-height: 40px; padding: .5em .8em; }
.btn-discover:hover, .discover-dropdown[open] > .btn-discover { background: #1ebe5a; color: var(--accent-ink); }
.btn-discover span { display: none; }
.btn-light { background: #fff; color: #075e54; }
.btn-light:hover { background: #e7f7f1; color: #075e54; }
.icon-btn--light { background: rgba(255, 255, 255, .12); border-color: rgba(255, 255, 255, .28); color: #fff; }
.icon-btn--light:hover { color: #fff; border-color: #fff; background: rgba(255, 255, 255, .22); }
.mobile-menu { color: var(--text); }
.mobile-menu__heading { margin: 12px 12px 2px; font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; }
@media (min-width: 520px) { .btn-discover span { display: inline; } }
@media (max-width: 380px) { .btn-add { display: none; } }

/* Search & filter bar */
.filter-bar { background: var(--tint); border-bottom: 1px solid var(--border); padding: 12px 0; }
.filter-form { display: grid; gap: 8px; grid-template-columns: 1fr auto; align-items: center; }
.filter-field { position: relative; min-width: 0; }
.filter-field--q input { padding-left: 40px; }
.filter-icon { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.filter-toggle { min-height: 46px; padding: 0 14px; }
.filter-extra { grid-column: 1 / -1; display: grid; gap: 8px; grid-template-columns: 1fr; }
.js .filter-form:not(.is-open) .filter-extra { display: none; }
.filter-buttons { grid-column: 1 / -1; display: flex; gap: 8px; }
.filter-buttons .btn { min-height: 46px; }
.filter-buttons .btn-primary { flex: 1; }
.btn-ghost-light { background: var(--surface); color: var(--muted); border: 1px solid var(--border); }
.btn-ghost-light:hover { color: var(--primary); border-color: var(--primary); }
html:not(.js) .filter-toggle { display: none; }
@media (min-width: 640px) { .filter-extra { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 960px) {
  .filter-form { grid-template-columns: minmax(220px, 1.5fr) 3fr auto; }
  .filter-toggle { display: none; }
  .js .filter-form:not(.is-open) .filter-extra, .filter-extra { display: grid; grid-column: auto; grid-template-columns: repeat(3, 1fr); }
  .filter-buttons { grid-column: auto; }
  .filter-buttons .btn-primary { flex: none; }
}

/* Homepage */
.home-title { padding-top: 22px; }
.home-title h1 { font-size: clamp(1.35rem, 3vw, 1.9rem); margin-bottom: 4px; }
.home-title .hero-stats { margin-top: 6px; }
.section--first { padding-top: 14px; }
.section--tint { background: var(--tint); }
.grid-ad { grid-column: 1 / -1; }
.grid-ad .ad-slot { margin: 2px 0; }
.grid-item:not([hidden]) { display: flex; }
.grid-item > .listing-card { flex: 1; }

/* Listing cards */
.listing-card__heading { min-width: 0; display: grid; gap: 6px; }
.listing-card__badges { display: flex; flex-wrap: wrap; gap: 4px; }
.listing-card__facts { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 4px; font-size: .83rem; color: var(--muted); }
.listing-card__facts li { display: flex; gap: 6px; align-items: center; min-width: 0; }
.listing-card__facts li span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.listing-card__facts .icon { width: 14px; height: 14px; }
.listing-card__actions { margin-top: auto; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.listing-card__actions .btn { position: relative; z-index: 1; padding-left: .5em; padding-right: .5em; }
.listing-card__actions .btn:only-child { grid-column: 1 / -1; }

/* Discover cards */
.discover-grid { display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 560px) { .discover-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 900px) { .discover-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1140px) { .discover-grid { grid-template-columns: repeat(4, 1fr); } }
.discover-card { display: flex; flex-direction: column; overflow: hidden; text-decoration: none; color: var(--text); transition: transform .15s, box-shadow .15s, border-color .15s; }
.discover-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--primary); color: var(--text); }
.discover-card__img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.discover-card__icon { display: grid; place-items: center; height: 92px; background: linear-gradient(135deg, var(--brand-1), var(--accent)); color: #fff; }
.discover-card__icon .icon { width: 38px; height: 38px; }
.discover-card__body { display: flex; flex-direction: column; gap: 6px; padding: 14px 16px 16px; flex: 1; }
.discover-card__body .badge { align-self: flex-start; }
.discover-card__desc { color: var(--muted); font-size: .9rem; }
.discover-card__more { margin-top: auto; color: var(--primary); font-weight: 700; display: inline-flex; gap: 4px; align-items: center; font-size: .9rem; }
.discover-ad { display: flex; }
.discover-ad .ad-slot { margin: 0; width: 100%; }

/* Country & language cards */
.locale-grid { display: grid; gap: 10px; grid-template-columns: repeat(2, 1fr); }
@media (min-width: 720px) { .locale-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1000px) { .locale-grid { grid-template-columns: repeat(4, 1fr); } }
.locale-card { display: flex; gap: 12px; align-items: center; padding: 12px 14px; text-decoration: none; color: var(--text); min-width: 0; }
.locale-card:hover { border-color: var(--primary); color: var(--text); }
.locale-card > span:last-child { min-width: 0; }
.locale-card__icon { font-size: 1.55rem; width: 42px; height: 42px; display: grid; place-items: center; border-radius: 12px; background: var(--primary-soft); color: var(--primary); flex: none; line-height: 1; }
.locale-card strong { display: block; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.locale-card .count, .cat-card span.count { display: block; font-size: .8rem; color: var(--muted); }
.locale-head-icon { width: 52px; height: 52px; font-size: 1.8rem; line-height: 1; }

/* Blog */
.post-card { display: flex; flex-direction: column; overflow: hidden; }
.post-card__img { display: block; width: 100%; aspect-ratio: 1200 / 630; object-fit: cover; background: var(--surface-2); }
.post-card__img--empty { display: grid; place-items: center; color: var(--primary); }
.post-card__img--empty .icon { width: 40px; height: 40px; }
.post-card__body { padding: 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.post-card h3 { margin: 0; font-size: 1.08rem; }
.post-card h3 a { color: var(--text); text-decoration: none; }
.post-card h3 a:hover { color: var(--primary); }
.post-card p { color: var(--muted); margin: 0; font-size: .92rem; }
.post-card .link-more { margin-top: auto; }
.post-article h1 { margin-top: 6px; }
.lead { font-size: 1.1rem; color: var(--muted); }
.post-hero { border-radius: var(--radius-sm); margin: 10px 0 20px; width: 100%; height: auto; }
.prose-inline h2 { margin-top: 1.3em; }
.prose-inline ul { padding-left: 22px; }

/* Information block */
.info-block { display: grid; gap: 24px; }
@media (min-width: 900px) { .info-block { grid-template-columns: 1.2fr 1fr; align-items: start; } }
.info-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.info-list a { display: flex; gap: 12px; padding: 14px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); text-decoration: none; color: var(--muted); font-size: .9rem; }
.info-list a:hover { border-color: var(--primary); color: var(--muted); }
.info-list .icon { color: var(--primary); width: 22px; height: 22px; margin-top: 2px; }
.info-list strong { display: block; color: var(--text); font-size: .98rem; }

/* Green footer */
.site-footer { background: linear-gradient(180deg, var(--brand-1), #053f38); color: rgba(255, 255, 255, .85); border-top: 0; }
[data-theme="dark"] .site-footer { background: var(--brand-1); }
.site-footer h2 { color: #fff; }
.site-footer p { color: rgba(255, 255, 255, .82); }
.site-footer a { color: rgba(255, 255, 255, .85); }
.site-footer a:hover { color: #fff; }
.site-footer .brand, .site-footer .brand:hover { color: #fff; }
.site-footer .brand-mark { background: rgba(255, 255, 255, .16); }
.site-footer .footer-about p { margin-top: 12px; }
.site-footer .social a { border-color: rgba(255, 255, 255, .3); }
.footer-bottom { border-top-color: rgba(255, 255, 255, .18); color: rgba(255, 255, 255, .75); }

@media print {
  .site-header, .site-footer, .filter-bar, .ad-slot, .detail-actions, .detail-side { display: none !important; }
}
