/* DSF Challenge site styles - only --qe-* tokens, no hardcoded brand colors. */

.site-nav { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.site-nav-link {
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 500;
  padding: 4px 2px;
  border-bottom: 2px solid transparent;
  transition: var(--qe-transition);
}
.site-nav-link:hover { color: #fff; }
.site-nav-link.active { color: #fff; border-bottom-color: var(--qe-green); }
.site-nav-link.as-button { background: none; border: none; cursor: pointer; font-family: var(--qe-font); }
.inline-form { display: inline; margin: 0; }
.nav-cta { font-size: 0.85rem; padding: 8px 16px; text-decoration: none; }

/* Hero */
.hero {
  position: relative;
  border-radius: var(--qe-radius);
  overflow: hidden;
  background: var(--qe-gradient-header);
  color: #fff;
  margin-bottom: 40px;
}
.hero::before {
  content: "";
  position: absolute; inset: 0;
  background: url('/qe/images/keyvisual-hero.jpg') no-repeat center center;
  background-size: cover;
  opacity: 0.35;
}
.hero-inner { position: relative; padding: 72px 48px; max-width: 760px; }
.hero h2 { font-size: 2.2rem; font-weight: 700; line-height: 1.2; margin: 0 0 16px; }
.hero p.lead { font-size: 1.15rem; line-height: 1.6; color: rgba(255,255,255,0.92); }
.hero .claim { letter-spacing: 0.18em; font-size: 0.78rem; font-weight: 600; color: var(--qe-green); text-transform: uppercase; }
.hero p.lead a { color: var(--qe-green); text-decoration: underline; text-underline-offset: 3px; }
.hero p.lead a:hover { color: #fff; }
/* Team overlay — rendered only when HERO_TEAM_PHOTO is set in views/pages/home.js.
   The white diffusion following the team's silhouette is baked into the PNG itself
   (regenerable via tools/team-photo/, see README there), so no styling is needed here. */
.hero-team {
  position: absolute;
  top: 50%;
  right: 16px;
  transform: translateY(-50%);
  width: min(46%, 680px);
}
.hero:has(.hero-team) .hero-inner { max-width: min(760px, 50%); }
@media (max-width: 1280px) {
  .hero-team { display: none; }
  .hero:has(.hero-team) .hero-inner { max-width: 760px; }
}

/* Content blocks */
.section { margin: 40px 0; }
.section h3 { color: var(--qe-dark-blue); font-weight: 700; margin-bottom: 16px; }
.card-qe {
  background: var(--qe-card);
  border: 1px solid var(--qe-border);
  border-radius: var(--qe-radius);
  box-shadow: var(--qe-shadow);
  padding: 28px;
  margin-bottom: 20px;
}
.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; }
.card-qe .icon { width: 36px; height: 36px; margin-bottom: 12px; }
.muted { color: var(--qe-text-light); }
.notice {
  background: var(--qe-primary-light);
  border: 1px solid var(--qe-border);
  border-left: 4px solid var(--qe-primary);
  border-radius: var(--qe-radius-sm);
  padding: 16px 20px;
  margin: 20px 0;
  font-size: 0.95rem;
}
.notice.warn { border-left-color: var(--qe-warning); background: #fff; }

/* Code / API docs */
pre.code, code.inline {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  background: var(--qe-dark);
  color: #e2e8f0;
  border-radius: var(--qe-radius-sm);
}
pre.code { padding: 18px 20px; overflow-x: auto; font-size: 0.85rem; line-height: 1.55; }
code.inline { background: var(--qe-primary-light); color: var(--qe-dark-blue); padding: 1px 6px; border-radius: 4px; font-size: 0.88em; }
.endpoint { border: 1px solid var(--qe-border); border-radius: var(--qe-radius-sm); margin-bottom: 14px; background: var(--qe-card); }
.endpoint summary { padding: 14px 18px; cursor: pointer; font-weight: 600; color: var(--qe-dark-blue); }
.endpoint .endpoint-body { padding: 0 18px 18px; }
.endpoint .method { display: inline-block; min-width: 52px; text-align: center; font-size: 0.75rem; font-weight: 700; border-radius: 4px; padding: 2px 8px; margin-right: 10px; background: var(--qe-primary-light); color: var(--qe-primary-dark); }
.endpoint .method.post { background: var(--qe-success-bg); color: var(--qe-dark-blue); }
table.params { width: 100%; border-collapse: collapse; font-size: 0.9rem; margin: 10px 0; }
table.params th, table.params td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--qe-border); vertical-align: top; }
table.params th { color: var(--qe-text-light); font-weight: 600; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.04em; }

/* API explorer (Try it) */
.api-key-box input {
  width: 100%;
  border: 1px solid var(--qe-border);
  border-radius: var(--qe-radius-sm);
  padding: 10px 12px;
  margin: 8px 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.92rem;
  color: var(--qe-text);
  background: var(--qe-card);
}
.api-key-box input:focus { outline: 2px solid var(--qe-primary); border-color: var(--qe-primary); }
.curl-row { display: flex; align-items: flex-start; gap: 10px; }
.curl-row pre.code { flex: 1; margin: 0; }
.curl-row .btn-copy { flex-shrink: 0; font-size: 0.82rem; padding: 6px 14px; }
.try-it { display: flex; align-items: center; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.try-it .try-base { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.88rem; color: var(--qe-text-light); }
.try-it .try-query {
  flex: 1;
  min-width: 220px;
  border: 1px solid var(--qe-border);
  border-radius: var(--qe-radius-sm);
  padding: 8px 10px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.85rem;
  color: var(--qe-text);
  background: var(--qe-card);
}
.try-it .try-query:focus { outline: 2px solid var(--qe-primary); border-color: var(--qe-primary); }
.try-result { margin-top: 12px; max-height: 420px; overflow: auto; }

/* Forms */
.form-qe { max-width: 560px; }
.form-qe .field { margin-bottom: 18px; }
.form-qe label { display: block; font-weight: 600; color: var(--qe-dark-blue); margin-bottom: 6px; }
.form-qe input[type=text], .form-qe input[type=email], .form-qe textarea {
  width: 100%;
  border: 1px solid var(--qe-border);
  border-radius: var(--qe-radius-sm);
  padding: 10px 12px;
  font-family: var(--qe-font);
  font-size: 0.95rem;
  color: var(--qe-text);
  background: var(--qe-card);
}
.form-qe input:focus, .form-qe textarea:focus { outline: 2px solid var(--qe-primary); border-color: var(--qe-primary); }
.form-qe textarea { min-height: 160px; resize: vertical; }
.form-qe .form-qe-legend { display: block; font-weight: 600; color: var(--qe-dark-blue); margin-bottom: 6px; }
.form-qe .checkbox-row { display: flex; gap: 10px; align-items: flex-start; font-size: 0.92rem; }
.form-qe input[type=url] {
  width: 100%;
  border: 1px solid var(--qe-border);
  border-radius: var(--qe-radius-sm);
  padding: 10px 12px;
  font-family: var(--qe-font);
  font-size: 0.95rem;
  color: var(--qe-text);
  background: var(--qe-card);
}
.form-qe .checkbox-row input { margin-top: 3px; }
.field-error { color: var(--qe-danger); font-size: 0.85rem; margin-top: 4px; }
.form-error-box { background: var(--qe-danger-bg); border: 1px solid var(--qe-danger-border); border-radius: var(--qe-radius-sm); padding: 12px 16px; margin-bottom: 18px; color: var(--qe-text); }

/* Credentials reveal */
.credential-box {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--qe-dark);
  color: var(--qe-green);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  border-radius: var(--qe-radius-sm);
  padding: 14px 18px;
  margin: 10px 0 22px;
  word-break: break-all;
}
.credential-box button { flex-shrink: 0; }

/* Admin */
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 16px; margin-bottom: 28px; }
.stat-card { background: var(--qe-card); border: 1px solid var(--qe-border); border-radius: var(--qe-radius); padding: 18px 22px; box-shadow: var(--qe-shadow-sm); }
.stat-card .stat-value { font-size: 1.8rem; font-weight: 700; color: var(--qe-dark-blue); }
.stat-card .stat-label { font-size: 0.82rem; color: var(--qe-text-light); text-transform: uppercase; letter-spacing: 0.05em; }
table.data { width: 100%; border-collapse: collapse; font-size: 0.9rem; background: var(--qe-card); border-radius: var(--qe-radius-sm); overflow: hidden; box-shadow: var(--qe-shadow-sm); }
table.data th, table.data td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--qe-border); }
table.data th { background: var(--qe-bg); color: var(--qe-text-light); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.05em; }
table.data tr:hover td { background: var(--qe-primary-light); }
.badge-score { display: inline-block; min-width: 44px; text-align: center; border-radius: 999px; padding: 2px 10px; font-weight: 700; font-size: 0.82rem; background: var(--qe-primary-light); color: var(--qe-primary-dark); }
.verdict-shortlist { color: var(--qe-success); font-weight: 700; }
.verdict-decline { color: var(--qe-danger); font-weight: 700; }
.verdict-second_round { color: var(--qe-accent); font-weight: 700; }

/* Responsive (CI breakpoints 992 / 768 / 480) */
@media (max-width: 992px) {
  .hero-inner { padding: 56px 32px; }
}
@media (max-width: 768px) {
  .site-nav { gap: 12px; }
  .hero h2 { font-size: 1.7rem; }
  .hero-inner { padding: 40px 24px; }
}
@media (max-width: 480px) {
  .header-title span { display: none; }
  .nav-cta { display: none; }
  .hero h2 { font-size: 1.45rem; }
}
