/* Open Badge Passport front page. Values are the app's Passport theme
   (salava-extra src/scss: variables.scss, extra/passport_variables.scss,
   core.scss, _fonts.scss), copied, not linked: this page does not load the
   app's CSS. */

:root {
  --primary: #006cdb;          /* $sl-primary */
  --primary-hover: #005bb8;
  --text: #111827;             /* $sl-text */
  --text-muted: #475569;       /* $sl-muted, AA on white */
  --surface: #ffffff;          /* $sl-surface */
  --page: #fcfdfe;             /* $sl-bg */
  --border: #d9dfe6;           /* $sl-border */
  --radius: 8px;               /* $sl-radius-md, cards */
  --radius-input: 6px;         /* $sl-radius-input, buttons */
  --radius-lg: 12px;           /* $sl-radius-lg */
  --surface-muted: #f9fafb;    /* $sl-color-gray-50: the badge image backdrop */
  --border-strong: #d1d5db;    /* $sl-color-border-strong: a hovered card's border */
  --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.05);   /* $sl-card-shadow: a card at rest */
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);  /* --sl-shadow-md: a card on hover */
  --focus: 0 0 0 2px var(--surface), 0 0 0 4px var(--primary);
  --link-hover: #0053a8;       /* $sl-link-hover: the primary darkened 10% */
  /* The app's ghost recipe (src/scss/components/_buttons.scss .sl-btn-ghost):
     a primary wash on hover, a stronger one pressed, and the primary mixed
     80/20 with the text colour as the hover ink (AA on the wash). */
  --ghost-wash: color-mix(in srgb, var(--primary) 10%, transparent);
  --ghost-wash-active: color-mix(in srgb, var(--primary) 16%, transparent);
  --ghost-ink: color-mix(in srgb, var(--primary) 80%, var(--text));

  /* the app's type scale ($sl-font-size-*) */
  --fs-xs: 0.75rem;    /* 12 */
  --fs-sm: 0.8125rem;  /* 13 */
  --fs-base: 0.875rem; /* 14, body */
  --fs-md: 1rem;       /* 16 */
  --fs-lg: 1.125rem;   /* 18, section titles */
  --fs-xl: 1.25rem;    /* 20 */
}

* { box-sizing: border-box; }

/* Text rendering exactly as the app (core.scss) */
html, body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: "kern" 1, "liga" 1;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  /* The Passport theme's stack ($sl-font-body) */
  font-family: "Inter", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: var(--fs-base);
  line-height: 1.5;
  color: var(--text);
  background: var(--page);
}

/* Headings: the theme's weight and tighter tracking (_fonts.scss) */
h1, h2, h3 { letter-spacing: -0.02em; font-weight: 600; line-height: 1.2; }

img { max-width: 100%; display: block; }

/* Links as in the app (core.scss): never underlined; hover darkens the colour. */
a { color: var(--primary); text-decoration: none; }
a:not(.btn):hover { color: var(--link-hover); }

/* Text links: hover is a WASH, never an underline (the app's .sl-btn-text-link
   in _buttons.scss): a small padded box tinted with the primary at 8%, and the
   ink deepened toward the text colour. The negative margin keeps the text
   where it was. A link inside a sentence keeps a permanent underline (the
   app's .sl-prose a): colour alone may not mark a link. */
.see-all,
.feed-empty a,
.site-footer a {
  padding: 1px 4px;
  margin-inline: -4px;
  border-radius: 4px;
  transition: background-color 0.15s, color 0.15s;
}
.see-all:hover,
.feed-empty a:hover,
.site-footer a:hover {
  background: color-mix(in srgb, var(--primary) 8%, transparent);
  color: var(--ghost-ink);
}
.feed-empty a { text-decoration: underline; text-underline-offset: 2px; }

/* The app's focus ring (--sl-ring-*): a 2px outline, 2px off the element. On
   the blue hero it is white, or it would vanish. */
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.hero :focus-visible { outline-color: #fff; }

/* Tabler icons sit before their label, sized with the text */
.ti { font-size: 1.15em; line-height: 1; }

/* The app's container (Bootstrap's steps and its 12px gutter), so the header's
   logo and buttons, and the content under them, sit where the app's signed-out
   pages put theirs: no jump going from this page to the login page and back. */
.container {
  width: 100%;
  margin: 0 auto;
  padding: 0 12px;
}
@media (min-width: 576px)  { .container { max-width: 540px; } }
@media (min-width: 768px)  { .container { max-width: 720px; } }
@media (min-width: 992px)  { .container { max-width: 960px; } }
@media (min-width: 1200px) { .container { max-width: 1140px; } }
@media (min-width: 1400px) { .container { max-width: 1320px; } }

.skip-link {
  position: absolute;
  left: 16px;
  top: -48px;
  background: var(--surface);
  padding: 8px 12px;
  z-index: 10;
}
.skip-link:focus { top: 8px; }

/* Buttons: the app's .sl-btn -- weight 500, flat, 8px icon gap ----------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 36px;            /* :sm, the app's workhorse size */
  padding: 0 14px;
  border-radius: var(--radius-input);
  font-weight: 500;
  font-size: var(--fs-base);
  line-height: 1;
  text-decoration: none;
  border: 1px solid transparent;
  white-space: nowrap;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}
.btn-lg { min-height: 40px; padding: 0 18px; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-ghost { color: var(--text); }
.btn-ghost:hover,
.main-nav a:hover,
.lang-switch summary:hover,
.lang-switch li a:hover,
.lang-switch[open] > summary { background: var(--ghost-wash); color: var(--ghost-ink); text-decoration: none; }
.btn-ghost:active,
.main-nav a:active,
.lang-switch summary:active,
.lang-switch li a:active { background: var(--ghost-wash-active); }
.btn-on-hero { min-height: 40px; background: #fff; color: var(--primary); }
.btn-on-hero:hover { background: #eef5fd; }
.btn-on-hero-outline { min-height: 40px; color: #fff; border-color: rgba(255, 255, 255, 0.85); }
.btn-on-hero-outline:hover { background: rgba(255, 255, 255, 0.12); }

/* Header ------------------------------------------------------------------ */

.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 5;
}
/* The app's anonymous header: a 60px logo row with 8px above and below (76px,
   and the 1px line under it = 77px), the buttons centred in it. */
.header-row {
  display: flex;
  align-items: center;
  gap: 24px;
  min-height: 76px;
  padding-block: 8px;
}
.logo img { height: 60px; width: auto; }
/* The app draws the logo in a 150px box (the image is 112.5px inside it), and
   the menu starts after the box: the same box here puts the menu in the same place. */
@media (min-width: 576px) { .logo { display: block; width: 150px; flex: none; } }
.main-nav { display: flex; gap: 4px; flex: 1; }
/* The app's public grid links (a ghost :sm button): 13px text, 4px 8px padding,
   a 13px icon 8px from the text, 36px tall -- so the menu does not move on the
   way to the app's pages. */
.main-nav a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  color: var(--text);
  text-decoration: none;
  font-size: var(--fs-sm);
  font-weight: 500;
  padding: 4px 8px;
  border: 1px solid transparent;   /* the app's .sl-btn has one: 1px more on each side */
  border-radius: var(--radius-input);
}
.main-nav a .ti { font-size: var(--fs-sm); }
.header-actions { display: flex; gap: 8px; }
/* Login and Create new account: the app's :sm button (13px text, 8px padding),
   as in the app's own header, so they do not change size on the way to the app. */
.header-actions .btn { font-size: var(--fs-sm); padding: 0 8px; }

/* Nav and language switcher: side by side on desktop (the wrapper adds no
   box), one row of their own on phones (see the narrow-screen rules). */
.header-sub { display: contents; }

/* Language switcher: a <details> with real links, so it works without JS. */
.lang-switch { position: relative; }
.lang-switch summary {
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 0 10px;
  border: 1px solid transparent;   /* ghost, like Login and the nav links */
  border-radius: var(--radius-input);
  background: transparent;
  color: var(--text);
  font-size: var(--fs-base);
  font-weight: 500;
  cursor: pointer;
}
.lang-switch summary::-webkit-details-marker { display: none; }
.lang-switch summary .ti-chevron-down { font-size: 0.9em; }
.lang-switch ul {
  position: absolute;
  inset-inline-end: 0;
  top: calc(100% + 4px);
  z-index: 6;
  min-width: 160px;
  margin: 0;
  padding: 4px;
  list-style: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.lang-switch li a {
  display: block;
  padding: 8px 10px;
  border-radius: var(--radius-input);
  color: var(--text);
  text-decoration: none;
  font-size: var(--fs-base);
}
/* The current language: the hover's wash and ink, held (the app's
   .sl-btn-ghost[aria-current="page"]). */
.lang-switch li a[aria-current="true"] { background: var(--ghost-wash); color: var(--ghost-ink); font-weight: 500; }
.lang-switch li a[aria-current="true"]:hover { background: var(--ghost-wash-active); }

/* Legal pages (terms, privacy): one flat bordered card with a readable column,
   as the app's terms panel reads. The text is the legal copy, verbatim; this
   only styles it. */
.legal {
  /* The full container, so the card lines up with the header's
     logo edge and the front page. */
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px 48px;
  line-height: 1.7;
  overflow-wrap: anywhere;
}
.legal h1 { margin: 0 0 4px; font-size: 1.5rem; }
.legal h2 { margin: 32px 0 8px; font-size: var(--fs-lg); }
.legal h3 { margin: 20px 0 6px; font-size: var(--fs-md); }
.legal h2 strong { font-weight: inherit; }
.legal p { margin: 0 0 12px; }
.legal ul, .legal ol { margin: 0 0 12px; padding-inline-start: 24px; }
.legal li { margin-bottom: 4px; }
.legal > p:first-of-type em,
.legal .terms-container > p:first-of-type em { color: var(--text-muted); }
/* The table of contents: a quiet block, links not underlined. */
.legal nav { margin: 16px 0 8px; padding: 16px 20px; background: var(--page); border: 1px solid var(--border); border-radius: var(--radius); }
.legal nav h2 { margin: 0 0 8px; font-size: var(--fs-base); }
.legal nav ol { margin: 0; }
.legal nav ul { list-style: none; margin: 4px 0; padding-inline-start: 16px; }
/* A link inside the text keeps its underline: colour alone must not mark it
   (the app's .sl-prose a). */
.legal p a, .legal li a { text-decoration: underline; text-underline-offset: 2px; }
.legal nav a { text-decoration: none; }
.legal section { margin: 0; }
@media (max-width: 767px) {
  .legal { padding: 28px 24px; }
}
@media (max-width: 575px) {
  .legal { padding: 20px 16px; border-radius: var(--radius); }
}

/* Footer language links: phones only (shown in the narrow-screen rules). */
.footer-langs { display: none; margin-bottom: 12px; }
.footer-langs ul { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 0; margin: 0; padding: 0; list-style: none; }
.footer-langs li + li::before { content: "\00b7"; padding: 0 10px; }
.footer-langs a { display: inline-block; padding: 6px 4px; margin-inline: -4px; font-weight: 500; }
.footer-langs a[aria-current="true"] { color: var(--ghost-ink); font-weight: 600; }

/* Japanese: Inter has no kana or kanji, so name a Japanese system face, and
   drop the headings' tight tracking (it crowds CJK glyphs). */
html:lang(ja) body {
  font-family: "Inter", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", "Yu Gothic", Meiryo, "Noto Sans CJK JP", "Noto Sans JP", ui-sans-serif, system-ui, sans-serif;
}
html:lang(ja) h1, html:lang(ja) h2, html:lang(ja) h3 { letter-spacing: 0; line-height: 1.35; }

/* Hero -------------------------------------------------------------------- */

.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  color: #fff;
  background: linear-gradient(100deg, #1e6bd6, #2468d9);
}
/* The photo (hero-team-laptop.webp) fills the right of the hero, faded in from the left
   and tinted blue so the white text keeps its contrast. Without the file the
   hero stays plain blue. */
.hero-photo {
  position: absolute;
  inset: 0 0 0 auto;
  width: 58%;
  z-index: -1;
  background: url("hero-team-laptop.webp") 65% center / cover no-repeat;
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, transparent 12%, #fff 72%);
  mask-image: linear-gradient(90deg, transparent 0%, transparent 12%, #fff 72%);
  opacity: 0.9;
}
.hero-photo::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(30, 107, 214, 0.65), rgba(30, 107, 214, 0.12) 65%);
}
.hero-inner { position: relative; padding: 72px 12px 64px; }
.hero h1 {
  margin: 0;
  max-width: 720px;
  font-size: 2.75rem;          /* marketing hero, as Lovable */
  line-height: 1.15;
  font-weight: 700;
}
.hero-lead {
  max-width: 600px;
  margin: 16px 0 0;
  font-size: var(--fs-md);
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.92);
}
.hero-links { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }

/* Stats: filled from the app's public counts. The row keeps its space from
   first paint (invisible until they arrive), so the hero never grows. */
.hero-stats {
  list-style: none;
  margin: 36px 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 16px 48px;
}
.hero-stats.is-pending { visibility: hidden; }
.hero-stats li { display: flex; flex-direction: column-reverse; gap: 2px; }
.hero-stats .stat-label {
  font-size: var(--fs-xs);
  font-weight: 500;
  color: rgba(255, 255, 255, 0.85);
}
.hero-stats .stat-value {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  min-height: 1.1em;           /* an empty value still holds its line */
}

/* Sections ---------------------------------------------------------------- */

.section { padding: 48px 0 0; }
.section:last-of-type { padding-bottom: 64px; }
.section h2 { margin: 0; font-size: var(--fs-lg); }   /* the app's :section-title */
.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}
.see-all {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 500;
  font-size: var(--fs-base);
  text-decoration: none;
}

/* Latest badges: the app's badge card look ------------------------------- */

.badge-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
/* The badge card: the app's gallery badge-card (src/scss/components/cards/
   _badge-card.scss) -- a square image on a muted backdrop at the left edge
   (96px, 160px from 576px), a 12px body, the 13px name, 12px issuer and
   recipients, a faint shadow that lifts on hover. */
.badge-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-xs);
  overflow: hidden;
  min-height: 98px;            /* a placeholder holds the loaded card's height */
  transition: box-shadow 0.15s ease, border-color 0.15s ease;
}
.badge-card:hover { box-shadow: var(--shadow-md); border-color: var(--border-strong); }
.badge-card.is-placeholder { background: linear-gradient(90deg, #eef1f5, #f6f8fb, #eef1f5); box-shadow: none; }
.badge-card a {
  display: flex;
  align-items: stretch;
  color: inherit;
  text-decoration: none;
  height: 100%;
}
.badge-card a:hover { color: inherit; }   /* the card lifts on hover; its text keeps its colour, as the app's */
.badge-card a:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; border-radius: var(--radius); }
.badge-image {
  width: 96px;
  aspect-ratio: 1;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-muted);
}
.badge-card img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 12px;
  border-radius: 6px;          /* $sl-radius-image */
}
.badge-card .badge-text {
  flex: 1;
  min-width: 0;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.badge-card .badge-name { font-weight: 600; font-size: var(--fs-sm); line-height: 1.25; letter-spacing: -0.01em; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.badge-card .badge-issuer { color: var(--text-muted); font-size: var(--fs-xs); line-height: 1.4; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.badge-card .badge-holders {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--text-muted);
  font-size: var(--fs-xs);
  margin-top: auto;
}
@media (min-width: 576px) {
  .badge-card { min-height: 162px; }
  .badge-image { width: 160px; }
}
.feed-empty { color: var(--text-muted); margin: 0; }

/* Map --------------------------------------------------------------------- */

.map-frame {
  margin-top: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
}
#map-section.is-pending { visibility: hidden; }   /* space held until the app answers */
.map-frame iframe { display: block; width: 100%; height: 480px; border: 0; }

/* Call to action ---------------------------------------------------------- */

.cta-band {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px 28px;
}
.cta-icon {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: var(--radius-lg);
  background: #e8f5ee;
  color: #15803d;
  font-size: 24px;
}
.cta-text { flex: 1 1 16rem; min-width: 0; }
.cta-band h2 { font-size: var(--fs-lg); }
.cta-text p { margin: 4px 0 0; color: var(--text-muted); }

/* Footer ------------------------------------------------------------------ */

/* The app's footer (.app-footer): centred, 12px, a line above, two lines of text. */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  font-size: var(--fs-xs);
  text-align: center;
  padding: 16px 24px;
}
.site-footer p { margin: 0 0 4px; }
.site-footer a { color: inherit; text-decoration: none; }
.site-footer a:hover { color: var(--text); }   /* the wash comes from the text-link rule above */
.site-footer a:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
@media (max-width: 575px) {
  .site-footer { padding: 16px 12px; }
}

/* Narrow screens ---------------------------------------------------------- */

@media (max-width: 991px) {
  .badge-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 767px) {
  /* The nav moves to its own row under the logo and buttons. */
  .header-row { flex-wrap: wrap; justify-content: space-between; gap: 8px 16px; padding-top: 8px; }
  /* The menu's own row, from the logo's left edge to the buttons' right edge,
     as the app's: no side or bottom offsets, so the row and the header keep
     the app's size (121px with the 36px row). */
  .header-sub { display: flex; align-items: center; order: 3; flex-basis: 100%; margin: 0; }
  .main-nav { flex: 1; min-width: 0; flex-wrap: wrap; }
  .lang-switch summary { padding: 0 8px; min-height: 32px; }
  .hero-inner { padding: 48px 12px 48px; }
  .hero-photo { width: 70%; opacity: 0.3; }
  .hero h1 { font-size: 2rem; }
  .hero-stats { gap: 12px 32px; }
  .hero-stats .stat-value { font-size: 1.375rem; }
  /* The call to action stacks: icon, text across the full width, then a
     full-width button (a side-by-side row squeezed the text to one word a line). */
  .cta-band { flex-direction: column; align-items: flex-start; padding: 20px; }
  .cta-text { flex: none; width: 100%; }
  .cta-band .btn { align-self: stretch; }
  .map-frame iframe { height: 360px; }
}

@media (max-width: 575px) {
  .badge-grid { grid-template-columns: minmax(0, 1fr); }
  /* Phones: one quiet row -- icon logo, language, Login, Create. The three
     links (Badges, Issuers, Spaces) go: the hero's buttons and the footer
     reach the same places. */
  .header-row { flex-wrap: nowrap; justify-content: flex-start; gap: 8px; min-height: 56px; }   /* the 40px icon + 8px above and below, as the app's phone header */
  .header-sub { display: contents; }
  .main-nav { display: none; }
  .logo img { height: 40px; }
  .lang-switch { display: none; }          /* the footer carries the languages */
  .footer-langs { display: block; }
  .header-actions { gap: 4px; margin-inline-start: auto; }
}
