/* Mauritius Guide. Palette: basalt and coral sand, plus the coloured earths of Chamarel, one per topic. */
:root {
  --basalt: #2a2421;
  --ink-soft: #5d5450;
  --sand: #f5f7f6;
  --sand-deep: #e7ebe8;
  --earth-1: #8f3b2e; /* oxide red  – places and sights */
  --earth-2: #6b5179; /* violet     – practical */
  --earth-3: #1f6f8b; /* lagoon     – things to do */
  --earth-4: #4f7d48; /* fern       – nature */
  --earth-5: #c08a3e; /* ochre      – food, shopping, nightlife */
  --c: var(--earth-3);
  --serif-display: 'Young Serif', Georgia, serif;
  --serif-text: 'Literata', Georgia, serif;
  --measure: 44rem;
  --gutter: clamp(1rem, 4vw, 2.5rem);
}
.topic--sights { --c: var(--earth-1); }
.topic--practical { --c: var(--earth-2); }
.topic--activities { --c: var(--earth-3); }
.topic--nature { --c: var(--earth-4); }
.topic--food { --c: var(--earth-5); }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--sand);
  color: var(--basalt);
  font: 400 1.1875rem/1.62 var(--serif-text);
  font-optical-sizing: auto;
}
img { max-width: 100%; height: auto; }
a { color: inherit; text-decoration-color: var(--c); text-decoration-thickness: 0.09em; text-underline-offset: 0.16em; }
a:hover { text-decoration-thickness: 0.16em; }
:focus-visible { outline: 3px solid var(--earth-3); outline-offset: 2px; border-radius: 2px; }
.visually-hidden, .skip:not(:focus) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip:focus { position: absolute; left: 1rem; top: 1rem; z-index: 10; background: #fff; padding: 0.5rem 1rem; }
h1, h2, h3, h4 { font-family: var(--serif-display); font-weight: 400; line-height: 1.15; letter-spacing: -0.005em; text-wrap: balance; }

/* ---------- masthead: wordmark, search, strata band ---------- */
.masthead { background: var(--sand); }
.masthead__inner {
  max-width: 76rem; margin: 0 auto; padding: 1.1rem var(--gutter) 0.9rem;
  display: flex; align-items: center; gap: 1.5rem; justify-content: space-between;
}
.wordmark { font: 400 1.55rem/1 var(--serif-display); text-decoration: none; white-space: nowrap; }
.strata { display: block; width: 100%; height: clamp(22px, 3.4vw, 44px); }
.strata .s1 { fill: var(--earth-1); }
.strata .s2 { fill: var(--earth-2); }
.strata .s3 { fill: var(--earth-3); }
.strata .s4 { fill: var(--earth-4); }
.strata .s5 { fill: var(--earth-5); }

/* topic navigation under the wordmark (not on the home page: the coloured-earths hero is the navigation there) */
.home .topics { display: none; }
.topics { max-width: 76rem; margin: 0 auto; padding: 0 var(--gutter) 0.7rem; }
.topics ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 0.3rem 1.6rem; flex-wrap: wrap; }
.topics a {
  display: inline-block; padding: 0.2rem 0 0.25rem; font-size: 0.95rem; text-decoration: none; color: var(--ink-soft);
  border-bottom: 3px solid color-mix(in srgb, var(--c) 35%, transparent);
}
.topics a:hover { color: var(--basalt); border-bottom-color: var(--c); }
.topics a[aria-current] { color: var(--basalt); font-weight: 600; border-bottom-color: var(--c); }
@media (max-width: 40rem) {
  /* one scrolling row; the fade on the right shows there is more, the padding lets the last topic clear it */
  .topics ul { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; padding-right: 2.5rem;
    -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 2.5rem), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 2.5rem), transparent); }
  .topics ul::-webkit-scrollbar { display: none; }
  .topics li { flex: none; }
}
.search { position: relative; flex: 0 1 22rem; }
.search input {
  width: 100%; font: inherit; font-size: 1rem; color: var(--basalt);
  padding: 0.55rem 0.9rem; border: 1.5px solid var(--sand-deep); border-radius: 6px; background: #fff;
}
.search input:focus { border-color: var(--earth-3); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--earth-3) 25%, transparent); }
.search__suggest {
  position: absolute; z-index: 5; top: calc(100% + 6px); left: 0; right: 0;
  background: #fff; border: 1.5px solid var(--sand-deep); border-radius: 6px; padding: 0.3rem; margin: 0; list-style: none;
}
.search__suggest a { display: block; padding: 0.5rem 0.6rem; border-radius: 4px; text-decoration: none; font-size: 0.95rem; line-height: 1.35; }
.search__suggest a span { display: block; color: var(--ink-soft); font-size: 0.82rem; }
.search__suggest a[aria-selected='true'], .search__suggest a:hover { background: var(--sand); }
.search__suggest .all { color: var(--earth-3); }

main { display: block; }

/* ---------- home ---------- */
.home .masthead .strata { display: none; } /* the hero below is the strata on the home page */
.intro {
  max-width: 76rem; margin: 0 auto; padding: clamp(2rem, 6vw, 4.5rem) var(--gutter) clamp(1.5rem, 4vw, 3rem);
  display: grid; gap: 2.5rem; grid-template-columns: minmax(0, 1fr); align-items: center;
}
@media (min-width: 60rem) { .intro { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 4rem; } }
.intro h1 { font-size: clamp(2.6rem, 6.4vw, 5rem); margin: 0 0 1.4rem; max-width: 12ch; }
.intro__text { max-width: 36rem; font-size: 1.14rem; color: var(--ink-soft); }
.intro__text p { margin: 0 0 1em; }

/* cross-section of the coloured earths: each layer is a topic, its top edge a wave */
.earths ol { list-style: none; margin: 0; padding: 1.4rem 0 0; }
.layer { position: relative; background: var(--c); }
.layer + .layer { margin-top: -1px; }
.layer::before {
  content: ''; position: absolute; left: 0; right: 0; bottom: calc(100% - 1px); height: 1.8rem; background: inherit;
  -webkit-mask: var(--wave) bottom / 100% 100% no-repeat; mask: var(--wave) bottom / 100% 100% no-repeat;
}
.layer--1 { --wave: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 20' preserveAspectRatio='none'%3E%3Cpath d='M0 20V9C60 2 110 14 180 8S300 0 400 6V20Z'/%3E%3C/svg%3E"); border-radius: 0; }
.layer--2 { --wave: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 20' preserveAspectRatio='none'%3E%3Cpath d='M0 20V12C70 4 140 16 220 9S340 3 400 10V20Z'/%3E%3C/svg%3E"); }
.layer--3 { --wave: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 20' preserveAspectRatio='none'%3E%3Cpath d='M0 20V7C90 14 150 3 240 10S350 16 400 5V20Z'/%3E%3C/svg%3E"); }
.layer--4 { --wave: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 20' preserveAspectRatio='none'%3E%3Cpath d='M0 20V11C50 5 130 15 200 10S330 2 400 9V20Z'/%3E%3C/svg%3E"); }
.layer--5 { --wave: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 20' preserveAspectRatio='none'%3E%3Cpath d='M0 20V6C80 13 160 4 230 11S360 14 400 7V20Z'/%3E%3C/svg%3E"); border-radius: 0 0 4px 4px; }
.layer a {
  display: flex; justify-content: space-between; align-items: baseline; gap: 1rem;
  padding: 0.7rem 1.4rem 1.5rem; color: #fff; text-decoration: none; min-height: 5.4rem;
}
.layer.topic--food a { color: var(--basalt); }
.layer__name { font: 400 clamp(1.25rem, 2.4vw, 1.6rem)/1.15 var(--serif-display); }
.layer__count { font-size: 0.9rem; opacity: 0.85; white-space: nowrap; }
.layer a:hover .layer__name { text-decoration: underline 0.07em; text-underline-offset: 0.18em; }
.layer a:focus-visible { outline-color: var(--basalt); outline-offset: -4px; }

.topic { max-width: 76rem; margin: 0 auto; padding: clamp(2rem, 5vw, 3.5rem) var(--gutter); scroll-margin-top: 1rem; }
.topic__head { margin-bottom: 1.6rem; max-width: 40rem; }
.topic__head h2 {
  font-size: clamp(1.7rem, 3.4vw, 2.3rem); margin: 0 0 0.5rem;
  text-decoration: underline var(--c) 0.11em; text-underline-offset: 0.2em; text-decoration-skip-ink: none;
}
.topic__head p { margin: 0; color: var(--ink-soft); font-size: 1rem; }

.tiles { list-style: none; margin: 0; padding: 0; display: grid; gap: 2.2rem 1.6rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr)); }
.tile a { display: flex; flex-direction: column; gap: 0.45rem; text-decoration: none; height: 100%; }
.tile__pic { display: block; aspect-ratio: 4 / 3; overflow: hidden; border-radius: 3px; background: color-mix(in srgb, var(--c) 22%, var(--sand-deep)); }
.tile__pic img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tile__blank { display: block; height: 100%; background: linear-gradient(170deg, transparent 55%, color-mix(in srgb, var(--c) 45%, transparent) 55% 70%, transparent 70%); }
.tile__title { font: 400 1.22rem/1.2 var(--serif-display); margin-top: 0.35rem; border-top: 3px solid var(--c); padding-top: 0.55rem; }
.tile__summary { font-size: 0.92rem; line-height: 1.45; color: var(--ink-soft); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.tile a:hover .tile__title { text-decoration: underline var(--c) 0.08em; text-underline-offset: 0.18em; }
.tiles--small { grid-template-columns: repeat(auto-fill, minmax(min(100%, 12rem), 1fr)); gap: 1.6rem 1.2rem; }
.tiles--small .tile__summary { display: none; }
.tiles--small .tile__title { font-size: 1.05rem; }

/* ---------- article ---------- */
.story { max-width: calc(var(--measure) + 2 * var(--gutter)); margin: 0 auto; padding: clamp(2rem, 6vw, 4.5rem) var(--gutter) 2rem; }
.story__topic { font-size: 0.95rem; color: var(--c); text-decoration: none; font-weight: 600; }
.story__topic:hover { text-decoration: underline; }
.story__head h1 { font-size: clamp(2.3rem, 6vw, 3.9rem); margin: 0.4rem 0 2rem; }
.story__body h2 { font-size: clamp(1.6rem, 3.6vw, 2.1rem); margin: 2.6rem 0 0.9rem; }
.story__body h3 { font-size: 1.42rem; margin: 2.2rem 0 0.6rem; }
.story__body h4 { font-size: 1.15rem; margin: 1.8rem 0 0.5rem; }
.story__body p { margin: 0 0 1.05em; hyphens: auto; }
.story__body p.contact {
  font-size: 0.95rem; line-height: 1.55; padding: 0.15rem 0 0.15rem 1rem; border-left: 3px solid var(--c);
  color: var(--ink-soft); hyphens: manual; overflow-wrap: anywhere;
}
.story__body p.contact a { color: var(--basalt); }
.story__body ul, .story__body ol { padding-left: 1.3em; margin: 0 0 1.1em; }
.story__body li { margin-bottom: 0.3em; }
.story__body strong { font-weight: 650; }
.story__body::after { content: ''; display: table; clear: both; }

/* YouTube links: cards like a YouTube tile, a row of them when several follow each other */
.videos { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 17rem), 1fr)); gap: 1.2rem; margin: 2rem 0; }
.video { display: flex; flex-direction: column; background: #fff; border: 1.5px solid var(--sand-deep); border-radius: 6px; overflow: hidden; text-decoration: none; }
.video:hover { border-color: var(--c); }
.video__thumb { position: relative; display: block; aspect-ratio: 16 / 9; background: var(--basalt); border-bottom: 4px solid #f00; }
.video__thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.video__play { position: absolute; top: 50%; left: 50%; width: 3rem; height: 3rem; margin: -1.5rem 0 0 -1.5rem; border-radius: 50%; background: rgb(42 36 33 / 0.72); }
.video__play::after { content: ""; position: absolute; top: 50%; left: 50%; margin: -0.5rem 0 0 -0.3rem; border-style: solid; border-width: 0.5rem 0 0.5rem 0.85rem; border-color: transparent transparent transparent #fff; }
.video:hover .video__play { background: #f00; }
.video__dur { position: absolute; right: 0.4rem; bottom: 0.4rem; padding: 0.15rem 0.35rem; border-radius: 4px; background: rgb(42 36 33 / 0.9); color: #fff; font: 600 0.75rem/1 system-ui, sans-serif; font-variant-numeric: tabular-nums; }
.video__body { display: block; padding: 0.7rem 0.9rem 0.85rem; }
.video__title { display: block; font-family: var(--serif-display); font-size: 1.05rem; line-height: 1.25; }
.video__meta { display: block; margin-top: 0.2rem; font-size: 0.82rem; color: var(--ink-soft); }

/* photos: a lone picture is a figure (small 2008-era ones sit beside the text), runs of pictures a justified gallery */
.photo { margin: 2rem 0; }
.photo .zoom, .photo .still { display: block; }
.photo img { display: block; width: 100%; border-radius: 3px; background: var(--sand-deep); }
.photo figcaption { font-size: 0.88rem; color: var(--ink-soft); margin-top: 0.5rem; line-height: 1.4; }
.photo--small img { width: auto; max-width: 100%; }
.photo .credit { display: block; font-size: 0.78rem; margin-top: 0.15rem; }
.photo .credit a { color: inherit; }
@media (min-width: 48rem) {
  .photo--small { float: right; clear: right; width: min(42%, 20rem); margin: 0.35rem 0 1.2rem 1.8rem; }
  .photo--small img { width: 100%; }
}
.gallery { display: flex; flex-wrap: wrap; gap: 6px; margin: 2rem 0; clear: both; }
.gallery .zoom, .gallery .still { flex: var(--r) 1 calc(var(--r) * 9.5rem); max-width: calc(var(--r) * 20rem); height: 11.5rem; overflow: hidden; border-radius: 3px; background: var(--sand-deep); }
.gallery img { width: 100%; height: 100%; object-fit: cover; display: block; }
@media (max-width: 34rem) { .gallery .zoom, .gallery .still { height: 8.5rem; flex-basis: calc(var(--r) * 7rem); } }
.zoom { cursor: zoom-in; }

.table-wrap { overflow-x: auto; margin: 1.6rem 0; clear: both; }
.story__body table { border-collapse: collapse; width: 100%; font-size: 0.95rem; line-height: 1.4; }
.story__body th, .story__body td { text-align: left; padding: 0.5rem 0.7rem; border-bottom: 1px solid var(--sand-deep); vertical-align: top; }
.story__body th { font-weight: 650; border-bottom: 2px solid var(--c); }

.more { max-width: 76rem; margin: 0 auto; padding: 2rem var(--gutter) 4rem; }
.more h2 { font-size: 1.5rem; margin: 0 0 1.3rem; }

/* ---------- lightbox ---------- */
.lightbox {
  width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0;
  background: #1e1917; color: #f2eeea;
}
.lightbox::backdrop { background: #1e1917; }
.lightbox figure { margin: 0; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.8rem; padding: 3.5rem 4.5rem 3rem; }
.lightbox img { max-width: 100%; max-height: calc(100dvh - 9rem); border-radius: 2px; }
.lightbox figcaption { font-size: 0.95rem; max-width: 40rem; text-align: center; }
.lightbox button {
  position: absolute; background: none; border: 0; color: inherit; font: 400 2.6rem/1 var(--serif-display);
  width: 3.4rem; height: 3.4rem; cursor: pointer; border-radius: 50%;
}
.lightbox button:hover { background: rgb(255 255 255 / 0.1); }
.lightbox__prev { left: 0.6rem; top: 50%; transform: translateY(-50%); }
.lightbox__next { right: 0.6rem; top: 50%; transform: translateY(-50%); }
.lightbox__close { right: 0.6rem; top: 0.6rem; font-size: 2.2rem; }
.lightbox__count { position: absolute; left: 1.2rem; top: 1rem; margin: 0; font-size: 0.9rem; opacity: 0.75; }
.lightbox[data-single] .lightbox__prev, .lightbox[data-single] .lightbox__next, .lightbox[data-single] .lightbox__count { display: none; }
@media (max-width: 40rem) { .lightbox figure { padding: 3.5rem 0.5rem 2.5rem; } .lightbox__prev, .lightbox__next { top: auto; bottom: 0.4rem; transform: none; } }

/* ---------- search results, 404 ---------- */
.results { max-width: calc(var(--measure) + 2 * var(--gutter)); margin: 0 auto; padding: clamp(2rem, 6vw, 4rem) var(--gutter) 4rem; min-height: 50vh; }
.results h1 { font-size: clamp(1.9rem, 5vw, 2.8rem); margin: 0 0 1.5rem; }
.hint { color: var(--ink-soft); }
.hits { list-style: none; padding: 0; margin: 0; }
.hit { padding: 1.1rem 0; border-top: 1px solid var(--sand-deep); }
.hit a { text-decoration: none; display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.2rem 0.8rem; }
.hit__title { font: 400 1.35rem/1.2 var(--serif-display); }
.hit a:hover .hit__title { text-decoration: underline var(--c) 0.08em; text-underline-offset: 0.18em; }
.hit__topic { font-size: 0.85rem; color: var(--c); font-weight: 600; }
.hit p { margin: 0.4rem 0 0; font-size: 0.98rem; color: var(--ink-soft); }
mark { background: color-mix(in srgb, var(--earth-5) 30%, transparent); color: var(--basalt); padding: 0 0.1em; border-radius: 2px; }

/* ---------- footer ---------- */
.colophon { border-top: 1px solid var(--sand-deep); margin-top: 2rem; }
.colophon__inner { max-width: 76rem; margin: 0 auto; padding: 2rem var(--gutter) 3rem; font-size: 0.92rem; color: var(--ink-soft); }
.colophon nav { display: flex; flex-wrap: wrap; gap: 0.4rem 1.4rem; margin-bottom: 0.8rem; }
.colophon nav a { color: var(--basalt); }
.colophon p { margin: 0; }

@media (max-width: 34rem) {
  .masthead__inner { flex-wrap: wrap; gap: 0.7rem; }
  .search { flex-basis: 100%; }
  body { font-size: 1.0625rem; }
}
@media (prefers-reduced-motion: no-preference) {
  .tile__pic img { transition: transform 0.6s ease; }
  .tile a:hover .tile__pic img { transform: scale(1.03); }
}
