/* ==========================================================================
   Miraal Arabia: WordPress additions
   Loaded after miraal.css (the v9 design). Covers what only exists in
   WordPress: journal stories, plain pages, editor content, pagination,
   the admin bar.
   ========================================================================== */

/* WordPress core helpers */
.screen-reader-text { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.screen-reader-text:focus { position: fixed !important; left: 16px; top: 12px; z-index: 200; width: auto; height: auto; padding: 12px 18px; margin: 0; clip: auto; background: var(--white); color: var(--ink); border-radius: var(--r-sm); box-shadow: var(--shadow-float); }

/* Logged-in admin bar sits above the fixed header */
.admin-bar .site-header { top: 32px; }
@media (max-width: 1180px) { .admin-bar .nav { top: calc(var(--header-total) + 32px); } }
@media (max-width: 782px) {
  .admin-bar .site-header { top: 46px; }
  .admin-bar .nav { top: calc(var(--header-total) + 46px); }
}
@media (max-width: 600px) { #wpadminbar { position: fixed; } }

/* --------------------------------------------------------------------------
   Plain page heading (pages, stories, search, 404)
   -------------------------------------------------------------------------- */
.plain-head { padding-block: var(--s7); }
.plain-head h1 { max-width: 18ch; }
.container--narrow.plain-head h1 { max-width: none; font-size: clamp(2.25rem, 1.5rem + 2.6vw, 3.75rem); }
.plain-head .lead { margin-top: var(--s5); max-width: 40rem; }
.plain-head .label span[aria-hidden] { color: var(--line-strong); }

/* --------------------------------------------------------------------------
   Journal story cards
   -------------------------------------------------------------------------- */
.post-card { display: flex; flex-direction: column; min-width: 0; background: var(--white); border-radius: var(--r-md); overflow: hidden; box-shadow: 0 0 0 1px var(--line); transition: box-shadow .35s var(--ease); }
.post-card:hover { box-shadow: 0 0 0 1px var(--line-strong), var(--shadow-card); }
.post-card__media { display: block; aspect-ratio: 16 / 10; overflow: hidden; background: var(--stone); }
.post-card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s var(--ease); }
.post-card:hover .post-card__media img { transform: scale(1.03); }
.post-card__body { display: flex; flex-direction: column; align-items: flex-start; flex: 1; padding: 1.75rem var(--s5) var(--s5); }
.post-card__meta { display: flex; flex-wrap: wrap; gap: .6em; margin: 0; font: 600 var(--fs-label)/1.2 var(--sans); letter-spacing: .16em; text-transform: uppercase; color: var(--olive-ink); }
.post-card__meta span[aria-hidden] { color: var(--line-strong); }
.post-card__title { margin-top: var(--s3); font-size: var(--fs-h3); line-height: 1.18; color: var(--ink); }
.post-card__title a:hover { color: var(--olive-ink); }
.post-card__desc { margin: var(--s3) 0 var(--s5); font-size: var(--fs-sm); line-height: 1.6; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.post-card .link { margin-top: auto; }
@media (max-width: 760px) { .posts { grid-template-columns: 1fr; } }

/* Numbered pages */
.pager { margin-top: var(--s7); }
.pager .nav-links { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--s2); }
.pager .page-numbers { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; padding: 0 1em; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--white); color: var(--ink); font-weight: 500; font-size: var(--fs-sm); transition: border-color .2s, background-color .2s, color .2s; }
.pager a.page-numbers:hover { border-color: var(--ink); }
.pager .page-numbers.current { background: var(--ink); border-color: var(--ink); color: var(--white); }
.pager .page-numbers.dots { border-color: transparent; background: none; min-width: 0; padding: 0 .25em; }

/* --------------------------------------------------------------------------
   A story or plain page
   -------------------------------------------------------------------------- */
.article__media { margin-bottom: var(--s7); }
.article__media .frame { aspect-ratio: 16 / 8; }
@media (max-width: 760px) { .article__media .frame { aspect-ratio: 4 / 3; } }

.prose { padding-bottom: var(--section); font-size: 1.125rem; line-height: 1.8; color: var(--text); }
.prose::after { content: ""; display: table; clear: both; }
.prose > * { margin-top: 0; margin-bottom: 0; }
.prose > * + * { margin-top: 1.3em; }
.prose p { margin: 0; }
.prose > * + p { margin-top: 1.3em; }
.prose h2 { font-size: clamp(1.75rem, 1.4rem + 1.2vw, 2.3rem); line-height: 1.15; margin-top: 2em; }
.prose h3 { font-size: var(--fs-h3); margin-top: 1.8em; }
.prose h4 { font: 600 var(--fs-base)/1.4 var(--sans); color: var(--ink); margin-top: 1.6em; }
.prose h2 + *, .prose h3 + *, .prose h4 + * { margin-top: .6em; }
.prose a:not(.wp-block-button__link):not(.wp-element-button) { color: var(--ink); text-decoration: underline; text-decoration-color: var(--olive); text-decoration-thickness: 1px; text-underline-offset: .25em; }
.prose a:not(.wp-block-button__link):not(.wp-element-button):hover { color: var(--olive-ink); }
.prose strong { font-weight: 600; color: var(--ink); }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose ul { list-style: disc; }
.prose ol { list-style: decimal; }
.prose li + li { margin-top: .45em; }
.prose li::marker { color: var(--olive-ink); }
.prose blockquote { margin-inline: 0; padding: .1em 0 .1em 1.5em; border-left: 2px solid var(--olive); font: 400 clamp(1.3rem, 1.1rem + .8vw, 1.6rem)/1.45 var(--serif); color: var(--ink); }
.prose blockquote p + p { margin-top: .8em; }
.prose blockquote cite { display: block; margin-top: .9em; font: 600 var(--fs-label)/1.2 var(--sans); letter-spacing: .16em; text-transform: uppercase; font-style: normal; color: var(--muted); }
.prose figure { margin-inline: 0; }
.prose img { border-radius: var(--r-md); }
.prose figcaption, .prose .wp-caption-text, .prose .wp-element-caption { margin-top: .7em; font-size: var(--fs-xs); line-height: 1.5; color: var(--muted); }
.prose hr { border: 0; border-top: 1px solid var(--line); margin-block: 2.5em; }
.prose table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); line-height: 1.55; }
.prose th, .prose td { padding: .8em 1em; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.prose th { background: var(--mist); color: var(--ink); font-weight: 600; }
.prose code { font-size: .9em; padding: .1em .35em; border-radius: var(--r-sm); background: var(--mist); }
.prose .wp-block-button__link, .prose .wp-element-button { display: inline-flex; align-items: center; justify-content: center; min-height: 54px; padding: 0 2.1em; border-radius: var(--r-sm); background: var(--ink); color: var(--white); font: 600 .8125rem/1 var(--sans); letter-spacing: .14em; text-transform: uppercase; text-decoration: none; }
.prose .wp-block-button__link:hover, .prose .wp-element-button:hover { background: var(--ink-2); }
.prose .is-style-outline .wp-block-button__link { background: none; border: 1px solid var(--ink); color: var(--ink); }
.prose .wp-block-embed iframe, .prose iframe { width: 100%; border: 0; border-radius: var(--r-md); }
.prose .wp-block-embed__wrapper { position: relative; }
.prose .alignleft { float: left; max-width: 50%; margin: .35em 1.75em 1em 0; }
.prose .alignright { float: right; max-width: 50%; margin: .35em 0 1em 1.75em; }
.prose .aligncenter { margin-inline: auto; text-align: center; }
.prose .aligncenter img { margin-inline: auto; }
.prose .alignwide, .prose .alignfull { width: min(100vw - 2 * var(--gutter), var(--container)); margin-left: 50%; transform: translateX(-50%); }
@media (max-width: 600px) { .prose .alignleft, .prose .alignright { float: none; max-width: 100%; margin: 1.3em 0 0; } }

.page-links { display: flex; flex-wrap: wrap; gap: var(--s2); margin-top: var(--s6); font-size: var(--fs-sm); }
.page-links a, .page-links > .post-page-numbers { display: inline-flex; align-items: center; justify-content: center; min-width: 40px; min-height: 40px; border: 1px solid var(--line); border-radius: var(--r-sm); text-decoration: none !important; }
.page-links .current { background: var(--ink); color: var(--white); border-color: var(--ink); }

.prose--with-foot { padding-bottom: var(--s7); }
.article__foot { display: grid; justify-items: start; gap: var(--s6); padding-bottom: var(--section); }
.article__nav { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s4); width: 100%; padding-top: var(--s6); border-top: 1px solid var(--line); }
.article__nav-item { display: grid; align-content: start; gap: var(--s2); padding: var(--s5); border-radius: var(--r-md); box-shadow: 0 0 0 1px var(--line); transition: box-shadow .3s var(--ease); }
.article__nav-item:hover { box-shadow: 0 0 0 1px var(--line-strong), var(--shadow-card); }
.article__nav-item span { font: 600 var(--fs-label)/1.2 var(--sans); letter-spacing: .16em; text-transform: uppercase; color: var(--olive-ink); }
.article__nav-item strong { font: 400 clamp(1.15rem, 1.05rem + .4vw, 1.35rem)/1.25 var(--serif); color: var(--ink); }
.article__nav-item--next { grid-column: 2; text-align: right; }
@media (max-width: 600px) {
  .article__nav { grid-template-columns: 1fr; }
  .article__nav-item--next { grid-column: auto; text-align: left; }
}

/* 404 actions inside the panel */
.empty__body .actions { margin-top: var(--s6); }
.empty__body .actions .btn, .empty__body .actions .link { margin-top: 0; }
