/**
 * Reading styles for posts, pages, and the Gutenberg editor.
 * Layout chrome (header, cards, sidebar) stays in theme.css.
 */

.entry-content,
.editor-styles-wrapper {
  font-family: var(--serif);
  font-size: 1.1875rem;
  line-height: 1.7;
  color: var(--ink);
  width: 100%;
  max-width: none;
  overflow-wrap: break-word;
  --wp--style--block-gap: 0;
}

.editor-styles-wrapper {
  padding: 1.5rem 1.5rem 3rem;
  background: var(--paper);
}

.entry-content > *,
.editor-styles-wrapper > * {
  max-width: 100%;
}

.entry-content p,
.editor-styles-wrapper p,
.entry-content .wp-block-paragraph {
  margin: 0 0 1.2em;
  margin-block: 0 1.2em;
}

.entry-content p:last-child,
.editor-styles-wrapper p:last-child {
  margin-bottom: 0;
}

:is(.entry-content, .editor-styles-wrapper) p.has-drop-cap:not(:focus)::first-letter {
  float: left;
  font-size: 3.4em;
  line-height: 0.78;
  font-weight: 650;
  margin: 0.08em 0.12em 0 0;
}

:is(.entry-content, .editor-styles-wrapper) a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

:is(.entry-content, .editor-styles-wrapper) a:hover {
  color: var(--ink);
}

.entry-content h1,
.entry-content h2,
.entry-content h3,
.entry-content h4,
.entry-content h5,
.entry-content h6,
.editor-styles-wrapper h1,
.editor-styles-wrapper h2,
.editor-styles-wrapper h3,
.editor-styles-wrapper h4,
.editor-styles-wrapper h5,
.editor-styles-wrapper h6 {
  font-family: var(--serif);
  font-weight: 650;
  letter-spacing: -0.02em;
  line-height: 1.28;
  color: var(--ink);
  margin: 1.85em 0 0.7em;
}

.entry-content h1, .editor-styles-wrapper h1 { font-size: 1.85rem; }
.entry-content h2, .editor-styles-wrapper h2 { font-size: 1.5rem; }
.entry-content h3, .editor-styles-wrapper h3 { font-size: 1.28rem; }
.entry-content h4, .editor-styles-wrapper h4 { font-size: 1.12rem; }
.entry-content h5,
.entry-content h6,
.editor-styles-wrapper h5,
.editor-styles-wrapper h6 { font-size: 1.02rem; }

.entry-content h2:first-child,
.entry-content h3:first-child,
.editor-styles-wrapper h2:first-child,
.editor-styles-wrapper h3:first-child {
  margin-top: 0;
}

.entry-content ul,
.entry-content ol,
.editor-styles-wrapper ul,
.editor-styles-wrapper ol {
  margin: 0 0 1.2em;
  padding-left: 1.35rem;
}

:is(.entry-content, .editor-styles-wrapper) li + li {
  margin-top: 0.35em;
}

:is(.entry-content, .editor-styles-wrapper) li > ul,
:is(.entry-content, .editor-styles-wrapper) li > ol {
  margin-top: 0.35em;
}

:is(.entry-content, .editor-styles-wrapper) hr,
:is(.entry-content, .editor-styles-wrapper) .wp-block-separator {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 2rem 0;
  height: 0;
}

:is(.entry-content, .editor-styles-wrapper) .wp-block-separator.is-style-wide {
  width: 100%;
}

:is(.entry-content, .editor-styles-wrapper) .wp-block-separator.is-style-dots {
  border: 0;
  text-align: center;
  height: auto;
}

:is(.entry-content, .editor-styles-wrapper) blockquote,
:is(.entry-content, .editor-styles-wrapper) .wp-block-quote {
  margin: 1.5rem 0;
  padding: 0.15rem 0 0.15rem 1.1rem;
  border-left: 3px solid var(--accent);
  color: var(--muted);
}

:is(.entry-content, .editor-styles-wrapper) blockquote p,
:is(.entry-content, .editor-styles-wrapper) .wp-block-quote p {
  margin: 0 0 0.7em;
}

:is(.entry-content, .editor-styles-wrapper) blockquote p:last-child,
:is(.entry-content, .editor-styles-wrapper) .wp-block-quote p:last-child {
  margin-bottom: 0;
}

:is(.entry-content, .editor-styles-wrapper) .wp-block-quote cite,
:is(.entry-content, .editor-styles-wrapper) blockquote cite {
  display: block;
  margin-top: 0.6rem;
  font-family: var(--sans);
  font-size: 0.88rem;
  font-style: normal;
  color: var(--muted);
}

:is(.entry-content, .editor-styles-wrapper) .wp-block-pullquote {
  margin: 1.75rem 0;
  padding: 1.1rem 0;
  border-top: 2px solid var(--ink);
  border-bottom: 2px solid var(--ink);
  text-align: center;
}

:is(.entry-content, .editor-styles-wrapper) .wp-block-pullquote p {
  font-size: 1.25rem;
  line-height: 1.45;
}

:is(.entry-content, .editor-styles-wrapper) code,
:is(.entry-content, .editor-styles-wrapper) kbd {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9em;
  background: var(--ad-bg);
  padding: 0.1em 0.35em;
  border-radius: 4px;
}

:is(.entry-content, .editor-styles-wrapper) pre,
:is(.entry-content, .editor-styles-wrapper) .wp-block-code,
:is(.entry-content, .editor-styles-wrapper) .wp-block-preformatted {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9rem;
  line-height: 1.55;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.9rem 1rem;
  overflow-x: auto;
}

:is(.entry-content, .editor-styles-wrapper) pre code {
  background: transparent;
  padding: 0;
}

:is(.entry-content, .editor-styles-wrapper) img,
:is(.entry-content, .editor-styles-wrapper) video,
:is(.entry-content, .editor-styles-wrapper) iframe {
  max-width: 100%;
  height: auto;
}

:is(.entry-content, .editor-styles-wrapper) figure,
:is(.entry-content, .editor-styles-wrapper) .wp-block-image,
:is(.entry-content, .editor-styles-wrapper) .wp-block-video,
:is(.entry-content, .editor-styles-wrapper) .wp-block-embed {
  margin: 1.4rem 0;
}

:is(.entry-content, .editor-styles-wrapper) .wp-block-image img,
:is(.entry-content, .editor-styles-wrapper) .wp-block-image figure img {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  border-radius: var(--radius);
}

:is(.entry-content, .editor-styles-wrapper) figcaption,
:is(.entry-content, .editor-styles-wrapper) .wp-element-caption {
  margin-top: 0.45rem;
  font-family: var(--sans);
  font-size: 0.84rem;
  color: var(--muted);
  text-align: center;
}

:is(.entry-content, .editor-styles-wrapper) .alignleft {
  float: left;
  margin: 0.25rem 1.15rem 0.75rem 0;
  max-width: 48%;
}

:is(.entry-content, .editor-styles-wrapper) .alignright {
  float: right;
  margin: 0.25rem 0 0.75rem 1.15rem;
  max-width: 48%;
}

:is(.entry-content, .editor-styles-wrapper) .aligncenter {
  display: block;
  margin-left: auto;
  margin-right: auto;
}

:is(.entry-content, .editor-styles-wrapper) .alignwide,
:is(.entry-content, .editor-styles-wrapper) .alignfull {
  width: 100%;
  max-width: 100%;
  margin-left: 0;
  margin-right: 0;
}

:is(.entry-content, .editor-styles-wrapper) .wp-block-gallery {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin: 1.4rem 0;
}

:is(.entry-content, .editor-styles-wrapper) .wp-block-gallery .wp-block-image {
  margin: 0;
  flex: 1 1 8rem;
}

:is(.entry-content, .editor-styles-wrapper) .wp-block-table,
:is(.entry-content, .editor-styles-wrapper) table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--sans);
  font-size: 0.95rem;
  overflow-x: auto;
}

:is(.entry-content, .editor-styles-wrapper) th,
:is(.entry-content, .editor-styles-wrapper) td {
  border: 1px solid var(--line);
  padding: 0.5rem 0.7rem;
  text-align: left;
}

:is(.entry-content, .editor-styles-wrapper) thead th {
  background: var(--paper-2);
}

:is(.entry-content, .editor-styles-wrapper) .wp-block-table {
  overflow-x: auto;
}

:is(.entry-content, .editor-styles-wrapper) .wp-block-columns {
  display: flex;
  flex-wrap: wrap;
  gap: 1.15rem;
}

:is(.entry-content, .editor-styles-wrapper) .wp-block-column {
  flex: 1 1 12rem;
  min-width: 0;
}

:is(.entry-content, .editor-styles-wrapper) .wp-block-media-text {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.15rem;
  align-items: center;
}

:is(.entry-content, .editor-styles-wrapper) .wp-block-button .wp-block-button__link {
  display: inline-block;
  background: var(--ink);
  color: #fff;
  text-decoration: none;
  border-radius: 999px;
  padding: 0.55rem 1.1rem;
  font-family: var(--sans);
  font-size: 0.92rem;
}

:is(.entry-content, .editor-styles-wrapper) .wp-block-button .wp-block-button__link:hover {
  background: var(--accent);
  color: #fff;
}

:is(.entry-content, .editor-styles-wrapper) .wp-block-cover {
  position: relative;
  min-height: 14rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  overflow: hidden;
}

:is(.entry-content, .editor-styles-wrapper) .wp-block-file a {
  font-family: var(--sans);
}

:is(.entry-content, .editor-styles-wrapper) .has-text-align-center { text-align: center; }
:is(.entry-content, .editor-styles-wrapper) .has-text-align-right { text-align: right; }
:is(.entry-content, .editor-styles-wrapper) .has-text-align-left { text-align: left; }

:is(.entry-content, .editor-styles-wrapper) .has-small-font-size { font-size: 0.92rem; }
:is(.entry-content, .editor-styles-wrapper) .has-medium-font-size { font-size: 1.125rem; }
:is(.entry-content, .editor-styles-wrapper) .has-large-font-size { font-size: 1.4rem; }
:is(.entry-content, .editor-styles-wrapper) .has-x-large-font-size { font-size: 1.7rem; }

.page-links {
  margin-top: 1.5rem;
  font-family: var(--sans);
  font-size: 0.92rem;
}

@media (max-width: 700px) {
  :is(.entry-content, .editor-styles-wrapper) .alignleft,
  :is(.entry-content, .editor-styles-wrapper) .alignright {
    float: none;
    display: block;
    margin: 0 0 1rem;
    max-width: 100%;
  }

  :is(.entry-content, .editor-styles-wrapper) .wp-block-media-text {
    grid-template-columns: 1fr;
  }
}
