/* ============================================================
   Search-engine styled version of the site.

   Self-contained: it shares no stylesheet with the standard site, so the two
   can look completely different without either constraining the other. The
   four colours come from settings, injected as variables by searchUiTheme().
   ============================================================ */

:root {
  --sui-accent:  #1a73e8;
  --sui-link:    #1a0dab;
  --sui-visited: #681da8;
  --sui-url:     #006621;

  --sui-text:    #202124;
  --sui-muted:   #70757a;
  --sui-line:    #dadce0;
  --sui-surface: #fff;
  --sui-hover:   #f8f9fa;
  --sui-radius:  24px;
  --sui-font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
}

* { box-sizing: border-box; }

body.sui {
  margin: 0;
  font-family: var(--sui-font);
  font-size: 14px;
  color: var(--sui-text);
  background: var(--sui-surface);
  -webkit-font-smoothing: antialiased;
}

body.sui a { color: var(--sui-link); }
body.sui a:visited { color: var(--sui-visited); }

/* ---------- header ---------- */

.sui-header {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-areas: 'brand search' 'tabs tabs';
  align-items: center;
  gap: 10px 22px;
  padding: 18px 20px 0;
  border-bottom: 1px solid var(--sui-line);
  position: sticky; top: 0; z-index: 30;
  background: var(--sui-surface);
}

.sui-brand {
  grid-area: brand;
  font-size: 23px; font-weight: 700; letter-spacing: -.5px;
  color: var(--sui-accent) !important; text-decoration: none;
}

.sui-searchbar {
  grid-area: search;
  display: flex; align-items: center; gap: 8px;
  max-width: 640px; width: 100%;
  border: 1px solid var(--sui-line); border-radius: var(--sui-radius);
  padding: 0 8px 0 18px; height: 44px;
  transition: box-shadow .15s, border-color .15s;
}
.sui-searchbar:focus-within {
  box-shadow: 0 1px 6px rgba(32, 33, 36, .28); border-color: transparent;
}
.sui-searchbar input {
  flex: 1 1 auto; min-width: 0;
  border: 0; outline: 0; background: none;
  font-family: inherit; font-size: 16px; color: var(--sui-text);
}
.sui-searchbar button {
  flex: 0 0 auto; display: grid; place-items: center;
  width: 36px; height: 36px; border: 0; border-radius: 50%;
  background: none; color: var(--sui-accent); cursor: pointer;
}
.sui-searchbar button:hover { background: var(--sui-hover); }

.sui-tabs { grid-area: tabs; display: flex; gap: 26px; margin-top: 14px; }
.sui-tabs a {
  padding-bottom: 12px; font-size: 13.5px; text-decoration: none;
  color: var(--sui-muted) !important; border-bottom: 3px solid transparent;
}
.sui-tabs a.active { color: var(--sui-accent) !important; border-bottom-color: var(--sui-accent); }

@media (max-width: 640px) {
  .sui-header { grid-template-columns: 1fr; grid-template-areas: 'brand' 'search' 'tabs'; }
  .sui-searchbar { max-width: none; }
  .sui-tabs { gap: 18px; overflow-x: auto; }
}

/* ---------- results ---------- */

.sui-main { max-width: 692px; margin: 0; padding: 20px 20px 60px; }
@media (min-width: 1100px) { .sui-main { margin-left: 170px; } }

.sui-count { color: var(--sui-muted); font-size: 12.5px; margin-bottom: 22px; }
.sui-count span { opacity: .85; }

.sui-result { display: flex; gap: 12px; margin-bottom: 30px; }

.sui-favicon {
  flex: 0 0 auto; width: 26px; height: 26px; margin-top: 3px;
  border-radius: 50%; object-fit: contain;
  background: var(--sui-surface); border: 1px solid var(--sui-line);
}

.sui-result-body { min-width: 0; }

.sui-crumbs {
  font-size: 12px; color: var(--sui-url);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  margin-bottom: 3px;
}

.sui-title { margin: 0 0 3px; font-size: 20px; font-weight: 400; line-height: 1.3; }
.sui-title a { text-decoration: none; }
.sui-title a:hover { text-decoration: underline; }

.sui-snippet {
  margin: 0; font-size: 14px; line-height: 1.58; color: #4d5156;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

.sui-facts { margin-top: 6px; display: flex; flex-wrap: wrap; gap: 6px 14px; }
.sui-facts span { font-size: 12.5px; color: var(--sui-muted); }

/* ---------- home ---------- */

body.sui-home { display: flex; flex-direction: column; min-height: 100vh; }

.sui-home-top { display: flex; justify-content: flex-end; gap: 18px; padding: 18px 24px; }
.sui-home-top a { font-size: 13.5px; color: var(--sui-text) !important; text-decoration: none; }
.sui-home-top a:hover { text-decoration: underline; }

.sui-hero {
  flex: 1 1 auto; display: flex; flex-direction: column; align-items: center;
  padding: 8vh 20px 40px; text-align: center;
}
.sui-wordmark {
  font-size: clamp(44px, 9vw, 76px); font-weight: 700; letter-spacing: -2px;
  color: var(--sui-accent); margin: 0 0 26px;
}
.sui-hero .sui-searchbar { height: 48px; max-width: 584px; }
.sui-hero-tagline { margin: 0 0 26px; font-size: 15px; color: var(--sui-muted); }

.sui-hero-actions { display: flex; gap: 12px; margin-top: 26px; flex-wrap: wrap; justify-content: center; }
.sui-hero-actions a {
  padding: 9px 18px; border-radius: 4px; font-size: 14px; text-decoration: none;
  background: var(--sui-hover); color: var(--sui-text) !important; border: 1px solid transparent;
}
.sui-hero-actions a:hover { border-color: var(--sui-line); }

/* Latest articles under the search box */
.sui-articles { width: 100%; max-width: 760px; margin: 56px auto 0; text-align: left; }
.sui-articles h2 { font-size: 14px; font-weight: 500; color: var(--sui-muted); margin: 0 0 14px; }
.sui-article-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); }
.sui-article {
  display: block; padding: 14px 16px; border: 1px solid var(--sui-line);
  border-radius: 8px; text-decoration: none; transition: background .15s, box-shadow .15s;
}
.sui-article:hover { background: var(--sui-hover); box-shadow: 0 1px 4px rgba(32,33,36,.12); }
.sui-article-title { display: block; font-size: 15px; line-height: 1.35; margin-bottom: 4px; }
.sui-article-meta { display: block; font-size: 12.5px; color: var(--sui-muted); }

/* ---------- company page ---------- */

.sui-company-head {
  display: flex; align-items: center; gap: 16px;
  padding-bottom: 20px; margin-bottom: 6px; border-bottom: 1px solid var(--sui-line);
}
.sui-company-logo {
  width: 56px; height: 56px; border-radius: 8px; object-fit: contain;
  border: 1px solid var(--sui-line); background: var(--sui-surface);
}
.sui-company-head h1 { margin: 0 0 4px; font-size: 24px; font-weight: 400; }
.sui-company-head .sui-crumbs { white-space: normal; }

.sui-about { margin: 22px 0 30px; font-size: 14px; line-height: 1.6; color: #4d5156; }
.sui-about p { margin: 0 0 .8em; }

.sui-section-title { font-size: 16px; font-weight: 500; margin: 0 0 18px; }

/* ---------- shared bits ---------- */

.sui-empty { padding: 40px 0; color: var(--sui-muted); font-size: 14px; }

.sui-pager { display: flex; gap: 14px; align-items: center; margin: 34px 0 0; }
.sui-pager a, .sui-pager span {
  font-size: 13.5px; text-decoration: none; padding: 6px 10px; border-radius: 4px;
}
.sui-pager a:hover { background: var(--sui-hover); }
.sui-pager .current { color: var(--sui-text); font-weight: 600; }

.sui-ad { margin: 0 0 28px; }

.sui-footer { border-top: 1px solid var(--sui-line); background: var(--sui-hover); margin-top: 40px; }
.sui-footer-inner {
  display: flex; flex-wrap: wrap; gap: 10px 22px; justify-content: space-between;
  padding: 18px 24px; font-size: 12.5px; color: var(--sui-muted);
}
.sui-footer-inner nav { display: flex; flex-wrap: wrap; gap: 18px; }
.sui-footer-inner a { color: var(--sui-muted) !important; text-decoration: none; }
.sui-footer-inner a:hover { text-decoration: underline; }

/* Ads keep to their column here too */
.sui-ad, .custom-ad-slot {
  max-width: 100%;
  overflow: hidden;
  box-sizing: border-box;
}
.sui-ad > *, .sui-ad ins, .sui-ad iframe, .sui-ad img,
.custom-ad-slot > *, .custom-ad-slot ins, .custom-ad-slot iframe, .custom-ad-slot img {
  max-width: 100% !important;
  box-sizing: border-box;
}
