/**
 * Content and form styling for pages wearing the brochure chrome.
 *
 * Bootstrap Barrio's stylesheet no longer loads on these pages, so the body copy
 * and the form elements Drupal renders (core's password form, the admin login,
 * node content) need the brochure's type and colour applied here.
 *
 * Everything that targets bare elements is scoped to
 * `.dc-page:not(.dc-page--sections):not(.dc-page--legal)`. The homepage's sections are components
 * with their own styles — the red CTA sets white text on its container and lets
 * the copy inherit it — and a two-class rule here would win and turn that copy
 * grey on red.
 */

/* Layout: the measure depends on what the page holds. */
.dc-page__main {
  max-width: var(--container);
  margin: 0 auto;
  padding: var(--space-10) var(--space-5) var(--space-16);
}

/* The homepage lays out full-width sections of its own. */
.dc-page--sections .dc-page__main {
  max-width: none;
  margin: 0;
  padding: 0;
}

/* Legal documents bring their own title band and body wrapper, both of which
   manage their own measure — the page template must not add another. */
.dc-page--legal .dc-page__main {
  max-width: none;
  padding: 0;
}

.dc-page--legal .dc-page__content {
  max-width: none;
}

/* A single form reads better in a narrow card. */
.dc-page--form .dc-page__main {
  max-width: 520px;
  padding: var(--space-12) var(--space-5) var(--space-16);
}

.dc-page--form .dc-page__content {
  padding: var(--space-6);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  background: var(--bg-canvas);
}

/* Content typography — never applied to the homepage's own sections. */
.dc-page:not(.dc-page--sections):not(.dc-page--legal) .dc-page__content h1,
.dc-page:not(.dc-page--sections):not(.dc-page--legal) .dc-page__content h2 {
  margin: 0 0 var(--space-4);
  color: var(--digicel-red);
  font-family: var(--font-brand);
  font-size: var(--text-2xl);
  font-weight: var(--weight-black);
  letter-spacing: var(--tracking-headline);
  line-height: var(--leading-snug);
}

.dc-page:not(.dc-page--sections):not(.dc-page--legal) .dc-page__content .description,
.dc-page:not(.dc-page--sections):not(.dc-page--legal) .dc-page__content p {
  color: var(--fg-primary);
  font-family: var(--font-brand);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  line-height: var(--leading-normal);
}

.dc-page:not(.dc-page--sections):not(.dc-page--legal) .dc-page__content a {
  color: var(--digicel-red);
  font-weight: var(--weight-bold);
}

/* Form elements. The homepage has no forms, so the exclusion is kept for
   consistency rather than necessity. */
.dc-page:not(.dc-page--sections):not(.dc-page--legal) .dc-page__content label {
  display: block;
  margin-bottom: var(--space-2);
  color: var(--fg-primary);
  font-family: var(--font-brand);
  font-size: var(--text-sm);
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-body);
}

.dc-page:not(.dc-page--sections):not(.dc-page--legal) .dc-page__content input[type="text"],
.dc-page:not(.dc-page--sections):not(.dc-page--legal) .dc-page__content input[type="email"],
.dc-page:not(.dc-page--sections):not(.dc-page--legal) .dc-page__content input[type="password"] {
  width: 100%;
  box-sizing: border-box;
  margin-bottom: var(--space-4);
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  background: var(--bg-canvas);
  color: var(--fg-primary);
  font-family: var(--font-brand);
  font-size: var(--text-base);
}

.dc-page:not(.dc-page--sections):not(.dc-page--legal) .dc-page__content input[type="text"]:focus,
.dc-page:not(.dc-page--sections):not(.dc-page--legal) .dc-page__content input[type="email"]:focus,
.dc-page:not(.dc-page--sections):not(.dc-page--legal) .dc-page__content input[type="password"]:focus {
  border-color: var(--digicel-red);
  outline: 2px solid var(--digicel-red);
  outline-offset: 1px;
}

.dc-page:not(.dc-page--sections):not(.dc-page--legal) .dc-page__content input[type="submit"],
.dc-page:not(.dc-page--sections):not(.dc-page--legal) .dc-page__content button[type="submit"] {
  padding: var(--space-4) var(--space-6);
  border: 0;
  border-radius: var(--radius-md);
  background: var(--digicel-red);
  color: var(--fg-on-red);
  cursor: pointer;
  font-family: var(--font-brand);
  font-size: var(--text-base);
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-body);
}

/**
 * Anchor targets clear the sticky header.
 *
 * The header is `position: sticky; top: 0`, so a plain anchor jump lands the
 * target underneath it and hides the heading. `scroll-margin-top` offsets the
 * scroll position by a little more than the header's height.
 */
:target,
.dc-help-section,
.dc-help-contact,
[id^="help-"] {
  scroll-margin-top: 76px;
}

@media (min-width: 768px) {
  :target,
  .dc-help-section,
  .dc-help-contact,
  [id^="help-"] {
    scroll-margin-top: 96px;
  }
}
