/* ============================================================
   SELF-HOSTED FONT: Manrope (full family)
   ============================================================ */

@font-face {
  font-family: "Manrope";
  src: url("/fonts/manrope/manrope-thin.woff2") format("woff2");
  font-weight: 100;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Manrope";
  src: url("/fonts/manrope/manrope-light.woff2") format("woff2");
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Manrope";
  src: url("/fonts/manrope/manrope-regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Manrope";
  src: url("/fonts/manrope/manrope-medium.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Manrope";
  src: url("/fonts/manrope/manrope-semibold.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Manrope";
  src: url("/fonts/manrope/manrope-bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* =========
   Color system
   ========= */

/* Default: LIGHT MODE (matches Encuro home light palette) */
:root {
  --bg: #f7faff;
  --bg-elevated: #ffffff;
  --fg: #0b1020;
  --muted: #6b7280;
  --link: #2563eb;
  --link-hover: #1e40af;
  --accent: #2563eb;
  --accent-contrast: #f9fafb;
  --accent-soft: rgba(37,99,235,0.14);
  --border: #e5e7eb;
  --pill-bg: #f3f4f6;
  --pill-border: #e5e7eb;
  --url: #14532d;
  --error: #b91c1c;
  --error-soft: #fee2e2;
  --footer-bg: #f9fafb;
  --input-bg: #ffffff;
  --suggest-bg: #ffffff;
  --suggest-hover-bg: #f3f4f6;
}

/* Dark mode: match Encuro dark palette */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #050816;
    --bg-elevated: #020617;
    --fg: #f9fafb;
    --muted: #cbd5f5;
    --link: #bfdbfe;
    --link-hover: #e0f2fe;
    --accent: #4f46e5;
    --accent-contrast: #f9fafb;
    --accent-soft: rgba(79,70,229,0.25);
    --border: rgba(148,163,184,0.6);
    --pill-bg: #020617;
    --pill-border: rgba(148,163,184,0.7);
    --url: #4ade80;
    --error: #fecaca;
    --error-soft: rgba(248,113,113,0.16);
    --footer-bg: #020617;
    --input-bg: rgba(15,23,42,0.95);
    --suggest-bg: #020617;
    --suggest-hover-bg: #020818;
  }
}

/* =========
   Base layout & typography
   ========= */

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font: 16px/1.45 "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--fg);
  background:
    radial-gradient(circle at 0% 0%, rgba(219,234,254,0.65), rgba(255,255,255,0) 55%),
    radial-gradient(circle at 100% 0%, rgba(252,231,243,0.55), rgba(255,255,255,0) 60%),
    linear-gradient(180deg, #ffffff 0%, #f7faff 100%);
  position: relative;
}

input,
button,
select,
textarea {
  font-family: inherit;
}


/* Subtle grid pattern – light */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(to right, rgba(0,0,0,0.035) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(0,0,0,0.035) 1px, transparent 1px);
  background-size: 32px 32px;
  opacity: 0.45;
  z-index: -1;
}

/* Dark background + grid (similar to Encuro home) */
@media (prefers-color-scheme: dark) {
  body {
    background:
      radial-gradient(circle at 10% 0%, rgba(79, 70, 229, 0.48), transparent 55%),
      radial-gradient(circle at 90% 10%, rgba(236, 72, 153, 0.40), transparent 60%),
      radial-gradient(circle at 50% 100%, rgba(56, 189, 248, 0.25), transparent 55%),
      linear-gradient(145deg, #020617 0%, #020617 40%, #020617 100%);
    background-attachment: fixed;
  }

  body::before {
    background-image:
      linear-gradient(to right, rgba(15,23,42,0.45) 1px, transparent 1px),
      linear-gradient(to bottom, rgba(15,23,42,0.45) 1px, transparent 1px);
    background-size: 26px 26px;
    mix-blend-mode: soft-light;
    opacity: 0.28;
  }
}

header {
  padding: 24px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-elevated);
  backdrop-filter: blur(10px);
}

.wrap {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 12px;
}

/* =========
   Brand
   ========= */

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  letter-spacing: 0.2px;
  margin-bottom: 8px;
}

.brand-logo img {
  display: block;
  height: 52px;
  width: auto;
  border-radius: 14px;
  padding: 3px 6px;
  background:
    radial-gradient(circle at 10% 0, rgba(129,140,248,0.18), transparent 55%),
    #020617;
  box-shadow: 0 10px 26px rgba(15,23,42,0.28);
}

@media (prefers-color-scheme: light) {
  .brand-logo img {
    background:
      radial-gradient(circle at 10% 0, #eff6ff, transparent 55%),
      #ffffff;
    box-shadow: 0 6px 18px rgba(15,23,42,0.12);
  }
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-size: 20px;
}

.brand-subtitle {
  font-size: 13px;
  color: var(--muted);
  margin-top: 2px;
}

/* =========
   Search bar
   ========= */

.search {
  display: flex;
  align-items: center;
  margin: 8px 0;
  flex-wrap: wrap;
  gap: 8px;
}

.search input[type="search"] {
  flex: 1 1 0;
  min-width: 0;
  font-size: 18px;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--input-bg);
  color: var(--fg);
  outline: none;
  transition:
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    background-color 0.18s ease;
}

.search input[type="search"]::placeholder {
  color: var(--muted);
}

.search input[type="search"]:focus-visible {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent-soft);
}

/* Search button */

.search button {
  padding: 10px 18px;
  border-radius: 999px;
  border: 0;
  cursor: pointer;
  font-size: 15px;
  font-weight: 600;
  color: var(--accent-contrast);
  background: linear-gradient(135deg, #2563eb, #ec4899);
  white-space: nowrap;
  transition:
    transform 0.1s ease,
    box-shadow 0.1s ease,
    filter 0.1s ease,
    background-color 0.1s ease;
  box-shadow: 0 8px 22px rgba(37,99,235,0.35);
}

@media (prefers-color-scheme: dark) {
  .search button {
    background: conic-gradient(from 210deg, #4f46e5, #ec4899, #22d3ee, #4f46e5);
    box-shadow: 0 12px 28px rgba(15,23,42,0.8);
  }
}

.search button:hover {
  transform: translateY(-0.5px);
  filter: brightness(1.03);
}

.search button:active {
  transform: translateY(0.5px);
  filter: brightness(0.97);
}

.search button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* =========
   Filters & hint
   ========= */

.filters {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
  font-size: 14px;
  color: var(--muted);
}

.filters label {
  font-size: 13px;
  color: var(--muted);
  user-select: none;
}

.filters input[type="checkbox"] {
  accent-color: var(--accent);
}

.hint {
  color: var(--muted);
  margin: 4px 0 14px;
}

/* pill badge (used in hint & matches) */

.pill {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--pill-bg);
  border: 1px solid var(--pill-border);
  font-size: 12px;
  color: var(--muted);
}

/* =========
   Main & results
   ========= */

main {
  padding: 16px 16px 48px;
}

ol.results {
  list-style: none;
  padding: 0;
  margin: 0;
}

.result {
  padding: 14px 10px;
  border-bottom: 1px solid var(--border);
  transition:
    background-color 0.14s ease,
    border-color 0.14s ease,
    transform 0.08s ease;
}

.result:hover {
  background: rgba(148,163,184,0.05); /* light + dark friendly */
  transform: translateY(-0.5px);
}

.result-title {
  font-size: 18px;
  color: var(--link);
  text-decoration: none;
}

.result-title:hover {
  color: var(--link-hover);
  text-decoration: underline;
}

.result-url {
  font-size: 13px;
  color: var(--url);
  margin-top: 2px;
  overflow-wrap: anywhere;
}

.result-url a,
.result-url a:visited {
  color: var(--url);        /* explicit green for both modes */
  text-decoration: none;   /* optional: keep it clean */
}

.result-url a:hover {
  text-decoration: underline;
}


.result-desc {
  font-size: 14px;
  color: var(--fg);
  margin-top: 6px;
}

.result-meta {
  font-size: 12px;
  color: var(--muted);
  margin-top: 6px;
}

/* ============================================
   Results: unify all link colors (title/url/meta)
   ============================================ */
ol.results a,
ol.results a:visited {
  color: var(--url);
  font-weight: 600;        /* bolder links */
  text-decoration: none;
}

ol.results a:hover {
  text-decoration: underline;
}

/* crawl badge inside URL line (e.g. (crawl failed)) */
.crawl-badge {
  font-size: 11px;
  margin-left: 6px;
  padding: 2px 6px;
  border-radius: 999px;
  border: 1px solid var(--border);
}

.crawl-badge.fail {
  color: var(--error);
  background: var(--error-soft);
  border-color: rgba(248,113,113,0.6);
}

/* crawl error text block */

.result-error {
  font-size: 12px;
  color: var(--error);
  margin-top: 4px;
  white-space: pre-wrap;
}

/* =========
   Footer
   ========= */

footer {
  text-align: center;
  color: var(--muted);
  padding: 24px;
  border-top: 1px solid var(--border);
  background: var(--footer-bg);
}

/* =========
   Suggestions dropdown
   ========= */

form.search {
  position: relative;
}

.suggestions-list {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  background: var(--suggest-bg);
  border: 1px solid var(--border);
  margin: 0;
  padding: 0;
  list-style: none;
  max-height: 220px;
  overflow-y: auto;
  z-index: 1000;
  box-shadow: 0 18px 40px rgba(0,0,0,0.15);
  display: none;
}

.suggestions-list li {
  padding: 6px 10px;
  cursor: pointer;
  font-size: 14px;
  color: var(--fg);
}

.suggestions-list li:hover {
  background: var(--suggest-hover-bg);
}

/* =========
   Responsive tweaks
   ========= */

@media (max-width: 480px) {
  .brand-title {
    font-size: 18px;
  }

  .search button {
    font-size: 14px;
    padding-inline: 14px;
  }
}

.search-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;   /* Important for mobile / small screens */
  margin-bottom: 12px;
}

.search-row input[type="search"] {
  flex: 1; /* Keep full width or shrink when needed */
}

.filters {
  margin-top: 4px;
  font-size: 14px;
}

.search {
  width: 100%;
}

.search-row {
  width: 100%;
}

/* Promo banner for chatcontrol.se */
.promo-banner {
  margin: 16px auto 12px;
  text-align: center;
}

.promo-banner a {
  display: inline-block;
}

.promo-banner img {
  max-width: 100%;
  height: auto;
  width: 320px;          /* logical size on mobile */
  border-radius: 8px;    /* optional, matches modern feel */
}

/* On wider screens, let it breathe a bit more */
@media (min-width: 900px) {
  .promo-banner img {
    width: 468px;        /* classic “full banner” inside the 860px column */
  }
}

/* Prefix each result with "#1 ", "#2 ", etc. based on data-visible-rank */
li.result::before {
  content: "#" attr(data-visible-rank) " ";
  font-weight: bold;
  margin-right: 0.25rem;
}



/* ============================================
   Encuro alignment – text tones (light only)
   ============================================ */

@media (prefers-color-scheme: light) {
  :root {
    --fg: #111827;   /* near-black, Encuro-like */
    --muted: #4b5563;/* charcoal grey for secondary text */
  }

  /* Stronger paragraphs & helper text in light mode */
  .result-desc,
  .hint,
  .brand-subtitle {
    color: #333333;
  }

  /* Light mode: dark blue search button like Encuro hero */
  .search button {
    background: #1c2f70;
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.18);
    color: #ffffff;
  }

  .search button:hover {
    background: #263b8a;
  }
}

/* ============================================
   Encuro alignment – dark mode readability
   ============================================ */

@media (prefers-color-scheme: dark) {
  /* Keep the earlier dark palette, but ensure text is bright */
  .result-desc,
  .hint,
  .brand-subtitle {
    color: #e5e7eb; /* light grey, readable on dark bg */
  }

  footer {
    color: #e5e7eb; /* make footer text clearly readable */
  }

  /* Make sure the search input text + placeholder is legible */
  .search input[type="search"] {
    color: #f9fafb;
  }

  .search input[type="search"]::placeholder {
    color: #9ca3af;
  }
    /* Dark mode: Encuro brick-red-orange search button */
  .search button {
    background: #d94822;
    color: #ffffff;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
    border: none;
  }

  .search button:hover {
    background: #e65a33;
  }
body {
    background:
      /* soft indigo glow top-left */
      radial-gradient(circle at 12% -10%, rgba(37, 99, 235, 0.20), transparent 55%),
      /* very subtle violet on the right, much lower alpha */
      radial-gradient(circle at 88% -10%, rgba(79, 70, 229, 0.12), transparent 60%),
      /* deepen bottom area instead of bright teal */
      radial-gradient(circle at 50% 120%, rgba(15, 23, 42, 0.85), transparent 65%),
      /* base deep navy */
      linear-gradient(145deg, #020617 0%, #020617 40%, #020617 100%);
    background-attachment: fixed;
  }

  body::before {
    /* keep as-is, nice subtle grid */
    background-image:
      linear-gradient(to right, rgba(15,23,42,0.45) 1px, transparent 1px),
      linear-gradient(to bottom, rgba(15,23,42,0.45) 1px, transparent 1px);
    background-size: 26px 26px;
    mix-blend-mode: soft-light;
    opacity: 0.28;
  }
}

/* ============================================
   Content links: use URL-green across pages
   (search results, winners, stat pages, etc.)
   ============================================ */
main a,
main a:visited {
  color: var(--url);
  font-weight: 600;
  text-decoration: none;
}

main a:hover {
  text-decoration: underline;
}

/* Winners page: make all links green/bold */
.winner-table a,
.winner-table a:visited,
main .hint a,
main .hint a:visited {
  color: var(--url);
  font-weight: 600;
  text-decoration: none;
}

.winner-table a:hover,
main .hint a:hover {
  text-decoration: underline;
}

/* Footer links: same green as URLs */
footer a,
footer a:visited {
  color: var(--url);
  font-weight: 600;
  text-decoration: none;
}

footer a:hover {
  text-decoration: underline;
}


.home-btn {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    text-decoration: none;
    font-weight: 700;
    padding: 8px 14px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--bg-elevated);
    color: var(--fg);
  }
  .home-btn:hover { filter: brightness(1.05); }
  
  header .wrap { position: relative; }

/* Make top header row full width */
header .topbar{
  width: 100%;
}

/* Let brand take left side, menu stick to right */
header .brand{
  flex: 1 1 auto;
}

/* Force hamburger fully right */
header .hamburger{
  margin-left: auto;
}

.header-bar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}

/* keep your normal wrap unchanged */
.wrap{
  max-width: 1100px;
  margin: 0 auto;
}

/* --- FORCE top row: brand left, hamburger right --- */
header .topbar{
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
}

/* brand already has margin-bottom in your CSS; remove it inside topbar */
header .topbar .brand{
  margin-bottom: 0 !important;
  flex: 1 1 auto;
  min-width: 0; /* allow text to shrink instead of wrapping layout */
}

/* keep the button from wrapping below */
header .topbar .hamburger{
  flex: 0 0 auto;
  margin-left: 12px;
}

header .brand-text { min-width: 0; }
header .brand-title,
header .brand-subtitle{
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ===== HEADER TOP BAR ===== */
header > .wrap > .topbar{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}


