/* Global Link Styles - Underline by default, remove on focus */
a {
  text-decoration: underline;
}
a:hover {
  text-decoration: underline;
}
a:focus {
  text-decoration: none;
}

/* Global h1 - Left aligned */
h1 {
  text-align: left;
}

/* Skip Link - Accessible hidden link */
.skip-link{
  position:absolute;
  left:-999px;
  top:auto;
  width:1px;
  height:1px;
  overflow:hidden;
}
.skip-link:focus{
  left: 1rem;
  top: 1rem;
  width:auto;
  height:auto;
  padding: .5rem .75rem;
  background: #fff;
  border: 2px solid #000;
  z-index: 9999;
  text-decoration: none;
}

/* Brand Bar (Logo) */
.uaaw-brand-bar {
  padding: 0.75rem 1rem;
  max-width: 1400px;
  margin: 0 auto;
  text-align: center;
}
.brand-link {
  text-decoration: none;
}
.brand-link img {
  height: 50px;
  width: auto;
}
.uaaw-title {
  font-size: 2.4em;
  font-weight: bold;
  color: black;
  margin-top: 0.5rem;
}

/* Header & Navigation */
.uaaw-header {
  background: #003366;
  padding: 0.5rem 1rem;
}

/* Navigation */
.uaaw-nav {
  max-width: 1400px;
  margin: 0 auto;
}
.uaaw-nav ul{
  list-style:none;
  display:flex;
  gap: 0.25rem;
  padding:0;
  margin:0;
  flex-wrap:wrap;
}
.uaaw-nav a{
  display:inline-block;
  padding: 0.5rem 0.75rem;
  border-radius: 0.25rem;
  text-decoration: underline;
  color: #fff;
  font-weight: 500;
  transition: background-color 0.15s ease;
}
.uaaw-nav a:hover {
  background: rgba(255, 255, 255, 0.15);
  text-decoration: underline;
}
.uaaw-nav a:focus{
  outline: 3px solid #fff;
  outline-offset: 2px;
  background: rgba(255, 255, 255, 0.15);
  text-decoration: none;
}
.uaaw-flash{
  max-width: 1200px;
  margin: .5rem auto;
  padding: 0 1rem;
}
.flash{
  padding:.5rem .75rem;
  border:1px solid #333;
  border-radius:.25rem;
  margin-bottom:.5rem;
  background:#fff;
}
.visually-hidden {
  position: absolute !important;
  height: 1px; width: 1px;
  overflow: hidden;
  clip: rect(1px, 1px, 1px, 1px);
  white-space: nowrap;
}

/* Scoreboard Controls */
.scoreboard-controls fieldset {
  border: 1px solid #ccc;
  padding: 1rem;
  border-radius: 0.5rem;
  margin-bottom: 1rem;
}

.scoreboard-controls legend {
  font-weight: 600;
  padding: 0 0.5rem;
}

.control-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: flex-end;
}

.control-group {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.control-group label {
  font-weight: 500;
}

.control-group select {
  padding: 0.5rem;
  font-size: 1rem;
  border: 1px solid #666;
  border-radius: 0.25rem;
  min-width: 180px;
}

.control-group button {
  padding: 0.5rem 1.25rem;
  font-size: 1rem;
  background: #0055a5;
  color: #fff;
  border: none;
  border-radius: 0.25rem;
  cursor: pointer;
}

.control-group button:hover,
.control-group button:focus {
  background: #003d7a;
}

/* View Toggle */
.view-toggle {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.view-btn {
  padding: 0.5rem 1rem;
  font-size: 0.95rem;
  background: #f0f0f0;
  border: 2px solid #666;
  border-radius: 0.25rem;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.view-btn:hover,
.view-btn:focus {
  background: #e0e0e0;
  border-color: #333;
}

.view-btn.active {
  background: #0055a5;
  color: #fff;
  border-color: #0055a5;
}

.view-btn:focus {
  outline: 3px solid #000;
  outline-offset: 2px;
}

/* Ensure hidden attribute works with display overrides */
[hidden] {
  display: none !important;
}

/* Agency Cards Grid */
.agency-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
  padding: 0;
  margin: 0;
}

.agency-card {
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 0.5rem;
  padding: 1rem;
  box-shadow: 0 2px 4px rgba(0,0,0,0.08);
}

.agency-card:hover {
  box-shadow: 0 4px 8px rgba(0,0,0,0.12);
}

.agency-card-title {
  font-size: 1.1rem;
  margin: 0 0 0.75rem 0;
  line-height: 1.3;
}

.agency-card-title a {
  color: #0055a5;
  text-decoration: none;
}

.agency-card-title a:hover,
.agency-card-title a:focus {
  text-decoration: underline;
}

.agency-card-title a:focus {
  outline: 3px solid #0055a5;
  outline-offset: 2px;
}

/* Card Data (Definition List) */
.agency-card-data {
  margin: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.data-item {
  display: flex;
  flex-direction: column;
}

.data-item dt {
  font-size: 0.8rem;
  color: #555;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.data-item dd {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
}

.data-item-score {
  grid-column: span 2;
  text-align: center;
  background: #f5f5f5;
  padding: 0.5rem;
  border-radius: 0.25rem;
  margin-bottom: 0.25rem;
}

.data-item-score dd {
  font-size: 1.5rem;
}

/* Score color coding */
.score-high {
  color: #1a7f37;
}

.score-medium {
  color: #9a6700;
}

.score-low {
  color: #cf222e;
}

.critical-highlight {
  color: #cf222e;
}

/* Table container */
.table-container {
  overflow-x: auto;
}

.table-container table {
  width: 100%;
  border-collapse: collapse;
}

.table-container th,
.table-container td {
  padding: 0.5rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid #ddd;
}

.table-container th {
  background: #f5f5f5;
  font-weight: 600;
}

.table-container tbody tr:hover {
  background: #f9f9f9;
}

/* Responsive adjustments */
@media (max-width: 600px) {
  .control-row {
    flex-direction: column;
    align-items: stretch;
  }
  
  .control-group select {
    min-width: 100%;
  }
  
  .agency-cards {
    grid-template-columns: 1fr;
  }
  
  .agency-card-data {
    grid-template-columns: 1fr 1fr;
  }
}

@media (min-width: 900px) {
  .agency-cards {
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  }
}

/* Footer */
.uaaw-footer {
  background: #003366;
  padding: 1rem;
  margin-top: 2rem;
}
.uaaw-footer nav {
  max-width: 1400px;
  margin: 0 auto;
}
.uaaw-footer ul {
  list-style: none;
  display: flex;
  gap: 1.5rem;
  padding: 0;
  margin: 0;
  justify-content: center;
  flex-wrap: wrap;
}
.uaaw-footer a {
  color: #fff;
  text-decoration: underline;
  font-weight: 500;
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
  transition: background-color 0.15s ease;
}
.uaaw-footer a:hover {
  background: rgba(255, 255, 255, 0.15);
}
.uaaw-footer a:focus {
  outline: 3px solid #fff;
  outline-offset: 2px;
  background: rgba(255, 255, 255, 0.15);
  text-decoration: none;
}
