/* ==========================================================================
   Epic Web Works, secondary content pages
   Case studies, portfolio, and blog. Depends on app.css tokens/primitives and
   the work-card/figure/tech-chip/testimonial/pill components defined in
   home.css, which are shared rather than homepage-exclusive despite the file
   name (a rename is a reasonable future cleanup, not urgent).
   ========================================================================== */

/* --------------------------------------------------------------------------
   Case study detail
   -------------------------------------------------------------------------- */

.cs-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3) var(--space-6);
  padding-block: var(--space-5);
  margin-bottom: var(--space-2);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.cs-meta__item { font-size: var(--text-sm); color: var(--ink-mute); }
.cs-meta__item strong { display: block; font-family: var(--font-display); font-size: var(--text-base); font-weight: 630; color: var(--ink); margin-top: 0.125rem; }

.cs-split {
  display: grid;
  gap: var(--space-6);
}

@media (min-width: 860px) { .cs-split { grid-template-columns: repeat(2, 1fr); gap: var(--space-8); } }

.cs-split__label {
  font-size: var(--label-sm);
  font-weight: 650;
  letter-spacing: 0.02em;
  color: var(--cyan);
  margin-bottom: var(--space-3);
}

.cs-split__text { font-size: var(--text-base); line-height: 1.75; color: var(--ink-soft); }

.cs-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr));
  gap: var(--space-4);
}

.cs-gallery img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
}

/* Product-page screenshot variant: real app captures are wide (dashboard
   layouts), not the 4:3 case-study photos the base .cs-gallery is sized
   for, and need a caption so a screenshot reads as "here is X" rather than
   an unexplained image dump. */
.cs-gallery--product {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr));
}

.cs-gallery--product figure { margin: 0; }

.cs-gallery--product img {
  aspect-ratio: 16 / 10;
  object-fit: cover;
  object-position: top;
}

.cs-gallery--product figcaption {
  margin-top: var(--space-3);
  font-size: var(--text-sm);
  color: var(--ink-mute);
}

.cs-gallery--product figcaption strong {
  display: block;
  font-family: var(--font-display);
  font-size: var(--text-base);
  font-weight: 630;
  color: var(--ink);
  margin-bottom: 0.25rem;
}

.cs-quote {
  padding: var(--space-8) var(--space-6);
  border-radius: var(--r-lg);
  background: var(--sand);
  text-align: center;
}

.cs-quote__text {
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 1.1rem + 0.8vw, 1.75rem);
  font-weight: 550;
  letter-spacing: -0.018em;
  line-height: 1.4;
  color: var(--ink);
  max-width: 44rem;
  margin-inline: auto;
}

.cs-quote__by {
  margin-top: var(--space-5);
  font-size: var(--text-sm);
  color: var(--ink-mute);
}

.cs-quote__by strong { color: var(--ink); }

/* Detail page: head, cover, narrative rows, deliverables, outcome, footer.
   The narrative is a label/text row per section (challenge, approach,
   solution...) rather than a two-column split, so it reads top to bottom in
   the order the work actually happened, and stays one column on phones. */
.cs-head { padding-bottom: var(--space-6); }
.cs-head__back { font-size: var(--text-sm); }
.cs-head__back::before { content: "\2190"; margin-right: 0.375rem; }
.cs-head .eyebrow { display: flex; }
.cs-head__lede { margin-top: var(--space-4); max-width: 60ch; }

.cs-meta__item--link .link { display: flex; width: fit-content; margin-top: 0.125rem; font-size: var(--text-base); }

/* Screenshots are 16:10 browser captures, not the 21:9 photos the base
   .detail-visual was sized for; anchored to the top so the site's header,
   the part that identifies it, is never the bit that gets cropped. */
.detail-visual--shot { aspect-ratio: 16 / 10; background: var(--void); border: 1px solid var(--line); margin-inline: 0; }
.detail-visual--shot img { object-position: top; }

/* .cs-cover itself (the typographic fallback when there is no screenshot)
   lives in home.css, since the homepage case study cards use it too. */

.cs-story { display: grid; gap: var(--space-6); }

.cs-story__row {
  display: grid;
  gap: var(--space-3);
  padding-top: var(--space-6);
  border-top: 1px solid var(--line);
}

@media (min-width: 860px) {
  .cs-story__row { grid-template-columns: 13rem minmax(0, 1fr); gap: var(--space-8); }
}

.cs-story__label {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--label-sm);
  font-weight: 650;
  letter-spacing: 0.02em;
  color: var(--cyan);
}

.cs-story__text { max-width: 66ch; font-size: var(--text-lg); line-height: 1.75; color: var(--ink-soft); }

/* Ordered lists in the write-up read as numbered steps (e.g. a workflow),
   not a plain bullet list. */
.cs-body { max-width: 66ch; }
.cs-body > :first-child { margin-top: 0; }
/* Doubled class: .article__body ol (later in this file) sets disc bullets at
   equal specificity, which put a dot in front of every step number. */
.cs-body.article__body ol { list-style: none; padding-left: 0; counter-reset: step; display: grid; gap: var(--space-3); }
.cs-body ol li { position: relative; padding-left: 2.75rem; margin: 0; counter-increment: step; }
.cs-body ol li::before {
  content: counter(step, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 0.1em;
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: 650;
  color: var(--cyan);
}

/* Left-aligned, unlike the shared .grid which centres a short row: one or two
   service cards under a left-aligned label looked misplaced. */
.cs-services { display: grid; gap: var(--space-4); grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr)); }

.cs-deliverables { display: grid; gap: var(--space-3) var(--space-6); }
@media (min-width: 640px) { .cs-deliverables { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.cs-deliverables li { display: flex; gap: 0.625rem; align-items: flex-start; font-size: var(--text-base); line-height: 1.6; color: var(--ink-soft); }
.cs-deliverables svg { width: 1.125rem; height: 1.125rem; flex-shrink: 0; margin-top: 0.2rem; color: var(--cyan); }

.cs-outcome {
  padding: clamp(1.5rem, 1rem + 2.5vw, 3rem);
  border-radius: var(--r-lg);
  border: 1px solid var(--line);
  border-left: 3px solid var(--cyan);
}

.cs-outcome__text {
  max-width: 62ch;
  margin-top: var(--space-3);
  font-family: var(--font-display);
  font-size: clamp(1.125rem, 1rem + 0.6vw, 1.375rem);
  font-weight: 520;
  line-height: 1.55;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.cs-foot {
  display: grid;
  gap: var(--space-8);
  padding-top: var(--space-8);
  border-top: 1px solid var(--line);
}

@media (min-width: 860px) { .cs-foot { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); align-items: end; } }

.cs-next {
  position: relative;
  display: grid;
  gap: 0.375rem;
  padding: var(--space-6);
  border-radius: var(--r-lg);
  border: 1px solid var(--line);
  transition: border-color var(--fast) var(--ease), transform var(--base) var(--ease);
}

.cs-next:hover { border-color: var(--cyan); transform: translateY(-3px); }
.cs-next__label { font-size: var(--label-sm); font-weight: 650; letter-spacing: 0.02em; color: var(--cyan); }
.cs-next__title { font-family: var(--font-display); font-size: var(--text-xl); font-weight: 640; letter-spacing: -0.015em; color: var(--ink); }
.cs-next__meta { font-size: var(--text-sm); color: var(--ink-mute); }
.cs-next__arrow { position: absolute; top: var(--space-6); right: var(--space-6); color: var(--cyan); }
.cs-next__arrow svg { width: 1.25rem; height: 1.25rem; }

/* --------------------------------------------------------------------------
   Case study list
   One large entry per project, alternating sides, instead of a card grid:
   there are few enough case studies that each can carry a full-size visual,
   and that reads as a body of work rather than a template gallery.
   -------------------------------------------------------------------------- */

.cs-list { display: grid; gap: clamp(3rem, 2rem + 4vw, 6rem); }

.cs-entry { display: grid; gap: var(--space-6); align-items: center; }

@media (min-width: 900px) {
  .cs-entry { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: clamp(2.5rem, 1rem + 4vw, 5rem); }
  .cs-entry:nth-child(even) .cs-entry__visual { order: 2; }
}

.cs-entry__visual {
  position: relative;
  display: block;
  aspect-ratio: 16 / 10;
  border-radius: var(--r-lg);
  border: 1px solid var(--line);
  background: var(--void);
  overflow: hidden;
  isolation: isolate;
}

.cs-entry__visual img { width: 100%; height: 100%; object-fit: cover; object-position: top; transition: transform var(--slow) var(--ease); }
.cs-entry__visual:hover img { transform: scale(1.02); }

.cs-entry__index { font-family: var(--font-display); font-size: var(--text-sm); font-weight: 650; color: var(--cyan); }
.cs-entry__meta { margin-top: var(--space-2); font-size: var(--text-sm); color: var(--ink-mute); }

.cs-entry__title {
  margin: var(--space-3) 0;
  font-family: var(--font-display);
  font-size: var(--display-md);
  font-weight: 660;
  letter-spacing: -0.025em;
  line-height: 1.1;
  color: var(--ink);
}

.cs-entry__title a { transition: color var(--fast) var(--ease); }
.cs-entry__title a:hover { color: var(--cyan); }
.cs-entry__text { max-width: 52ch; margin-bottom: var(--space-5); font-size: var(--text-base); line-height: 1.7; color: var(--ink-soft); }

/* --------------------------------------------------------------------------
   Portfolio filtering
   -------------------------------------------------------------------------- */

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-8);
}

.filter-pill {
  padding: 0.5rem 1.125rem;
  border-radius: var(--r-pill);
  border: 1px solid var(--line);
  background: var(--paper);
  font-size: var(--text-sm);
  font-weight: 590;
  color: var(--ink-mute);
  cursor: pointer;
  transition: background-color var(--fast) var(--ease), border-color var(--fast) var(--ease),
              color var(--fast) var(--ease), transform var(--fast) var(--ease);
}

.filter-pill:hover { border-color: var(--cyan); color: var(--cyan); }
.filter-pill:active { transform: scale(0.96); }

.filter-pill.is-active {
  background: var(--cyan);
  border-color: var(--cyan);
  color: var(--paper);
}

.work-card[hidden] { display: none; }

/* --------------------------------------------------------------------------
   Portfolio and case study detail hero image
   -------------------------------------------------------------------------- */

.detail-visual {
  position: relative;
  aspect-ratio: 21 / 9;
  border-radius: var(--r-lg);
  background: var(--cyan-deep);
  overflow: hidden;
  isolation: isolate;
  margin-bottom: clamp(2.5rem, 2rem + 3vw, 4rem);
}

.detail-visual__arc { width: 60%; height: 100%; top: -20%; right: -15%; background: rgba(255, 255, 255, 0.08); }

.detail-visual__initials {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-size: clamp(2rem, 1.5rem + 2vw, 3.5rem);
  font-weight: 660;
  letter-spacing: -0.03em;
  color: rgba(255, 255, 255, 0.92);
}

.detail-visual img { width: 100%; height: 100%; object-fit: cover; }

/* --------------------------------------------------------------------------
   Blog
   -------------------------------------------------------------------------- */

.blog-layout {
  display: grid;
  gap: var(--space-8);
}

@media (min-width: 960px) { .blog-layout { grid-template-columns: minmax(0, 1fr) 18rem; } }

.blog-list { display: grid; gap: var(--space-5); }

.blog-card {
  display: grid;
  gap: var(--space-5);
  padding-bottom: var(--space-6);
  border-bottom: 1px solid var(--line);
}

@media (min-width: 640px) { .blog-card { grid-template-columns: 12rem minmax(0, 1fr); align-items: start; } }

.blog-card__visual {
  aspect-ratio: 4 / 3;
  border-radius: var(--r-md);
  background: var(--cyan-deep);
  display: grid;
  place-items: center;
  overflow: hidden;
}

.blog-card__visual img { width: 100%; height: 100%; object-fit: cover; }

.blog-card__initials {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 650;
  color: rgba(255, 255, 255, 0.9);
}

.blog-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  align-items: center;
  margin-bottom: var(--space-3);
  font-size: var(--label-xs);
  color: var(--ink-faint);
}

.blog-card__title {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 630;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin-bottom: var(--space-2);
  transition: color var(--fast) var(--ease);
}

.blog-card:hover .blog-card__title { color: var(--cyan); }

.blog-card__excerpt { font-size: var(--text-sm); line-height: 1.65; color: var(--ink-mute); }

.blog-side { display: grid; gap: var(--space-8); align-content: start; }

.blog-search {
  display: flex;
  gap: var(--space-2);
  padding: 0.25rem;
  border-radius: var(--r-pill);
  border: 1px solid var(--line);
  background: var(--paper);
}

.blog-search input {
  flex: 1;
  border: 0;
  background: none;
  padding: 0.625rem 1rem;
  font-size: var(--text-sm);
}

.blog-search input:focus { outline: none; }

.blog-search button {
  padding: 0.625rem 1.125rem;
  border-radius: var(--r-pill);
  border: 0;
  background: var(--cyan);
  color: var(--paper);
  font-weight: 600;
  font-size: var(--text-sm);
  cursor: pointer;
}

.blog-side__title {
  font-size: var(--label-sm);
  font-weight: 650;
  letter-spacing: 0.02em;
  color: var(--ink-faint);
  margin-bottom: var(--space-3);
}

.blog-side__list { display: grid; gap: 0.5rem; }

.blog-side__list a {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 0.75rem;
  border-radius: var(--r-sm);
  font-size: var(--text-sm);
  color: var(--ink-soft);
  transition: background-color var(--fast) var(--ease);
}

.blog-side__list a:hover { background: var(--sand); }
.blog-side__list a.is-active { background: var(--cyan-tint); color: var(--cyan-deep); font-weight: 600; }

.pagination {
  display: flex;
  gap: var(--space-2);
  justify-content: center;
  margin-top: var(--space-8);
}

.pagination a, .pagination span {
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: var(--r-pill);
  border: 1px solid var(--line);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--ink-mute);
  transition: border-color var(--fast) var(--ease), color var(--fast) var(--ease), transform var(--fast) var(--ease);
}

.pagination a:active { transform: scale(0.92); }

.pagination a:hover { border-color: var(--cyan); color: var(--cyan); }
.pagination .is-current { background: var(--cyan); border-color: var(--cyan); color: var(--paper); }

/* --------------------------------------------------------------------------
   Blog article
   -------------------------------------------------------------------------- */

.article {
  max-width: 42rem;
  margin-inline: auto;
}

.article__meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  align-items: center;
  margin-bottom: var(--space-5);
  font-size: var(--text-sm);
  color: var(--ink-mute);
}

.article__author {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.article__body {
  font-size: 1.0625rem;
  line-height: 1.8;
  color: var(--ink-soft);
}

.article__body p { margin-bottom: var(--space-5); }
.article__body h2 { margin: var(--space-8) 0 var(--space-4); font-size: var(--display-sm); }
.article__body h3 { margin: var(--space-6) 0 var(--space-3); font-size: var(--text-xl); font-family: var(--font-display); font-weight: 630; color: var(--ink); }
.article__body ul, .article__body ol { margin: 0 0 var(--space-5); padding-left: 1.25rem; list-style: disc; }
.article__body li { margin-bottom: var(--space-2); }
.article__body a { color: var(--cyan); border-bottom: 1px solid currentColor; }

.article__tags { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-8); padding-top: var(--space-6); border-top: 1px solid var(--line); }

/* Optional FAQ at the end of a post; the accordion itself is .faq in home.css. */
.post-faq { margin-top: var(--space-8); }
.post-faq__title { font-family: var(--font-display); font-size: var(--display-sm); color: var(--ink); margin-bottom: var(--space-3); }
.post-faq .faq__item:last-child { border-bottom: 0; }

/* End-of-post call to action (partials/post-cta.php). */
.post-cta {
  margin-top: var(--space-8);
  padding: var(--space-6);
  border-radius: var(--r-lg);
  background: var(--sand);
  border-top: 3px solid var(--cyan);
}
.post-cta__title { font-family: var(--font-display); font-size: var(--text-xl); font-weight: 630; color: var(--ink); }
.post-cta__text { margin: var(--space-3) 0 var(--space-5); color: var(--ink-soft); max-width: 56ch; }

.related-grid { max-width: 74rem; margin-inline: auto; }

/* --------------------------------------------------------------------------
   Careers
   -------------------------------------------------------------------------- */

.role-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  align-items: center;
  justify-content: space-between;
  padding: var(--space-5) 0;
  border-bottom: 1px solid var(--line);
}

.role-row__title {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 630;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.role-row__meta { margin-top: 0.25rem; font-size: var(--text-sm); color: var(--ink-mute); }

.empty-openings {
  padding: var(--space-8) var(--space-6);
  border-radius: var(--r-lg);
  background: var(--paper);
  border: 1px solid var(--line);
}

/* --------------------------------------------------------------------------
   Feature cards with a "what you get" bullet list (ClinicOS showcase and
   any future product page that needs the same shape).
   -------------------------------------------------------------------------- */

.card__list {
  display: grid;
  gap: 0.5rem;
  margin-top: var(--space-4);
}

.card__list li {
  position: relative;
  padding-left: 1.25rem;
  font-size: var(--text-sm);
  line-height: 1.6;
  color: var(--ink-mute);
}

.section--void .card__list li { color: #8993a0; }

.card__list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 0.4rem;
  height: 0.4rem;
  border-radius: 999px;
  background: var(--cyan);
}

/* A standout card for the "one of a kind" style feature, set apart from a
   regular grid card with a colour accent rather than a heavier treatment
   that would fight the rest of the page for attention.
   These sit in a flex row (.grid) with the default align-items: stretch,
   so every card in the row matches the tallest one. When one item's copy
   wraps a line longer than its siblings, the shorter cards get a visibly
   uneven gap below the text. Keep the three copy blocks close enough in
   length to wrap to the same number of lines, rather than fixing it here
   with CSS. */
.card--accent { border-top: 3px solid var(--cyan); }
.card--accent .pill { margin-bottom: var(--space-4); }

/* --------------------------------------------------------------------------
   About: at a glance
   Company facts on the left as a definition list (plain HTML, so the facts
   are readable by anyone, crawlers included), and the work that backs them
   up on the right.
   -------------------------------------------------------------------------- */

.glance {
  display: grid;
  gap: var(--space-8);
  margin-top: var(--space-6);
  padding-top: var(--space-6);
  border-top: 1px solid var(--line);
}

@media (min-width: 900px) { .glance { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(2.5rem, 1rem + 4vw, 5rem); } }

.glance__facts { display: grid; gap: 0; }

.glance__facts > div {
  display: grid;
  gap: 0.25rem;
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--line);
}

@media (min-width: 560px) { .glance__facts > div { grid-template-columns: 11rem minmax(0, 1fr); gap: var(--space-4); } }

.glance__facts dt { font-size: var(--text-sm); color: var(--ink-mute); }
.glance__facts dd { font-size: var(--text-base); font-weight: 560; color: var(--ink); overflow-wrap: anywhere; }
.glance__profiles { display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; }

.glance__work-title { font-size: var(--label-sm); font-weight: 650; letter-spacing: 0.02em; color: var(--cyan); margin-bottom: var(--space-3); }

.glance__work ul { display: grid; gap: 0; }

.glance__work li { padding: var(--space-4) 0; border-bottom: 1px solid var(--line); }
.glance__work li:first-child { padding-top: 0; }

.glance__kicker { display: block; font-size: var(--text-xs, 0.8125rem); color: var(--ink-mute); margin-bottom: 0.125rem; }

.glance__name {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 640;
  letter-spacing: -0.015em;
  color: var(--ink);
  transition: color var(--fast) var(--ease);
}

.glance__name svg { width: 1rem; height: 1rem; color: var(--cyan); transition: transform var(--base) var(--ease); }
.glance__name:hover { color: var(--cyan); }
.glance__name:hover svg { transform: translateX(3px); }
.glance__work p { margin-top: 0.25rem; font-size: var(--text-sm); line-height: 1.65; color: var(--ink-soft); }
