/* =========================================
   Mapping Robinson Crusoe – main stylesheet
   Layout inspired by Frans Hals Museum
   ========================================= */

:root {
  --bg: #FFF0DE;
  --card-bg: #ffffff;
  --text-main: #222222;
  --text-muted: #666666;
  --accent: #D68A2D; 
  --accent-soft: #CC9E66;
  --border-subtle: #ded6c9;

  --radius-lg: 24px;
  --shadow-soft: 0 18px 45px rgba(0, 0, 0, 0.12);
  --max-width: 1120px;
}

/* ---------- Base ---------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  background: var(--bg);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

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

/* ---------- Header & Navigation ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(244, 239, 232, 0.92);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  background: var(--accent-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.85rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.brand-text {
  display: flex;
  flex-direction: column;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.brand-title {
  font-weight: 600;
}

.brand-subtitle {
  color: var(--text-muted);
  font-size: 0.7rem;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 1.75rem;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

.site-nav a {
  position: relative;
  padding: 0.25rem 0;
  text-decoration: none;
}

.site-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -0.25rem;
  width: 0;
  height: 2px;
  background: var(--accent);
  transition: width 0.2s ease;
}

.site-nav a:hover::after,
.site-nav a.is-active::after {
  width: 100%;
}

/* Mobile nav toggle */

.nav-toggle {
  display: none;
  border: none;
  background: transparent;
  padding: 0.25rem;
  cursor: pointer;
}

.nav-toggle-box {
  width: 20px;
  height: 16px;
  position: relative;
}

.nav-toggle-line {
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: #333;
  border-radius: 999px;
  transition: transform 0.2s ease, opacity 0.2s ease, top 0.2s ease,
    bottom 0.2s ease;
}

.nav-toggle-line:nth-child(1) {
  top: 0;
}

.nav-toggle-line:nth-child(2) {
  top: 7px;
}

.nav-toggle-line:nth-child(3) {
  bottom: 0;
}

.site-header.is-open .nav-toggle-line:nth-child(1) {
  top: 7px;
  transform: rotate(45deg);
}

.site-header.is-open .nav-toggle-line:nth-child(2) {
  opacity: 0;
}

.site-header.is-open .nav-toggle-line:nth-child(3) {
  bottom: 7px;
  transform: rotate(-45deg);
}

/* ---------- Main layout ---------- */

.main {
  padding: 2.5rem 0 4rem;
}

/* Eyebrow label used in multiple sections */

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

/* ---------- Hero / Collections slider ---------- */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1.3fr);
  gap: 2.5rem;
  align-items: stretch;
  margin-bottom: 4rem;
}

.hero-text h1 {
  font-size: clamp(2.1rem, 3vw, 2.7rem);
  line-height: 1.1;
  margin: 0 0 1rem;
  font-weight: 600;
}

.hero-text p {
  font-size: 1rem;
  color: var(--text-muted);
  max-width: 34rem;
}

.hero-actions {
  margin-top: 1.75rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.btn-primary,
.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.7rem 1.4rem;
  border-radius: 999px;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease,
    background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.btn-primary {
  background: var(--accent);
  color: #ffffff;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.25);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.3);
  text-decoration: none;
}

.btn-ghost {
  background: transparent;
  border-color: var(--accent);
  color: var(--accent);
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.7);
  text-decoration: none;
}

/* Slider frame */

.hero-slider {
  position: relative;
  min-height: 320px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--card-bg);
  box-shadow: var(--shadow-soft);
}

.hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.6s ease;
  display: flex;
  flex-direction: column;
}

.hero-slide.is-active {
  opacity: 1;
}

.hero-slide-image {
  flex: 1 1 auto;
  overflow: hidden;
}

.hero-slide-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Caption overlays bottom of the image like a museum label */

.hero-slide-caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 1.4rem 1.6rem 1.6rem;
  color: #ffffff;
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.75),
    rgba(0, 0, 0, 0.15),
    transparent
  );
}

.hero-slide-caption h2 {
  font-size: 1.2rem;
  margin: 0 0 0.3rem;
}

.hero-slide-caption p {
  margin: 0;
  font-size: 0.85rem;
}

/* Dots + arrows */

.hero-dots {
  position: absolute;
  left: 1.4rem;
  bottom: 1.6rem;
  display: flex;
  gap: 0.35rem;
}

.hero-dots button {
  width: 8px;
  height: 8px;
  padding: 0;
  border-radius: 999px;
  border: none;
  background: rgba(255, 255, 255, 0.45);
  cursor: pointer;
}

.hero-dots button.is-active {
  width: 16px;
  background: #ffffff;
}

.hero-slide-control {
  position: absolute;
  bottom: 1.35rem;
  right: 1.4rem;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: none;
  background: rgba(0, 0, 0, 0.6);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.hero-slide-control.prev {
  right: 3.4rem;
}

/* ---------- Welcome section (image + text touching) ---------- */

.welcome {
  margin-bottom: 4rem;
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 2.4fr);
  gap: 0;
  align-items: stretch;
}

.welcome-image {
  border-radius: var(--radius-lg) 0 0 var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
}

.welcome-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.welcome-text {
  background: var(--card-bg);
  border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
  box-shadow: var(--shadow-soft);
  padding: 2rem 2.4rem;
  position: relative;
}

.welcome-text h2 {
  margin: 0 0 0.8rem;
  font-size: 1.6rem;
}

.welcome-text p {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin: 0 0 0.8rem;
}

/* ---------- Highlights / featured collections ---------- */

.highlights {
  margin-bottom: 4rem;
}

.section-heading {
  margin-bottom: 1.8rem;
  max-width: 40rem;
}

.section-heading h2 {
  margin: 0 0 0.6rem;
  font-size: 1.5rem;
}

.section-heading p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.highlight-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.5rem;
}

.highlight-card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-soft);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.highlight-card img {
  width: 100%;
  height: 180px;
  object-fit: cover;
}

.highlight-body {
  padding: 1.4rem 1.5rem 1.5rem;
}

.highlight-body h3 {
  margin: 0 0 0.4rem;
  font-size: 1rem;
}

.highlight-body p {
  margin: 0 0 0.9rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.highlight-link {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
}

.highlight-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 22px 50px rgba(0, 0, 0, 0.18);
  text-decoration: none;
}

/* ---------- Generic content pages ---------- */

.page-intro {
  max-width: 42rem;
  margin: 0 auto 2.5rem;
}

.page-intro h1 {
  margin: 0 0 0.85rem;
  font-size: 1.9rem;
}

.page-intro p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.98rem;
}

.page-section {
  margin-bottom: 3rem;
}

.page-section h2 {
  margin: 0 0 0.7rem;
  font-size: 1.35rem;
}

.page-section p {
  margin: 0 0 0.7rem;
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* ---------- Map figure on collection pages ---------- */

.map-figure {
  margin: 0;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  background: var(--card-bg);
}

.map-figure img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
}

.map-figure-caption {
  padding: 0.9rem 1.2rem 1.1rem;
  font-size: 0.9rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border-subtle);
}

/* ---------- Code block styling on mapping page ---------- */

.code-block {
  margin-top: 1rem;
  padding: 1rem 1.2rem;
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  border: 1px solid var(--border-subtle);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
    "Liberation Mono", "Courier New", monospace;
  font-size: 0.85rem;
  line-height: 1.5;
  overflow-x: auto;
}

.code-block code {
  white-space: pre;
}

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

.site-footer {
  border-top: 1px solid var(--border-subtle);
  padding: 1.8rem 0 2.2rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

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

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

@media (max-width: 960px) {
  .hero {
    grid-template-columns: minmax(0, 1fr);
  }

  .welcome {
    grid-template-columns: minmax(0, 1fr);
  }

  .welcome-image {
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  }

  .welcome-text {
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    margin-top: -0.8rem; /* small overlap to keep them "touching" */
  }

  .highlight-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  .header-inner {
    padding-inline: 1rem;
  }

  .site-nav {
    position: absolute;
    top: 100%;
    right: 1.5rem;
    margin-top: 0.4rem;
    padding: 0.75rem 1.2rem;
    border-radius: 999px;
    background: var(--card-bg);
    box-shadow: var(--shadow-soft);
    flex-direction: column;
    gap: 0.7rem;
    display: none;
  }

  .site-header.is-open .site-nav {
    display: flex;
  }

  .nav-toggle {
    display: inline-flex;
  }

  .hero {
    margin-bottom: 3.25rem;
  }

  .highlights {
    margin-bottom: 3rem;
  }

  .highlight-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .hero-slider {
    min-height: 260px;
  }
}

@media (max-width: 480px) {
  .hero-text h1 {
    font-size: 1.9rem;
  }

  .welcome-text {
    padding: 1.6rem 1.5rem 1.8rem;
  }
}
