/* Shared content typography — front (.prose) + editor (.editor-styles-wrapper) */

.prose,
.editor-styles-wrapper {
  color: var(--text);
  line-height: 1.7;
  font-size: 1.05rem;
}

.prose > *:first-child,
.editor-styles-wrapper > *:first-child,
.editor-styles-wrapper .is-root-container > *:first-child {
  margin-top: 0;
}

.prose h2,
.editor-styles-wrapper h2 {
  font-family: var(--font-head);
  color: var(--blue-600);
  font-size: 1.55rem;
  line-height: 1.3;
  margin: 1.8em 0 0.6em;
}

.prose h3,
.editor-styles-wrapper h3 {
  font-family: var(--font-head);
  color: var(--ink);
  font-size: 1.25rem;
  line-height: 1.35;
  margin: 1.4em 0 0.5em;
}

.prose h4,
.editor-styles-wrapper h4 {
  font-family: var(--font-head);
  color: var(--ink);
  font-size: 1.05rem;
  margin: 1.2em 0 0.4em;
}

.prose p,
.editor-styles-wrapper p {
  margin: 0 0 1em;
}

.prose ul,
.prose ol,
.editor-styles-wrapper ul,
.editor-styles-wrapper ol {
  padding-left: 1.35em;
  margin: 0 0 1.1em;
}

.prose li,
.editor-styles-wrapper li {
  margin-bottom: 0.45em;
}

.prose strong,
.editor-styles-wrapper strong {
  color: var(--ink);
  font-weight: 700;
}

.prose em,
.editor-styles-wrapper em {
  font-style: italic;
}

.prose a,
.editor-styles-wrapper a {
  color: var(--blue-600);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.prose a:hover,
.editor-styles-wrapper a:hover {
  color: var(--blue-700);
}

/* Buttons are links — don't inherit prose/editor link styling */
.prose a.btn,
.editor-styles-wrapper a.btn,
a.btn {
  text-decoration: none;
}
.prose a.btn--yellow,
.editor-styles-wrapper a.btn--yellow,
.prose a.btn--yellow:hover,
.editor-styles-wrapper a.btn--yellow:hover {
  color: var(--ink);
}
.prose a.btn--green,
.editor-styles-wrapper a.btn--green,
.prose a.btn--green:hover,
.editor-styles-wrapper a.btn--green:hover {
  color: var(--ink);
}
.prose a.btn--blue,
.editor-styles-wrapper a.btn--blue,
.prose a.btn--blue:hover,
.editor-styles-wrapper a.btn--blue:hover {
  color: #fff;
}
.prose a.btn--ghost,
.editor-styles-wrapper a.btn--ghost {
  color: var(--blue-600);
}
.prose a.btn--ghost:hover,
.editor-styles-wrapper a.btn--ghost:hover {
  color: var(--blue-600);
}

.prose blockquote,
.editor-styles-wrapper blockquote {
  border-left: 4px solid var(--yellow);
  padding: 10px 20px;
  margin: 1.6em 0;
  color: var(--muted);
  font-style: italic;
  background: var(--bg-soft);
}

.prose img,
.prose figure,
.editor-styles-wrapper img,
.editor-styles-wrapper figure {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-sm);
  margin: 1.4em 0;
}

/* Classic WP image alignment + captions (imported pages) */
.prose::after,
.editor-styles-wrapper::after {
  content: "";
  display: table;
  clear: both;
}
.prose .alignright,
.prose .wp-caption.alignright,
.prose img.alignright,
.editor-styles-wrapper .alignright,
.editor-styles-wrapper .wp-caption.alignright,
.editor-styles-wrapper img.alignright {
  float: right;
  margin: 0.25em 0 1em 1.25em;
  max-width: min(100%, 340px);
}
.prose .alignleft,
.prose .wp-caption.alignleft,
.prose img.alignleft,
.editor-styles-wrapper .alignleft,
.editor-styles-wrapper .wp-caption.alignleft,
.editor-styles-wrapper img.alignleft {
  float: left;
  margin: 0.25em 1.25em 1em 0;
  max-width: min(100%, 340px);
}
.prose .aligncenter,
.prose .wp-caption.aligncenter,
.prose img.aligncenter,
.editor-styles-wrapper .aligncenter,
.editor-styles-wrapper .wp-caption.aligncenter,
.editor-styles-wrapper img.aligncenter {
  display: block;
  float: none;
  margin-left: auto;
  margin-right: auto;
  clear: both;
}
.prose .wp-caption,
.editor-styles-wrapper .wp-caption {
  margin: 0.25em 0 1em;
  padding: 8px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  box-sizing: border-box;
}
.prose .wp-caption.alignright,
.editor-styles-wrapper .wp-caption.alignright {
  margin: 0.25em 0 1em 1.25em;
}
.prose .wp-caption.alignleft,
.editor-styles-wrapper .wp-caption.alignleft {
  margin: 0.25em 1.25em 1em 0;
}
.prose .wp-caption img,
.editor-styles-wrapper .wp-caption img {
  margin: 0;
  border-radius: calc(var(--radius-sm) - 2px);
}
.prose .wp-caption-text,
.prose figcaption.wp-caption-text,
.editor-styles-wrapper .wp-caption-text,
.editor-styles-wrapper figcaption.wp-caption-text {
  margin: 0.5em 0 0;
  padding: 0;
  font-size: 0.8125rem;
  line-height: 1.35;
  color: var(--muted);
  text-align: center;
}
@media (max-width: 640px) {
  .prose .alignright,
  .prose .alignleft,
  .prose .wp-caption.alignright,
  .prose .wp-caption.alignleft,
  .prose img.alignright,
  .prose img.alignleft,
  .editor-styles-wrapper .alignright,
  .editor-styles-wrapper .alignleft,
  .editor-styles-wrapper .wp-caption.alignright,
  .editor-styles-wrapper .wp-caption.alignleft,
  .editor-styles-wrapper img.alignright,
  .editor-styles-wrapper img.alignleft {
    float: none;
    display: block;
    margin: 1.4em auto;
    max-width: min(100%, 280px);
  }
}

/* WP [gallery] shortcode + core/gallery — don't inherit prose figure margins */
.prose .gallery,
.prose .wp-block-gallery,
.editor-styles-wrapper .gallery,
.editor-styles-wrapper .wp-block-gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 1.6em 0;
  padding: 0;
  list-style: none;
}
.prose .gallery-columns-2,
.prose .columns-2.wp-block-gallery,
.editor-styles-wrapper .gallery-columns-2 { grid-template-columns: repeat(2, 1fr); }
.prose .gallery-columns-4,
.prose .columns-4.wp-block-gallery,
.editor-styles-wrapper .gallery-columns-4 { grid-template-columns: repeat(4, 1fr); }
.prose .gallery-columns-5,
.prose .columns-5.wp-block-gallery,
.editor-styles-wrapper .gallery-columns-5 { grid-template-columns: repeat(5, 1fr); }
.prose .gallery-columns-6,
.prose .columns-6.wp-block-gallery,
.editor-styles-wrapper .gallery-columns-6 { grid-template-columns: repeat(6, 1fr); }
.prose .gallery-columns-7,
.editor-styles-wrapper .gallery-columns-7 { grid-template-columns: repeat(7, 1fr); }
.prose .gallery-columns-8,
.editor-styles-wrapper .gallery-columns-8 { grid-template-columns: repeat(8, 1fr); }
.prose .gallery-columns-9,
.editor-styles-wrapper .gallery-columns-9 { grid-template-columns: repeat(9, 1fr); }

.prose .gallery .gallery-item,
.prose .gallery figure,
.prose .wp-block-gallery figure,
.prose .wp-block-gallery .wp-block-image,
.editor-styles-wrapper .gallery .gallery-item,
.editor-styles-wrapper .gallery figure,
.editor-styles-wrapper .wp-block-gallery figure {
  margin: 0;
  width: auto !important;
  max-width: none;
  overflow: visible;
  border-radius: 0;
  background: transparent;
  display: flex;
  flex-direction: column;
}
.prose .gallery .gallery-icon,
.prose .wp-block-gallery .wp-block-image,
.editor-styles-wrapper .gallery .gallery-icon {
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: var(--radius-sm);
  background: var(--bg-soft);
}
.prose .gallery .gallery-icon,
.prose .gallery a,
.editor-styles-wrapper .gallery .gallery-icon,
.editor-styles-wrapper .gallery a {
  display: block;
  width: 100%;
}
.prose .gallery .gallery-icon a,
.editor-styles-wrapper .gallery .gallery-icon a {
  height: 100%;
}
.prose .gallery img,
.prose .wp-block-gallery img,
.editor-styles-wrapper .gallery img,
.editor-styles-wrapper .wp-block-gallery img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  margin: 0;
  border-radius: 0;
  transition: transform .3s ease;
}
.prose .gallery a:hover img,
.prose .wp-block-gallery a:hover img {
  transform: scale(1.04);
}
.prose .gallery .gallery-caption,
.editor-styles-wrapper .gallery .gallery-caption {
  display: block;
  margin: 0;
  padding: 10px 6px 0;
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--blue-600);
  text-align: center;
  background: transparent;
}

@media (max-width: 900px) {
  .prose .gallery,
  .prose .wp-block-gallery,
  .prose .gallery-columns-4,
  .prose .gallery-columns-5,
  .prose .gallery-columns-6,
  .prose .gallery-columns-7,
  .prose .gallery-columns-8,
  .prose .gallery-columns-9,
  .editor-styles-wrapper .gallery,
  .editor-styles-wrapper .wp-block-gallery {
    grid-template-columns: repeat(3, 1fr);
  }
}
@media (max-width: 600px) {
  .prose .gallery,
  .prose .wp-block-gallery,
  .prose .gallery-columns-2,
  .prose .gallery-columns-3,
  .prose .gallery-columns-4,
  .prose .gallery-columns-5,
  .prose .gallery-columns-6,
  .editor-styles-wrapper .gallery,
  .editor-styles-wrapper .wp-block-gallery {
    grid-template-columns: repeat(2, 1fr);
  }
}

.prose figcaption,
.editor-styles-wrapper figcaption {
  font-size: 0.875rem;
  color: var(--muted);
  margin-top: 0.5em;
  text-align: center;
}

.prose hr,
.editor-styles-wrapper hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 2em 0;
}

.prose table,
.editor-styles-wrapper table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.4em 0;
  font-size: 0.95rem;
}

.prose th,
.prose td,
.editor-styles-wrapper th,
.editor-styles-wrapper td {
  border: 1px solid var(--line);
  padding: 10px 12px;
  text-align: left;
}

.prose th,
.editor-styles-wrapper th {
  background: var(--bg-soft);
  font-weight: 600;
  color: var(--ink);
}

.prose code,
.editor-styles-wrapper code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9em;
  background: var(--bg-soft);
  padding: 0.15em 0.4em;
  border-radius: 4px;
}

/* Person / text-image blocks */
.aisys-person {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 28px;
  align-items: start;
  margin: 1.5em 0;
}
.aisys-person__photo {
  aspect-ratio: 1;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--blue-050);
}
.aisys-person__photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.aisys-person__name { margin: 0 0 4px; color: var(--blue-600); font-family: var(--font-head); }
.aisys-person__role { margin: 0 0 14px; color: var(--muted); font-size: 0.95rem; text-transform: uppercase; letter-spacing: .06em; }

.aisys-text-image {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 36px;
  align-items: center;
  margin: 2em 0;
}
.aisys-text-image--image-left { direction: rtl; }
.aisys-text-image--image-left > * { direction: ltr; }
.aisys-text-image__media img {
  width: 100%;
  border-radius: var(--radius);
  display: block;
}
.aisys-text-image__title {
  margin: 0 0 12px;
  color: var(--blue-600);
  font-family: var(--font-head);
}

.aisys-gallery__item {
  position: relative;
  display: block;
  overflow: hidden;
  border-radius: var(--radius-sm);
}
.aisys-gallery__item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .35s ease;
}
.aisys-gallery__item:hover img { transform: scale(1.04); }
.aisys-gallery__caption {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 10px 12px;
  background: linear-gradient(transparent, rgba(15,23,42,.72));
  color: #fff;
  font-size: 13px;
  opacity: 0;
  transition: opacity .25s ease;
}
.aisys-gallery__item:hover .aisys-gallery__caption { opacity: 1; }
