/*
 * DPC theme on top of Bootstrap Italia 2.x (loaded after CKAN's main.css, see templates/base.html).
 * Only what is needed to make CKAN's own markup consistent with Bootstrap Italia.
 * Colours come from Bootstrap Italia's custom properties: change the primary colour there (A11), not here.
 */

/* ---- Typography and page background ---------------------------------------------------------- */
body {
  font-family: "Titillium Web", Geneva, Tahoma, sans-serif;
  background-color: #fff;
}

/* CKAN wraps the content in .main with its own background and padding */
.main {
  background: #fff;
  padding-top: 1.5rem;
  padding-bottom: 3rem;
}

/* ---- Header -------------------------------------------------------------------------------- */
.it-header-wrapper .dpc-brand-link {
  display: flex;
  align-items: center;
  color: inherit;
  text-decoration: none;
}

.it-header-wrapper .dpc-logo,
.it-footer .dpc-logo {
  /* official logo, 359x300 */
  width: auto;
  height: 82px;
  margin-right: 1rem;
  flex-shrink: 0;
}

@media (max-width: 991.98px) {
  .it-header-wrapper .dpc-logo {
    width: auto;
    height: 56px;
  }
}

.it-header-slim-wrapper .dropdown-toggle {
  background: transparent;
  border: 0;
  color: #fff;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: .25rem;
}

.it-header-slim-wrapper .dropdown-toggle .icon {
  fill: #fff;
}

.it-header-slim-wrapper .dpc-account .dropdown-toggle {
  display: flex;
  align-items: center;
  gap: .5rem;
}

/* "Log out" is a <button> (POST): Bootstrap Italia gives every button of the slim header a dark background (same
   selector, to win over it); here it must look like the other links of the menu */
.it-header-slim-wrapper .it-header-slim-wrapper-content .it-header-slim-right-zone form .dropdown-item,
.it-header-slim-wrapper .it-header-slim-wrapper-content .it-header-slim-right-zone form .dropdown-item:hover,
.it-header-slim-wrapper .it-header-slim-wrapper-content .it-header-slim-right-zone form .dropdown-item:focus {
  width: 100%;
  text-align: left;
  background: transparent;
  border: 0;
  box-shadow: none;
  color: var(--bs-primary, #06c);
  font-weight: 400;
}

.it-header-slim-wrapper form .dropdown-item:hover span,
.it-header-slim-wrapper form .dropdown-item:focus span {
  text-decoration: underline;
}

/* ---- Footer -------------------------------------------------------------------------------- */
.it-footer .dpc-brand-link {
  display: flex;
  align-items: center;
  color: #fff;
  text-decoration: none;
}

.it-footer .footer-heading {
  color: #fff;
}

.it-footer .dpc-powered,
.it-footer .dpc-powered a {
  color: #fff;
  font-size: .875rem;
}

/* ---- Home ---------------------------------------------------------------------------------- */
.dpc-hero {
  background-color: var(--bs-primary, #06c);
  padding: 3rem 0;
}

.dpc-hero .it-hero-text-wrapper {
  background: transparent !important;
  padding: 0;
}

.dpc-hero h1,
.dpc-hero p {
  color: #fff;
}

.dpc-hero-search {
  max-width: 48rem;
  margin-top: 1.5rem;
}

/* Input and button as one white block: no Bootstrap Italia bottom border on the input (the button has none),
   rounded outer corners on both (Bootstrap Italia forces border-radius: 0 on .form-control) */
.dpc-hero-search .form-control {
  background-color: #fff;
  border: 0;
  border-radius: 4px 0 0 4px !important;
  padding-left: 1rem;
}

.dpc-hero-search .dpc-hero-btn {
  display: flex;
  align-items: center;
  gap: .25rem;
  background-color: #fff;
  color: var(--bs-primary, #06c);
  border: 1px solid #fff;
  border-left: 1px solid #e6e9f2;
  font-weight: 600;
  padding: .5rem 1.5rem;
  /* CKAN main.css moves every .form-group .btn 2px up: aligned with the input */
  top: 0;
}

/* Bootstrap Italia gives every span of the hero text white colour and a bottom margin */
.dpc-hero-search .dpc-hero-btn span {
  color: inherit;
  margin-bottom: 0;
}

.dpc-hero-search .dpc-hero-btn:hover {
  background-color: #f2f7fc;
}

.dpc-stat {
  font-size: 2.5rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--bs-primary, #06c);
}

.dpc-home .card-wrapper .card {
  height: 100%;
}

/* ---- CKAN components on Bootstrap Italia ------------------------------------------------------ */
/* Breadcrumb. CKAN calls its breadcrumb bar ".toolbar", the name of a Bootstrap Italia component: without these
   rules it gets a fixed height and a decorative shadow (::before, 360px high, z-index 6) that rises over the header
   (z-index 5) and covers the account menu on phones ("Esci" not clickable). */
.main .toolbar {
  height: auto;
}

.main .toolbar::before {
  content: none;
}

.toolbar .breadcrumb {
  display: flex;
  flex-wrap: wrap;
  background: transparent;
  padding: 0;
  font-size: 1rem;
}

.toolbar .breadcrumb li {
  display: inline-flex;
  align-items: center;
  width: auto;
  max-width: none;
}

/* Module boxes of CKAN pages */
.module-content .page-header {
  border-bottom: 1px solid #e6e9f2;
}

/* Visible focus everywhere (WCAG 2.4.7). Form fields reached with the keyboard keep the ring of Bootstrap
   Italia (white and black box-shadow, !important), which wins over this rule. */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid #ff9900;
  outline-offset: 2px;
  box-shadow: none;
}

/* Forms: Bootstrap Italia positions .form-group labels over the field (floating labels), CKAN forms put
   them above the field. Inside CKAN's content the labels go back to the normal flow. */
.main .form-group label,
.main .form-group .form-label,
.main .form-group .control-label {
  position: static;
  transform: none;
  display: block;
  width: auto;
  margin-bottom: .25rem;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.5;
  color: #1a1a1a;
  background: transparent;
  pointer-events: auto;
}

.main .form-group {
  margin-bottom: 1.5rem;
}
