/* ==========================================================================
   Modern stylesheet for Cyril Pitrou's homepage
   - One file, edit here to change the look of every page
   - Plain CSS, no build step required to use it
   - Imports nav.css, the shared header/nav/footer also used on
     primat.htm, xpand.htm, xconf.htm
   ========================================================================== */

@import url("nav.css");

:root {
  --color-accent: #795F3C;
  --color-bg: #f6f8fb;
  --color-bg-alt: #e9eff7;
  --color-card: #ffffff;
  --color-text: #222831;
  --color-muted: #5b6573;
  --max-width: 1100px;
  --radius: 10px;
  --shadow: 0 2px 10px rgba(20, 40, 80, 0.08);
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
}

body {
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.6;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* ---------------- Hero ---------------- */

.hero {
  background: linear-gradient(135deg, var(--color-bg-alt) 0%, var(--color-bg) 100%);
  padding: 3rem 0 2rem;
  text-align: center;
}

.hero h1 {
  font-size: 2.4rem;
  margin: 0 0 0.4rem;
  color: var(--color-accent);
}

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

.hero-photo {
  width: 160px;
  height: 160px;
  object-fit: cover;
  border-radius: 50%;
  box-shadow: var(--shadow);
  margin-bottom: 1rem;
  border: 4px solid #fff;
}

/* ---------------- Photo gallery ---------------- */

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 0.6rem;
  margin: 1.5rem 0 2.5rem;
}

.gallery img {
  width: 100%;
  height: 130px;
  object-fit: cover;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: transform 0.2s ease;
}

.gallery img:hover {
  transform: scale(1.04);
}

/* Single randomly-picked photo, shown full-width */

.random-photo {
  margin: 1.5rem 0 2.5rem;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.random-photo img {
  display: block;
  width: 100%;
  height: 360px;
  object-fit: cover;
}

@media (max-width: 700px) {
  .random-photo img {
    height: 220px;
  }
}

/* ---------------- Content sections / cards ---------------- */

main.container {
  padding-top: 2rem;
  padding-bottom: 3rem;
}

h1, h2, h3 {
  color: var(--color-accent);
}

h2 {
  border-bottom: 2px solid var(--color-bg-alt);
  padding-bottom: 0.3rem;
  margin-top: 2.2rem;
}

.card {
  background: var(--color-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.25rem;
}

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

.card-grid .card {
  margin-bottom: 0;
}

.card h3 {
  margin-top: 0;
}

/* Image galleries inside card-grid (e.g. code screenshots) */

.card-grid img {
  display: block;
  width: 100%;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* ---------------- Code page feature boxes (PRIMAT, xPand, xConf) ---------------- */

.newfeature {
  background: linear-gradient(135deg, var(--color-bg-alt) 0%, #f4f8e8 100%);
  border-left: 5px solid var(--color-primary);
  border-radius: var(--radius);
  padding: 1rem 1.5rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow);
}

.newbadge {
  display: inline-block;
  background: var(--color-primary);
  color: #fff;
  font-weight: bold;
  font-size: 0.7rem;
  letter-spacing: 1px;
  padding: 2px 9px;
  border-radius: 4px;
  margin-right: 8px;
  vertical-align: middle;
}

.gh-btn {
  display: inline-block;
  background: #24292e;
  color: #fff !important;
  padding: 7px 16px;
  border-radius: 6px;
  font-family: "Courier New", monospace;
  font-size: 0.9rem;
  margin: 6px 4px 6px 0;
  font-weight: bold;
  text-decoration: none !important;
  border: none;
}

.gh-btn:hover {
  background: #444d56 !important;
  color: #fff !important;
}

.app-btn {
  display: inline-block;
  background: #FF4B4B;
  color: #fff !important;
  padding: 7px 16px;
  border-radius: 6px;
  font-family: "Courier New", monospace;
  font-size: 0.9rem;
  margin: 6px 4px 6px 0;
  font-weight: bold;
  text-decoration: none !important;
  border: none;
}

.app-btn:hover {
  background: #d6373a !important;
  color: #fff !important;
}

.subfeature-title {
  font-size: 1.05rem;
  font-weight: bold;
  color: var(--color-accent);
  margin-top: 0.6rem;
  margin-bottom: 0.4rem;
}

.feature-divider {
  border: none;
  border-top: 1px solid var(--color-bg-alt);
  margin: 1rem 0;
}

/* Collapsible long lists (e.g. citation lists) */

details > summary {
  cursor: pointer;
  font-weight: bold;
  color: var(--color-primary);
}

details ul {
  margin-top: 1rem;
  padding-left: 1.25rem;
}

details li {
  margin-bottom: 0.75rem;
}

a {
  color: var(--color-primary);
}

a:hover {
  color: var(--color-accent);
}
