/*
Theme Name: M.K. Arsenault - Ruined Saints
Theme URI: https://mkarsenault.com
Author: M.K. Arsenault
Description: A custom block theme for M.K. Arsenault and The Book of Ruined Saints.
Version: 1.1.1
Requires at least: 6.5
Tested up to: 6.9
Requires PHP: 7.4
Text Domain: mk-ruined-saints
*/

:root {
  --mk-night: #050305;
  --mk-bruised: #211020;
  --mk-violet: #4c0550;
  --mk-bone: #eae4d8;
  --mk-ash: #c9c6c6;
  --mk-blood: #6b0404;
  --mk-rule: rgba(234, 228, 216, 0.2);
}

html { scroll-behavior: smooth; }

body {
  background: var(--mk-night);
  color: var(--mk-bone);
  margin: 0;
}

a { text-underline-offset: 0.22em; }

.wp-site-blocks { overflow: hidden; }

.mk-site-header {
  background: rgba(5, 3, 5, 0.96);
  border-bottom: 1px solid var(--mk-rule);
  position: relative;
  z-index: 20;
}

.mk-site-header__inner {
  min-height: 92px;
}

.mk-author-mark {
  color: var(--mk-bone);
  display: inline-flex;
  flex-direction: column;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: clamp(1.05rem, 2vw, 1.45rem);
  letter-spacing: 0.25em;
  line-height: 1;
  text-decoration: none;
  text-transform: uppercase;
}

.mk-author-mark::after {
  background: var(--mk-violet);
  content: '';
  height: 2px;
  margin-top: 0.55rem;
  width: 58%;
}

.mk-site-header .wp-block-navigation {
  font-family: 'Arial Narrow', 'Helvetica Neue Condensed', Arial, sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.mk-site-header .wp-block-navigation a { text-decoration: none; }
.mk-site-header .wp-block-navigation a:hover,
.mk-site-header .wp-block-navigation a:focus-visible { color: var(--mk-ash); }

.mk-hero {
  background-color: var(--mk-night);
  border-bottom: 1px solid var(--mk-rule);
  min-height: clamp(610px, 76vh, 820px);
  overflow: hidden;
  position: relative;
}

.mk-hero::before {
  background:
    linear-gradient(90deg, var(--mk-night) 0%, var(--mk-night) 41%, rgba(5,3,5,0.48) 61%, rgba(5,3,5,0.08) 100%),
    linear-gradient(0deg, var(--mk-night) 0%, transparent 28%),
    url('assets/images/mk-portrait.png') 82% 33% / min(54vw, 760px) auto no-repeat;
  content: '';
  inset: 0;
  position: absolute;
}

.mk-hero::after {
  border: 2px solid rgba(76, 5, 80, 0.92);
  border-radius: 50%;
  content: '';
  height: min(38vw, 540px);
  opacity: 0.78;
  position: absolute;
  right: clamp(4%, 8vw, 13%);
  top: 12%;
  transform: rotate(-7deg);
  width: min(38vw, 540px);
}

.mk-hero__inner {
  align-items: flex-start;
  display: flex;
  min-height: clamp(610px, 76vh, 820px);
  position: relative;
  z-index: 2;
}

.mk-hero__copy {
  max-width: 790px;
  padding-bottom: clamp(5rem, 9vw, 9rem);
  padding-top: clamp(5rem, 9vw, 9rem);
}

.mk-eyebrow,
.mk-evidence-label,
.mk-post-meta {
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.mk-eyebrow { color: var(--mk-ash); }

.mk-hero h1 {
  color: var(--mk-bone);
  font-family: Impact, 'Arial Narrow', 'Helvetica Neue Condensed', sans-serif;
  font-size: clamp(4.4rem, 9.2vw, 9.4rem);
  font-stretch: condensed;
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 0.76;
  margin: 1.4rem 0 1.8rem;
  max-width: 760px;
  position: relative;
  text-transform: uppercase;
}

.mk-hero h1::after {
  background: var(--mk-violet);
  content: '';
  height: clamp(8px, 1vw, 14px);
  left: -2%;
  position: absolute;
  top: 58%;
  transform: rotate(-2.8deg);
  width: 103%;
  z-index: 2;
}

.mk-pressure-line {
  color: var(--mk-bone);
  font-family: Georgia, 'Times New Roman', serif;
  font-size: clamp(1.2rem, 2vw, 1.8rem);
  font-style: italic;
  letter-spacing: 0.04em;
  margin-bottom: 2.2rem;
}

.mk-button .wp-block-button__link,
.wp-element-button {
  background: transparent;
  border: 1px solid var(--mk-bone);
  border-radius: 0;
  color: var(--mk-bone);
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  padding: 1rem 1.55rem;
  text-transform: uppercase;
}

.mk-button .wp-block-button__link:hover,
.mk-button .wp-block-button__link:focus-visible,
.wp-element-button:hover,
.wp-element-button:focus-visible {
  background: var(--mk-violet);
  border-color: var(--mk-violet);
  color: var(--mk-bone);
}

.mk-latest {
  background: var(--mk-bruised);
  border-bottom: 1px solid var(--mk-rule);
  border-top: 1px solid var(--mk-rule);
}

.mk-latest__grid {
  align-items: center;
  display: grid;
  gap: clamp(2rem, 6vw, 6rem);
  grid-template-columns: minmax(150px, 0.55fr) minmax(0, 1.45fr);
}

.mk-catalog {
  background: var(--mk-night);
  border-bottom: 1px solid var(--mk-rule);
}

.mk-catalog-grid {
  display: grid;
  gap: clamp(0.9rem, 1.5vw, 1.35rem);
  grid-template-columns: repeat(12, minmax(0, 1fr));
  margin-top: 2.5rem;
}

.mk-substack-feed {
  display: grid;
  gap: clamp(0.9rem, 1.5vw, 1.35rem);
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 2.5rem;
}

.mk-catalog-card,
.mk-feed-card {
  background: #0b080b;
  border: 1px solid var(--mk-rule);
  color: var(--mk-bone);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: clamp(1.5rem, 2.4vw, 2.25rem);
  text-decoration: none;
  transition: border-color 160ms ease, transform 160ms ease;
}

.mk-catalog-card--featured {
  grid-column: span 6;
  min-height: 360px;
}

.mk-catalog-card--wide {
  align-items: start;
  grid-column: 1 / -1;
  min-height: 250px;
  padding-right: clamp(2rem, 12vw, 10rem);
}

.mk-catalog-card--utility {
  grid-column: span 4;
  min-height: 230px;
}

.mk-feed-card { min-height: 260px; }

.mk-catalog-card:hover,
.mk-catalog-card:focus-visible,
.mk-feed-card:hover,
.mk-feed-card:focus-within {
  border-color: var(--mk-violet);
  transform: translateY(-4px);
}

.mk-catalog-card h3,
.mk-feed-card h3 {
  font-family: Impact, 'Arial Narrow', 'Helvetica Neue Condensed', sans-serif;
  font-size: clamp(1.9rem, 2.5vw, 3.15rem);
  line-height: 0.92;
  margin: 1.1rem 0 0.9rem;
  overflow-wrap: anywhere;
  text-transform: uppercase;
}

.mk-catalog-card--featured h3 { font-size: clamp(2.5rem, 4.6vw, 5.2rem); }
.mk-catalog-card--wide h3 { font-size: clamp(2.6rem, 5.2vw, 5.8rem); }
.mk-catalog-card--long h3 { font-size: clamp(1.65rem, 2.25vw, 2.7rem); }

.mk-catalog-card p,
.mk-feed-card p {
  color: var(--mk-ash);
  font-family: Georgia, 'Times New Roman', serif;
  font-size: clamp(0.96rem, 1.05vw, 1.08rem);
  line-height: 1.55;
  margin-bottom: 0;
  max-width: 42ch;
}

.mk-catalog-card--wide p { max-width: 66ch; }

.mk-catalog-card__cta,
.mk-feed-card__meta {
  color: var(--mk-ash);
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  margin-top: auto;
  padding-top: 1.5rem;
  text-transform: uppercase;
}

.mk-feed-card h3 a { color: var(--mk-bone); text-decoration: none; }

.mk-about {
  background: var(--mk-bruised);
  border-bottom: 1px solid var(--mk-rule);
}

.mk-about__grid {
  align-items: start;
  display: grid;
  gap: clamp(2.5rem, 7vw, 7rem);
  grid-template-columns: minmax(220px, 0.65fr) minmax(0, 1.35fr);
}

.mk-about__copy {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: clamp(1.1rem, 1.6vw, 1.35rem);
  line-height: 1.7;
}

.mk-about__copy strong { color: var(--mk-bone); }

.mk-evidence-label {
  background: var(--mk-bone);
  box-shadow: 8px 8px 0 var(--mk-violet);
  color: var(--mk-night);
  display: inline-block;
  padding: 0.85rem 1.15rem;
  transform: rotate(-1deg);
}

.mk-section-title,
.mk-entry-title,
.mk-archive-title {
  font-family: Impact, 'Arial Narrow', 'Helvetica Neue Condensed', sans-serif;
  font-weight: 800;
  letter-spacing: 0.01em;
  line-height: 0.9;
  text-transform: uppercase;
}

.mk-section-title { font-size: clamp(2.8rem, 6vw, 6.4rem); }
.mk-entry-title { font-size: clamp(3.4rem, 7vw, 7.6rem); }
.mk-archive-title { font-size: clamp(3rem, 6vw, 6.5rem); }

.mk-story-index { background: var(--mk-night); }

.mk-story-index .wp-block-post-template {
  display: grid;
  gap: 1px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.mk-story-card {
  background: #0b080b;
  border: 1px solid var(--mk-rule);
  height: 100%;
  padding: clamp(1.5rem, 3vw, 2.6rem);
  transition: border-color 160ms ease, transform 160ms ease;
}

.mk-story-card:hover {
  border-color: var(--mk-violet);
  transform: translateY(-4px);
}

.mk-story-card .wp-block-post-title {
  font-family: Impact, 'Arial Narrow', 'Helvetica Neue Condensed', sans-serif;
  font-size: clamp(2rem, 3vw, 3.6rem);
  line-height: 0.95;
  text-transform: uppercase;
}

.mk-story-card .wp-block-post-title a { text-decoration: none; }

.mk-newsletter {
  background: var(--mk-bone);
  color: var(--mk-night);
  position: relative;
}

.mk-newsletter::before {
  border: 2px solid var(--mk-violet);
  border-radius: 50%;
  content: '';
  height: 180px;
  left: 6%;
  opacity: 0.35;
  position: absolute;
  top: 12%;
  transform: rotate(12deg);
  width: 180px;
}

.mk-newsletter .wp-element-button {
  border-color: var(--mk-night);
  color: var(--mk-night);
}

.mk-site-footer {
  background: #020102;
  border-top: 1px solid var(--mk-rule);
}

.mk-site-footer .wp-block-site-title {
  font-family: Georgia, 'Times New Roman', serif;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.mk-reading-shell { background: var(--mk-night); }
.mk-reading-shell .wp-block-post-content { font-family: Georgia, 'Times New Roman', serif; }
.mk-reading-shell .wp-block-post-content > * { max-width: 760px; }
.mk-reading-shell .wp-block-post-content > .alignwide { max-width: 1180px; }
.mk-reading-shell .wp-block-post-content > .alignfull { max-width: none; }

.mk-reading-shell blockquote {
  border-left: 6px solid var(--mk-violet);
  color: var(--mk-ash);
  font-style: italic;
  margin-left: 0;
  padding-left: 1.5rem;
}

.mk-not-found { min-height: 60vh; }

@media (max-width: 960px) {
  .mk-hero::before {
    background:
      linear-gradient(90deg, var(--mk-night) 0%, rgba(5,3,5,0.86) 62%, rgba(5,3,5,0.3) 100%),
      linear-gradient(0deg, var(--mk-night) 0%, transparent 30%),
      url('assets/images/mk-portrait.png') 92% 20% / auto 88% no-repeat;
  }
  .mk-hero::after { height: 54vw; right: -4%; top: 17%; width: 54vw; }
  .mk-story-index .wp-block-post-template { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mk-catalog-card--featured,
  .mk-catalog-card--utility { grid-column: span 6; }
  .mk-catalog-card--wide { grid-column: 1 / -1; }
  .mk-substack-feed { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 680px) {
  .mk-site-header__inner { min-height: 74px; }
  .mk-site-header .wp-block-navigation { font-size: 0.7rem; }
  .mk-hero { min-height: 690px; }
  .mk-hero::before {
    background:
      linear-gradient(0deg, var(--mk-night) 5%, rgba(5,3,5,0.62) 55%, rgba(5,3,5,0.05) 100%),
      url('assets/images/mk-portrait.png') 65% 8% / auto 67% no-repeat;
  }
  .mk-hero::after { height: 74vw; right: -7%; top: 4%; width: 74vw; }
  .mk-hero__inner { align-items: flex-end; min-height: 690px; }
  .mk-hero__copy { padding-bottom: 3.5rem; padding-top: 21rem; }
  .mk-hero h1 { font-size: clamp(3.8rem, 17vw, 6.4rem); }
  .mk-latest__grid { grid-template-columns: 1fr; }
  .mk-story-index .wp-block-post-template { grid-template-columns: 1fr; }
  .mk-catalog-grid { gap: 0.85rem; }
  .mk-catalog-card--featured,
  .mk-catalog-card--wide,
  .mk-catalog-card--utility { grid-column: 1 / -1; min-height: 0; padding: 1.45rem; }
  .mk-catalog-card h3,
  .mk-catalog-card--featured h3,
  .mk-catalog-card--wide h3,
  .mk-catalog-card--long h3 { font-size: clamp(2.15rem, 12vw, 3.25rem); }
  .mk-catalog-card--long h3 { font-size: clamp(1.85rem, 9.5vw, 2.5rem); }
  .mk-catalog-card p { font-size: 1rem; max-width: none; }
  .mk-catalog-card__cta { padding-top: 1.25rem; }
  .mk-substack-feed,
  .mk-about__grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .mk-story-card { transition: none; }
}
