/* ==========================================================================
   FLiAI on WordPress: what the static stylesheet did not need.
   site.css is the design system and stays untouched; this file adds the blog,
   the role pages, photographs, and resets for WordPress's own block output.
   ========================================================================== */

/* ---------- 1. Block resets ---------- */
/* WordPress puts a gap between every block; the ported sections carry their own rhythm. */
.fl-sections > .wp-block-post-content > *,
.fl-sections .wp-block-post-content > * + *,
main.wp-block-group > * + * { margin-block-start: 0; }
.part-header, .part-footer { display: contents; }
.wp-block-group.wrap { box-sizing: border-box; }
.page-hero .wp-block-post-title { margin: 0; }
.wrap-narrow { max-width: 804px; margin-inline: auto; padding-inline: 22px; box-sizing: border-box; }
:where(.wp-site-blocks) > * { margin-block-start: 0; }
.page-hero--compact { padding: 48px 0 40px; }
.page-hero--compact h1 { font-size: clamp(2rem, 5vw, 3.2rem); }

/* ---------- 2. Photographs ---------- */
.photo { margin: 0; border-radius: var(--r-lg); overflow: hidden; background: var(--surface-2); box-shadow: var(--shadow); }
.photo img { width: 100%; height: 100%; object-fit: cover; }
.photo-pair { display: grid; grid-template-columns: 1.6fr 1fr; gap: var(--gap); }
.photo-pair .photo { aspect-ratio: 3 / 2; }
.photo-pair .photo:last-child { aspect-ratio: auto; }
.split-photo { display: grid; grid-template-columns: 1.1fr 1fr; gap: 48px; align-items: center; }
.split-photo .photo { aspect-ratio: 4 / 3; }

.page-hero-photo {
  position: relative; z-index: 1;
  max-width: var(--wrap); margin: 36px auto 0; padding-inline: 22px;
}
.page-hero-photo img { width: 100%; aspect-ratio: 21 / 9; object-fit: cover; border-radius: var(--r-lg); box-shadow: var(--shadow-lg); }

/* Home hero: the generated network image sits behind the logo, faded into the page tint. */
.hero-photo {
  position: absolute; inset: 0 0 0 38%;
  background: url("../img/hero-home.webp") center right / cover no-repeat;
  opacity: .5;
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 45%, #000 80%, transparent 100%), linear-gradient(180deg, #000 60%, transparent 100%);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(90deg, transparent 0%, #000 45%, #000 80%, transparent 100%), linear-gradient(180deg, #000 60%, transparent 100%);
  mask-composite: intersect;
  pointer-events: none;
}

/* ---------- 3. Post cards (home teaser, blog index, related) ---------- */
.post-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gap); list-style: none; padding: 0; margin: 0; }
.post-grid > li { margin: 0; }
.post-card {
  height: 100%;
  display: flex; flex-direction: column;
  background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden;
  transition: transform .3s var(--ease), box-shadow .3s var(--ease), border-color .3s var(--ease);
}
.post-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--line-strong); }
.post-card-media, .post-card .wp-block-post-featured-image { display: block; margin: 0; aspect-ratio: 16 / 9; overflow: hidden; background: var(--surface-2); }
.post-card-media img, .post-card .wp-block-post-featured-image img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease); }
.post-card:hover .post-card-media img, .post-card:hover .wp-block-post-featured-image img { transform: scale(1.035); }
.post-card-body { padding: 22px 24px 24px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.post-card h3, .post-card .wp-block-post-title { font-family: var(--display); font-weight: 400; font-size: 1.32rem; line-height: 1.2; letter-spacing: -.01em; margin: 0; }
.post-card h3 a, .post-card .wp-block-post-title a { color: var(--ink); text-decoration: none; }
.post-card h3 a:hover, .post-card .wp-block-post-title a:hover { color: var(--indigo); }
.post-card p, .post-card .wp-block-post-excerpt__excerpt { margin: 0; font-size: .95rem; }
.post-card .wp-block-post-excerpt { margin: 0; }
.post-card .wp-block-post-excerpt__more-text { display: none; }
.post-meta, .post-card .post-meta { margin-top: auto; display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: .8rem; color: var(--muted); }
.post-meta > * { margin: 0 !important; color: var(--muted); }
.post-meta p { font-size: inherit; }
.post-cat, .post-cat a {
  font-size: .7rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
  color: var(--indigo); text-decoration: none;
}
.post-cat { margin: 0; }
.fl-pagination { margin-top: 44px; gap: 8px; font-weight: 600; }
.fl-pagination a, .fl-pagination .page-numbers { padding: 8px 14px; border-radius: 10px; border: 1px solid var(--line); text-decoration: none; color: var(--ink); background: #fff; }
.fl-pagination .current { background: var(--indigo); border-color: var(--indigo); color: #fff; }

/* ---------- 4. Single post ---------- */
.post-hero .wp-block-post-title { margin: 10px 0 0; font-size: clamp(2rem, 5vw, 3.1rem); }
.post-hero .lead p { margin: 0; color: inherit; font-size: inherit; }
.post-hero .post-meta { margin-top: 22px; font-size: .86rem; }
.post-hero .post-meta > * + *::before { content: "·"; margin-right: 14px; color: var(--line-strong); }
.post-cover-wrap { margin-top: -1px; padding-top: 34px; }
.post-cover { margin: 0; border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow-lg); }
.post-cover img { width: 100%; height: 100%; object-fit: cover; }

.prose { font-size: 1.07rem; line-height: 1.78; color: var(--ink-2); }
.prose > * + * { margin-top: 1.2em; }
.prose h2 { font-size: clamp(1.55rem, 3vw, 2rem); margin-top: 1.9em; }
.prose h3 { font-size: 1.22rem; margin-top: 1.6em; color: var(--ink); }
.prose a { color: var(--indigo); text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--indigo) 35%, transparent); text-underline-offset: 3px; }
.prose a:hover { text-decoration-color: var(--indigo); }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li + li { margin-top: .45em; }
.prose ul li::marker { color: var(--amber); }
.prose blockquote {
  margin-inline: 0; padding: 6px 0 6px 22px; border-left: 3px solid var(--amber);
  font-family: var(--display); font-size: 1.3rem; line-height: 1.4; color: var(--ink);
}
.prose blockquote cite { display: block; margin-top: 10px; font-family: var(--sans); font-size: .85rem; font-style: normal; color: var(--muted); }
.prose figure { margin-inline: 0; }
.prose img { border-radius: var(--r); }
.prose figcaption { font-size: .85rem; color: var(--muted); text-align: center; margin-top: 10px; }
.prose code { font-size: .9em; background: var(--surface-2); padding: 2px 6px; border-radius: 6px; }
.prose pre { background: var(--ink); color: #E8EBF7; padding: 20px 22px; border-radius: var(--r); overflow-x: auto; font-size: .88rem; line-height: 1.6; }
.prose pre code { background: none; padding: 0; color: inherit; }
.prose hr { border: 0; height: 1px; background: var(--line); margin: 2.4em 0; }
.prose .alignwide { max-width: 1060px; margin-inline: calc((min(100vw, 1060px) - 100%) / -2); }
.prose table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.prose th, .prose td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; }

.post-foot { margin-top: 48px; padding-top: 26px; border-top: 1px solid var(--line); display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.post-tags { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; font-size: 0; }
.post-tags a { font-size: .78rem; font-weight: 600; padding: 5px 12px; border-radius: 100px; background: var(--surface); border: 1px solid var(--line); color: var(--ink-2); text-decoration: none; }
.post-tags .wp-block-post-terms__separator { display: none; }
.post-nav-prev a, .post-nav-next a { display: block; padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--r); text-decoration: none; color: var(--ink); font-weight: 600; font-size: .95rem; }
.post-nav-prev, .post-nav-next { font-size: .76rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.post-nav-prev a, .post-nav-next a { margin-top: 8px; letter-spacing: normal; text-transform: none; }
.post-nav-next { text-align: right; grid-column: 2; }
.post-nav-prev a:hover, .post-nav-next a:hover { border-color: var(--indigo); color: var(--indigo); }

.fl-search { margin-top: 20px; max-width: 520px; }
.fl-search .wp-block-search__input { border: 1px solid var(--line-strong); border-radius: 12px; padding: 12px 14px; font: inherit; }
.fl-search .wp-block-search__button { border: 0; border-radius: 12px; background: var(--indigo); color: #fff; font-weight: 600; padding: 0 20px; }

/* ---------- 5. Openings ---------- */
.job-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.badge--amber { --accent: #B9740A; }
.badge--closed { --accent: #A23B3B; }
.job-desc h2 { font-size: 1.55rem; }
.job-desc ul li::marker { color: var(--green); }
#apply .section-head { margin-bottom: 28px; }

/* ---------- 6. Responsive ---------- */
@media (max-width: 1024px) {
  .post-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero-photo { inset: 0; opacity: .28; }
}
@media (max-width: 760px) {
  .post-grid, .photo-pair, .split-photo { grid-template-columns: 1fr; }
  .split-photo { gap: 26px; }
  .page-hero-photo img { aspect-ratio: 16 / 10; }
  .post-foot { grid-template-columns: 1fr; }
  .post-nav-next { grid-column: auto; }
}
@media (prefers-reduced-motion: reduce) {
  .post-card, .post-card img { transition: none !important; }
  .post-card:hover { transform: none; }
}

/* ---------- 7. Split panels with real imagery ---------- */
/* Services: a photograph fills the panel, the static site's chips float over it. */
.split-media.has-photo { min-height: 340px; background: var(--surface-2); }
.split-media.has-photo::before { z-index: 1; background: linear-gradient(180deg, transparent 60%, rgba(19, 26, 56, .08)); }
.split-photo-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .8s var(--ease); }
.split-media.has-photo:hover .split-photo-img { transform: scale(1.03); }
.split-media.has-photo .chip-float { z-index: 2; }

/* Snap: two real phone screens, fanned. */
.split-media.has-phones { min-height: 440px; }
.phones { position: relative; width: 100%; height: 100%; min-height: 440px; z-index: 1; }
.phone {
  position: absolute; top: 50%; left: 50%; margin: 0;
  width: 168px; aspect-ratio: 780 / 1267;
  padding: 7px; border-radius: 30px;
  background: #0E1328; box-shadow: var(--shadow-lg), 0 0 0 1px rgba(255, 255, 255, .06) inset;
  transition: transform .6s var(--ease);
}
.phone img { width: 100%; height: 100%; object-fit: cover; object-position: top; border-radius: 23px; background: #fff; }
.phone--back { transform: translate(-8%, -54%) rotate(7deg); }
.phone--front { transform: translate(-92%, -46%) rotate(-5deg); z-index: 2; }
.split-media.has-phones:hover .phone--back { transform: translate(-2%, -56%) rotate(9deg); }
.split-media.has-phones:hover .phone--front { transform: translate(-98%, -46%) rotate(-7deg); }
.split-media.has-phones .chip-float { z-index: 3; }
@media (max-width: 640px) {
  .split-media.has-phones, .phones { min-height: 380px; }
  .phone { width: 140px; border-radius: 26px; }
  .phone img { border-radius: 20px; }
}
@media (prefers-reduced-motion: reduce) {
  .phone, .split-photo-img { transition: none !important; }
}
