/**
 * CaseAid theme styles
 * ---------------------------------------------------------------------------
 * Loaded AFTER assets/css/app.css.
 *
 * app.css is a pre-built (and now frozen) Tailwind bundle: there is no build
 * step in this theme, so any utility added to a template after that bundle was
 * generated resolves to nothing. This file restores the utilities the templates
 * actually rely on, using Tailwind v3 semantics and the same custom-property
 * plumbing as the bundle, plus the long-form content styles the editor needs.
 *
 * Section 1 mirrors Tailwind output verbatim -- do not "tidy" the values.
 * Section 2 onward is hand-authored theme CSS.
 */

/* ==========================================================================
   2. Long-form content typography
   --------------------------------------------------------------------------
   Tailwind's preflight strips heading sizes, list markers and link colour.
   The templates asked for @tailwindcss/typography ("prose"), which is not in
   the bundle -- so post bodies rendered as one undifferentiated block with
   invisible links and no bullets. These rules restore a real reading style
   for anything the block editor outputs.
   ========================================================================== */

.entry-content {
  color: rgb(255 255 255 / 0.78);
  font-size: 1.0625rem;
  line-height: 1.75;
}

.entry-content > * + * { margin-top: 1.25em; }

.entry-content h1,
.entry-content h2,
.entry-content h3,
.entry-content h4,
.entry-content h5,
.entry-content h6 {
  color: #fff;
  font-family: 'Red Hat Display', system-ui, sans-serif;
  font-weight: 800;
  line-height: 1.25;
  margin-top: 2em;
  margin-bottom: 0.6em;
  text-wrap: balance;
}
.entry-content > :first-child { margin-top: 0; }
.entry-content h1 { font-size: 2.25em; }
.entry-content h2 { font-size: 1.75em; }
.entry-content h3 { font-size: 1.375em; }
.entry-content h4 { font-size: 1.125em; }
.entry-content h5,
.entry-content h6 { font-size: 1em; letter-spacing: 0.02em; text-transform: uppercase; }

.entry-content p { margin: 0 0 1.25em; }
.entry-content strong,
.entry-content b { color: #fff; font-weight: 700; }
.entry-content em { font-style: italic; }

.entry-content a {
  color: hsl(var(--primary));
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  transition: color 0.2s ease;
}
.entry-content a:hover { color: #d8b4fe; }

.entry-content ul,
.entry-content ol {
  margin: 0 0 1.25em;
  padding-left: 1.5em;
}
.entry-content ul { list-style: disc; }
.entry-content ol { list-style: decimal; }
.entry-content li { margin: 0.4em 0; padding-left: 0.25em; }
.entry-content li::marker { color: hsl(var(--primary)); }
.entry-content ul ul,
.entry-content ol ol,
.entry-content ul ol,
.entry-content ol ul { margin: 0.4em 0 0.4em; }

.entry-content blockquote {
  margin: 1.75em 0;
  padding: 0.25em 0 0.25em 1.25em;
  border-left: 3px solid hsl(var(--primary));
  color: #fff;
  font-size: 1.125em;
  font-style: italic;
}
.entry-content blockquote p:last-child { margin-bottom: 0; }

.entry-content img,
.entry-content video,
.entry-content iframe {
  max-width: 100%;
  height: auto;
  border-radius: 0.75rem;
}
.entry-content figure { margin: 1.75em 0; }
.entry-content figcaption {
  margin-top: 0.6em;
  color: rgb(255 255 255 / 0.5);
  font-size: 0.875em;
  text-align: center;
}

.entry-content hr {
  margin: 2.5em 0;
  border: 0;
  border-top: 1px solid rgb(255 255 255 / 0.12);
}

.entry-content code {
  background: rgb(255 255 255 / 0.08);
  border-radius: 0.3em;
  color: #e9d5ff;
  font-size: 0.875em;
  padding: 0.15em 0.4em;
}
.entry-content pre {
  background: rgb(255 255 255 / 0.05);
  border: 1px solid rgb(255 255 255 / 0.1);
  border-radius: 0.75rem;
  margin: 1.75em 0;
  overflow-x: auto;
  padding: 1.25em;
}
.entry-content pre code { background: none; padding: 0; color: inherit; }

.entry-content table {
  border-collapse: collapse;
  display: block;
  margin: 1.75em 0;
  overflow-x: auto;
  width: 100%;
}
.entry-content th,
.entry-content td {
  border: 1px solid rgb(255 255 255 / 0.12);
  padding: 0.6em 0.9em;
  text-align: left;
}
.entry-content th { background: rgb(255 255 255 / 0.05); color: #fff; font-weight: 700; }

/* WordPress alignment helpers inside content */
.entry-content .alignleft { float: left; margin: 0.5em 1.5em 1em 0; }
.entry-content .alignright { float: right; margin: 0.5em 0 1em 1.5em; }
.entry-content .aligncenter { display: block; margin-left: auto; margin-right: auto; }
.entry-content .alignwide,
.entry-content .alignfull { max-width: none; }

/* ==========================================================================
   3. Component fixes
   ========================================================================== */

/* Skip link -- visible only on keyboard focus. */
.skip-link {
  background: hsl(var(--primary));
  border-radius: 0 0 0.5rem 0;
  color: #fff;
  font-weight: 600;
  left: 0;
  padding: 0.75rem 1.25rem;
  position: absolute;
  top: 0;
  transform: translateY(-120%);
  transition: transform 0.15s ease;
  z-index: 100;
}
.skip-link:focus { transform: translateY(0); outline: 2px solid #fff; outline-offset: -4px; }

/* Mobile navigation panel (built by assets/js/main.js). */
.caseaid-mobile-menu {
  background: rgb(0 0 0 / 0.95);
  backdrop-filter: blur(8px);
  display: flex;
  flex-direction: column;
  inset: 0;
  padding: 5rem 1.5rem 2rem;
  position: fixed;
  z-index: 55;
  animation: caseaid-fade-in 0.2s ease-in-out;
}
.caseaid-mobile-menu__close {
  align-items: center;
  background: none;
  border: 0;
  border-radius: 0.5rem;
  color: #fff;
  cursor: pointer;
  display: flex;
  height: 44px;
  justify-content: center;
  position: absolute;
  right: 1rem;
  top: 1rem;
  width: 44px;
}
.caseaid-mobile-menu__link {
  border-bottom: 1px solid rgb(255 255 255 / 0.15);
  color: #fff;
  display: block;
  font-size: 1.25rem;
  font-weight: 500;
  padding: 1rem 0;
  text-decoration: none;
}
.caseaid-mobile-menu__close:focus-visible,
.caseaid-mobile-menu__link:focus-visible {
  outline: 2px solid hsl(var(--primary));
  outline-offset: 2px;
}
.caseaid-mobile-menu__link:hover { color: #d8b4fe; }

@keyframes caseaid-fade-in { from { opacity: 0; } to { opacity: 1; } }

/* Locks background scrolling while the mobile menu is open. */
body.caseaid-menu-open { overflow: hidden; }

/* Footer/inline links need a comfortable touch target on phones without
   changing the visual rhythm of the desktop layout. */
@media (max-width: 767px) {
  .caseaid-footer-links a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
  }
}

/* Give focus a visible, consistent ring everywhere. */
a:focus-visible,
button:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid hsl(var(--primary));
  outline-offset: 2px;
  border-radius: 0.25rem;
}

/* Pagination (posts list). */
.pagination .page-numbers {
  align-items: center;
  border: 1px solid rgb(255 255 255 / 0.15);
  border-radius: 0.5rem;
  color: rgb(255 255 255 / 0.7);
  display: inline-flex;
  justify-content: center;
  min-height: 2.5rem;
  min-width: 2.5rem;
  padding: 0 0.75rem;
  text-decoration: none;
  transition: background-color 0.2s ease, color 0.2s ease;
}
.pagination .page-numbers:hover { background: rgb(255 255 255 / 0.08); color: #fff; }
.pagination .page-numbers.current {
  background: hsl(var(--primary));
  border-color: hsl(var(--primary));
  color: #fff;
}
.pagination .screen-reader-text { position: absolute; }

/* ==========================================================================
   4. Motion preferences
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
