/*
  WordPress supplement.

  main.css is the design system as approved, and it is kept free of WordPress
  selectors so it can still be lifted to another platform. Everything WordPress
  itself emits - block alignments, captions, the admin bar, comment markup,
  pagination - is styled here instead, using the same tokens.
*/

/* ---------------------------------------------------------------------------
   Admin bar
   ------------------------------------------------------------------------ */

body.admin-bar .site-header { top: 32px; }

@media screen and (max-width: 782px) {
  body.admin-bar .site-header { top: 46px; }
}

/* ---------------------------------------------------------------------------
   WordPress accessibility classes

   The design system uses .sr-only; core and many plugins emit
   .screen-reader-text. Both need to behave identically.
   ------------------------------------------------------------------------ */

.screen-reader-text {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.screen-reader-text:focus {
  z-index: 100000;
  top: 16px;
  left: 16px;
  display: block;
  width: auto !important;
  height: auto !important;
  padding: 12px 18px !important;
  clip: auto !important;
  color: var(--white);
  background: var(--navy-900);
  border-radius: 8px;
}

/* Honeypot: invisible to people, still reachable by a bot that reads the DOM. */
.ek-hp {
  position: absolute !important;
  left: -9999px !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* ---------------------------------------------------------------------------
   Block editor content
   ------------------------------------------------------------------------ */

.entry-content > * {
  max-width: 760px;
  margin-inline: auto;
}

.entry-content > .alignwide {
  max-width: 1100px;
}

.entry-content > .alignfull {
  max-width: none;
  margin-inline: calc(50% - 50vw);
  width: 100vw;
}

.alignleft {
  float: left;
  margin: 6px 28px 20px 0;
}

.alignright {
  float: right;
  margin: 6px 0 20px 28px;
}

.aligncenter {
  margin-inline: auto;
  text-align: center;
}

.entry-content img,
.wp-block-image img {
  border-radius: var(--radius-md);
}

.wp-block-image figcaption,
.wp-caption-text {
  margin-top: 10px;
  color: var(--muted);
  font-size: .82rem;
  text-align: center;
}

.wp-block-quote,
.entry-content blockquote {
  margin: 32px 0;
  padding: 24px 28px;
  border-left: 4px solid var(--gold-500);
  border-radius: 0 14px 14px 0;
  color: var(--navy-800);
  background: var(--gold-100);
  font-family: var(--font-display);
  font-size: 1.22rem;
}

.wp-block-quote cite {
  display: block;
  margin-top: 12px;
  color: var(--muted);
  font-family: var(--font-sans);
  font-size: .85rem;
  font-style: normal;
}

.wp-block-table table,
.entry-content table {
  width: 100%;
  border-collapse: collapse;
  font-size: .9rem;
}

.wp-block-table th,
.wp-block-table td,
.entry-content th,
.entry-content td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

.wp-block-table th,
.entry-content th {
  color: var(--navy-900);
  font-weight: 800;
}

.wp-block-separator {
  height: 0;
  margin: 40px auto;
  border: 0;
  border-top: 1px solid var(--line);
}

.wp-block-code,
.entry-content pre {
  overflow-x: auto;
  padding: 18px 20px;
  border-radius: var(--radius-sm);
  color: var(--white);
  background: var(--navy-900);
  font-size: .85rem;
}

.entry-content ul,
.entry-content ol {
  display: grid;
  gap: 9px;
  margin: 18px 0 24px 20px;
}

.entry-content li {
  list-style: disc;
}

.entry-content ol li {
  list-style: decimal;
}

.wp-block-embed__wrapper {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
}

/* ---------------------------------------------------------------------------
   Pagination
   ------------------------------------------------------------------------ */

.pagination {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 48px;
}

.pagination .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--navy-900);
  background: var(--white);
  font-weight: 700;
  font-size: .88rem;
  transition: color var(--transition), background var(--transition), border-color var(--transition);
}

.pagination .page-numbers:hover {
  border-color: var(--navy-900);
  color: var(--white);
  background: var(--navy-900);
}

.pagination .page-numbers.current {
  border-color: var(--navy-900);
  color: var(--white);
  background: var(--navy-900);
}

.pagination .page-numbers.dots {
  border-color: transparent;
  background: transparent;
}

/* ---------------------------------------------------------------------------
   Widgets
   ------------------------------------------------------------------------ */

.widget {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--white);
  box-shadow: var(--shadow-sm);
}

.widget + .widget {
  margin-top: 18px;
}

.widget__title {
  margin-bottom: 14px;
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 800;
}

.widget ul {
  display: grid;
  gap: 9px;
}

.widget li a {
  color: var(--muted);
  font-size: .88rem;
}

.widget li a:hover {
  color: var(--gold-700);
}

/* ---------------------------------------------------------------------------
   Comments
   ------------------------------------------------------------------------ */

.comments-area {
  margin-top: 48px;
  padding: 32px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--white);
}

.comment-list {
  display: grid;
  gap: 24px;
  margin-bottom: 32px;
}

.comment-list li {
  list-style: none;
}

.comment-body {
  padding: 20px;
  border-radius: var(--radius-md);
  background: var(--cream-100);
}

.comment-author {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  font-weight: 800;
}

.comment-author img {
  border-radius: 50%;
}

.comment-metadata {
  margin-bottom: 10px;
  color: var(--muted);
  font-size: .78rem;
}

.comment-list .children {
  margin-top: 18px;
  margin-left: 28px;
}

/* ---------------------------------------------------------------------------
   Small additions used by the theme's own markup
   ------------------------------------------------------------------------ */

.field-help {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: .78rem;
}

.mobile-subnav-lead a {
  font-weight: 800;
}

.blog-layout--full {
  grid-template-columns: minmax(0, 1fr);
}

.empty-state {
  padding: 56px 24px;
  border: 1px dashed var(--line);
  border-radius: var(--radius-lg);
  text-align: center;
}

.empty-state h3 {
  margin-bottom: 8px;
}

.empty-state p {
  color: var(--muted);
}

/* Marks content the visitor has not paid for. Locked rows stay readable so the
   curriculum still sells the course; only the link is withheld. */
.is-locked {
  opacity: .62;
  cursor: not-allowed;
}

.is-locked .icon {
  color: var(--muted-2);
}

.lock-note {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: .78rem;
}

/* ---------------------------------------------------------------------------
   Print

   A certificate and an order receipt are the two things people actually print
   from a site like this. Both should come out without navigation furniture.
   ------------------------------------------------------------------------ */

@media print {
  .site-header,
  .mobile-panel,
  .site-footer,
  .cookie-banner,
  .toast-region,
  .modal-backdrop,
  .dashboard-sidebar,
  .skip-link {
    display: none !important;
  }

  body {
    background: #fff;
  }

  .section {
    padding: 12px 0;
  }

  a[href^="http"]::after {
    content: " (" attr(href) ")";
    font-size: .75em;
    color: #555;
  }
}
