/* Type specs pulled from native.works/writing (placeholder, per Matt):
   - headings: Times New Roman, ~26px, weight 400
   - body: "Items Text" (Schick Toikka) on the original — Georgia is its
     designated fallback and stands in here. To use a licensed face later,
     uncomment the @font-face below, drop the files in /fonts/, and it
     takes over automatically (it's already first in the body font stack). */

/*
@font-face {
  font-family: "Items Text";
  src: url("/fonts/ItemsText-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
*/

:root {
  --bg: #e7eaf3;
  --ink: #0c0e11;
  --body: #3a4353;
}

* { box-sizing: border-box; }

html {
  background: var(--bg);
}

body {
  margin: 0 auto;
  padding: 3rem 1.25rem 5rem;
  max-width: 600px;
  font-family: "Items Text", Georgia, serif;
  font-size: 16px;
  line-height: 24px;
  font-weight: 400;
  color: var(--body);
}

h1, h2, h3 {
  font-family: "Times New Roman", Times, serif;
  font-weight: 400;
  color: var(--ink);
  line-height: 1.2;
  margin: 2rem 0 0.5rem;
}

h1 { font-size: 26px; }
h2 { font-size: 22px; }
h3 { font-size: 18px; }

a {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 2px;
}

time {
  color: var(--body);
  opacity: 0.6;
  font-size: 14px;
}

.site-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 3rem;
}

.site-header a { text-decoration: none; }
.site-header nav a { margin-left: 1rem; opacity: 0.6; }

.site-title {
  font-family: "Times New Roman", Times, serif;
  font-size: 18px;
  color: var(--ink);
}

.post-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.post-list li {
  border-bottom: 1px solid rgba(12, 14, 17, 0.15);
}

a.post-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1.25rem;
  padding: 1.25rem 0;
  text-decoration: none;
}

.post-item-text {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.post-item-title {
  font-family: "Times New Roman", Times, serif;
  font-size: 22px;
  line-height: 1.2;
  color: var(--ink);
}

a.post-item:hover .post-item-title {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.post-item-desc {
  color: var(--body);
}

.post-item-text time {
  margin-top: 0.25rem;
  font-variant-numeric: tabular-nums;
}

.post-item-thumb {
  width: 130px;
  height: 87px;
  object-fit: cover;
  flex-shrink: 0;
  margin-top: 0.25rem;
}

@media (max-width: 480px) {
  .post-item-thumb {
    width: 90px;
    height: 60px;
  }
}

article img,
article video {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 1.5rem 0;
}

article figcaption,
article img + em {
  font-size: 14px;
  opacity: 0.6;
}

article h1 { margin-top: 0; margin-bottom: 0.25rem; }
article > time { display: block; margin-bottom: 2rem; }

blockquote {
  margin: 1.5rem 0;
  padding-left: 1rem;
  border-left: 2px solid var(--ink);
}

hr {
  border: none;
  border-top: 1px solid rgba(12, 14, 17, 0.2);
  margin: 2.5rem 0;
}

.back {
  margin-top: 3rem;
  display: flex;
  justify-content: space-between;
}

.post-nav {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(12, 14, 17, 0.15);
}

.post-nav a { text-decoration: none; display: block; }
.post-nav-label { display: block; font-size: 13px; color: var(--body); opacity: 0.6; margin-bottom: 2px; }
.post-nav-title { font-family: "Times New Roman", Times, serif; font-size: 18px; color: var(--ink); }
.post-nav a:hover .post-nav-title { text-decoration: underline; text-underline-offset: 2px; }
.post-nav-next { text-align: right; }

article .video-embed {
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 0;
  display: block;
  margin: 1.5rem 0;
}

button.share {
  font: inherit;
  color: var(--ink);
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* share dialog — geometry measured from Substack's share modal,
   colors mapped to this site's palette */

#share-dialog {
  background: #fbfbfd;
  color: var(--ink);
  border: none;
  border-radius: 20px;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  padding: 24px;
  max-width: 440px;
  width: calc(100vw - 2.5rem);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.4;
}

#share-dialog::backdrop {
  background: rgba(12, 14, 17, 0.4);
}

#share-dialog [hidden] {
  display: none !important;
}

.share-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  font-size: 17px;
  font-weight: 600;
  color: var(--ink);
}

.share-close {
  font: inherit;
  font-size: 22px;
  font-weight: 400;
  line-height: 1;
  color: var(--ink);
  opacity: 0.6;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}

.share-card {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  background: var(--bg);
  margin-bottom: 20px;
}

.share-card img {
  display: block;
  width: 100%;
  height: auto;
}

.share-card-text span {
  display: block;
}

.share-card.has-image .share-card-text {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 48px 16px 16px;
  background: linear-gradient(rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.45));
  color: #fff;
}

.share-card:not(.has-image) .share-card-text {
  padding: 16px;
}

.share-site {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 4px;
  opacity: 0.9;
}

.share-title {
  font-size: 17px;
  font-weight: 600;
  line-height: 24px;
}

.share-desc {
  font-size: 13px;
  opacity: 0.85;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.share-actions {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.share-actions button,
.share-actions a {
  font: inherit;
  color: var(--ink);
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  flex: 1;
}

.share-tile {
  width: 64px;
  height: 64px;
  border-radius: 20px;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
}

.share-actions button:hover .share-tile,
.share-actions a:hover .share-tile {
  background: #dde1ee;
}

.share-tile svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: var(--ink);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.share-tile svg circle {
  fill: var(--ink);
}

.share-glyph {
  font-size: 20px;
  font-weight: 600;
}

.share-label {
  font-size: 11px;
  font-weight: 600;
}

@media (max-width: 420px) {
  .share-tile {
    width: 52px;
    height: 52px;
    border-radius: 16px;
  }
}
