/* Reusable pieces: headings, buttons, cards, slider, tabs, gallery, forms. */

/* ---------- Section headings ---------- */

.heading-accent::after {
  display: block;
  width: 100px;
  height: 3px;
  margin-top: 14px;
  background: var(--ico-red);
  content: "";
}

.heading-accent--center {
  text-align: center;
}

.heading-accent--center::after {
  margin-inline: auto;
}

.eyebrow {
  display: block;
  margin-bottom: 10px;
  color: var(--ico-red);
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.lede {
  font-size: 1.08rem;
  color: var(--body);
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-block;
  padding: 12px 26px;
  background: var(--ico-red);
  color: #fff;
  border: 1px solid var(--ico-red);
  border-radius: var(--radius);
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition);
}

.btn:hover {
  background: var(--ico-red-dark);
  border-color: var(--ico-red-dark);
  color: #fff;
  text-decoration: none;
}

.btn[disabled] {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn--outline {
  background: transparent;
  color: var(--ico-red);
}

.btn--outline:hover {
  background: var(--ico-red);
  color: #fff;
}

/* ---------- Service cards ---------- */

.service-card {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 32px 26px;
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-top: 3px solid var(--ico-red);
  box-shadow: var(--shadow-card);
}

.service-card__logo {
  display: grid;
  place-items: center;
  min-height: 110px;
}

/* Source logos carry a lot of built-in whitespace, so they need generous
   display width to read at a comfortable size. */
.service-card__logo img {
  width: 100%;
  max-width: 220px;
  height: auto;
}

.service-card p {
  flex: 1;
  min-height: 85px;
  font-size: 0.95rem;
}

.service-card .btn {
  align-self: flex-start;
}

/* ---------- Media figure ---------- */

.media-figure {
  margin: 0;
}

.media-figure img {
  width: 100%;
  border: 1px solid var(--line-soft);
}

.media-figure figcaption {
  margin-top: 10px;
  font-size: 0.875rem;
  color: var(--muted);
}

.portfolio-item h3 {
  margin-top: 20px;
}

/* ---------- Hero slider ---------- */

.hero-slider {
  position: relative;
  background: var(--bar-dark);
  overflow: hidden;
}

.hero-slider__viewport {
  position: relative;
  min-height: 560px;
}

.hero-slide {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 560px;
  padding: 40px var(--gutter);
  background-position: center;
  background-size: cover;
  isolation: isolate;
}

.hero-slide::after {
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.25), rgba(0, 0, 0, 0.6));
  content: "";
}

.hero-slide__title {
  margin: 0;
  color: #fff;
  /* The first slide is an <h1>, the rest are <p> — pin family and weight so they match. */
  font-family: var(--font-body);
  font-weight: 400;
  font-size: clamp(2rem, 5.5vw, 3.75rem);
  letter-spacing: 0.02em;
  text-align: center;
  text-transform: uppercase;
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.5);
}

/* Without JS every slide simply stacks — content stays reachable. */
.hero-slider.is-enhanced .hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity 600ms ease;
}

.hero-slider.is-enhanced .hero-slide.is-active {
  position: relative;
  opacity: 1;
  visibility: visible;
}

.hero-slider__arrow {
  position: absolute;
  top: 50%;
  z-index: 3;
  display: none;
  place-items: center;
  width: 48px;
  height: 48px;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.42);
  border: 1px solid rgba(255, 255, 255, 0.35);
  color: #fff;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  transition: background var(--transition);
}

.hero-slider.is-enhanced .hero-slider__arrow {
  display: grid;
}

.hero-slider__arrow:hover {
  background: var(--ico-red);
}

.hero-slider__arrow--prev {
  left: 18px;
}

.hero-slider__arrow--next {
  right: 18px;
}

.hero-slider__dots {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 26px;
  z-index: 3;
  display: none;
  justify-content: center;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.hero-slider.is-enhanced .hero-slider__dots {
  display: flex;
}

.hero-slider__dot {
  width: 12px;
  height: 12px;
  padding: 0;
  background: rgba(255, 255, 255, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 50%;
  cursor: pointer;
}

.hero-slider__dot[aria-selected="true"] {
  background: var(--ico-red);
  border-color: #fff;
}

@media (max-width: 720px) {
  .hero-slider__viewport,
  .hero-slide {
    min-height: 380px;
  }

  .hero-slider__arrow {
    width: 40px;
    height: 40px;
  }

  .hero-slider__arrow--prev {
    left: 8px;
  }

  .hero-slider__arrow--next {
    right: 8px;
  }

  /* Keep the title clear of the arrow hit areas. */
  .hero-slide {
    padding-inline: 64px;
  }
}

/* ---------- Tabs ---------- */

.tabs {
  margin-top: 0;
}

.tablist {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  margin: 0 0 40px;
  padding: 0;
  list-style: none;
  background: var(--line-soft);
}

.tablist__btn {
  flex: 1 1 auto;
  padding: 16px 20px;
  background: var(--ico-red);
  border: 0;
  color: #f3f3f3;
  font-family: var(--font-body);
  font-size: 0.88rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background var(--transition);
}

.tablist__btn:hover {
  background: var(--ico-red-dark);
}

/* Active tab: the original theme only darkened the fill, which is a weak
   signal on its own — an inset marker makes the selection unambiguous. */
.tablist__btn[aria-selected="true"] {
  background: var(--ico-red-dark);
  box-shadow: inset 0 -4px 0 rgba(0, 0, 0, 0.45);
  color: #fff;
}

/* Panels are all visible until JS takes over. */
.tabs.is-enhanced .tabpanel[hidden] {
  display: none;
}

.tabpanel:focus {
  outline: none;
}

.tabpanel + .tabpanel {
  margin-top: var(--section-y);
}

.tabs.is-enhanced .tabpanel + .tabpanel {
  margin-top: 0;
}

@media (max-width: 720px) {
  .tablist {
    flex-direction: column;
  }
}

/* ---------- Contact panel ---------- */

.contact-panel {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  border: 1px solid var(--line-soft);
  background: var(--surface-grey);
}

.contact-panel__media {
  min-height: 100%;
  background: center / cover no-repeat var(--bar-dark);
}

.contact-panel__body {
  padding: 40px;
}

@media (max-width: 860px) {
  .contact-panel {
    grid-template-columns: 1fr;
  }

  .contact-panel__media {
    min-height: 220px;
  }

  .contact-panel__body {
    padding: 28px 22px;
  }
}

.contact-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.contact-list li + li {
  margin-top: 8px;
}

.contact-person + .contact-person {
  margin-top: 28px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}

.contact-person__name {
  margin: 0 0 6px;
  font-family: var(--font-body);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ink);
}

.contact-person__role {
  display: block;
  margin-bottom: 10px;
  color: var(--ico-red);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* Source data has no usable address for these — rendered unlinked on purpose. */
.contact-email--unlinked {
  color: var(--muted);
  cursor: default;
}

/* ---------- Gallery ---------- */

/* Source logos are small (125x85), so the tiles are sized to them rather than
   stretched to fill an arbitrary grid. */
.logo-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 170px));
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.logo-gallery img {
  width: 100%;
  height: 96px;
  padding: 10px;
  background: #fff;
  border: 1px solid #ccc;
  object-fit: contain;
}

/* ---------- Form ---------- */

.form-field {
  margin-bottom: 20px;
}

.form-field label {
  display: block;
  margin-bottom: 6px;
  color: var(--ink);
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.form-field .required {
  color: var(--ico-red);
}

.form-field input,
.form-field textarea {
  width: 100%;
  padding: 12px 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font: inherit;
  color: var(--ink);
  transition: border-color var(--transition);
}

.form-field input:focus,
.form-field textarea:focus {
  border-color: var(--ico-red);
}

.form-field textarea {
  min-height: 150px;
  resize: vertical;
}

.form-field__error {
  display: block;
  margin-top: 6px;
  color: var(--ico-red);
  font-size: 0.85rem;
}

.form-field input[aria-invalid="true"],
.form-field textarea[aria-invalid="true"] {
  border-color: var(--ico-red);
}

.form-status {
  margin-bottom: 20px;
  padding: 14px 16px;
  border-left: 3px solid var(--muted);
  background: var(--surface-grey);
  font-size: 0.95rem;
}

.form-status[hidden] {
  display: none;
}

.form-status--error {
  border-left-color: var(--ico-red);
  background: var(--ico-red-tint);
  color: var(--ico-red-dark);
}

.form-status--success {
  border-left-color: #2f7a3f;
  background: rgba(47, 122, 63, 0.08);
  color: #23602f;
}
