@import url("https://fonts.googleapis.com/css2?family=Atkinson+Hyperlegible:wght@400;700&family=Source+Sans+3:wght@400;600;700&display=swap");

:root {
  color-scheme: light;
  --kph-ink: #0b1f2a;
  --kph-ink-muted: #24414d;
  --kph-primary: #0f6b7a;
  --kph-primary-dark: #0a5160;
  --kph-accent: #d8801f;
  --kph-accent-dark: #b16516;
  --kph-bg: #f6f8f7;
  --kph-surface: #ffffff;
  --kph-border: #c6d3d8;
  --kph-focus: #0b1f2a;
  --kph-shadow: 0 10px 30px rgba(6, 28, 39, 0.12);
  --kph-radius: 14px;
  --kph-radius-sm: 10px;
  --kph-max: 1100px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  * {
    transition: none !important;
    animation: none !important;
  }
}

body.kph {
  margin: 0;
  background: radial-gradient(circle at top, #f0f6f5 0%, #f6f8f7 35%, #eef1f3 100%);
  color: var(--kph-ink);
  font-family: "Source Sans 3", "Segoe UI", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
}

img {
  max-width: 100%;
  height: auto;
}

a {
  color: var(--kph-primary-dark);
  text-decoration: underline;
  text-underline-offset: 3px;
}

a:hover {
  color: var(--kph-primary);
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--kph-focus);
  outline-offset: 2px;
}

.skip-link {
  position: absolute;
  left: 10px;
  top: -40px;
  background: #000000;
  color: #ffffff;
  padding: 10px 14px;
  border-radius: 8px;
  z-index: 1000;
}

.skip-link:focus {
  top: 10px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

#container {
  max-width: var(--kph-max);
  margin: 0 auto;
  padding: 18px 18px 0;
}

#header {
  background: #ffffff;
  color: var(--kph-ink);
  border: 2px solid var(--kph-primary);
  border-radius: 12px;
  padding: 20px 22px;
  box-shadow: 0 8px 20px rgba(6, 28, 39, 0.06);
}

#header img {
  display: block;
  margin: 8px 0 0;
  max-height: 70px;
}

#menu-bottom {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 12px;
}

#menu-bottom-item {
  background-color: transparent;
}

#menu-bottom-item a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 16px;
  border-radius: 8px;
  background: var(--kph-primary);
  color: #ffffff;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-decoration: none;
  border: 2px solid var(--kph-primary);
}

#menu-bottom-item a:hover {
  background: var(--kph-primary-dark);
  border-color: var(--kph-primary-dark);
  color: #ffffff;
}

#menu-bottom-item a:focus-visible {
  outline-color: var(--kph-focus);
}

#ScoreLegend {
  margin-top: 18px;
}

#ScoreGuide {
  width: 100%;
  margin-left: 0;
}

#ScoreGuide td {
  padding: 6px 0;
}

input[type="submit"],
button,
.aspNetButton {
  appearance: none;
  border: none;
  border-radius: 999px;
  background: #56215e;
  color: #ffffff;
  font-weight: 400;
  padding: 12px 20px;
  min-height: 44px;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(86, 33, 94, 0.2);
}

input[type="submit"]:hover,
button:hover {
  background: #421847;
}

#content {
  max-width: var(--kph-max);
  margin: 24px auto 40px;
  padding: 18px;
  width: 90%; /* keeps at least 5% clear on the left and right */
  background: #ffffff;
  border: 2px solid var(--kph-primary);
  border-radius: 12px;
  box-shadow: 0 8px 20px rgba(6, 28, 39, 0.06);
}

#table1 {
  width: 100%;
  margin-left: 0;
}

.BoxedHeaderLeft {
  display: block;
  font-family: "Atkinson Hyperlegible", "Source Sans 3", "Segoe UI", Arial, sans-serif;
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--kph-ink);
  margin: 0 0 12px;
}

.bluebold {
  display: block;
  color: var(--kph-primary-dark);
  font-weight: 700;
  margin: 18px 0 10px;
}

.BlackStandard {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--kph-surface);
  border: 2px solid var(--kph-primary);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 8px 20px rgba(6, 28, 39, 0.06);
}

.BlackStandard th {
  background: var(--kph-primary-dark) !important;
  color: #ffffff;
  text-align: left;
  padding: 12px 14px;
  font-weight: 700;
}

.BlackStandard td {
  padding: 12px 14px;
  color: var(--kph-ink);
  border-top: 1px solid var(--kph-border);
  vertical-align: top;
}

.BlackStandard tr:nth-child(even) td {
  background: #f4f7f8;
}

.BlackStandard a {
  color: var(--kph-primary-dark);
  font-weight: 600;
  text-decoration: underline;
}

.BlackStandard span {
  text-decoration: none !important;
}

.Hidden {
  display: none !important;
}

.modalPopup {
  background: var(--kph-surface);
  border-radius: var(--kph-radius-sm);
  box-shadow: var(--kph-shadow);
  padding: 16px;
}

@media (max-width: 900px) {
  #header {
    padding: 16px;
  }

  #menu-bottom {
    justify-content: flex-start;
  }

  #menu-bottom-item a {
    width: 100%;
    text-align: center;
  }

  .BlackStandard th,
  .BlackStandard td {
    padding: 10px 12px;
  }
}

@media (max-width: 720px) {
  #content,
  #container {
    padding-left: 14px;
    padding-right: 14px;
  }

  .BoxedHeaderLeft {
    font-size: 1.35rem;
  }
}


body.kph.search-page {
  margin: 0;
  background: #ffffff;
}

body.kph.search-page .page-shell {
  max-width: var(--kph-max);
  margin: 0 auto;
  padding: 24px 16px 40px;
}

body.kph.search-page .form-card {
  background: var(--kph-surface);
  border: 1px solid var(--kph-border);
  border-radius: 18px;
  box-shadow: 0 8px 18px rgba(6, 28, 39, 0.05);
  overflow: hidden;
}

body.kph.search-page .card-body {
  padding: 18px;
}

body.kph.search-page .hero-card {
  background: linear-gradient(180deg, #ffffff 0%, #f7fbfc 100%);
  border: 1px solid var(--kph-border);
  border-radius: 20px;
  padding: 22px;
  margin-bottom: 20px;
}

body.kph.search-page .kph-breadcrumb {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 14px;
  padding: 0;
  color: #000000;
}

body.kph.search-page .kph-breadcrumb-button {
  display: inline-flex;
  align-items: center;
  gap: 0;
  padding: 0;
  margin: 0;
  border: 0;
  background: transparent;
  color: #000000;
  box-shadow: none;
  min-height: 0;
  appearance: none;
  -webkit-appearance: none;
  font-family: "Atkinson Hyperlegible", "Source Sans 3", "Segoe UI", Arial, sans-serif;
  font-size: 1.3rem;
  line-height: 1.1;
  font-weight: 400;
  text-decoration: none;
  cursor: pointer;
}

body.kph.search-page .kph-breadcrumb-button:hover {
  background: transparent;
  color: #56215e;
  text-decoration: none;
}

body.kph.search-page .kph-breadcrumb:hover {
  color: #56215e;
}

body.kph.search-page .kph-breadcrumb-button::before {
  content: "\f060";
  display: inline-block;
  margin-right: 0.55rem;
  font-family: "Font Awesome 6 Free";
  font-size: 1em;
  font-weight: 900;
  line-height: 1;
  color: currentColor;
  transform: translateY(0.02em);
}

body.kph.search-page .kph-breadcrumb-button:focus-visible {
  outline: 3px solid var(--kph-focus);
  outline-offset: 2px;
}

body.kph.search-page .hero-logo {
  max-width: 260px;
  height: auto;
  display: block;
  margin-bottom: 18px;
}

body.kph.search-page .eyebrow {
  color: var(--kph-primary-dark);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 800;
  font-size: 0.82rem;
  margin-bottom: 0.35rem;
}

body.kph.search-page .intro {
  color: var(--kph-ink-muted);
  max-width: 72ch;
  margin-bottom: 0;
}

body.kph.search-page .kph-info-alert {
  background: #e9f4fb;
  border: 1px solid #8ec0e0;
  color: #0b4f78;
  border-radius: 14px;
  padding: 10px 12px;
  box-shadow: none;
  margin-bottom: 1rem !important;
}

body.kph.search-page .kph-info-alert i {
  color: #0b74b5;
  font-size: 2rem;
  line-height: 1;
  flex: 0 0 auto;
}

body.kph.search-page .form-label {
  font-weight: 700;
  color: var(--kph-ink);
  margin-bottom: 0.35rem;
}

body.kph.search-page .form-control,
body.kph.search-page .form-select {
  min-height: 46px;
  border-radius: 12px;
  border-color: #cbd9de;
}

body.kph.search-page .form-control:focus,
body.kph.search-page .form-select:focus {
  border-color: var(--kph-primary);
  box-shadow: 0 0 0 0.25rem rgba(15, 107, 122, 0.15);
}

body.kph.search-page .btn-kph {
  min-height: 46px;
  border-radius: 12px;
  background: #56215e;
  color: #ffffff;
  font-weight: 400;
  border: 1px solid #56215e;
  box-shadow: 0 8px 18px rgba(86, 33, 94, 0.2);
}

body.kph.search-page .btn-kph:hover {
  background: #421847;
  border-color: #421847;
  color: #ffffff;
}

body.kph.search-page .btn-kph-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 10px 18px;
  border-radius: 12px;
  border: 1px solid #56215e;
  background: #56215e;
  color: #ffffff;
  font-weight: 400;
  white-space: nowrap;
  flex: 0 0 auto;
  width: max-content;
  max-width: none;
  text-decoration: none;
  box-shadow: 0 8px 18px rgba(86, 33, 94, 0.2);
}

body.kph.search-page .btn-kph-link:hover {
  background: #421847;
  border-color: #421847;
  color: #ffffff;
  text-decoration: none;
}

body.kph.search-page .note-label {
  color: #8a1f2d;
}

@media (max-width: 768px) {
  body.kph.search-page .page-shell {
    padding: 14px 12px 30px;
  }

  body.kph.search-page .form-card,
  body.kph.search-page .hero-card {
    border-radius: 16px;
  }

  body.kph.search-page .hero-logo {
    max-width: 220px;
  }
}

body.kph.search-page .kph-warning-alert {
  background: #fff4cc;
  border: 1px solid #e1bd52;
  color: #000000;
  border-radius: 14px;
  padding: 10px 12px;
  box-shadow: none;
}

body.kph.search-page .kph-warning-alert i {
  color: #c78f00;
  font-size: 1.35rem;
  line-height: 1;
  flex: 0 0 auto;
}

body.kph.search-page .kph-search-error-alert {
  position: relative;
  display: block;
  margin-bottom: 1rem !important;
  padding: 14px 16px 14px 58px;
  border-radius: 14px;
  border: 1px solid #c76a72 !important;
  background: #fbecee !important;
  color: #000000 !important;
  font-weight: 700;
  letter-spacing: 0.01em;
  box-shadow: 0 8px 18px rgba(139, 16, 32, 0.06);
}

body.kph.search-page .kph-search-error-alert::before {
  content: "!";
  position: absolute;
  left: 16px;
  top: 50%;
  width: 26px;
  height: 26px;
  transform: translateY(-50%);
  border-radius: 50%;
  background: #fbecee !important;
  color: #8c1020 !important;
  border: 2px solid #8c1020 !important;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 800;
  line-height: 1;
  box-shadow: none;
}


/* =========================================================
   Food Establishment Scores page (FoodScoreRecords.aspx)
   ========================================================= */

/* Visible heading text for the page (use a real <h1>) */
h1.BoxedHeaderLeft {
  margin: 0 0 12px;
}

/* "Selected establishment" banner - the "you are here" marker */
.establishment-banner {
  display: block;
  margin: 0 0 22px;
  padding: 16px 22px 18px;
  background: #ffffff;
  border: 2px solid var(--kph-primary);
  border-left: 8px solid var(--kph-primary);
  border-radius: var(--kph-radius-sm);
  color: #0b1f2a;
}

.establishment-banner p,
.establishment-banner h2 {
  margin: 0;
  overflow-wrap: anywhere;
}

/* Small caps-style label on top */
.establishment-banner .est-label {
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--kph-primary-dark);
  margin-bottom: 2px;
}

/* Establishment name: the focal point */
.establishment-banner .est-name {
  font-family: "Atkinson Hyperlegible", "Source Sans 3", "Segoe UI", Arial, sans-serif;
  font-size: 1.9rem;
  font-weight: 700;
  line-height: 1.2;
  color: #0b1f2a;
}

/* Address under the name, lighter weight */
.establishment-banner .est-address {
  margin-top: 6px;
  padding-top: 8px;
  border-top: 1px solid var(--kph-border);
  font-size: 1.15rem;
  font-weight: 400;
  color: var(--kph-ink-muted);
}

/* Fallback when the header text is a message rather than "Label: Name" */
.establishment-banner .est-message {
  font-size: 1.35rem;
  font-weight: 600;
}

@media (max-width: 720px) {
  .establishment-banner {
    padding: 14px 16px 16px;
  }
  .establishment-banner .est-name {
    font-size: 1.5rem;
  }
}

/* Logo above the page heading */
.hero-logo {
  display: block;
  max-width: 260px;
  height: auto;
  margin: 0 0 18px;
}

/* Empty legend panel should take no space */
#ScoreLegend:empty {
  display: none;
  margin: 0;
}

/* Scroll wrapper keeps real table semantics on small screens.
   Wrap the grid:  <div class="table-scroll" role="region"
   aria-labelledby="score-caption" tabindex="0"> ... </div>        */
.table-scroll {
  width: 100%;
  overflow-x: auto;
  border-radius: 8px;
}

.table-scroll:focus-visible {
  outline: 3px solid var(--kph-focus);
  outline-offset: 2px;
}

/* Table caption (set GridView Caption="...") */
.BlackStandard caption {
  caption-side: top;
  text-align: left;
  padding: 0 0 10px;
  font-family: "Atkinson Hyperlegible", "Source Sans 3", "Segoe UI", Arial, sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--kph-ink);
}

.BlackStandard {
  min-width: 720px;
}

/* Column helpers (add via ItemStyle-CssClass / HeaderStyle-CssClass) */
.BlackStandard .col-date {
  white-space: nowrap;
}

.BlackStandard .col-score {
  white-space: nowrap;
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

.BlackStandard th.col-score {
  text-align: right;
}

/* View Report link / icon link */
.BlackStandard a.view-report,
.BlackStandard td a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;           /* WCAG 2.2 target size */
  min-width: 44px;
  padding: 6px 4px;
}

.BlackStandard a:hover {
  color: var(--kph-primary);
  text-decoration-thickness: 2px;
}

.BlackStandard a:focus-visible {
  outline: 3px solid var(--kph-focus);
  outline-offset: 2px;
  background: #ffffff;
}

/* Header logo on this page */
#header img,
.hero-logo {
  max-width: 260px;
  height: auto;
}

/* Windows High Contrast / forced colors */
@media (forced-colors: active) {
  .BlackStandard,
  .BlackStandard th,
  .BlackStandard td {
    border: 1px solid CanvasText;
  }
  a:focus-visible,
  button:focus-visible,
  .table-scroll:focus-visible {
    outline: 3px solid Highlight;
  }
}

@media print {
  body.kph {
    background: #ffffff;
  }
  .skip-link,
  #menu-bottom {
    display: none;
  }
  .table-scroll {
    overflow: visible;
  }
}


/* ---- Additions for DataGrid / action column ---- */

/* DataGrid renders header cells as <td>, so style the header row directly */
.BlackStandard .grid-header td {
  background: var(--kph-primary-dark);
  color: #ffffff;
  font-weight: 700;
}

.BlackStandard .col-action {
  width: 1%;
  white-space: nowrap;
  text-align: center;
}

/* Image buttons: 44px target size (icon file is a 44px rounded button) */
.BlackStandard input[type="image"] {
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  border-radius: 10px;
  background: transparent;
  box-shadow: none;
  vertical-align: middle;
}

.BlackStandard input[type="image"]:hover {
  filter: brightness(0.8);
}


/* ---- Legend (GMV = Geometric Mean Value), used on WaterStationRecords ---- */
dl.score-guide {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 14px;
  margin: 0 0 12px;
  color: var(--kph-ink);
}

dl.score-guide dt {
  font-weight: 700;
  color: var(--kph-primary-dark);
}

dl.score-guide dd {
  margin: 0;
}


/* ---- Logo + legend block at the top of the content box ---- */
.page-top {
  margin: 0 0 22px;
  padding: 0 0 18px;
  border-bottom: 1px solid var(--kph-border);
}

.page-top #ScoreLegend {
  margin-top: 0;
}

.page-top dl.score-guide:last-child {
  margin-bottom: 0;
}
