/**
 * Hilliard Distributor Portal
 *
 * Deliberately small: layout and form styling only. Colors, typography, and
 * buttons come from the Bedstone theme so the portal stays on brand when the
 * theme changes.
 */

/* ---------------------------------------------------------------- Panels */

.hp-panel {
  padding-block: clamp(2rem, 6vw, 4.5rem);
}

.hp-panel__inner {
  max-width: 30rem;
  margin-inline: auto;
}

.hp-panel--wide .hp-panel__inner {
  max-width: 46rem;
}

.hp-panel__title {
  margin-top: 0;
}

.hp-panel__intro {
  margin-bottom: 1.75rem;
}

.hp-panel__foot {
  margin-top: 2rem;
  font-size: 0.9rem;
}

/* ---------------------------------------------------------------- Notices */

.hp-notice {
  margin-bottom: 1.5rem;
  padding: 0.85rem 1rem;
  border-left: 4px solid;
  border-radius: 2px;
  font-size: 0.95rem;
}

.hp-notice--error {
  border-color: var(--bedstone-palette-attention, #dd1e36);
  background-color: #fdeceE;
  color: #7a1020;
}

.hp-notice--success {
  border-color: #2f7a45;
  background-color: #edf6ef;
  color: #1d4c2b;
}

.hp-notice--info {
  border-color: var(--bedstone-palette-interactive, #1a466e);
  background-color: #eef4f9;
  color: #163a5c;
}

.hp-notice--info a {
  color: inherit;
  font-weight: 600;
}

/* The theme's .btn styles are written for <a> elements; real <button>
   elements keep the browser's default border and text color unless reset.
   This makes the Sign In / Search submit buttons render as standard site
   buttons (red, white uppercase text, slide hover from the theme). */
button.btn {
  appearance: none;
  -webkit-appearance: none;
  border: 0;
  cursor: pointer;
  color: var(--bedstone-palette-bg, #fff);
}

/* ------------------------------------------------------------------ Forms */

.hp-form {
  margin: 0;
}

.hp-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 1.15rem;
}

.hp-field label {
  font-weight: 600;
  font-size: 0.95rem;
}

.hp-field input[type='text'],
.hp-field input[type='email'],
.hp-field input[type='password'] {
  width: 100%;
  padding: 0.65rem 0.75rem;
  border: 1px solid #b9b9b9;
  border-radius: 3px;
  background-color: #fff;
  font-size: 1rem;
  line-height: 1.4;
}

.hp-field input:focus-visible {
  outline: 2px solid var(--bedstone-palette-attention, #dd1e36);
  outline-offset: 1px;
}

.hp-field--check {
  flex-direction: row;
  align-items: center;
  gap: 0.5rem;
}

.hp-field--check label {
  font-weight: 400;
}

.hp-field__hint {
  font-size: 0.85rem;
  color: #666;
}

.hp-actions {
  margin-bottom: 1rem;
}

.hp-actions .btn {
  width: 100%;
  justify-content: center;
  text-align: center;
}

.hp-links {
  font-size: 0.925rem;
}

/* Honeypot: off-screen rather than display:none so bots still fill it in. */
.hp-hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* ------------------------------------------------------ Section index */

.hp-pages {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
  gap: 1rem;
  margin: 2rem 0;
  padding: 0;
  list-style: none;
}

.hp-pages__item {
  margin: 0;
}

.hp-pages__link {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  height: 100%;
  padding: 1.25rem;
  border: 1px solid #e0e0e0;
  border-left: 4px solid var(--bedstone-palette-attention, #dd1e36);
  border-radius: 4px;
  background-color: #fff;
  color: inherit;
  text-decoration: none;
  transition: box-shadow 0.15s ease, border-color 0.15s ease;
}

.hp-pages__link:hover,
.hp-pages__link:focus-visible {
  border-color: #c4c4c4;
  border-left-color: var(--bedstone-palette-brand-2, #881010);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.hp-pages__title {
  font-weight: 700;
  font-size: 1.1rem;
  line-height: 1.3;
}

.hp-pages__summary {
  font-size: 0.9rem;
  color: #666;
}

/* ------------------------------------------------------------------- News */

.hp-news__item {
  padding: 1.25rem 0;
  border-bottom: 1px solid #e0e0e0;
}

.hp-news__item:first-child {
  padding-top: 0;
}

.hp-news__date {
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--bedstone-palette-brand-2, #881010);
}

.hp-news__title {
  margin: 0.25rem 0 0.35rem;
}

.hp-news__title a {
  color: inherit;
  text-decoration: none;
}

.hp-news__title a:hover,
.hp-news__title a:focus-visible {
  color: var(--bedstone-palette-attention, #dd1e36);
  text-decoration: underline;
}

.hp-news__excerpt {
  margin: 0;
  color: #555;
}

.hp-news__pagination {
  margin-top: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.hp-news__pagination .page-numbers {
  padding: 0.35rem 0.75rem;
  border: 1px solid #ccc;
  border-radius: 3px;
  text-decoration: none;
}

.hp-news__pagination .page-numbers.current {
  background-color: var(--bedstone-palette-brand-2, #881010);
  border-color: var(--bedstone-palette-brand-2, #881010);
  color: #fff;
}

/* -------------------------------------------------------------- Resources */

.hp-resources {
  margin: 2rem 0;
  padding: 0;
  list-style: none;
}

.hp-resources__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1rem 1.25rem;
  margin-bottom: 0.75rem;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  background-color: #fff;
}

.hp-resources__text {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}

.hp-resources__title {
  font-weight: 700;
}

.hp-resources__summary {
  font-size: 0.9rem;
  color: #555;
}

.hp-resources__meta {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #888;
}

.hp-resources__button {
  flex-shrink: 0;
}

@media (max-width: 540px) {
  .hp-resources__item {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }
}

/* ---------------------------------------------------------------- Account */

.hp-details {
  margin-bottom: 2.5rem;
  padding: 1.5rem;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  background-color: #fff;
}

.hp-details h2 {
  margin-top: 0;
}

.hp-details__list {
  display: grid;
  grid-template-columns: minmax(8rem, auto) 1fr;
  gap: 0.5rem 1.5rem;
  margin: 0 0 1rem;
}

.hp-details__list dt {
  font-weight: 600;
}

.hp-details__list dd {
  margin: 0;
}

.hp-details__note {
  margin-bottom: 0;
  font-size: 0.9rem;
  color: #666;
}

@media (max-width: 480px) {
  .hp-details__list {
    grid-template-columns: 1fr;
    gap: 0.15rem;
  }

  .hp-details__list dd {
    margin-bottom: 0.75rem;
  }
}

/* ------------------------------------------------- Portal singles */

/* News, catalog item, and account pages skip the theme's overlay header, so
   give the content some breathing room below the standard header instead.
   Target the post's own wrapper, not .site-main — the theme reuses the
   .site-main class inside the footer and footer CTA, which must stay flush. */
.single-hp_news .site-main > .type-hp_news,
.single-hp_catalog_item .site-main > .type-hp_catalog_item,
.hp-route-account .hp-panel {
  margin-top: var(--wp--preset--spacing--80);
}

/* Product display also gets matching space above the footer CTA. */
.single-hp_catalog_item .site-main > .type-hp_catalog_item {
  margin-bottom: var(--wp--preset--spacing--80);
}

/* Catalog items have no editor content — everything in their constrained
   section is the plugin's spec sheet and cross-reference table — so use the
   wide width instead of the (narrower) content width. Scoped to the item's
   own post wrapper so the footer CTA's blocks keep their normal widths. */
.single-hp_catalog_item .type-hp_catalog_item > .content.is-layout-constrained > * {
  max-width: var(--wp--style--global--wide-size);
}

/* -------------------------------------------- Catalog & cross reference */

.hp-filter-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 1.25rem;
}

.hp-filter-form input[type="search"] {
  flex: 1 1 16rem;
  padding: 0.55em 0.75em;
  border: 1px solid #c9c9c9;
  border-radius: 4px;
}

.hp-filter-form select {
  padding: 0.5em 0.6em;
  border: 1px solid #c9c9c9;
  border-radius: 4px;
  max-width: 14rem;
}

.hp-filter-form__clear {
  font-size: 0.9rem;
}

.hp-catalog__count,
.hp-xref__count {
  font-size: 0.85rem;
  color: #666;
  margin-bottom: 0.5rem;
}

.hp-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.hp-table th,
.hp-table td {
  padding: 0.6em 0.75em;
  border-bottom: 1px solid #e0e0e0;
  text-align: left;
  vertical-align: top;
}

.hp-table thead th {
  border-bottom: 2px solid var(--bedstone-palette-interactive, #1a466e);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.hp-table tbody tr:nth-child(even) {
  background-color: #f7f8f9;
}

.hp-pagination {
  margin-top: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.hp-pagination .page-numbers {
  padding: 0.35em 0.7em;
  border: 1px solid #d5d5d5;
  border-radius: 4px;
  text-decoration: none;
}

.hp-pagination .page-numbers.current {
  background-color: var(--bedstone-palette-interactive, #1a466e);
  border-color: var(--bedstone-palette-interactive, #1a466e);
  color: #fff;
}

.hp-pagination .page-numbers.dots {
  border: 0;
}

/* Single catalog item */

.hp-item__back {
  margin: 0 0 1rem;
  font-size: 0.9375rem;
}

.hp-item__back a {
  text-decoration: none;
  font-weight: 600;
}

.hp-item {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  margin-bottom: 2rem;
}

.hp-item__media {
  flex: 0 1 260px;
  margin: 0;
}

.hp-item__image {
  width: 100%;
  height: auto;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
}

.hp-item__specs {
  flex: 1 1 24rem;
}

.hp-table--specs th {
  width: 11rem;
  font-weight: 600;
}

.hp-item__actions {
  margin-top: 1.25rem;
}

.hp-item__quote {
  font-weight: 600;
}

.hp-item-xref {
  margin-bottom: 2rem;
}

/* Stack catalog tables on small screens */

@media (max-width: 700px) {
  .hp-table--catalog thead,
  .hp-table--xref thead {
    display: none;
  }

  .hp-table--catalog tr,
  .hp-table--xref tr {
    display: block;
    padding: 0.5rem 0;
    border-bottom: 1px solid #e0e0e0;
  }

  .hp-table--catalog td,
  .hp-table--xref td {
    display: flex;
    gap: 0.75rem;
    padding: 0.2em 0;
    border: 0;
  }

  .hp-table--catalog td::before,
  .hp-table--xref td::before {
    content: attr(data-label);
    flex: 0 0 9rem;
    font-weight: 600;
  }
}
