/*
 * AdScope — pages.css
 *
 * Page-specific styles for the About, Sitemap, and Subscribe / RSS templates.
 * Loaded only when one of those templates is active (see inc/pages.php).
 *
 * Relies on the CSS custom properties defined in style.css:
 *   --bg --surface --surface-2 --ink --ink-2 --muted --muted-2
 *   --rule --rule-strong --accent --accent-soft
 *   --font-body --font-display --font-meta
 *   --r-sm --r-md --r-lg
 *
 * @package AdScope
 */

/* ═══════════════════════════════════════════════════════════════════════
   Shared utilities  (not in main style.css)
   ═══════════════════════════════════════════════════════════════════════ */

/* Eyebrow label — small ALL-CAPS meta text above a heading */
.eyebrow {
  font-family: var(--font-meta);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  font-weight: 600;
}

/* Lead paragraph — slightly larger muted intro text */
.lead {
  font-size: 1.05rem;
  color: var(--muted);
}

/* Performance / CWV badge */
.perf {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-meta);
  font-size: 12px;
  border: 1px solid var(--rule);
  padding: 6px 10px;
  border-radius: var(--r-md);
  background: var(--surface);
  white-space: nowrap;
}
.perf .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #16a34a;
  box-shadow: 0 0 0 3px color-mix(in srgb, #16a34a 20%, transparent);
  flex-shrink: 0;
}

/* ═══════════════════════════════════════════════════════════════════════
   About page
   ═══════════════════════════════════════════════════════════════════════ */

/* Hero */
.about-head {
  padding: 72px 0 48px;
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 56px;
  align-items: center;
}
@media (max-width: 760px) {
  .about-head {
    grid-template-columns: 1fr;
    gap: 32px;
    padding: 40px 0 32px;
  }
}
.about-head .eyebrow {
  margin-bottom: 16px;
}
.about-head h1 {
  font-size: clamp(2.4rem, 1.6rem + 3vw, 3.6rem);
  letter-spacing: -0.022em;
  margin-bottom: 18px;
}
.about-head .lead {
  font-size: 1.2rem;
  max-width: 50ch;
  margin: 0;
  line-height: 1.5;
}

/* Decorative art panel */
.about-art {
  aspect-ratio: 4/5;
  border-radius: var(--r-lg);
  background:
    radial-gradient(80% 60% at 70% 30%, var(--accent-soft), transparent 70%),
    linear-gradient(180deg, var(--surface-2), var(--surface));
  border: 1px solid var(--rule);
  position: relative;
  overflow: hidden;
}
.about-art::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 50% 55%, color-mix(in srgb, var(--ink) 75%, transparent) 0 1px, transparent 1.5px);
  background-size: 14px 14px;
  opacity: .18;
}

/* Stats strip */
.about-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}
@media (max-width: 700px) {
  .about-stats {
    grid-template-columns: repeat(2, 1fr);
  }
}
.about-stats > div {
  padding: 32px 24px;
  border-left: 1px solid var(--rule);
}
.about-stats > div:first-child {
  border-left: 0;
}
@media (max-width: 700px) {
  .about-stats > div:nth-child(odd) {
    border-left: 0;
  }
  .about-stats > div:nth-child(3),
  .about-stats > div:nth-child(4) {
    border-top: 1px solid var(--rule);
  }
}
.about-stats .num {
  font-family: var(--font-display);
  font-size: 2.2rem;
  line-height: 1;
  letter-spacing: -0.02em;
}
.about-stats .lbl {
  font-family: var(--font-meta);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-top: 8px;
}

/* About body — two-column: sticky heading + prose */
.about-body {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 56px;
  padding: 64px 0;
}
@media (max-width: 760px) {
  .about-body {
    grid-template-columns: 1fr;
    gap: 16px;
    padding: 40px 0;
  }
}
.about-body h2 {
  font-size: 1.4rem;
  letter-spacing: -0.012em;
  position: sticky;
  top: 80px;
}
.about-body .prose {
  font-size: 17px;
  line-height: 1.7;
}

/* "What I write about" section */
.what {
  padding: 56px 0;
  border-top: 1px solid var(--rule);
}
.what-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  margin-top: 32px;
}
@media (max-width: 760px) {
  .what-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }
}
.what-item {
  border-top: 2px solid var(--ink);
  padding-top: 16px;
}
.what-item h3 {
  font-size: 1.1rem;
  margin-bottom: 6px;
}
.what-item p {
  font-size: 0.95rem;
  color: var(--muted);
  margin: 0;
}

/* ═══════════════════════════════════════════════════════════════════════
   Sitemap page
   ═══════════════════════════════════════════════════════════════════════ */

.sm-hd {
  padding: 56px 0 32px;
  border-bottom: 1px solid var(--rule);
}
.sm-hd .eyebrow {
  margin-bottom: 12px;
}
.sm-hd h1 {
  font-size: clamp(2rem, 1.5rem + 2vw, 2.8rem);
  letter-spacing: -0.022em;
  margin-bottom: 12px;
  max-width: 22ch;
}
.sm-hd .dek {
  font-size: 1.05rem;
  color: var(--muted);
  max-width: 55ch;
  margin: 0;
}

.sm-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 20px 0;
  border-bottom: 1px solid var(--rule);
}
.sm-toolbar .meta {
  font-family: var(--font-meta);
  font-size: 11.5px;
  color: var(--muted);
}
.sm-toolbar .pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--surface-2);
  font-family: var(--font-meta);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}
.sm-toolbar .pill b {
  color: var(--ink);
  font-weight: 600;
}
.sm-toolbar .right {
  margin-left: auto;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* Sitemap table groups */
.sm-group {
  padding: 40px 0 8px;
  border-top: 1px solid var(--rule);
}
.sm-group:first-of-type {
  border-top: 0;
}
.sm-group-hd {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.sm-group-hd h2 {
  font-size: 1.2rem;
  letter-spacing: -0.012em;
}
.sm-group-hd .count {
  font-family: var(--font-meta);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted-2);
}

.sm-list {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  border-top: 1px solid var(--rule);
}
.sm-list th,
.sm-list td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--rule);
}
.sm-list th {
  font-family: var(--font-meta);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted-2);
  font-weight: 600;
}
.sm-list a {
  text-decoration: none;
  color: inherit;
  font-weight: 500;
}
.sm-list a:hover {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.sm-list tr:hover td {
  background: var(--surface-2);
}
.sm-list .when {
  font-family: var(--font-meta);
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.sm-list .pri {
  font-family: var(--font-meta);
  font-size: 12px;
  color: var(--muted-2);
  font-variant-numeric: tabular-nums;
  width: 60px;
  text-align: right;
}
.sm-list .pri b {
  color: var(--ink);
  font-weight: 600;
}
.sm-list .freq {
  font-family: var(--font-meta);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted-2);
  width: 100px;
}
@media (max-width: 700px) {
  .sm-list .hide-sm {
    display: none;
  }
}

/* ═══════════════════════════════════════════════════════════════════════
   Shared XML preview card (used on both Sitemap and Subscribe pages)
   ═══════════════════════════════════════════════════════════════════════ */

.xml-card {
  margin-top: 16px;
  border: 1px solid var(--rule);
  border-radius: var(--r-md);
  background: var(--surface);
  overflow: hidden;
}
.xml-card .head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--rule);
  background: var(--surface-2);
}
.xml-card .head .l {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-meta);
  font-size: 12px;
  color: var(--ink);
}
.xml-card .head .l::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}
.xml-card .head .r {
  font-family: var(--font-meta);
  font-size: 11px;
  color: var(--muted);
}
.xml-card pre {
  margin: 0;
  padding: 16px 18px;
  font-family: var(--font-meta);
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--ink-2);
  overflow-x: auto;
  background: var(--surface);
}
.xml-card .tag  { color: var(--accent); }
.xml-card .attr { color: #7a5af8; }
.xml-card .val  { color: var(--ink); }
.xml-card .com  { color: var(--muted-2); font-style: italic; }
.xml-card .cdata { color: var(--muted); }

html[data-theme="dark"] .xml-card .attr { color: #b3a8ff; }

/* Subscribe page positions the XML card with more top margin */
.rss-hd ~ .section-hd + .xml-card,
main[data-screen-label="rss"] .xml-card {
  margin-top: 0;
}

/* ═══════════════════════════════════════════════════════════════════════
   Subscribe / RSS page
   ═══════════════════════════════════════════════════════════════════════ */

.rss-hd {
  padding: 56px 0 32px;
  border-bottom: 1px solid var(--rule);
}
.rss-hd .eyebrow {
  margin-bottom: 12px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
/* RSS icon using a mask so it inherits the accent color */
.rss-hd .eyebrow .ic {
  width: 14px;
  height: 14px;
  display: inline-block;
  background: var(--accent);
  /* stylelint-disable property-no-vendor-prefix */
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><circle cx='6.18' cy='17.82' r='2.18'/><path d='M4 4.44v2.83A12.73 12.73 0 0 1 16.73 20h2.83A15.56 15.56 0 0 0 4 4.44Z'/><path d='M4 10.1v2.86A6.86 6.86 0 0 1 11.04 20h2.86A9.71 9.71 0 0 0 4 10.1Z'/></svg>") center / contain no-repeat;
          mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><circle cx='6.18' cy='17.82' r='2.18'/><path d='M4 4.44v2.83A12.73 12.73 0 0 1 16.73 20h2.83A15.56 15.56 0 0 0 4 4.44Z'/><path d='M4 10.1v2.86A6.86 6.86 0 0 1 11.04 20h2.86A9.71 9.71 0 0 0 4 10.1Z'/></svg>") center / contain no-repeat;
  /* stylelint-enable property-no-vendor-prefix */
  flex-shrink: 0;
}
.rss-hd h1 {
  font-size: clamp(2rem, 1.5rem + 2vw, 2.8rem);
  letter-spacing: -0.022em;
  margin-bottom: 12px;
  max-width: 22ch;
}
.rss-hd .dek {
  font-size: 1.05rem;
  color: var(--muted);
  max-width: 55ch;
  margin: 0 0 24px;
}

/* Feed URL pill + copy button */
.feed-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}
.feed-url {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--r-md);
  font-family: var(--font-meta);
  font-size: 13px;
  color: var(--ink);
}
.feed-url .copy {
  appearance: none;
  border: 0;
  background: transparent;
  cursor: pointer;
  color: var(--muted);
  padding: 2px 4px;
  border-radius: 3px;
  font-size: 14px;
  line-height: 1;
}
.feed-url .copy:hover {
  color: var(--accent);
}

/* RSS reader buttons grid */
.clients {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-top: 16px;
}
@media (max-width: 600px) {
  .clients {
    grid-template-columns: repeat(2, 1fr);
  }
}
.clients a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--rule);
  border-radius: var(--r-md);
  background: var(--surface);
  text-decoration: none;
  color: inherit;
  font-size: 13.5px;
  transition: border-color .12s, transform .12s;
}
.clients a:hover {
  border-color: var(--rule-strong);
}
.clients a span:first-child {
  width: 24px;
  height: 24px;
  border-radius: 4px;
  background: var(--accent-soft);
  color: var(--accent);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 12px;
  display: inline-grid;
  place-items: center;
  flex-shrink: 0;
}
.clients a b {
  font-weight: 600;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.clients a small {
  color: var(--muted);
  font-size: 11px;
  display: block;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Reader-style preview shell */
.reader {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 32px;
  padding: 32px 0;
  align-items: start;
}
@media (max-width: 820px) {
  .reader {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}

/* Reader sidebar */
.reader-side {
  border: 1px solid var(--rule);
  border-radius: var(--r-md);
  background: var(--surface);
  overflow: hidden;
}
.reader-side .head {
  padding: 14px 16px;
  border-bottom: 1px solid var(--rule);
  background: var(--surface-2);
  font-family: var(--font-meta);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.reader-side .head .count {
  color: var(--accent);
  font-weight: 600;
}
.reader-side ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.reader-side li {
  border-top: 1px solid var(--rule);
}
.reader-side li:first-child {
  border-top: 0;
}
.reader-side a {
  display: block;
  padding: 12px 16px;
  text-decoration: none;
  color: inherit;
}
.reader-side a:hover {
  background: var(--surface-2);
}
.reader-side a.active {
  background: var(--accent-soft);
  border-left: 2px solid var(--accent);
  padding-left: 14px;
}
.reader-side .it-title {
  font-family: var(--font-display);
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: -0.005em;
  line-height: 1.35;
  margin: 0;
  text-wrap: pretty;
}
.reader-side .it-meta {
  font-family: var(--font-meta);
  font-size: 10.5px;
  color: var(--muted-2);
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.reader-side .it-meta .new {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  margin-right: 6px;
  vertical-align: middle;
}

/* Reader main panel */
.reader-main {
  border: 1px solid var(--rule);
  border-radius: var(--r-md);
  background: var(--surface);
  overflow: hidden;
}
.reader-main .head {
  padding: 12px 18px;
  border-bottom: 1px solid var(--rule);
  background: var(--surface-2);
  font-family: var(--font-meta);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.reader-art {
  aspect-ratio: 16/8;
  background:
    radial-gradient(80% 60% at 70% 30%, var(--accent-soft), transparent 70%),
    linear-gradient(135deg, var(--surface-2), var(--surface));
  border-bottom: 1px solid var(--rule);
  overflow: hidden;
}
.reader-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.reader-body {
  padding: 28px 32px 32px;
}
@media (max-width: 540px) {
  .reader-body {
    padding: 20px;
  }
}
.reader-body .cat {
  margin-bottom: 8px;
  display: inline-block;
}
.reader-body h2 {
  font-size: clamp(1.4rem, 1.1rem + 1vw, 1.7rem);
  letter-spacing: -0.015em;
  margin: 0 0 8px;
}
.reader-body .meta-line {
  color: var(--muted);
  margin-bottom: 16px;
  display: block;
}
.reader-body p {
  color: var(--ink-2);
  margin: 0 0 1em;
  line-height: 1.65;
}
.reader-body .more {
  font-family: var(--font-meta);
  font-size: 12px;
  color: var(--muted);
}
.reader-body .more a {
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.reader-body .more a:hover {
  color: var(--accent);
}

/* Section heading row (above XML card and above cat feeds) */
.section-hd {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 40px 0 8px;
  border-top: 1px solid var(--rule);
  margin-top: 24px;
}
.section-hd h2 {
  font-size: 1.3rem;
  letter-spacing: -0.012em;
}
.section-hd .helper {
  font-family: var(--font-meta);
  font-size: 11.5px;
  color: var(--muted);
}
