/* Colours and fonts used throughout the widget */
:root {
  --text: #17221f;
  --muted-text: #586662;
  --stirling-green: #00664f;
  --dark-green: #004b3e;
  --pale-green: #f1f7f4;
  --border: #d8e2de;
  --white: #ffffff;

  font-family: Arial, Helvetica, sans-serif;
}

/* Include padding and borders within element widths */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 260px;
  color: var(--text);
  background: transparent;
  font-size: 16px;
  line-height: 1.5;
}

/* Main container */
.widget {
  width: 100%;
  max-width: 900px;
  overflow: hidden;
  background: var(--white);
  border: 1px solid var(--border);
  border-top: 5px solid var(--stirling-green);
  border-radius: 8px;
}

/* Heading area */
.widget-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  background: var(--pale-green);
  border-bottom: 1px solid var(--border);
}

.service-name {
  margin: 0 0 3px;
  color: var(--stirling-green);
  font-size: 13px;
  font-weight: bold;
  letter-spacing: 1px;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: 26px;
  line-height: 1.2;
}

/* General links */
a {
  color: var(--stirling-green);
}

a:hover {
  color: var(--dark-green);
}

a:focus-visible {
  outline: 3px solid #f2b705;
  outline-offset: 3px;
}

.view-all-link {
  flex-shrink: 0;
  font-weight: bold;
}

/* Loading and error message area */
.status {
  min-height: 140px;
  padding: 45px 20px;
  color: var(--muted-text);
  text-align: center;
}

.status-error {
  color: var(--text);
}

.status-error strong {
  display: block;
  margin-bottom: 6px;
}

/* Opportunity list */
.opportunity-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.opportunity {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.opportunity:hover {
  background: var(--pale-green);
}

.opportunity-link {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--text);
  font-size: 17px;
  font-weight: bold;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.opportunity-description {
  margin: 6px 0 0;
  color: var(--muted-text);
}

.opportunity-description:empty,
.opportunity-date:empty {
  display: none;
}

.opportunity-date {
  margin: 7px 0 0;
  color: var(--stirling-green);
  font-size: 13px;
  font-weight: bold;
}

/* Bottom section */
.widget-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 13px 20px;
  background: var(--pale-green);
  font-size: 14px;
}

.widget-footer p {
  margin: 0;
  color: var(--muted-text);
}

.widget-footer a {
  flex-shrink: 0;
  font-weight: bold;
}

/* Narrow Canvas areas and mobile screens */
@media (max-width: 520px) {
  .widget-header {
    align-items: flex-start;
    padding: 16px;
  }

  h1 {
    font-size: 22px;
  }

  .opportunity {
    padding: 15px 16px;
  }

  .widget-footer {
    align-items: flex-start;
    flex-direction: column;
    padding: 13px 16px;
  }
}

@media (max-width: 360px) {
  .widget-header {
    flex-direction: column;
  }
}
