@import url('https://cdnfonts.com');

html {
  background: #ece9e7;
  min-height: 100%;
}

body {
  font-family: "Latin Modern Roman", "Computer Modern Roman", Georgia, serif;
  max-width: 700px;
  margin: 2rem auto;
  padding: 0 1rem;
  line-height: 1.6;
  background: #faf9f7;
  color: #333;
  min-height: 100%;
  border-radius: 0.25rem;
}

header h1 {
  text-decoration: none;
  color: #333;
  letter-spacing: 0.5px;
}

nav {
	display: flex;
	align-content: stretch;
	border: .125rem #555 solid;
	justify-content: space-around;
	border-radius: 0.25rem;
}

nav a, nav a:link, nav a:visited {
  text-decoration: none;
  color: #555;
  width: 100%;
  text-align: center;
  padding: 0.25rem 0;
}

nav a:hover {
  color: #faf9f7;
  background: #555;
}

footer {
  margin-top: 4rem;
  font-size: 0.9rem;
  color: #777;
}

a:link, a:visited {
  color: #900;
}



a:hover {
  color: #f00;
}

/* --- imagery --- */
main img { max-width: 100%; height: auto; }

figure { margin: 1.75rem 0; }
figure img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid #cfc9c4;
  border-radius: 0.25rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}
figcaption {
  margin-top: 0.4rem;
  font-size: 0.8rem;
  color: #8a827c;
  text-align: center;
  letter-spacing: 0.03em;
}

/* homepage banner */
.hero { margin: 0 0 1.75rem; }
.hero img {
  display: block;
  width: 100%;
  height: 300px;
  object-fit: cover;
  object-position: center;
  border: 1px solid #cfc9c4;
  border-radius: 0.25rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

/* two-timeline pairing on the Books page: matched HEIGHT, natural widths,
   since the two sit side by side */
.pair { display: flex; flex-wrap: wrap; gap: 1rem; justify-content: center; margin: 1.75rem 0; }
.pair figure { margin: 0; }
.pair figure img { height: 225px; width: auto; max-width: 100%; }
@media (max-width: 520px) {
  .pair figure img { height: auto; width: 100%; }
}

/* book cover -- intentional, constrained (a cover thumbnail, not full-width) */
figure.cover { margin: 1.5rem auto; max-width: 240px; }
figure.cover a { display: block; }
figure.cover img { width: 100%; }

/* keep long words / URLs from forcing the page wider than the screen */
body { overflow-wrap: break-word; }

/* code blocks and tables scroll INSIDE their own box, not the page */
pre {
  overflow-x: auto;
  background: #f0ede9;
  border: 1px solid #e0dbd4;
  border-radius: 0.25rem;
  padding: 0.75rem 0.9rem;
  font-size: 0.85rem;
  line-height: 1.45;
}
code { font-size: 0.92em; }

table {
  display: block;
  max-width: 100%;
  overflow-x: auto;
  border-collapse: collapse;
  font-size: 0.95rem;
}
th, td {
  padding: 0.3rem 0.6rem;
  border-bottom: 1px solid #e0dbd4;
  text-align: left;
}
th { border-bottom-width: 2px; }

/* content / kink tags */
.tags { margin: 1.5rem 0; }
.taglabel {
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #900;
  font-weight: bold;
  margin: 0 0 0.5rem;
}
.taglist {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.taglist li {
  border: 1px solid #d8cfc8;
  border-radius: 1rem;
  padding: 0.1rem 0.7rem;
  font-size: 0.9rem;
  color: #444;
  background: #f4f1ec;
}
.tags summary {
  cursor: pointer;
  margin-top: 0.7rem;
  font-size: 0.85rem;
  color: #900;
}
.tags details[open] summary { margin-bottom: 0.5rem; }

/* newsletter signup */
.signup {
  margin: 1.75rem 0;
  padding: 1rem 1.15rem;
  background: #f4f1ec;
  border: 1px solid #e0dbd4;
  border-radius: 0.4rem;
}
.signup-label { margin: 0 0 0.6rem; font-weight: bold; }
.signup-form { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.signup-form input[type="email"] {
  flex: 1 1 12rem;
  padding: 0.4rem 0.6rem;
  border: 1px solid #cfc9c4;
  border-radius: 0.25rem;
  font-family: inherit;
  font-size: 1rem;
}
.signup-form button {
  padding: 0.4rem 1.2rem;
  border: none;
  border-radius: 0.25rem;
  background: #900;
  color: #faf9f7;
  font-family: inherit;
  font-size: 1rem;
  cursor: pointer;
}
.signup-form button:hover { background: #b00; }
.signup-note { margin: 0.55rem 0 0; font-size: 0.8rem; color: #8a827c; }

/* --- preview chapter reader --- */
.chapnav {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.75rem;
  font-size: 0.9rem;
  margin: 1.5rem 0;
}
.chapnav a { color: #900; }
.chapnav a:hover { color: #f00; }
.chapnav .contents { color: #777; }
.chapnav.top { margin-top: 0; padding-bottom: 0.85rem; border-bottom: 1px solid #e0dbd4; }
.chapnav.bottom { padding-top: 0.85rem; border-top: 1px solid #e0dbd4; }
.endpreview {
  margin: 2.5rem 0 0;
  padding: 1.15rem 1.25rem;
  background: #f4f1ec;
  border: 1px solid #e0dbd4;
  border-radius: 0.4rem;
  text-align: center;
}
.endpreview p { margin: 0.5rem 0; }

/* --- 18+ age gate (shown only when <html> has .age-gate-on) --- */
#age-gate { display: none; }
.age-gate-on #age-gate {
  display: flex;
  position: fixed;
  inset: 0;
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(28, 24, 22, 0.93);
}
.age-gate-on body { overflow: hidden; }
.age-gate-box {
  max-width: 30rem;
  background: #faf9f7;
  color: #333;
  border: 1px solid #cfc9c4;
  border-radius: 0.4rem;
  padding: 1.75rem 1.75rem 1.5rem;
  text-align: center;
  box-shadow: 0 6px 28px rgba(0, 0, 0, 0.4);
}
.age-gate-box h2 { margin: 0 0 0.75rem; letter-spacing: 0.02em; }
.age-gate-box p { margin: 0 0 1.25rem; line-height: 1.5; }
.age-gate-buttons { display: flex; flex-wrap: wrap; gap: 0.9rem; justify-content: center; align-items: center; }
#age-enter {
  padding: 0.5rem 1.3rem;
  border: none;
  border-radius: 0.25rem;
  background: #900;
  color: #faf9f7;
  font-family: inherit;
  font-size: 1rem;
  cursor: pointer;
}
#age-enter:hover { background: #b00; }
#age-leave { color: #777; font-size: 0.9rem; text-decoration: none; padding: 0.5rem; }
#age-leave:hover { color: #900; }
