/* martyn-ford.com — the original Weebly design, rebuilt by hand.
   Same fonts (Playfair Display, Gentium Basic, Raleway), same gold, same banners.
   Changes are polish: bigger, darker body text, sharper layout, proper mobile menu. */

@font-face { font-family: "Playfair Display"; src: url("fonts/playfair.woff2") format("woff2"); font-weight: 400 900; font-display: swap; }
@font-face { font-family: "Raleway"; src: url("fonts/raleway.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Gentium Basic"; src: url("fonts/gentium-400-normal.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Gentium Basic"; src: url("fonts/gentium-400-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Gentium Basic"; src: url("fonts/gentium-700-normal.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Gentium Basic"; src: url("fonts/gentium-700-italic.woff2") format("woff2"); font-weight: 700; font-style: italic; font-display: swap; }

:root {
  --gold: #dea227;        /* the original link colour */
  --gold-text: #a8730b;   /* same gold, darkened so it's readable as text on white */
  --text: #56655f;        /* the original grey-green #7b8c89, darkened for readability */
  --heading: #42514c;     /* original heading colour */
  --nav: #6f6f6f;
  --rule: #e2e2e2;
  --footer: #f6f6f6;
  --serif: "Gentium Basic", Georgia, serif;
  --display: "Playfair Display", Georgia, serif;
  --sans: "Raleway", "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; background: #fff; color: var(--text);
  font-family: var(--serif); font-size: 1.125rem; line-height: 1.7;
  min-height: 100vh; display: flex; flex-direction: column;
}
main { flex: 1 0 auto; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--gold-text); text-decoration: none; }
a:hover { color: var(--gold); text-decoration: underline; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
.skip { position: absolute; left: 1rem; top: -4rem; background: #fff; padding: .5rem 1rem; z-index: 20; }
.skip:focus { top: 1rem; }

/* ---------- Header: centred logo + capitals menu ---------- */
.site-header { background: #fff; padding: 2.2rem 1.25rem 1.6rem; text-align: center; position: relative; }
.logo {
  display: inline-block; font-family: var(--sans); font-weight: 300; color: #333;
  font-size: clamp(1.6rem, 3.2vw, 2.4rem); line-height: 1.1; letter-spacing: .32em; padding-left: .32em;
  text-transform: uppercase; text-decoration: none;
}
.logo:hover { color: #333; text-decoration: none; }
.menu { margin: 1.6rem auto 0; max-width: 62rem; }
.menu ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: .35rem .3rem; }
.menu a {
  display: block; font-family: var(--sans); font-weight: 500; font-size: .78rem; letter-spacing: .12em;
  text-transform: uppercase; color: var(--nav); padding: .5rem .8rem; border-radius: 2px;
}
.menu a:hover { color: var(--gold-text); text-decoration: none; background: #fafafa; }
.menu a[aria-current="page"], .menu .in-section > a { background: #f4f4f4; color: var(--gold-text); }
.menu-toggle { display: none; }

/* Dropdowns for Adult books / Children's books */
.menu .has-sub { position: relative; }
.menu .has-sub > a::after { content: ""; display: inline-block; width: .35em; height: .35em; margin-left: .55em; vertical-align: .2em;
  border-right: 1px solid currentColor; border-bottom: 1px solid currentColor; transform: rotate(45deg); }
.menu .sub { display: none; position: absolute; top: 100%; left: 50%; transform: translateX(-50%); z-index: 30;
  flex-direction: column; gap: 0; min-width: 17rem; background: #fff; padding: .45rem 0; text-align: left;
  box-shadow: 0 8px 24px rgba(0,0,0,.12); border: 1px solid #eee; }
.menu .sub a { padding: .65rem 1.1rem; border-radius: 0; white-space: nowrap; }
@media (min-width: 761px) {
  .menu .has-sub:hover .sub, .menu .has-sub:focus-within .sub { display: flex; }
}

@media (max-width: 760px) {
  .site-header { padding: 1.4rem 1rem 1.1rem; }
  .logo { font-size: 1.55rem; letter-spacing: .28em; padding-left: .28em; }
  .js .menu-toggle {
    display: inline-flex; align-items: center; gap: .55rem; margin-top: 1rem;
    font-family: var(--sans); font-size: .78rem; letter-spacing: .14em; text-transform: uppercase; font-weight: 600;
    color: var(--nav); background: none; border: 1px solid var(--rule); border-radius: 2px; padding: .55rem 1rem; cursor: pointer;
  }
  .menu-toggle .bars { width: 16px; height: 10px; border-top: 2px solid currentColor; border-bottom: 2px solid currentColor; position: relative; }
  .menu-toggle .bars::after { content: ""; position: absolute; left: 0; right: 0; top: 2px; border-top: 2px solid currentColor; }
  .js .menu { display: none; margin-top: .9rem; }
  .js .menu.open { display: block; }
  .menu ul { flex-direction: column; gap: 0; }
  .menu a { font-size: .85rem; padding: .8rem; border-top: 1px solid #f0f0f0; }
  .menu .sub { display: flex; position: static; transform: none; box-shadow: none; border: 0; padding: 0; min-width: 0; text-align: center; }
  .menu .sub a { font-size: .78rem; color: #8a8a8a; padding: .65rem; white-space: normal; }
  .menu .has-sub > a::after { display: none; }
}

/* ---------- Banners ---------- */
.banner {
  position: relative; background-color: #222; background-size: cover; background-repeat: no-repeat;
  display: flex; align-items: center; justify-content: center; text-align: center; color: #fff;
}
.banner::before { content: ""; position: absolute; inset: 0; background: rgba(0,0,0,.18); }
.banner > * { position: relative; }
.banner-home { height: clamp(320px, 43vw, 620px); background-image: url("img/banner-home.jpg"); background-position: 50% 31.6%; }
/* Page titles: a plain band, no photo. Colour comes from the page's book cover where there is one. */
.banner-page { background: var(--tone, #2f3a36); padding: clamp(2.75rem, 6vw, 4.5rem) 1.25rem; }
.banner-page::before { display: none; }
.banner-page h1 { text-shadow: none; }
.banner-page h1::after { content: ""; display: block; width: 2.75rem; height: 2px; background: rgba(255,255,255,.6); margin: 1.1rem auto 0; opacity: .9; }
.banner h1 {
  margin: 0; padding: 0 1.25rem; font-family: var(--display); font-weight: 400;
  font-size: clamp(2rem, 4vw, 3.1rem); line-height: 1.15; letter-spacing: .01em;
  text-shadow: 0 1px 12px rgba(0,0,0,.35);
}

/* ---------- Content ---------- */
.content { max-width: 50rem; margin: 0 auto; padding: 3.25rem 1.25rem 4.5rem; }
.content p { margin: 0 0 1.15em; }
.content h2 {
  font-family: var(--display); font-weight: 400; color: var(--heading);
  font-size: 1.65rem; line-height: 1.25; margin: 2.4rem 0 1rem;
}
.content h2:first-child { margin-top: 0; }
.content h2.caps { text-transform: uppercase; font-size: 1.3rem; letter-spacing: .03em; }
.lead { font-weight: 700; color: var(--heading); }
.clear::after { content: ""; display: table; clear: both; }

/* Cover floated right, with the original thin frame */
.cover-right { float: right; width: 18rem; margin: .3rem 0 1.5rem 2.25rem; }
.cover-right img, .framed { border: 1px solid #d0d0d0; padding: 5px; background: #fff; }
.cover-right figcaption { font-size: .85rem; text-align: center; margin-top: .4rem; color: #8a9693; }
@media (max-width: 600px) { .cover-right { float: none; width: 13rem; margin: 0 auto 1.75rem; } }

/* Reviews: quote, then who said it */
.reviews { margin: 0 0 1.5rem; padding: 0; list-style: none; }
.reviews li { margin: 0 0 1.4rem; }
.reviews .who { display: block; font-weight: 700; color: var(--heading); margin-top: .2rem; font-size: 1rem; }

.order { display: inline-block; margin-top: .4rem; font-family: var(--sans); font-weight: 600; font-size: .78rem; letter-spacing: .12em; text-transform: uppercase;
  background: var(--gold); color: #fff; padding: .85rem 1.4rem; border-radius: 2px; }
.order:hover { background: #c88a0c; color: #fff; text-decoration: none; }
.order.outline { background: transparent; color: var(--gold-text); box-shadow: inset 0 0 0 1px var(--gold); }
.order.outline:hover { background: var(--gold); color: #fff; }
.pub { font-size: 1rem; }
hr.rule { border: 0; border-top: 1px solid var(--rule); margin: 3rem 0; clear: both; }

/* Home */
.welcome { max-width: 40rem; margin: 0 auto; padding: 3.25rem 1.25rem 4rem; text-align: center; }
.welcome p { margin: 0 0 1em; font-size: 1.2rem; }
.welcome hr { border: 0; border-top: 1px solid var(--rule); margin: 2rem auto; width: 100%; }
.welcome .teaser { font-size: 1.1rem; }

/* Adult books / Children's books lists */
.book-row { display: grid; grid-template-columns: 10.5rem 1fr; gap: 2rem; align-items: start; padding: 2.25rem 0; border-top: 1px solid var(--rule); }
.book-row:first-of-type { border-top: 0; padding-top: 1rem; }
.book-row-cover img { width: 100%; }
.book-row h2 { margin: .2rem 0 .3rem !important; }
.book-row h2 a { color: var(--heading); }
.book-row h2 a:hover { color: var(--gold-text); }
.book-row .pub { margin-bottom: .8rem; }
.row-actions { margin: 0; }
@media (max-width: 560px) { .book-row { grid-template-columns: 7rem 1fr; gap: 1.25rem; } }

/* Trilogy */
.series-book { padding-top: .25rem; }
.editions { display: flex; gap: 2rem; flex-wrap: wrap; margin-top: 1.5rem; }
.editions figure { margin: 0; width: 12rem; }
.editions figcaption { font-size: .85rem; color: #8a9693; margin-top: .4rem; }
.plain-list { list-style: none; padding: 0; margin: 0 0 1rem; }

/* First chapter viewer (replaces the Weebly slideshow) */
.viewer { margin-top: 1.25rem; }
.viewer-main { position: relative; background: #fafafa; border: 1px solid #ececec; padding: 1rem; text-align: center; }
.viewer-main img { margin: 0 auto; max-height: 78vh; width: auto; border: 1px solid #e6e6e6; background: #fff; }
.viewer-nav { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-top: .9rem; font-family: var(--sans); font-size: .85rem; }
.viewer-nav button { font-family: var(--sans); font-weight: 600; font-size: .75rem; letter-spacing: .12em; text-transform: uppercase; color: var(--gold-text);
  background: #fff; border: 1px solid var(--gold); padding: .6rem 1rem; border-radius: 2px; cursor: pointer; }
.viewer-nav button:hover:not([disabled]) { background: var(--gold); color: #fff; }
.viewer-nav button[disabled] { opacity: .35; cursor: default; }
.thumbs { display: flex; gap: .5rem; overflow-x: auto; margin-top: .9rem; padding-bottom: .5rem; }
.thumbs button { flex: 0 0 auto; padding: 0; border: 2px solid transparent; background: none; cursor: pointer; }
.thumbs button[aria-current="true"] { border-color: var(--gold); }
.thumbs img { width: 3.4rem; height: auto; opacity: .85; }
.no-js-pages img { margin: 0 auto 1rem; border: 1px solid #e6e6e6; }

/* Events: two-up photos with captions */
.events-intro { overflow: hidden; }
.events-intro .cover-left { float: left; width: 10rem; margin: .3rem 1.75rem 1rem 0; }
@media (max-width: 600px) { .events-intro .cover-left { float: none; width: 12rem; margin: 0 auto 1.5rem; } }
.photo-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2.25rem 1.75rem; margin-top: 2.5rem; }
.photo-grid figure { margin: 0; }
.photo-grid figure.wide { grid-column: 1 / -1; }
.photo-grid img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border: 1px solid #d0d0d0; padding: 4px; background: #fff; }
.photo-grid figure.wide > img { aspect-ratio: auto; }
.photo-grid figcaption { font-size: .95rem; text-align: center; margin-top: .6rem; line-height: 1.5; }
@media (max-width: 560px) { .photo-grid { grid-template-columns: 1fr; } }

/* Advice for writers */
.step-no { font-family: var(--display); color: var(--gold); margin-right: .35rem; }
.pairpi-box { background: var(--footer); border-left: 3px solid var(--gold); padding: 1.75rem 1.75rem 1.5rem; margin: 1.5rem 0 1rem; }
.pairpi-box p:last-child { margin-bottom: 0; }
.disclosure { font-size: .9rem; color: #7a8784; margin-top: .4rem; }

/* Contact */
.center { text-align: center; }

/* ---------- Footer: the light grey band with icons ---------- */
.site-footer { background: var(--footer); padding: 2.25rem 1.25rem; }
.footer-inner { max-width: 50rem; margin: 0 auto; display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.site-footer small { font-family: var(--sans); font-size: .78rem; color: #8e8e8e; letter-spacing: .04em; }
.social { display: flex; gap: 1rem; }
.social a { color: #8e8e8e; display: inline-flex; padding: .25rem; }
.social a:hover { color: var(--gold-text); }
.social svg { width: 18px; height: 18px; fill: currentColor; }

.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
