/* Ilana C. Myer — revival of the ilanacmyer.com design.
   Cormorant Garamond (display, italic) + EB Garamond (body) + Cinzel (nav/UI).
   Warm parchment white, deep wine, antique gold. A literary author's home. */

:root {
  --paper: oklch(0.988 0.005 80);
  --ink: oklch(0.175 0.006 55);
  --ink-soft: oklch(0.48 0.008 55);
  --wine: oklch(0.37 0.115 15);
  --gold: oklch(0.68 0.075 65);
  --rule: oklch(0.875 0.006 80);
  --wash: oklch(0.958 0.005 80);

  --display: "Cormorant Garamond", "Palatino Linotype", Palatino, "Book Antiqua", serif;
  --body: "EB Garamond", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --ui: "Cinzel", "Palatino Linotype", Palatino, Georgia, serif;

  --measure: 40rem;
  --card: 54rem;
  --gutter: clamp(1.25rem, 5vw, 2.5rem);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 1.25rem;
  font-weight: 400;
  line-height: 1.68;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: oklch(0.92 0.04 15); }

a {
  color: var(--wine);
  font-weight: 500;
  text-decoration: none;
  transition: opacity 0.18s var(--ease-out), color 0.18s var(--ease-out);
}

a:hover { opacity: 0.72; }

:focus-visible {
  outline: 2px solid var(--wine);
  outline-offset: 3px;
}

img { max-width: 100%; height: auto; }

@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }

  ::view-transition-old(root),
  ::view-transition-new(root) { animation-duration: 0.22s; }
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}

.skip-link {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  background: var(--ink);
  color: var(--paper);
  z-index: 10;
}

.skip-link:focus {
  width: auto;
  height: auto;
  clip-path: none;
  top: 0.5rem;
  left: 0.5rem;
  padding: 0.5rem 1rem;
  color: var(--paper);
}

/* ---------------------------------------------------------------- site header */

.site-header {
  background: var(--paper);
  text-align: center;
  padding: 0 var(--gutter) 0.5rem;
  border-bottom: 1px solid var(--rule);
  position: relative;
  overflow: hidden;
}

.site-header::before {
  content: "";
  display: block;
  height: clamp(16rem, 42vw, 30rem);
  margin: 0 calc(var(--gutter) * -1) clamp(1.75rem, 4vw, 2.5rem);
  background-image:
    linear-gradient(
      to bottom,
      oklch(0.988 0.005 80 / 0) 0%,
      oklch(0.988 0.005 80 / 0) 60%,
      oklch(0.988 0.005 80 / 0.12) 85%,
      oklch(0.988 0.005 80 / 0.24) 100%
    ),
    url("../../images/site-header.jpg");
  background-position: center 30%;
  background-repeat: no-repeat;
  background-size: cover;
}

.site-brand {
  display: block;
  text-decoration: none;
  margin-bottom: clamp(1rem, 2.8vw, 1.6rem);
}

.site-brand:hover { opacity: 1; }

.site-title {
  display: block;
  font-family: var(--display);
  font-style: italic;
  font-weight: 700;
  font-size: clamp(3.5rem, 10vw, 6.4rem);
  line-height: 0.94;
  color: var(--ink);
  letter-spacing: -0.022em;
}

.site-description {
  display: block;
  font-family: var(--body);
  font-style: normal;
  font-weight: 400;
  font-size: clamp(1rem, 2.1vw, 1.18rem);
  color: var(--ink-soft);
  margin-top: 0.7rem;
  letter-spacing: 0.01em;
}

.site-description em {
  font-style: italic;
  color: var(--wine);
}

@media (max-width: 40rem) {
  .site-header::before {
    height: clamp(12rem, 58vw, 18rem);
    background-position: center 28%;
  }
}

.top-navigation {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0;
  font-family: var(--ui);
  font-size: 0.8rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 0.35rem 0 0.7rem;
}

.top-navigation a {
  color: var(--ink-soft);
  font-weight: 400;
  padding: 0.2rem 1rem;
  transition: color 0.18s var(--ease-out);
}

.top-navigation a:hover { color: var(--wine); opacity: 1; }

.top-navigation a[aria-current="page"] { color: var(--wine); }

.top-navigation a + a::before {
  content: "·";
  margin-right: 1rem;
  color: var(--rule);
  font-size: 1rem;
  vertical-align: middle;
}

/* ---------------------------------------------------------------- home — entry listing */

.home-feed {
  max-width: min(46rem, 100%);
  margin: 0 auto;
  background: transparent;
}

.home-feed .entry {
  text-align: center;
}

.home-feed .entry-header {
  margin-bottom: 0.85rem;
}

.home-feed .entry-date {
  margin-bottom: 0.45rem;
}

.home-feed .entry-content {
  max-width: 58ch;
  margin-inline: auto;
  text-align: left;
}

.entry {
  max-width: var(--card);
  margin: 0 auto;
  padding: clamp(2.5rem, 6vw, 4rem) var(--gutter) 0;
}

.home-feed .entry:first-of-type {
  padding-top: clamp(2rem, 5vw, 3rem);
}

.entry + .entry {
  border-top: 1px solid var(--rule);
}

.entry--lead .entry-title {
  font-size: clamp(1.5rem, 4vw, 2.25rem);
}

.entry-header { margin-bottom: 1rem; }

.entry-date {
  display: block;
  font-family: var(--body);
  font-style: italic;
  font-size: 1rem;
  color: var(--ink-soft);
  margin-bottom: 0.35rem;
}

.entry-title {
  margin: 0;
  font-family: var(--display);
  font-style: italic;
  font-weight: 600;
  font-size: clamp(1.25rem, 3vw, 1.75rem);
  line-height: 1.25;
  text-wrap: balance;
  color: var(--ink);
}

.entry-title a {
  color: var(--ink);
  font-weight: 600;
}

.entry-title a:hover { color: var(--wine); opacity: 1; }

.entry-meta {
  margin: 0.3rem 0 0;
  font-style: italic;
  font-size: 1rem;
  color: var(--ink-soft);
}

.entry-content { max-width: 60ch; }

.entry-content > p:first-child { margin-top: 0; }

.continue {
  font-style: italic;
  font-size: 1rem;
  margin-top: 0.5rem;
}

.continue a { color: var(--wine); }

.continue a:hover { opacity: 0.72; }

main > .entry:last-of-type::after {
  content: "❧";
  display: block;
  text-align: center;
  font-size: 1.375rem;
  color: var(--gold);
  margin-top: clamp(2.5rem, 6vw, 4rem);
  padding-bottom: clamp(2rem, 5vw, 3rem);
}

/* ---------------------------------------------------------------- featured image */

.post-featured-image {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
  object-position: center;
  background: var(--wash);
  margin-bottom: 1.5rem;
}

.single .post-featured-image {
  max-height: min(80vh, 50rem);
  margin-bottom: 0;
}

/* ---------------------------------------------------------------- single post header */

.entry-head {
  max-width: var(--card);
  margin: 0 auto;
  padding: clamp(1.75rem, 4vw, 2.75rem) var(--gutter) 0;
  text-align: center;
}

.single .entry-title {
  font-size: clamp(1.75rem, 5vw, 2.875rem);
  text-align: center;
}

.single .entry-date,
.single .entry-meta {
  text-align: center;
}

.entry-head::after {
  content: "❧";
  display: block;
  font-size: 1.375rem;
  color: var(--gold);
  text-align: center;
  margin-top: 1.5rem;
  margin-bottom: 0;
}

/* ---------------------------------------------------------------- post body */

.post-body {
  max-width: var(--measure);
  margin-inline: auto;
  padding: clamp(1.25rem, 3vw, 1.75rem) var(--gutter) 0;
  font-size: 1.25rem;
  line-height: 1.72;
  text-wrap: pretty;
}

.post-body > p:first-child { margin-top: 0; }

.single .post-body > p:first-child::first-letter {
  float: left;
  font-family: var(--display);
  font-style: italic;
  font-weight: 700;
  font-size: 3.6em;
  line-height: 0.74;
  padding: 0.06em 0.14em 0 0;
  color: var(--wine);
}

.post-body h2,
.post-body h3,
.post-body h4 {
  font-family: var(--display);
  font-style: italic;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.25;
  margin: 2.25rem 0 0.5rem;
  text-wrap: balance;
}

.post-body h2 { font-size: 1.625rem; }
.post-body h3 { font-size: 1.375rem; }
.post-body h4 { font-size: 1.125rem; }

.post-body strong { font-weight: 600; }

.post-body img {
  display: block;
  margin: 2rem auto;
}

.post-body figure { margin: 2rem 0; }
.post-body figure img { margin: 0 auto; }

.post-body figcaption {
  text-align: center;
  font-style: italic;
  color: var(--ink-soft);
  font-size: 1rem;
  margin-top: 0.5rem;
}

.post-body blockquote {
  margin: 2rem 0;
  padding: 0.25rem 0 0.25rem 1.5rem;
  border-left: 3px solid var(--gold);
  font-style: italic;
  font-size: 1.1875rem;
  line-height: 1.62;
  color: var(--ink-soft);
}

.post-body blockquote p { margin: 0.4rem 0; }
.post-body blockquote p:first-child { margin-top: 0; }

.post-body blockquote cite {
  display: block;
  text-align: right;
  font-style: normal;
  font-size: 1rem;
  color: var(--wine);
  margin-top: 0.75rem;
}

.post-body pre {
  background: var(--wash);
  border: 1px solid var(--rule);
  padding: 1rem 1.25rem;
  overflow-x: auto;
  font-size: 0.875rem;
  line-height: 1.55;
}

.post-body code {
  font-size: 0.82em;
  background: var(--wash);
  border: 1px solid var(--rule);
  padding: 0.08em 0.35em;
  border-radius: 2px;
}

.post-body pre code {
  background: none;
  border: none;
  padding: 0;
  font-size: 1em;
}

.post-body iframe { max-width: 100%; }

.post-body hr {
  border: none;
  text-align: center;
  margin: 2.5rem auto;
  color: var(--gold);
  font-size: 1.25rem;
  letter-spacing: 0.4rem;
}

.post-body hr::before { content: "· · ·"; }

.post-body ul > li,
.post-body ol > li { margin-bottom: 0.55rem; }

.post-body a { font-weight: 500; }

.entry .post-body::after {
  content: "◆";
  display: block;
  text-align: center;
  margin-top: 2.75rem;
  color: var(--gold);
  font-size: 0.6875rem;
  letter-spacing: 0.5rem;
}

.tags {
  max-width: var(--measure);
  margin: 1.5rem auto 0;
  padding-inline: var(--gutter);
  font-style: italic;
  font-size: 1rem;
  color: var(--ink-soft);
}

.tags a { color: var(--wine); font-weight: 500; }

/* ---------------------------------------------------------------- pagination */

.pagenav {
  max-width: var(--card);
  margin: clamp(2.5rem, 6vw, 4rem) auto 0;
  padding: 1.5rem var(--gutter) 0;
  border-top: 1px solid var(--rule);
}

.pagenav-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}

.pagenav-item { display: flex; flex-direction: column; gap: 0.2rem; }

.pagenav-item.next {
  text-align: right;
  grid-column: 2;
}

.pagenav-label {
  font-style: italic;
  color: var(--ink-soft);
  font-size: 0.9375rem;
}

.pagenav-item a {
  font-family: var(--display);
  font-style: italic;
  font-weight: 600;
  font-size: 1.125rem;
  line-height: 1.3;
  color: var(--wine);
}

@media (max-width: 36rem) {
  .pagenav-inner { grid-template-columns: 1fr; }
  .pagenav-item.next { text-align: left; grid-column: auto; }
}

/* ---------------------------------------------------------------- page layouts */

.page {
  max-width: var(--card);
  margin-inline: auto;
  padding: clamp(2rem, 5vw, 3.25rem) var(--gutter) 0;
}

.page-title {
  font-family: var(--display);
  font-style: italic;
  font-weight: 700;
  font-size: clamp(1.875rem, 5vw, 3rem);
  line-height: 1.15;
  color: var(--ink);
  margin: 0 0 1.5rem;
  text-wrap: balance;
}

.page .post-body {
  max-width: none;
  padding-inline: 0;
}

/* ---------------------------------------------------------------- books page */

.page--books .post-body .book-cover {
  float: left;
  margin: 0.25rem 1.75rem 1rem 0;
  width: min(180px, 38%);
  max-width: 100%;
  height: auto;
}

@media (max-width: 36rem) {
  .page--books .post-body .book-cover {
    float: none;
    display: block;
    margin: 0 auto 1.25rem;
    width: min(180px, 62vw);
  }
}

.page .post-body hr { clear: both; }

/* ---------------------------------------------------------------- contact form */

.contact-form {
  max-width: var(--measure);
  margin: 2rem auto;
  padding: 0;
}

.form-group {
  margin-bottom: 1.5rem;
  display: flex;
  flex-direction: column;
}

.form-group label {
  display: block;
  font-weight: 500;
  margin-bottom: 0.4rem;
  color: var(--ink);
  font-family: var(--body);
  font-size: 1rem;
}

.form-group input,
.form-group textarea {
  padding: 0.75rem;
  border: 1px solid var(--rule);
  border-radius: 2px;
  font-family: var(--body);
  font-size: 1rem;
  color: var(--ink);
  background: var(--paper);
  transition: border-color 0.2s var(--ease-out), box-shadow 0.2s var(--ease-out);
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--wine);
  box-shadow: 0 0 0 3px oklch(0.37 0.115 15 / 0.1);
}

.form-group textarea {
  resize: vertical;
  line-height: 1.6;
}

.turnstile-wrapper {
  margin-bottom: 1.5rem;
  display: flex;
  justify-content: center;
}

.submit-button {
  padding: 0.875rem 1.5rem;
  background: var(--wine);
  color: var(--paper);
  border: none;
  border-radius: 2px;
  font-family: var(--ui);
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.2s var(--ease-out), opacity 0.2s var(--ease-out);
  display: block;
  margin: 0 auto;
}

.submit-button:hover {
  background: oklch(0.35 0.12 15);
  opacity: 1;
}

.submit-button:active {
  opacity: 0.9;
}

.submit-button.loading {
  opacity: 0.7;
  cursor: not-allowed;
}

.submit-button.success {
  background: oklch(0.4 0.08 130);
}

.submit-button.error {
  background: oklch(0.5 0.12 15);
}

.error-message {
  background: oklch(0.95 0.04 15 / 0.15);
  border: 1px solid oklch(0.5 0.12 15);
  border-radius: 2px;
  padding: 1rem;
  margin-bottom: 1.5rem;
  color: oklch(0.35 0.12 15);
  font-size: 0.95rem;
}

.success-message {
  background: oklch(0.92 0.04 130 / 0.1);
  border: 1px solid oklch(0.4 0.08 130);
  border-radius: 2px;
  padding: 2rem 1.5rem;
  text-align: center;
  color: var(--ink);
}

.success-message h3 {
  margin: 0 0 0.5rem;
  font-family: var(--display);
  font-size: 1.5rem;
  color: var(--ink);
}

.success-message p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 1rem;
}

/* ---------------------------------------------------------------- site footer */

.site-footer {
  margin-top: clamp(4rem, 9vw, 6rem);
  padding: clamp(1.5rem, 4vw, 2.5rem) var(--gutter);
  border-top: 1px solid var(--rule);
  text-align: center;
}

.bottom-navigation {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.4rem 2rem;
  font-family: var(--ui);
  font-size: 0.775rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  margin-bottom: 1rem;
}

.bottom-navigation a {
  color: var(--ink-soft);
  font-weight: 400;
}

.bottom-navigation a:hover { color: var(--wine); opacity: 1; }

.site-footer small {
  display: block;
  font-size: 0.9375rem;
  font-style: italic;
  color: var(--ink-soft);
}

/* ---------------------------------------------------------------- motion discipline */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
