/**
 * Protected Downloads – public form + pages styling
 * (kept intentionally small + predictable, no theme overrides beyond this scope)
 */

/* Page wrapper (title + intro + form) */
.protected-downloads-request-page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 20px;
}

/* Title + intro spacing */
.protected-downloads-title {
  margin-top: 40px;
  margin-bottom: 20px;
}

.protected-downloads-title + p {
  margin-bottom: 32px;
  max-width: 760px;
}

/* Constrain the public download request form */
.protected-downloads-request-form {
  max-width: 720px;
  margin: 0 auto;
}

/* Prevent inputs/textareas/selects from overflowing */
.protected-downloads-request-form input,
.protected-downloads-request-form textarea,
.protected-downloads-request-form select {
  max-width: 100%;
  box-sizing: border-box;
}

/* Field rows: label column + input column */
.protected-downloads-request-form .js-form-item {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  column-gap: 24px;
  align-items: center;
}

/* Force left-aligned labels (overrides any theme rules) */
.protected-downloads-request-form .js-form-item > label {
  text-align: left !important;
  justify-self: start;
  margin: 0;
}

/* Make text inputs fill the input column */
.protected-downloads-request-form input.form-text,
.protected-downloads-request-form input.form-email,
.protected-downloads-request-form input.form-tel {
  width: 100%;
}

/* Checkbox row: align with input column + keep label close */
.protected-downloads-request-form .js-form-type-checkbox {
  display: flex;
  align-items: center;
  margin-left: 180px; /* aligns checkbox row with inputs column */
}

.protected-downloads-request-form .js-form-type-checkbox input {
  margin-right: 10px;
}

.protected-downloads-request-form .js-form-type-checkbox label {
  margin: 0;
  text-align: left !important;
}

/* Add a bit of breathing room under the button */
.protected-downloads-request-form .form-actions {
  margin-bottom: 60px;
}

/* Optional: if you use a two-column layout elsewhere */
.protected-downloads-layout {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 40px;
  max-width: 1100px;
  margin: 0 auto;
}

@media (max-width: 900px) {
  .protected-downloads-layout {
    grid-template-columns: 1fr;
  }

  /* Stack labels above inputs on smaller screens */
  .protected-downloads-request-form .js-form-item {
    grid-template-columns: 1fr;
    row-gap: 8px;
    align-items: start;
  }

  .protected-downloads-request-form .js-form-type-checkbox {
    margin-left: 0;
  }
}

/* Centre main protected downloads content */
#block-custom-content {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Centre headings + text visually */
#block-custom-content h1,
#block-custom-content p {
  text-align: center;
}

/* Centre the file list */
#block-custom-content ul {
  list-style: none;
  padding: 0;
  margin: 24px auto;
  text-align: center;
}

#block-custom-content ul li {
  margin-bottom: 12px;
}

/* Centre system messages (errors, status) */
.messages__wrapper {
  max-width: 900px;
  margin: 20px auto;
  padding: 0 20px;
}

/* Optional: soften the error message look */
.messages {
  text-align: center;
}

/* === Protected downloads page centring === */
.layout-content #block-custom-content {
  max-width: 900px;
  margin: 60px auto 0; /* top spacing + centring */
  padding: 0 20px;
}

/* Match heading spacing used elsewhere on site */
.layout-content #block-custom-content h1 {
  margin-top: 40px;
  margin-bottom: 16px;
}

/* Intro paragraph spacing */
.layout-content #block-custom-content > p {
  margin-bottom: 24px;
}

/* Centre the downloads list */
.layout-content #block-custom-content ul {
  list-style: none;
  padding: 0;
  margin: 0 auto;
}

.layout-content #block-custom-content ul li {
  margin-bottom: 12px;
}
/* 1) Force the region wrapper to centre its contents */
.layout-content > div {
  display: flex !important;
  justify-content: center !important;
}

/* 2) Constrain + pad the actual block */
.layout-content > div > #block-custom-content {
  width: 100% !important;
  max-width: 900px !important;
  padding: 0 20px !important;
  margin: 0 auto !important;
}

/* 3) Heading spacing */
.layout-content > div > #block-custom-content h1 {
  margin-top: 40px !important;
  margin-bottom: 16px !important;
}

/* Downloads page: centre + constrain content */
body.path-downloads .layout-content > div > #block-custom-content {
  max-width: 1100px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 20px;
  padding-right: 20px;
}

/* Match heading spacing to other pages */
body.path-downloads #block-custom-content h1 {
  margin-top: 48px;
  margin-bottom: 18px;
}

body.path-downloads #block-custom-content {
  text-align: center;
}
body.path-downloads #block-custom-content ul {
  display: inline-block;
  text-align: left; /* keeps list neat */
}
