/*
Theme Name: UIAppeals
Theme URI: https://uiappeals.com/
Author: UIAppeals Editorial
Description: Accessible, performance-minded block theme for the independent UIAppeals legal-education publication.
Version: 0.4.2-r2
Requires at least: 6.9
Requires PHP: 8.1
Text Domain: uiappeals
*/

:root {
  --ui-ink: #142f35;
  --ui-ink-soft: #315057;
  --ui-teal: #075f5b;
  --ui-teal-dark: #064844;
  --ui-sage: #dce8e1;
  --ui-amber: #d9a441;
  --ui-coral: #c5664c;
  --ui-paper: #fbfaf6;
  --ui-white: #ffffff;
  --ui-line: #c7d4cf;
  --ui-muted: #eef2ef;
  --ui-shadow: 0 18px 50px rgba(20, 47, 53, 0.09);
  --ui-radius: 0.8rem;
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--ui-paper);
  color: var(--ui-ink);
  font-family: "Aptos", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.72;
  margin: 0;
  text-rendering: optimizeLegibility;
}

body::before {
  background: linear-gradient(90deg, var(--ui-teal) 0 67%, var(--ui-amber) 67% 83%, var(--ui-coral) 83% 100%);
  content: "";
  display: block;
  height: 0.35rem;
}

* {
  box-sizing: border-box;
}

img,
svg {
  height: auto;
  max-width: 100%;
}

a {
  color: var(--ui-teal-dark);
  text-decoration-thickness: 0.09em;
  text-underline-offset: 0.15em;
}

a:hover {
  color: #923d2c;
}

:where(a, button, input, select, textarea, summary):focus-visible {
  border-radius: 0.15rem;
  outline: 0.22rem solid var(--ui-amber);
  outline-offset: 0.18rem;
}

.skip-link {
  background: var(--ui-white);
  color: var(--ui-ink);
  font-weight: 750;
  left: 1rem;
  padding: 0.7rem 1rem;
  position: fixed;
  top: -10rem;
  z-index: 100000;
}

.skip-link:focus {
  top: 1rem;
}

.site-header {
  background: rgba(251, 250, 246, 0.98);
  border-bottom: 1px solid var(--ui-line);
  position: relative;
  z-index: 20;
}

.header-inner {
  gap: 1.5rem;
  justify-content: space-between;
  min-height: 6.4rem;
  padding-bottom: 1rem;
  padding-top: 1rem;
}

.brand-lockup {
  flex-shrink: 0;
  gap: 0.75rem;
}

.brand-mark {
  align-items: center;
  background: var(--ui-teal);
  border-radius: 50% 50% 50% 0.25rem;
  color: var(--ui-white);
  display: inline-flex;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.15rem;
  font-weight: 700;
  height: 3rem;
  justify-content: center;
  letter-spacing: -0.08em;
  transform: rotate(-6deg);
  width: 3rem;
}

.brand-mark > span {
  transform: rotate(6deg);
}

.site-header .wp-block-site-title {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.35rem, 1.1rem + 0.6vw, 1.8rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1;
  margin: 0;
}

.site-header .wp-block-site-title a {
  color: var(--ui-ink);
  text-decoration: none;
}

.site-descriptor {
  color: var(--ui-ink-soft);
  font-size: 0.78rem;
  font-weight: 720;
  letter-spacing: 0.075em;
  line-height: 1.3;
  margin: 0.35rem 0 0;
  text-transform: uppercase;
}

.primary-nav {
  font-size: 0.9rem;
  font-weight: 680;
}

.primary-nav .wp-block-navigation-item__content {
  padding: 0.55rem 0.15rem;
  text-decoration: none;
}

.primary-nav .current-menu-item > .wp-block-navigation-item__content,
.primary-nav .wp-block-navigation-item__content:hover {
  box-shadow: inset 0 -0.18rem 0 var(--ui-amber);
  color: var(--ui-ink);
}

.site-main {
  min-height: 50vh;
  padding-bottom: clamp(4rem, 8vw, 7rem);
  padding-top: clamp(1.3rem, 3vw, 2.3rem);
}

.article-shell {
  background: var(--ui-white);
  border: 1px solid rgba(199, 212, 207, 0.86);
  border-radius: 0 0 var(--ui-radius) var(--ui-radius);
  box-shadow: var(--ui-shadow);
  overflow: hidden;
}

.article-body {
  padding: clamp(1.5rem, 4.5vw, 4.5rem);
}

.breadcrumbs {
  color: var(--ui-ink-soft);
  font-size: 0.86rem;
  margin: 0 auto 1rem;
  max-width: 74rem;
}

.breadcrumbs ol {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.55rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.breadcrumbs li:not(:last-child)::after {
  color: #6d827e;
  content: "/";
  margin-left: 0.55rem;
}

.breadcrumbs a {
  color: inherit;
}

.page-context {
  color: var(--ui-ink-soft);
  display: flex;
  flex-wrap: wrap;
  font-size: 0.8rem;
  gap: 0.3rem;
  line-height: 1.4;
  margin: 0;
  padding: 0.8rem clamp(1.15rem, 4.5vw, 4.5rem) 0;
}

.entry-content {
  margin-left: auto;
  margin-right: auto;
  max-width: 48rem;
}

.entry-content > :first-child {
  margin-top: 0;
}

.entry-content h1,
.entry-content h2,
.entry-content h3 {
  color: var(--ui-ink);
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 680;
  letter-spacing: -0.025em;
  text-wrap: balance;
}

.entry-content h1 {
  font-size: clamp(2.25rem, 1.65rem + 2.5vw, 4.2rem);
  line-height: 1.04;
  margin-bottom: 1.3rem;
}

.entry-content h2 {
  border-top: 1px solid var(--ui-line);
  font-size: clamp(1.6rem, 1.35rem + 1vw, 2.35rem);
  line-height: 1.16;
  margin-bottom: 0.75rem;
  margin-top: 3.25rem;
  padding-top: 1.4rem;
}

.entry-content h3 {
  font-size: clamp(1.25rem, 1.15rem + 0.45vw, 1.55rem);
  line-height: 1.25;
  margin-bottom: 0.5rem;
  margin-top: 2rem;
}

.entry-content p,
.entry-content li {
  max-width: 72ch;
}

.entry-content > p:first-of-type {
  color: var(--ui-ink-soft);
  font-size: clamp(1.12rem, 1.04rem + 0.35vw, 1.32rem);
  line-height: 1.62;
}

.uiappeals-context-image {
  margin: clamp(1.75rem, 4vw, 2.75rem) 0 clamp(2.25rem, 5vw, 3.5rem);
}

.uiappeals-context-image__media {
  aspect-ratio: 16 / 9;
  background: var(--ui-muted);
  border: 1px solid var(--ui-line);
  border-radius: var(--ui-radius);
  box-shadow: 0 12px 32px rgba(20, 47, 53, 0.12);
  display: block;
  height: auto;
  object-fit: contain;
  width: 100%;
}

.uiappeals-context-image--secondary {
  margin-left: auto;
  margin-right: auto;
  max-width: 42rem;
}

.home .uiappeals-context-image--hero {
  margin-top: clamp(1.5rem, 3vw, 2.25rem);
}

.entry-content ul,
.entry-content ol {
  padding-left: 1.35rem;
}

.entry-content li + li {
  margin-top: 0.38rem;
}

.entry-content blockquote {
  border-left: 0.3rem solid var(--ui-amber);
  color: var(--ui-ink-soft);
  margin: 2rem 0;
  padding: 0.4rem 0 0.4rem 1.4rem;
}

.entry-content hr {
  border: 0;
  border-top: 1px solid var(--ui-line);
  margin: 2.75rem 0;
}

.entry-content table {
  border-collapse: collapse;
  display: block;
  font-size: 0.92rem;
  margin: 1.5rem 0 2rem;
  max-width: 100%;
  overflow-x: auto;
  width: max-content;
}

.entry-content th,
.entry-content td {
  border: 1px solid #9cb0ab;
  min-width: 9rem;
  padding: 0.65rem 0.7rem;
  text-align: left;
  vertical-align: top;
}

.entry-content th {
  background: var(--ui-sage);
  font-weight: 750;
}

.home .article-shell {
  border-radius: var(--ui-radius);
}

.home .entry-content {
  max-width: 62rem;
}

.home .entry-content h1 {
  max-width: 16ch;
}

.home .entry-content > p:nth-of-type(1) {
  max-width: 54rem;
}

.home .entry-content > p:nth-of-type(2) {
  max-width: 48rem;
}

.home .entry-content > p:nth-of-type(3) {
  background: var(--ui-sage);
  border-left: 0.35rem solid var(--ui-teal);
  border-radius: 0 var(--ui-radius) var(--ui-radius) 0;
  display: grid;
  gap: 0.45rem;
  margin: 2rem 0 3rem;
  padding: 1.2rem 1.35rem;
}

.home .entry-content > p:nth-of-type(3) br {
  display: none;
}

.tool-actions {
  align-items: center;
  background: #f4eee1;
  border-bottom: 1px solid #dfd1b8;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  padding: 0.85rem clamp(1rem, 4vw, 2rem);
}

.tool-actions p {
  font-size: 0.84rem;
  margin: 0;
}

.print-button {
  background: var(--ui-teal);
  border: 0;
  border-radius: 999px;
  color: var(--ui-white);
  cursor: pointer;
  font: inherit;
  font-size: 0.87rem;
  font-weight: 750;
  padding: 0.65rem 1.1rem;
}

.print-button:hover {
  background: var(--ui-teal-dark);
}

.uiappeals-tool .entry-content {
  max-width: 66rem;
}

.uiappeals-tool .entry-content td {
  height: 3.2rem;
}

.not-found {
  padding: clamp(3rem, 10vw, 8rem) 1.5rem;
  text-align: center;
}

.not-found h1 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.2rem, 6vw, 4.5rem);
}

.site-footer {
  background: var(--ui-ink);
  color: #eef5f2;
  font-size: 0.9rem;
}

.footer-inner {
  padding-bottom: 2.5rem;
  padding-top: 3rem;
}

.footer-identity {
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.05rem, 2vw, 1.3rem);
  line-height: 1.5;
  margin: 0 0 1.6rem;
  max-width: 54rem;
  padding-bottom: 1.5rem;
}

.footer-nav {
  gap: 0.65rem 1.15rem;
}

.footer-nav a {
  color: #f6fbf9;
}

@media (max-width: 980px) {
  .header-inner {
    min-height: 5.5rem;
  }

  .primary-nav .wp-block-navigation__responsive-container.is-menu-open {
    background: var(--ui-paper);
    color: var(--ui-ink);
    padding: 2rem;
  }

  .primary-nav .wp-block-navigation__responsive-container-content {
    align-items: flex-start;
  }
}

@media (max-width: 700px) {
  body {
    font-size: 1rem;
  }

  .brand-mark {
    height: 2.55rem;
    width: 2.55rem;
  }

  .site-descriptor {
    font-size: 0.68rem;
  }

  .article-body {
    padding-left: 1.15rem;
    padding-right: 1.15rem;
  }

  .entry-content h1 {
    font-size: clamp(2rem, 10vw, 2.8rem);
  }

  .uiappeals-context-image {
    margin-bottom: 2.25rem;
    margin-top: 1.5rem;
  }

  .tool-actions {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

@media print {
  @page {
    margin: 0.65in;
  }

  body {
    background: #fff;
    color: #000;
    font-size: 10.5pt;
  }

  body::before,
  .site-header,
  .breadcrumbs,
  .page-context,
  .tool-actions,
  .uiappeals-context-image,
  .site-footer {
    display: none !important;
  }

  .site-main {
    padding: 0;
  }

  .article-shell {
    border: 0;
    box-shadow: none;
  }

  .article-body {
    padding: 0;
  }

  .entry-content,
  .uiappeals-tool .entry-content {
    max-width: none;
  }

  .entry-content a {
    color: #000;
    text-decoration: underline;
  }

  .entry-content a[href^="http"]::after {
    content: " (" attr(href) ")";
    font-size: 8pt;
    overflow-wrap: anywhere;
  }

  .entry-content h1,
  .entry-content h2,
  .entry-content h3 {
    break-after: avoid;
    color: #000;
  }

  .entry-content table,
  .entry-content tr,
  .entry-content blockquote {
    break-inside: avoid;
  }

  .entry-content table {
    display: table;
    font-size: 8.5pt;
    width: 100%;
  }

  .entry-content th,
  .entry-content td {
    min-width: 0;
  }
}
