/* casabona.org — literary serif */

/**
 * @license
 * MyFonts Webfont Build ID 3867246, 2020-12-16T11:57:38-0500
 * The fonts listed in this notice are subject to the End User License
 * Agreement(s) entered into by the website owner. All other parties are
 * explicitly restricted from using the Licensed Webfonts(s).
 * Copyright © 2024 Monotype Imaging Inc. All rights reserved.
 * © 2024 MyFonts Inc. */
@font-face {
  font-family: "Roca";
  src: url("/fonts/roca-bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --paper: #fbf8f0;
  --ink: #1b2f3d;
  --muted: #5e7079;
  --rule: #e4ddcc;
  --accent: #082c45;
  --mark: #e8c04e;
  --measure: 34rem;
  --display: "Roca", "EB Garamond", Georgia, serif;
  --serif: "EB Garamond", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  color-scheme: light;
}

/* Themes. Default: paper in light mode, black in dark mode.
   A choice from the footer switcher sets data-theme on <html>. */
:root[data-theme="white"] {
  --paper: #ffffff;
  --ink: #111111;
  --muted: #5f5f5f;
  --rule: #e6e6e6;
  --accent: #111111;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --paper: #15191c;
  --ink: #e8e2d4;
  --muted: #9aa6ab;
  --rule: #2c3337;
  --accent: #f1dfa6;
  --mark: #b8963a;
  color-scheme: dark;
}
:root[data-theme="black"] {
  --paper: #000000;
  --ink: #e6e6e6;
  --muted: #8f8f8f;
  --rule: #262626;
  --accent: #f1dfa6;
  --mark: #b8963a;
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --paper: #000000;
    --ink: #e6e6e6;
    --muted: #8f8f8f;
    --rule: #262626;
    --accent: #f1dfa6;
    --mark: #b8963a;
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: clamp(1.125rem, 1rem + 0.45vw, 1.3rem);
  font-optical-sizing: auto;
  font-variant-numeric: oldstyle-nums proportional-nums;
  line-height: 1.65;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  padding: 0 1.25rem;
}

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 0.18em; text-decoration-color: var(--mark); }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--mark); outline-offset: 3px; border-radius: 2px; }

.skip { position: absolute; left: -9999px; }
.skip:focus { left: 1rem; top: 1rem; background: var(--paper); padding: .5rem 1rem; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* header / footer */
.site-header, main, .site-footer { max-width: var(--measure); margin-inline: auto; }
.site-header {
  display: flex; flex-wrap: wrap; gap: .5rem 1.5rem;
  align-items: center; justify-content: space-between;
  padding: 2rem 0 3.5rem;
}
.wordmark {
  font-family: var(--display);
  font-size: 1.3em; font-weight: 700; letter-spacing: -0.01em;
  color: var(--ink); text-decoration: none;
}
.site-header nav { flex-basis: 100%; display: flex; flex-wrap: wrap; justify-content: center; gap: .25rem 1.25rem; margin-top: .75rem; }
.theme-switch { display: flex; gap: .5rem; }
.theme-switch button {
  width: .8rem; height: .8rem; padding: 0; border-radius: 50%; cursor: pointer;
  border: 1px solid color-mix(in srgb, var(--muted) 60%, transparent);
}
.theme-switch [data-theme="paper"] { background: #fbf8f0; }
.theme-switch [data-theme="white"] { background: #ffffff; }
.theme-switch [data-theme="dark"] { background: #15191c; }
.theme-switch [data-theme="black"] { background: #000000; }
.theme-switch button:hover { border-color: var(--ink); }
.theme-switch button[aria-pressed="true"] { outline: 2px solid var(--mark); outline-offset: 2px; }
.site-header nav a {
  color: var(--muted); text-decoration: none;
  font-variant-caps: all-small-caps; letter-spacing: 0.08em; font-size: 1.05em;
}
.site-header nav a:hover, .site-header nav a[aria-current] { color: var(--ink); }
.site-footer {
  margin-top: 6rem; padding: 2rem 0 4rem; border-top: 1px solid var(--rule);
  color: var(--muted); font-size: .85em;
}
.site-footer a { color: inherit; }
.footer-search { display: flex; gap: .5rem; margin: 0 0 1.25rem; }
.footer-search input {
  flex: 1 1 auto; min-width: 0; font: inherit; color: var(--ink); background: transparent;
  border: 1px solid var(--rule); border-radius: 4px; padding: .45em .7em;
}
.footer-search input:focus { outline: 2px solid var(--mark); outline-offset: 1px; border-color: transparent; }
.footer-search button {
  font: inherit; font-family: var(--display); font-weight: 700; cursor: pointer;
  color: var(--paper); background: var(--ink); border: 0; border-radius: 4px; padding: .45em 1em;
}
.footer-search button:hover { background: var(--accent); }
/* Pagefind search results, in the site's colors */
#search {
  --pagefind-ui-primary: var(--ink); --pagefind-ui-text: var(--ink); --pagefind-ui-background: var(--paper);
  --pagefind-ui-border: var(--rule); --pagefind-ui-tag: var(--rule); --pagefind-ui-border-radius: 4px;
  --pagefind-ui-font: var(--serif);
}
#search .pagefind-ui__result-link { color: var(--accent); font-family: var(--display); }
#search mark { background: color-mix(in srgb, var(--mark) 45%, transparent); color: inherit; }

/* home intro */
/* two columns, a little wider than the reading column */
.intro {
  width: min(44rem, calc(100vw - 2.5rem)); position: relative; left: 50%; transform: translateX(-50%);
  display: grid; grid-template-columns: auto 1fr; gap: 2rem; align-items: start; margin: 0 0 3.5rem;
}
.intro-photo { width: 9rem; height: 9rem; border-radius: 50%; object-fit: cover; }
.intro-text { font-size: 1.08em; }
.intro-text p { margin: 0 0 .9em; }
.signup { grid-column: 1 / -1; }
/* Kit's embedded form, restyled to match the site */
.signup .formkit-form { max-width: none !important; margin: 0 !important; padding: 0 !important; background: none !important; border: 0 !important; box-shadow: none !important; }
.signup .formkit-form [data-style="clean"], .signup .formkit-form .formkit-background { padding: 0 !important; }
.signup .formkit-fields { display: flex !important; flex-wrap: wrap; gap: .5rem; margin: 0 !important; }
.signup .formkit-field { flex: 1 1 11rem; margin: 0 !important; }
.signup .formkit-input {
  font: inherit !important; font-size: .95em !important; color: var(--ink) !important; background: transparent !important;
  border: 1px solid var(--rule) !important; border-radius: 4px !important; padding: .55em .75em !important;
}
.signup .formkit-input::placeholder { color: var(--muted) !important; }
.signup .formkit-submit {
  flex: 0 0 auto; margin: 0 !important; font-family: var(--display) !important; font-weight: 700 !important; font-size: .95em !important;
  color: var(--paper) !important; background: var(--ink) !important; border-radius: 4px !important;
}
.signup .formkit-submit > span { padding: .55em 1.2em !important; color: var(--paper) !important; }
.signup .formkit-powered-by-convertkit-container { display: none !important; }
.all-essays { margin: 1.5rem 0 0; }
.all-essays a { font-variant-caps: all-small-caps; letter-spacing: .08em; text-decoration: none; }
.all-essays a::after { content: " →"; }

/* index */
.year {
  font-weight: 400; font-size: .9em; color: var(--muted);
  font-variant-numeric: lining-nums; letter-spacing: 0.1em;
  margin: 0 0 1rem; padding-bottom: .4rem; border-bottom: 1px solid var(--rule);
}
.year:not(:first-of-type) { margin-top: 3.5rem; }
.essay-list { list-style: none; margin: 0; padding: 0; }
.essay-list li {
  display: grid; grid-template-columns: 1fr auto; gap: 1.5rem;
  align-items: baseline; padding: .9rem 0;
  border-bottom: 1px solid color-mix(in srgb, var(--rule) 60%, transparent);
}
.essay-list a { text-decoration: none; color: var(--ink); display: block; }
.essay-list .title { font-family: var(--display); display: block; font-size: 1.2em; line-height: 1.3; font-weight: 700; }
.essay-list a:hover .title { text-decoration: underline; text-decoration-color: var(--mark); text-underline-offset: .18em; }
.essay-list .desc {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  color: var(--muted); font-size: .9em; margin-top: .25rem; line-height: 1.5;
}
.essay-list time {
  color: var(--muted); font-size: .85em; white-space: nowrap;
  font-variant-caps: all-small-caps; letter-spacing: .05em;
}

/* essay */
.essay-header { margin-bottom: 2.75rem; }
.essay-header h1 {
  font-family: var(--display);
  font-size: clamp(2rem, 1.4rem + 2.6vw, 2.9rem);
  font-weight: 700; line-height: 1.1; letter-spacing: -0.015em;
  margin: 0 0 .9rem; text-wrap: balance;
}
.meta { margin: 0; color: var(--muted); font-size: .9em; font-style: italic; }

.prose > * + * { margin-top: 1.1em; }
.prose p { margin: 0; hanging-punctuation: first; }
.prose > p + p { margin-top: 1.1em; }
.prose h2, .prose h3 { font-family: var(--display); font-weight: 700; line-height: 1.25; margin: 2.2em 0 .6em; text-wrap: balance; }
.prose h2 { font-size: 1.45em; }
.prose h3 { font-size: 1.15em; font-weight: 700; }
.prose strong { font-weight: 600; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li + li { margin-top: .35em; }
.prose li::marker { color: var(--muted); }
.prose blockquote {
  margin: 1.8em 0; padding: 0 0 0 1.25em; border-left: 2px solid var(--mark);
  font-style: italic; color: var(--ink);
}
.prose hr { border: 0; margin: 2.5em 0; text-align: center; }
.prose hr::after { content: "⁂"; color: var(--muted); }
.prose img, .prose video { display: block; max-width: 100%; height: auto; margin: 2em auto; border-radius: 2px; }
.prose figure { margin: 2em 0; }
.prose .gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr)); gap: .5rem; margin: 2em 0; }
.prose .gallery p { margin: 0; }
.prose .gallery img { margin: 0; width: 100%; aspect-ratio: 1; object-fit: cover; }
.prose table { width: 100%; border-collapse: collapse; font-size: .9em; font-variant-numeric: lining-nums tabular-nums; margin: 1.8em 0; display: block; overflow-x: auto; }
.prose th, .prose td { text-align: left; padding: .5em .75em .5em 0; border-bottom: 1px solid var(--rule); vertical-align: top; }
.prose th { font-weight: 700; border-bottom-color: var(--muted); }
.prose figcaption { color: var(--muted); font-size: .85em; font-style: italic; text-align: center; margin-top: .5em; }
.prose iframe { display: block; width: 100%; border: 0; margin: 0 0 2em; }
.prose code { font-size: .88em; background: color-mix(in srgb, var(--rule) 55%, transparent); padding: .1em .3em; border-radius: 3px; }
.prose pre { overflow-x: auto; padding: 1em; background: color-mix(in srgb, var(--rule) 45%, transparent); border-radius: 4px; font-size: .85em; line-height: 1.5; }
.prose details {
  margin-top: 2.5em; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); padding: .8em 0;
}
.prose summary {
  cursor: pointer; color: var(--muted);
  font-variant-caps: all-small-caps; letter-spacing: .08em;
}
.prose details[open] summary { margin-bottom: 1em; }
.prose details > div, .prose details p { font-size: .92em; color: var(--muted); }

.essay-end { text-align: center; color: var(--muted); margin: 3.5rem 0 0; letter-spacing: .2em; }

.more {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem;
  margin-top: 4rem; padding-top: 1.5rem; border-top: 1px solid var(--rule);
}
.more a { text-decoration: none; color: var(--ink); line-height: 1.35; }
.more a span {
  display: block; color: var(--muted); font-size: .8em;
  font-variant-caps: all-small-caps; letter-spacing: .08em; margin-bottom: .2em;
}
.more-next { grid-column: 2; text-align: right; }
.more a:hover { text-decoration: underline; text-decoration-color: var(--mark); }

@media (max-width: 34rem) {
  .intro { grid-template-columns: 1fr; gap: 1.25rem; }
  .signup .formkit-submit { flex: 1 1 100%; }
  .intro-photo { width: 7rem; height: 7rem; }
  .site-header { padding: 1.5rem 0 2.5rem; }
  .essay-list li { grid-template-columns: 1fr; gap: .15rem; }
  .essay-list time { order: -1; }
  .more { grid-template-columns: 1fr; }
  .more-next { grid-column: 1; text-align: left; }
}

/* footnotes */
.prose sup { line-height: 0; font-size: .7em; }
.prose sup a { text-decoration: none; }
.prose .footnotes { margin-top: 3em; padding-top: 1em; border-top: 1px solid var(--rule); font-size: .85em; color: var(--muted); }
.prose iframe[src*="youtube"] { aspect-ratio: 16 / 9; height: auto; }
