/* =========================
   Shared overlay wiring
   Applies to ALL variants
   ========================= */

.library-header {
  position: relative;
  isolation: isolate;
}

.library-header::before {
  content: '';
  position: absolute;
  inset: 0;

  background-image: var(--lib-bg-image, none);
  background-size: cover;
  background-repeat: no-repeat;
  background-position: top;
  background-attachment: fixed;

  border-radius: inherit;
  z-index: -2;
  pointer-events: none;
}

.library-header::after {
  content: '';
  position: absolute;
  inset: 0;

  background-color: var(--overlay-color, transparent);

  border-radius: inherit;
  z-index: -1;
  pointer-events: none;
}

.library-header > * {
  position: relative;
  z-index: 1;
}

/* Shared form structure */
.library-hero .search-section form,
.library-basic .search-section form {
  width: 100%;
}

.library-hero .search-section,
.library-basic .search-section {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.library-hero .search-box,
.library-basic .search-box {
  display: flex;
  align-items: stretch;
  width: 100%;
  flex-wrap: nowrap;
  background-color: #fff;
  border-radius: 5px;
  overflow: hidden;
}

.library-hero .search-box__logo,
.library-basic .search-box__logo {
  display: flex;
  align-items: center;
  padding: 0 8px;
  background: transparent;
}

.library-hero .search-logo,
.library-basic .search-logo {
  height: 40px;
  width: auto;
  display: block;
}

.library-hero .search-input,
.library-basic .search-input {
  flex: 1;
  min-width: 0;
  padding: 14px 12px;
  font-size: 16px;
  border: 0;
  border-left: 1px solid #d9d9d9;
  height: 56px;
  background: #fff;
  box-sizing: border-box;
}

.library-hero .search-button,
.library-basic .search-button {
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #ffc423;
  background-color: #ffc423;
  padding: 0 16px;
  font-size: 16px;
  cursor: pointer;
  height: 56px;
}

.library-hero .visually-hidden,
.library-basic .visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  border: 0;
}

@media (min-width: 992px) {
  .library-hero .quick-links a:not(:first-of-type),
  .library-basic .quick-links a:not(:first-of-type) {
    border-left: 1px solid #ccc;
    padding-left: 10px;
  }
}

/* =========================
   BASIC variant
   data-style="basic"
   ========================= */

.library-basic span.header-text {
  font-size: 24px;
}

.library-basic .library-header {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  max-width: 1200px;
  margin: 30px auto;
  position: relative;
  overflow: hidden;

  /* basic variant: no padding, no fallback background */
  padding: 0;
  background-color: transparent;
}

/* basic variant: search box has a border */
.library-basic .search-box {
  border: 1px solid #bbbbbb;
}

/* basic variant: quick links align left */
.library-basic .quick-links {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-start;
  width: 100%;
}

.library-basic .quick-links a {
  font-size: 17px;
  text-decoration: none;
  white-space: nowrap;
}

.library-basic .quick-links a:focus,
.library-basic .quick-links a:hover {
  text-decoration: underline;
}

@media (max-width: 768px) {
  .library-basic .quick-links {
    flex-direction: column;
    align-items: center;
    gap: 8px;
  }
}

/* =========================
   HERO variant
   data-style="hero"
   ========================= */

.library-hero span.header-text {
  color: #fff;
  font-size: 24px;
  font-weight: bold;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.library-hero .library-header {
  background-color: rgba(63, 121, 182, 0.92); /* hero fallback */
  border-radius: 10px;
  padding: 30px;
  display: flex;
  flex-direction: column;
  align-items: center; /* hero centers content */
  gap: 10px;
  max-width: 1200px;
  margin: 0 auto 20px;
  position: relative;
  overflow: hidden;
}

/* hero variant: centered quick links + max width */
.library-hero .quick-links {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  width: 100%;
  max-width: 800px;
}

.library-hero .quick-links a {
  color: #fff;
  font-size: 17px;
  text-shadow: 0 1px 1px #000;
  text-decoration: none;
  white-space: nowrap;
  font-weight: bold;
}

.library-hero .quick-links a:focus,
.library-hero .quick-links a:hover {
  text-decoration: underline;
}

/* hero variant: rounded button right corners */
.library-hero .search-button {
  border-top-right-radius: 5px;
  border-bottom-right-radius: 5px;
}

/* hero variant: horizontal padding on search-section */
.library-hero .search-section {
  padding-inline: 16px;
  box-sizing: border-box;
}

@media (max-width: 768px) {
  .library-hero .library-header {
    padding: 20px;
  }

  .library-hero .quick-links {
    flex-direction: column;
    align-items: center;
    gap: 8px;
  }
}

@media (min-width: 768px) {
  .library-hero .search-section {
    padding-inline: 24px;
  }
}

@media (min-width: 1200px) {
  .library-hero .search-section {
    padding-inline: 32px;
  }
}
