/*
 * Custom hardware development page (/egyedi-hardverfejlesztes/): the <style> of egyedi-hardverfejlesztes.astro as
 * plain CSS (plan §8.3). Every selector starts with the .page-hardware body class; Astro :global(x) became
 * .page-hardware … x.
 */

/* Hero: the 16:9 illustration cropped to its detailed right half */
.page-hardware .hw-hero__frame {
  aspect-ratio: 5 / 4;
}

.page-hardware .hw-hero__frame img {
  object-position: 80% 50%;
}

/* The title holds a soft hyphen (U+00AD); text-wrap: balance would happily break there ("hardver- / fejlesztés"),
   so hyphenation is switched off. "hardverfejlesztés" is ≈ 8.3 em in Montserrat 300: at ≤ 400 px the size follows
   the viewport (10vw), so the word fits unbroken even at 320 px. */
.page-hardware .hw-hero .page-hero__text h1 {
  hyphens: none;
}

@media (max-width: 25em) {
  .page-hardware .hw-hero .page-hero__text h1 {
    font-size: min(var(--fs-6), 10vw);
  }
}

/* Leads: the global .measure allows 85+ character lines in Hungarian Lato text – narrowed to ~70 characters here,
   the lead of the shared SectionHeading too. */
.page-hardware .section .section-head > .lead,
.page-hardware .hw-services__note,
.page-hardware .hw-related__lead {
  max-width: 58ch;
}

/* Services */
.page-hardware .hw-services {
  list-style: none;
  padding: 0;
  margin: 0;
}

.page-hardware .hw-services__note {
  margin-top: var(--space-6);
  color: var(--c-text-2);
}

/* Reference projects */
/* The title holds a soft hyphen – it breaks only where the word does not fit in one piece */
@media (max-width: 25em) {
  .page-hardware .hw-references .section-title {
    hyphens: manual;
    overflow-wrap: anywhere;
  }
}

.page-hardware .hw-refs {
  display: grid;
  gap: clamp(3rem, 6vw, 5rem);
}

.page-hardware .hw-ref + .hw-ref {
  padding-top: clamp(3rem, 6vw, 5rem);
  border-top: 1px solid var(--c-line);
}

.page-hardware .hw-ref h3 {
  max-width: 24ch;
  margin-bottom: var(--space-5);
}

.page-hardware .hw-ref__facts {
  gap: var(--space-3) var(--space-5);
}

.page-hardware .hw-ref__facts dd {
  color: var(--c-text);
}

.page-hardware .hw-ref__link {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.page-hardware .hw-chips {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.45rem;
}

.page-hardware .hw-chips li {
  padding: 0.2rem 0.7rem;
  border: 1px solid var(--c-line);
  border-radius: 999px;
  background: var(--c-paper);
  font-size: var(--fs-0);
  line-height: 1.5;
}

.page-hardware .hw-ref__media {
  margin: 0;
}

/* The frame follows the aspect ratio of the photo (the PNGs differ), not a fixed 4:3.
   The PNGs carry their own white margin, so the inner padding of the frame is small on mobile. */
.page-hardware .hw-ref__frame {
  padding: clamp(0.5rem, 2vw, 2rem);
  background: var(--c-paper);
  border: 1px solid var(--c-line);
}

.page-hardware .hw-ref__frame img {
  height: auto;
  max-height: 26rem;
  object-fit: contain;
}

/* The development steps – in a dark band (like the "Hogyan dolgozunk" section of the home page), so there is rhythm
   between the references (mist) and the related services (white) as well */
@media (min-width: 60em) {
  .page-hardware .hw-process__intro {
    position: sticky;
    top: calc(var(--header-h) + 2rem);
  }
}

/* In the dark band the intro paragraphs are muted (like .lead); the title and the step titles stay white */
.page-hardware .hw-process__intro p {
  color: var(--c-on-dark-2);
}

.page-hardware .hw-process__intro .btn--link {
  margin-top: var(--space-4);
}

.page-hardware .hw-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: hw-step;
}

.page-hardware .hw-steps li {
  counter-increment: hw-step;
  display: grid;
  grid-template-columns: 3.5rem minmax(0, 1fr);
  column-gap: var(--space-4);
  padding-block: var(--space-5);
  border-top: 1px solid var(--c-ink-line);
}

.page-hardware .hw-steps li:last-child {
  border-bottom: 1px solid var(--c-ink-line);
}

.page-hardware .hw-steps li::before {
  content: counter(hw-step);
  grid-row: 1 / span 2;
  font: 300 var(--fs-5) / 1 var(--ff-display);
  letter-spacing: -0.02em;
  color: var(--c-turq);
  font-variant-numeric: tabular-nums;
}

.page-hardware .hw-steps h3,
.page-hardware .hw-steps p {
  grid-column: 2;
}

.page-hardware .hw-steps h3 {
  font-size: var(--fs-3);
  margin: 0 0 0.4em;
}

@media (max-width: 25em) {
  .page-hardware .hw-steps li {
    grid-template-columns: 2.75rem minmax(0, 1fr);
    column-gap: var(--space-3);
  }
}

.page-hardware .hw-steps p {
  margin: 0;
  max-width: 60ch;
  color: var(--c-on-dark-2);
}

/* Related services */
.page-hardware .hw-related__lead {
  margin-bottom: var(--space-7);
}

/* The overflow: hidden of .tiles would clip a focus ring drawn outside – it is pushed inside */
.page-hardware .hw-related a.tile:focus-visible {
  outline-offset: -4px;
}

.page-hardware .hw-nowrap {
  white-space: nowrap;
}
