/* Workshop on X-Ray Scattering Data Analysis — site stylesheet */

:root {
  --blue: #00457c;       /* deep science blue */
  --blue-light: #e8f1f8;
  --orange: #f39200;     /* accent */
  --text: #222;
  --muted: #5a6570;
  --border: #d8dee4;
  --code-bg: #f4f6f8;
  --max-width: 960px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Segoe UI", -apple-system, "Helvetica Neue", Arial, sans-serif;
  font-size: 17px;
  line-height: 1.6;
  color: var(--text);
  background: #fff;
}

/* ---------- Header & navigation ---------- */

.site-header {
  background: var(--blue);
  color: #fff;
  border-bottom: 4px solid var(--orange);
}

.site-header .wrap {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}

.brand {
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  font-size: 1.05rem;
  padding: 0.9rem 0;
  letter-spacing: 0.02em;
}

nav.main-nav { display: flex; align-items: stretch; }

nav.main-nav > a,
nav.main-nav .dropdown > a {
  color: #fff;
  text-decoration: none;
  padding: 0.9rem 0.8rem;
  display: block;
  font-size: 0.95rem;
}

nav.main-nav > a:hover,
nav.main-nav .dropdown:hover > a { background: rgba(255, 255, 255, 0.12); }

nav.main-nav > a.active,
nav.main-nav .dropdown.active > a { box-shadow: inset 0 -4px 0 var(--orange); }

.dropdown { position: relative; }

.dropdown .menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 260px;
  background: #fff;
  border: 1px solid var(--border);
  border-top: 3px solid var(--orange);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 10;
}

.dropdown:hover .menu { display: block; }

.dropdown .menu a {
  display: block;
  padding: 0.6rem 0.9rem;
  color: var(--text);
  text-decoration: none;
  font-size: 0.92rem;
  border-bottom: 1px solid var(--border);
}

.dropdown .menu a:last-child { border-bottom: none; }
.dropdown .menu a:hover { background: var(--blue-light); }

/* ---------- Hero (index page) ---------- */

.hero {
  background: linear-gradient(135deg, #002a4d 0%, #00457c 55%, #015a8f 100%);
  color: #fff;
  padding: 3.2rem 1rem;
  text-align: center;
}

.hero h1 {
  margin: 0 auto 0.8rem;
  max-width: 820px;
  font-size: 2.3rem;
  font-weight: 800;
  line-height: 1.3;
  color: #fff;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
}

.hero p.subtitle {
  margin: 0 auto 1.5rem;
  max-width: 640px;
  font-size: 1.15rem;
  font-weight: 500;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}

.hero .facts {
  display: flex;
  justify-content: center;
  gap: 2rem;
  flex-wrap: wrap;
  font-size: 0.98rem;
  margin-bottom: 1.5rem;
}

.btn {
  display: inline-block;
  background: var(--orange);
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  padding: 0.7rem 1.6rem;
  border-radius: 4px;
}

.btn:hover { background: #d98200; }

/* ---------- Content ---------- */

main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2rem 1rem 3rem;
}

h1 { color: var(--blue); font-size: 1.7rem; line-height: 1.3; }
h2 {
  color: var(--blue);
  font-size: 1.3rem;
  margin-top: 2.2rem;
  padding-bottom: 0.3rem;
  border-bottom: 2px solid var(--blue-light);
}
h3 { color: var(--text); font-size: 1.1rem; margin-top: 1.6rem; }

a { color: #0a66a8; }

/* ---------- Boxes ---------- */

.box {
  border: 1px solid var(--border);
  border-left: 4px solid var(--blue);
  background: var(--blue-light);
  padding: 0.9rem 1.1rem;
  margin: 1.2rem 0;
  border-radius: 0 4px 4px 0;
}

.box.warn { border-left-color: var(--orange); background: #fdf3e3; }
.box.tip  { border-left-color: #2e8b57; background: #eaf5ee; }

.box p:first-child { margin-top: 0; }
.box p:last-child { margin-bottom: 0; }

/* ---------- Cards (index) ---------- */

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}

.card {
  border: 1px solid var(--border);
  border-top: 3px solid var(--orange);
  border-radius: 4px;
  padding: 1rem 1.2rem;
  background: #fff;
}

.card h3 { margin-top: 0.2rem; }
.card a.more { font-weight: 600; text-decoration: none; }

/* ---------- Tables ---------- */

table {
  border-collapse: collapse;
  width: 100%;
  margin: 1.2rem 0;
  font-size: 0.95rem;
}

th, td {
  border: 1px solid var(--border);
  padding: 0.5rem 0.7rem;
  text-align: left;
  vertical-align: top;
}

th { background: var(--blue); color: #fff; font-weight: 600; }
tr:nth-child(even) td { background: #f7f9fb; }

/* ---------- Code ---------- */

code {
  font-family: Consolas, "Courier New", monospace;
  font-size: 0.88em;
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 0.08em 0.35em;
}

pre {
  background: #22303c;
  color: #e8eef4;
  padding: 0.9rem 1.1rem;
  border-radius: 5px;
  overflow-x: auto;
  font-size: 0.86rem;
  line-height: 1.5;
}

pre code { background: none; border: none; color: inherit; padding: 0; }

/* ---------- Step lists (tutorials) ---------- */

ol.steps { counter-reset: step; list-style: none; padding-left: 0; }

ol.steps > li {
  counter-increment: step;
  position: relative;
  padding: 0 0 1.2rem 3rem;
  border-left: 2px solid var(--blue-light);
  margin-left: 1rem;
}

ol.steps > li::before {
  content: counter(step);
  position: absolute;
  left: -1rem;
  top: 0;
  width: 2rem;
  height: 2rem;
  line-height: 2rem;
  text-align: center;
  background: var(--blue);
  color: #fff;
  border-radius: 50%;
  font-weight: 700;
  font-size: 0.9rem;
}

ol.steps > li > strong:first-child { color: var(--blue); }

/* ---------- Figures / screenshots ---------- */

figure {
  margin: 1.6rem 0;
  text-align: center;
}

figure img {
  max-width: 100%;
  height: auto;
  border: 1px solid var(--border);
  border-radius: 4px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.10);
  background: #fff;
}

figure.small img { max-width: 420px; }

figcaption {
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 0.55rem;
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
}

/* ---------- References ---------- */

.refs { font-size: 0.9rem; color: var(--muted); }
.refs li { margin-bottom: 0.4rem; }

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

.site-footer {
  border-top: 1px solid var(--border);
  background: #f7f9fb;
  color: var(--muted);
  font-size: 0.85rem;
  text-align: center;
  padding: 1.2rem 1rem;
  margin-top: 2rem;
}

.site-footer a { color: var(--muted); }

/* ---------- Responsive ---------- */

@media (max-width: 700px) {
  .site-header .wrap { flex-direction: column; align-items: flex-start; }
  nav.main-nav { flex-wrap: wrap; }
  .hero h1 { font-size: 1.5rem; }
  .hero .facts { flex-direction: column; gap: 0.4rem; }
}
