/* Aberfal. Colours come from the photographs: harbour ink, ember orange, warm paper.
   Change the variables and the whole site follows. */
:root {
  --ink: #0e1c24;
  --ink-2: #1b303b;
  --ember: #e0793a;
  --ember-dark: #b95a1f;
  --sea: #3d7a78;
  --paper: #f3ede2;
  --paper-2: #e9e1d2;
  --muted: #55646c;
  --display: Fraunces, Georgia, serif;
  --serif: "Source Serif 4", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --wrap: 1180px;
  --measure: 700px;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--serif); font-size: 18px; line-height: 1.7; }
img, svg { max-width: 100%; height: auto; display: block; }
a { color: var(--ink); text-decoration-color: var(--ember); text-underline-offset: 3px; }
a:hover { color: var(--ember-dark); }
:focus-visible { outline: 3px solid var(--ember); outline-offset: 3px; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 16px; top: 16px; background: var(--paper); padding: 8px 16px; z-index: 20; }
h1, h2, h3 { font-family: var(--display); font-weight: 700; line-height: 1.15; letter-spacing: -0.01em; }

/* buttons */
.btn { display: inline-flex; align-items: center; min-height: 44px; padding: 12px 26px; border-radius: 3px; font-family: var(--sans);
  font-weight: 600; font-size: 15px; text-decoration: none; border: 2px solid transparent; }
.btn-ember { background: var(--ember); color: var(--ink); }
.btn-ember:hover { background: #f08c4d; color: var(--ink); }
.btn-ghost { color: var(--paper); border-color: rgba(243,237,226,.55); }
.btn-ghost:hover { background: var(--paper); color: var(--ink); }
.btn-outline { color: var(--ink); border-color: var(--ink); }
.btn-outline:hover { background: var(--ink); color: var(--paper); }
.btn-row { display: flex; flex-wrap: wrap; gap: 14px; }

/* header */
.site-header { background: var(--ink); }
.site-header .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 24px; padding-top: 14px; padding-bottom: 14px; }
.logo { font-family: var(--display); font-weight: 700; font-size: 28px; letter-spacing: -0.01em; color: var(--paper); text-decoration: none; line-height: 1; }
.logo:hover { color: var(--ember); }
.site-nav { display: flex; flex-wrap: wrap; gap: 0 24px; font-family: var(--sans); font-size: 15px; }
.site-nav a { color: var(--paper); text-decoration: none; min-height: 44px; display: inline-flex; align-items: center; }
.site-nav a:hover { color: var(--ember); }
.site-nav a[aria-current] { box-shadow: inset 0 -3px var(--ember); }
.site-header.on-hero { position: absolute; left: 0; right: 0; z-index: 5; background: linear-gradient(rgba(14,28,36,.85), rgba(14,28,36,0)); }

/* hero */
.hero { position: relative; min-height: min(86vh, 760px); display: flex; align-items: flex-end; color: var(--paper);
  background: var(--ink) center 40% / cover no-repeat; }
.hero::before { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(14,28,36,.15) 20%, rgba(14,28,36,.9) 100%); }
.hero h1, .hero .lede, .hero .eyebrow { text-shadow: 0 2px 18px rgba(8,14,18,.7); }
.hero .eyebrow { color: #f6a56d; font-size: 14px; }
.hero .wrap { position: relative; padding-top: 140px; padding-bottom: 72px; }
.eyebrow { margin: 0 0 12px; font-family: var(--sans); font-size: 13px; letter-spacing: .18em; text-transform: uppercase; font-weight: 600; color: var(--ember); }
.eyebrow.dark { color: var(--ember-dark); }
.hero h1 { margin: 0 0 16px; font-size: clamp(56px, 10vw, 128px); line-height: .95; }
.hero .lede { max-width: 38ch; margin: 0 0 28px; font-size: 21px; line-height: 1.55; }

/* bands */
.band { padding: 72px 0; }
.band h2 { margin: 0 0 24px; font-size: clamp(30px, 4vw, 44px); }
.meaning .wrap { display: grid; grid-template-columns: 1fr 1.3fr; gap: 48px; align-items: start; }
.meaning .parts p { margin: 0 0 14px; }
.meaning .parts strong { font-family: var(--display); font-size: 1.15em; color: var(--ember-dark); }
.meaning .sum { font-family: var(--display); font-size: 26px; line-height: 1.3; margin-top: 24px; }
.section-label { margin: 0 0 24px; font-family: var(--sans) !important; font-size: 13px !important; letter-spacing: .18em; text-transform: uppercase; font-weight: 600 !important; color: var(--ember-dark); }
.section-label.light { color: var(--ember); }
.latest { background: var(--paper-2); }
.photos { background: var(--ink); color: var(--paper); }
.photos .strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 28px; }
.photos .strip a { display: block; overflow: hidden; aspect-ratio: 3 / 2; }
.photos .strip img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.photos .strip a:hover img { transform: scale(1.04); }

/* cards and grid */
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px 28px; margin-bottom: 32px; }
.card .imgl { display: block; overflow: hidden; aspect-ratio: 3 / 2; background: var(--ink); margin-bottom: 14px; }
.card .thumb { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.card:hover .thumb { transform: scale(1.04); }
.card h3 { margin: 4px 0 0; font-size: 21px; }
.card h3 a { text-decoration: none; }
.card h3 a:hover { text-decoration: underline; }
.meta { margin: 0; font-family: var(--sans); font-size: 13px; color: var(--muted); letter-spacing: .02em; }
.meta a { color: var(--muted); }
.cat { color: var(--ember-dark); font-weight: 600; text-transform: uppercase; letter-spacing: .1em; font-size: 12px; }

/* page headers */
.page-hero { background: var(--ink); color: var(--paper); padding: 48px 0 44px; }
.page-hero h1 { margin: 0; font-size: clamp(34px, 5.4vw, 60px); max-width: 22ch; }
.page-hero .tag { margin: 12px 0 0; font-size: 19px; color: #cfd6d6; }
.page-hero .meta { color: #b7c2c4; margin-bottom: 14px; }
.page-hero .meta a { color: #b7c2c4; }
.page-hero .cat { color: var(--ember); }
.page-hero.post .wrap { max-width: calc(var(--measure) + 48px); }

/* blog index feature */
.feat { display: grid; grid-template-columns: 1.4fr 1fr; gap: 40px; align-items: center; padding: 48px 0; }
.feat .imgl { display: block; aspect-ratio: 3 / 2; overflow: hidden; background: var(--ink); }
.feat .thumb { width: 100%; height: 100%; object-fit: cover; }
.feat h2 { margin: 8px 0 12px; font-size: clamp(28px, 3.4vw, 40px); }
.feat h2 a { text-decoration: none; }
.feat .ex { margin: 0 0 22px; color: var(--muted); }
.pager { display: flex; justify-content: space-between; padding: 24px 0 64px; font-family: var(--sans); font-size: 15px; }
.blog-index .grid, .index .grid { margin-bottom: 40px; }

/* article */
.article { max-width: calc(var(--measure) + 48px); margin: 0 auto; padding: 44px 24px 24px; }
.article > * { max-width: var(--measure); }
.article p, .article ul, .article ol { margin: 0 0 1.25em; }
.article h2 { margin: 2em 0 .6em; font-size: 30px; }
.article h3 { margin: 1.8em 0 .5em; font-size: 24px; }
.article hr { border: 0; border-top: 1px solid #cfc6b4; margin: 2.4em 0; }
.article blockquote { margin: 1.6em 0; padding-left: 20px; border-left: 4px solid var(--ember); font-style: italic; }
.article figure { margin: 2em 0; }
.article figure img { border-radius: 2px; }
.article figcaption { margin-top: 8px; font-family: var(--sans); font-size: 14px; color: var(--muted); }
.article table { border-collapse: collapse; width: 100%; font-size: 16px; margin-bottom: 1.4em; }
.article th, .article td { border: 1px solid #cfc6b4; padding: 8px 12px; text-align: left; }
.article .video { position: relative; aspect-ratio: 16 / 9; margin: 2em 0; }
.article .video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
/* big photographs may break out of the text column */
.article figure:has(img[width]) { max-width: min(1000px, calc(100vw - 48px)); margin-left: 50%; transform: translateX(-50%); }
@media (min-width: 1040px) { .article figure:has(img[width]) { width: 1000px; } }

/* galleries */
.article:has(.gallery) .gallery { max-width: none; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; margin: 2em 0; }
.article .gallery { position: relative; left: 50%; width: min(1180px, calc(100vw - 48px)); transform: translateX(-50%); }
.gallery figure { margin: 0 !important; max-width: none !important; transform: none !important; width: auto !important; position: static !important; }
.gallery a { display: block; overflow: hidden; background: var(--ink); }
.gallery img { width: 100%; height: 280px; object-fit: cover; transition: transform .4s; }
.gallery a:hover img { transform: scale(1.04); }
.lightbox { position: fixed; inset: 0; z-index: 50; background: rgba(8,14,18,.94); display: flex; align-items: center; justify-content: center; }
.lightbox[hidden] { display: none; }
.lightbox img { max-width: 92vw; max-height: 84vh; object-fit: contain; }
.lightbox button { position: absolute; background: none; border: 0; color: var(--paper); font-size: 44px; line-height: 1; cursor: pointer; padding: 12px 18px; min-width: 44px; min-height: 44px; }
.lightbox button:hover { color: var(--ember); }
.lb-close { top: 8px; right: 12px; } .lb-prev { left: 8px; top: 50%; } .lb-next { right: 8px; top: 50%; }
.lb-cap { position: absolute; bottom: 16px; left: 0; right: 0; text-align: center; color: #cfd6d6; font-family: var(--sans); font-size: 14px; margin: 0; }
body.lb-open { overflow: hidden; }

/* post footer */
.post-foot { max-width: calc(var(--measure) + 48px); margin: 0 auto; padding: 8px 24px 72px; }
.byline { font-family: var(--sans); font-size: 15px; color: var(--muted); border-top: 1px solid #cfc6b4; padding-top: 20px; }
.post-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 24px; }
.post-nav a { display: block; padding: 16px 18px; background: var(--paper-2); text-decoration: none; font-family: var(--display); font-weight: 700; line-height: 1.25; }
.post-nav a:hover { background: var(--ink); color: var(--paper); }
.post-nav small { display: block; font-family: var(--sans); font-weight: 600; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--ember-dark); margin-bottom: 4px; }
.post-nav .next { text-align: right; }

/* footer */
.site-footer { background: var(--ink); color: var(--paper); padding: 40px 0; font-family: var(--sans); font-size: 15px; }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 20px 40px; align-items: center; justify-content: space-between; }
.site-footer .logo { margin: 0; }
.footer-line { margin: 4px 0 0; color: #9fb0b3; }
.footer-links { display: flex; flex-wrap: wrap; gap: 4px 22px; }
.site-footer a { color: var(--paper); text-decoration: none; min-height: 44px; display: inline-flex; align-items: center; }
.site-footer a:hover { color: var(--ember); }
.copy { margin: 0; color: #9fb0b3; }

@media (max-width: 860px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
  .meaning .wrap, .feat { grid-template-columns: 1fr; gap: 24px; }
  .photos .strip { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  body { font-size: 17px; }
  .grid { grid-template-columns: 1fr; }
  .band { padding: 52px 0; }
  .hero .lede { font-size: 18px; }
  .post-nav { grid-template-columns: 1fr; }
  .post-nav .next { text-align: left; }
  .gallery img { height: 220px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
