/* Who is Fero — public page (matches app light theme, mobile-first) */
@import url("../shared/fero-light-theme.css");

:root {
  --radius: 16px;
}

* {
  box-sizing: border-box;
}

html {
  overflow-x: hidden;
}

body.fero-page {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans Arabic", sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  overflow-x: hidden;
}

.fero-top {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--paper);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 0 rgba(43, 38, 34, 0.04);
}

.fero-top-inner {
  max-width: 720px;
  margin: 0 auto;
  padding: 0.75rem 1rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem 1rem;
}

.fero-top-nav {
  display: flex;
  align-items: center;
  gap: 0.35rem 0.85rem;
  flex: 1 1 auto;
  justify-content: center;
  order: 3;
  width: 100%;
}

@media (min-width: 560px) {
  .fero-top-nav {
    order: 0;
    width: auto;
    justify-content: flex-start;
    margin-inline-start: 0.5rem;
  }
}

.fero-top-nav-link {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 500;
  padding: 0.25rem 0;
}

.fero-top-nav-link:hover {
  color: var(--primary);
}

.fero-top-nav-link.is-current {
  color: var(--primary);
  font-weight: 600;
}

.fero-brand {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  line-height: 0;
}

.fero-brand-logo {
  display: block;
  width: auto;
  height: 2.75rem;
  max-width: 8rem;
  border-radius: 10px;
}

.fero-lang a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9rem;
}

.fero-lang a.active {
  color: var(--primary);
  font-weight: 600;
}

.fero-main {
  max-width: 720px;
  margin: 0 auto;
  padding: 1.25rem 1rem 2.5rem;
}

.fero-hero {
  background: linear-gradient(
    135deg,
    color-mix(in srgb, var(--secondary-container) 85%, var(--paper)),
    color-mix(in srgb, var(--primary-container) 70%, var(--paper))
  );
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 1.5rem 1.25rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow);
}

.fero-hero-icon {
  font-size: 2.25rem;
  margin-bottom: 0.5rem;
}

.fero-hero h1 {
  font-family: Fraunces, Georgia, serif;
  font-size: 1.55rem;
  margin: 0 0 0.5rem;
  line-height: 1.3;
  color: var(--ink);
}

.fero-hero p {
  margin: 0;
  font-size: 1.05rem;
  color: var(--muted);
}

.fero-features {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.fero-feature-card {
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  box-shadow: 0 2px 8px rgba(43, 38, 34, 0.04);
}

.fero-feature-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
  width: 2.5rem;
  height: 2.5rem;
  display: grid;
  place-items: center;
  background: var(--primary-container);
  border-radius: 50%;
}

.fero-feature-card h2 {
  font-family: Fraunces, Georgia, serif;
  font-size: 1.05rem;
  margin: 0 0 0.25rem;
}

.fero-feature-card p {
  margin: 0;
  font-size: 0.95rem;
  color: var(--muted);
}

.fero-section {
  margin-bottom: 1.5rem;
}

.fero-section-title {
  font-family: Fraunces, Georgia, serif;
  font-size: 1.35rem;
  margin: 0 0 0.35rem;
}

.fero-section-lead {
  margin: 0 0 1rem;
  color: var(--muted);
}

.fero-examples {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.fero-example {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(43, 38, 34, 0.05);
}

.fero-example-summary {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem;
  cursor: pointer;
  user-select: none;
}

.fero-example-summary::-webkit-details-marker {
  display: none;
}

.fero-example-num {
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: var(--primary);
  color: var(--on-primary);
  font-weight: 700;
  font-size: 0.95rem;
  display: grid;
  place-items: center;
}

.fero-example-head {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.fero-example-head strong {
  font-size: 1rem;
}

.fero-example-hint {
  font-size: 0.8rem;
  color: var(--primary);
  font-weight: 500;
}

.fero-example-chevron {
  flex-shrink: 0;
  width: 0.5rem;
  height: 0.5rem;
  border-inline-end: 2px solid var(--primary);
  border-bottom: 2px solid var(--primary);
  transform: rotate(-45deg);
  transition: transform 0.2s ease;
  margin-inline-end: 0.25rem;
}

[dir="rtl"] .fero-example-chevron {
  transform: rotate(135deg);
}

.fero-example[open] .fero-example-chevron {
  transform: rotate(45deg);
}

[dir="rtl"] .fero-example[open] .fero-example-chevron {
  transform: rotate(-135deg);
}

.fero-example-body {
  padding: 0 1rem 1rem;
  border-top: 1px solid var(--border);
}

.fero-example-summary-text {
  margin: 0.75rem 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.fero-block {
  background: var(--tertiary-container);
  border-radius: 12px;
  padding: 0.85rem 1rem;
  margin-bottom: 0.65rem;
}

.fero-block-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--tertiary);
  margin-bottom: 0.35rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.fero-block p {
  margin: 0;
  white-space: pre-wrap;
  word-wrap: break-word;
  overflow-wrap: anywhere;
}

.fero-question {
  font-size: 0.98rem;
}

.fero-md-rendered {
  max-width: 100%;
  overflow-x: hidden;
  word-wrap: break-word;
  overflow-wrap: anywhere;
  font-size: 0.95rem;
  line-height: 1.6;
}

.fero-md-rendered h1 {
  font-size: 1.25rem;
  margin: 0.6em 0 0.35em;
}

.fero-md-rendered h2 {
  font-size: 1.1rem;
  margin: 0.55em 0 0.3em;
}

.fero-md-rendered h3 {
  font-size: 1rem;
  margin: 0.5em 0 0.25em;
  color: var(--primary);
}

.fero-md-rendered p {
  margin: 0.4em 0;
}

.fero-md-rendered ul,
.fero-md-rendered ol {
  margin: 0.35em 0;
  padding-inline-start: 1.25em;
}

.fero-md-rendered hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 0.85rem 0;
}

.fero-md-rendered blockquote {
  margin: 0.5em 0;
  padding: 0.5em 0.75em;
  border-inline-start: 3px solid var(--tertiary);
  background: var(--surface2);
  border-radius: 0 8px 8px 0;
}

.fero-md-rendered pre,
.fero-md-rendered code {
  font-family: inherit;
  white-space: pre-wrap;
  word-wrap: break-word;
  overflow-wrap: anywhere;
  background: rgba(0, 0, 0, 0.05);
  border-radius: 8px;
}

.fero-md-rendered pre {
  overflow-x: hidden;
  max-width: 100%;
  padding: 0.65rem 0.75rem;
  margin: 0.5em 0;
}

.fero-md-rendered :not(pre) > code {
  padding: 0.1em 0.35em;
  font-size: 0.92em;
}

.fero-md-rendered table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  margin: 0.65em 0;
  font-size: 0.9rem;
}

.fero-md-rendered th,
.fero-md-rendered td {
  border: 1px solid var(--border);
  padding: 0.45rem 0.5rem;
  word-wrap: break-word;
  overflow-wrap: anywhere;
  vertical-align: top;
}

.fero-md-rendered th {
  background: var(--surface2);
}

@media (max-width: 520px) {
  .fero-md-rendered table {
    display: block;
  }

  .fero-md-rendered thead {
    display: none;
  }

  .fero-md-rendered tbody,
  .fero-md-rendered tr,
  .fero-md-rendered td {
    display: block;
    width: 100%;
  }

  .fero-md-rendered tr {
    margin-bottom: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.25rem 0;
  }

  .fero-md-rendered td {
    border: none;
    border-bottom: 1px solid var(--border);
  }

  .fero-md-rendered td:last-child {
    border-bottom: none;
  }
}

.fero-md-rendered .katex-display {
  max-width: 100%;
  overflow-x: hidden;
}

.fero-tip {
  background: var(--secondary-container);
  border-radius: var(--radius);
  padding: 1rem;
  font-size: 0.95rem;
  color: var(--on-secondary-container);
}

.fero-md-source {
  display: none !important;
}
