/* ==========================================================================
   WEB IMPEL — additions for WordPress
   (blog with real posts, article page, form states, admin bar, 404)
   The design itself lives in style.css — this file only adds what WordPress needs.
   ========================================================================== */

/* ---------- Admin bar (only visible to you when logged in) ---------- */
.admin-bar .site-header,
.admin-bar .mobile-menu { top: 32px; }
@media (max-width: 782px) {
  .admin-bar .site-header,
  .admin-bar .mobile-menu { top: 46px; }
}
@media (max-width: 600px) { .admin-bar .site-header { top: 0; } }

.screen-reader-text {
  position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(1px, 1px, 1px, 1px); clip-path: inset(50%); border: 0; word-wrap: normal !important;
}

/* WordPress adds an underline to links in classic themes — keep the design's own link styles */
a:where(:not(.wp-element-button)) { text-decoration: none; }
.prose a:where(:not(.wp-element-button)) { text-decoration: underline; }

/* ---------- Blog: category chips are links ---------- */
a.chip { display: inline-flex; align-items: center; }
.chip[aria-current="page"] { background: var(--lime); color: var(--ink); box-shadow: none; font-weight: 800; }

/* posts without a cover image */
.post-fallback {
  position: absolute; inset: 0; display: grid; place-items: center; padding: 16px;
  background-color: var(--silver); background-image: var(--chrome); color: var(--ink); text-align: center; overflow: hidden;
}
.post-fallback { container-type: inline-size; }
.post-fallback span {
  font-family: var(--f-display); font-weight: 800; line-height: .95; letter-spacing: -0.05em; text-transform: uppercase;
  font-size: 2rem;                          /* older browsers */
  font-size: clamp(11px, 11.5cqi, 104px);   /* scales with the card, words never break */
}
.post-row__img .post-fallback { padding: 6px; }
.post-row__img .post-fallback span { letter-spacing: -0.02em; line-height: 1.05; }
.post--wide .post__text { display: flex; flex-direction: column; gap: 14px; }
.post--wide .post__excerpt { color: var(--ink); }
.featured__excerpt:empty, .post__excerpt:empty { display: none; }

/* simple grid: page 2+, categories with few posts, "Keep reading" */
.posts__grid--uniform { grid-template-columns: minmax(0, 1fr); }
@media (min-width: 768px) { .posts__grid--uniform { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1200px) { .posts__grid--uniform { grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: 40px; row-gap: 56px; } }
.posts--more .posts__head { align-items: center; gap: 16px; }

.pager {
  margin-top: 48px; padding-top: 24px; border-top: 2px solid var(--ink);
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px;
}
.posts__empty { display: flex; flex-direction: column; gap: 20px; max-width: 760px; }

/* ---------- Contact form states ---------- */
.form-card { position: relative; }
.wi-hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-card__error {
  grid-column: 1 / -1; padding: 14px 18px; border-radius: 14px;
  background: var(--ink); color: var(--milk); font-weight: 700; font-size: 14px; line-height: 1.5;
}
.form-card__error a { color: var(--lime); text-decoration: underline; }
.form-card--done { align-content: start; gap: 16px; scroll-margin-top: calc(var(--header-h) + 24px); }
.form-card--done:focus { outline: none; }
.form-card__done-icon { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; background: var(--ink); color: var(--lime); }
.form-card__done-title { font-family: var(--f-display); font-weight: 600; font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2.25rem); line-height: 1.15; letter-spacing: -0.035em; }
.form-card__done-text { font-size: 16px; line-height: 1.6; color: var(--graphite); max-width: 520px; }
@media (min-width: 1200px) { .form-card--done { grid-template-columns: minmax(0, 1fr); padding: 48px; } }

/* ---------- Article page (blog post, ordinary pages) ---------- */
.article-hero { padding: 40px 0 44px; }
.article-hero__inner { display: flex; flex-direction: column; align-items: flex-start; gap: 18px; max-width: calc(980px + 2 * var(--pad)); }
.article-hero__back { color: var(--lime); min-height: 0; font-size: 14px; }
.article-hero .meta span:first-child { color: var(--lime); }
.article-hero .meta span + span { color: rgba(245, 241, 235, .7); }
.article-hero__title {
  font-family: var(--f-display); font-weight: 600; font-size: clamp(2.125rem, 1.3rem + 3.6vw, 4.5rem);
  line-height: 1.04; letter-spacing: -0.045em; text-wrap: balance; overflow-wrap: break-word;
}
.article-hero__lead { color: rgba(245, 241, 235, .84); max-width: 760px; }
.article-hero__img { margin-top: 36px; aspect-ratio: 16 / 9; border-radius: 20px; }
@media (min-width: 768px) {
  .article-hero { padding: 64px 0 64px; }
  .article-hero__inner { gap: 22px; }
  .article-hero__img { margin-top: 48px; border-radius: 28px; }
}
@media (min-width: 1200px) {
  .article-hero { padding: 88px 0 80px; }
  .article-hero__img { margin-top: 64px; aspect-ratio: 21 / 9; border-radius: 999px 999px 28px 28px; }
}

.article-body { background: var(--milk); color: var(--ink); padding: 48px 0 72px; }
@media (min-width: 768px) { .article-body { padding: 72px 0 104px; } }
@media (min-width: 1200px) { .article-body { padding: 96px 0 130px; } }
.article-body__cat { max-width: 740px; margin: 56px auto 0; padding-top: 20px; border-top: 2px solid var(--ink); color: var(--graphite); }
.article-body__cat a { color: var(--ink); text-decoration: underline; text-underline-offset: 4px; }

/* text written in the WordPress editor */
.prose { max-width: 740px; margin-inline: auto; font-size: 17px; line-height: 1.75; color: var(--graphite); }
@media (min-width: 768px) { .prose { font-size: 18px; } }
.prose::after { content: ""; display: table; clear: both; }
.prose > * + * { margin-top: 1.25em; }
.prose > :first-child { margin-top: 0; }
.prose h2, .prose h3, .prose h4 { color: var(--ink); text-wrap: balance; }
.prose h2 { margin-top: 2.1em; font-family: var(--f-display); font-weight: 600; font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2.25rem); line-height: 1.15; letter-spacing: -0.035em; }
.prose h3 { margin-top: 1.8em; font-family: var(--f-display); font-weight: 600; font-size: clamp(1.2rem, 1.05rem + .6vw, 1.5rem); line-height: 1.25; letter-spacing: -0.02em; }
.prose h4 { margin-top: 1.6em; font-weight: 800; font-size: .85em; letter-spacing: .14em; text-transform: uppercase; }
.prose h2 + *, .prose h3 + *, .prose h4 + * { margin-top: .6em; }
.prose a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: 4px; }
.prose a:hover { background: var(--lime); }
.prose strong { color: var(--ink); }
.prose ul > li { position: relative; padding-left: 26px; }
.prose ul > li::before { content: ""; position: absolute; left: 4px; top: .7em; width: 7px; height: 7px; background: var(--accent); transform: rotate(45deg); }
.prose ol { counter-reset: wi; }
.prose ol > li { position: relative; padding-left: 38px; counter-increment: wi; }
.prose ol > li::before { content: counter(wi, decimal-leading-zero); position: absolute; left: 0; top: .25em; font-family: var(--f-display); font-weight: 700; font-size: .72em; color: var(--accent); }
.prose li + li { margin-top: .5em; }
.prose li > ul, .prose li > ol { margin-top: .5em; }
.prose blockquote, .prose .wp-block-quote { padding: 4px 0 4px 22px; border-left: 3px solid var(--accent); font-family: var(--f-serif); font-style: italic; font-size: 1.45em; line-height: 1.3; color: var(--ink); }
.prose blockquote p + p { margin-top: .5em; }
.prose blockquote cite { display: block; margin-top: .7em; font-family: var(--f-body); font-style: normal; font-size: .5em; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; color: var(--graphite); }
.prose .wp-block-pullquote { padding: 32px 0; border-block: 2px solid var(--ink); text-align: center; }
.prose .wp-block-pullquote blockquote { border: 0; padding: 0; font-size: 1.7em; }
.prose img { height: auto; border-radius: 18px; }
.prose figure { margin-bottom: 0; }
.prose figcaption, .prose .wp-element-caption { margin-top: 10px; font-size: 13px; line-height: 1.5; color: var(--graphite); text-align: center; }
.prose hr, .prose .wp-block-separator { border: 0; height: 2px; background: var(--ink); margin-block: 2.5em; opacity: 1; }
.prose code { font-size: .88em; padding: .15em .4em; border-radius: 6px; background: rgba(18, 14, 16, .08); }
.prose pre { overflow-x: auto; padding: 18px 20px; border-radius: 14px; background: var(--ink); color: var(--milk); font-size: 14px; line-height: 1.6; }
.prose pre code { padding: 0; background: none; }
.prose table { width: 100%; border-collapse: collapse; font-size: .9em; }
.prose th, .prose td { padding: 10px 12px; border-bottom: 1px solid var(--line-light); text-align: left; vertical-align: top; }
.prose th, .prose thead td { color: var(--ink); font-weight: 800; border-bottom: 2px solid var(--ink); }
.prose .wp-block-table { overflow-x: auto; }
.prose iframe, .prose video { max-width: 100%; }
.prose .wp-block-embed__wrapper iframe { width: 100%; }
.prose .wp-block-buttons { display: flex; flex-wrap: wrap; gap: 12px; }
.prose .wp-block-button__link {
  display: inline-flex; align-items: center; min-height: 54px; padding: 0 26px; border-radius: 999px;
  background: var(--accent); color: var(--ink); font-weight: 800; font-size: 15px; text-decoration: none;
}
.prose .wp-block-button__link:hover { background: var(--accent); box-shadow: 0 22px 44px -16px rgba(255, 46, 147, .75); }
.prose .is-style-outline .wp-block-button__link { background: transparent; box-shadow: inset 0 0 0 2px var(--ink); }
.prose .alignwide { width: auto; max-width: none; margin-inline: calc(50% - min(560px, 50vw - var(--pad))); }
.prose .alignfull { width: auto; max-width: none; margin-inline: calc(50% - 50vw); }
.prose .alignfull img { border-radius: 0; }
.prose .aligncenter { margin-inline: auto; text-align: center; }
.prose .alignleft { float: left; max-width: 50%; margin: .3em 1.5em 1em 0; }
.prose .alignright { float: right; max-width: 50%; margin: .3em 0 1em 1.5em; }

/* ---------- 404 ---------- */
.notfound { display: flex; align-items: center; min-height: 70vh; }
.notfound__inner { display: flex; flex-direction: column; align-items: flex-start; gap: 20px; }
.notfound__num { font-family: var(--f-display); font-weight: 900; font-size: clamp(7rem, 3rem + 18vw, 16rem); line-height: .9; letter-spacing: -0.07em; }
.notfound__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 28px; margin-top: 12px; }
