/**
 * Awards module — year toggle, filters, award cards, overall country table.
 * Matches the Awards mockup; not the prose-column treatment.
 */

.dwc-awards {
  --awards-accent: #c8102e;
  --awards-accent-hover: #a50d26;
  --awards-ink: #111;
  --awards-body: #222;
  --awards-muted: #777;
  --awards-line: #ececec;
  --awards-soft: #f4f4f4;
  --awards-radius: 14px;
  --awards-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 10px 28px rgba(0, 0, 0, 0.08);

  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 24px 88px;
  color: var(--awards-body);
}

/* —— Header —— */
.dwc-awards-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.25rem 2rem;
  margin-bottom: 2rem;
}

.dwc-awards-head h1 {
  margin: 0 0 0.35rem;
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--awards-ink);
}

.dwc-awards-sub {
  margin: 0;
  font-size: 1.02rem;
  color: var(--awards-muted);
}

/* —— Filters —— */
.dwc-awards-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  margin-bottom: 0.85rem;
}

.dwc-awards-toolbar h2 {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--awards-ink);
}

.dwc-awards-count {
  font-size: 0.9rem;
  color: var(--awards-muted);
}

.dwc-awards-bar {
  position: sticky;
  top: calc(var(--dwch-sticky-top, 0px) + 0.5rem);
  z-index: 150;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.65rem 0.85rem;
  margin: 0 0 2rem;
  padding: 0.4rem 0.5rem;
  border: 1px solid var(--awards-line);
  border-radius: 12px;
  background: rgba(244, 245, 247, 0.94);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.06);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.dwc-awards-seg {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border-radius: 10px;
  background: #e8eaed;
}

.dwc-awards-seg-btn {
  min-height: 32px;
  padding: 0 0.85rem;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #555;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.dwc-awards-seg-btn:hover {
  color: var(--awards-ink);
}

.dwc-awards-seg-btn.is-active {
  background: #fff;
  color: var(--awards-ink);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.dwc-awards-bar-divider {
  flex: none;
  width: 1px;
  align-self: stretch;
  min-height: 24px;
  background: #d5d8de;
}

.dwc-awards-dds {
  display: flex;
  flex: none;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.45rem;
}

.dwc-awards-dd {
  position: relative;
  display: inline-flex;
  flex: none;
  margin: 0;
}

.dwc-awards-dd select {
  appearance: none;
  -webkit-appearance: none;
  width: auto;
  max-width: none;
  min-height: 32px;
  padding: 0 1.85rem 0 0.75rem;
  border: 1px solid #d5d8de;
  border-radius: 8px;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%23666' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 0.65rem center;
  color: #444;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
}

.dwc-awards-dd select:hover,
.dwc-awards-dd select:focus {
  border-color: #b8bcc4;
  outline: none;
}

.dwc-awards-dd select.is-filtered {
  border-color: var(--awards-accent);
  color: var(--awards-ink);
}

.dwc-awards-clear {
  flex: none;
  margin-left: auto;
  min-height: 32px;
  padding: 0 0.85rem;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #666;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.dwc-awards-clear:hover {
  background: #e8eaed;
  color: var(--awards-ink);
}

.dwc-awards-clear[hidden] {
  display: none;
}

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

/* —— Category sections —— */
.dwc-awards-section {
  margin: 0 0 2.5rem;
}

.dwc-awards-section[hidden] {
  display: none !important;
}

.dwc-awards-section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem 0.75rem;
  margin: 0 0 1rem;
}

.dwc-awards-section-head h3 {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--awards-ink);
}

.dwc-awards-age-badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 0.65rem;
  border-radius: 999px;
  background: var(--awards-soft);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #555;
}

.dwc-awards-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.15rem;
}

.dwc-awards-card[hidden] {
  display: none !important;
}

.dwc-awards-card {
  display: flex;
  flex-direction: column;
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--awards-line);
  border-radius: var(--awards-radius);
  background: #fff;
  box-shadow: var(--awards-shadow);
}

.dwc-awards-card-media {
  position: relative;
  aspect-ratio: 3 / 4;
  background: #ebebeb;
  overflow: hidden;
}

.dwc-awards-card-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.dwc-awards-card-ph {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  font-weight: 500;
  color: #9a9a9a;
}

.dwc-awards-card-body {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex: 1;
  padding: 0.95rem 1rem 1.1rem;
}

.dwc-awards-badge {
  display: inline-flex;
  align-self: flex-start;
  align-items: center;
  min-height: 22px;
  margin-bottom: 0.15rem;
  padding: 0 0.55rem;
  border-radius: 999px;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.dwc-awards-badge-winner {
  background: var(--awards-accent);
  color: #fff;
}

.dwc-awards-badge-runner {
  background: #4b5563;
  color: #fff;
}

.dwc-awards-card-title {
  margin: 0;
  font-size: 0.84rem;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: 0.02em;
  color: #444;
}

.dwc-awards-card-winner {
  margin: 0.2rem 0 0;
  font-size: 1.12rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--awards-ink);
}

.dwc-awards-card-studio,
.dwc-awards-card-country {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.4;
  color: var(--awards-muted);
}

.dwc-awards-card-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: auto;
  padding-top: 0.75rem;
  color: #2563eb;
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
}

.dwc-awards-card-link:hover {
  text-decoration: underline;
}

.dwc-awards-card-link.is-disabled {
  color: #9aa3b2;
  pointer-events: none;
}

.dwc-awards-card-link-icon {
  width: 14px;
  height: 14px;
  flex: none;
}

.dwc-awards-empty {
  margin: 0 0 2rem;
  padding: 1.5rem;
  border: 1px dashed #ddd;
  border-radius: var(--awards-radius);
  text-align: center;
  color: var(--awards-muted);
  font-size: 0.98rem;
}

.dwc-awards-empty[hidden] {
  display: none !important;
}

/* —— Overall —— */
.dwc-awards-overall {
  margin-top: 0.5rem;
  padding-top: 0.25rem;
}

.dwc-awards-overall-head {
  margin: 0 0 1.25rem;
}

.dwc-awards-overall-head h2 {
  margin: 0 0 0.35rem;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--awards-ink);
}

.dwc-awards-overall-head p {
  margin: 0;
  font-size: 0.98rem;
  color: var(--awards-muted);
}

.dwc-awards-overall-filter {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem 1rem;
  margin: 0 0 1rem;
}

.dwc-awards-overall-label {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--awards-muted);
}

.dwc-awards-select-wrap {
  position: relative;
  flex: 1 1 16rem;
  max-width: 28rem;
}

.dwc-awards-select-wrap::after {
  content: '';
  position: absolute;
  top: 50%;
  right: 0.95rem;
  width: 0.45rem;
  height: 0.45rem;
  border-right: 2px solid #555;
  border-bottom: 2px solid #555;
  transform: translateY(-65%) rotate(45deg);
  pointer-events: none;
}

.dwc-awards-select-wrap > .dwc-awards-select {
  width: 100%;
  min-height: 42px;
  padding: 0.55rem 2.25rem 0.55rem 0.95rem;
  border: 1px solid #d8d8d8;
  border-radius: 10px;
  background: #fff;
  color: var(--awards-ink);
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.3;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}

.dwc-awards-select-wrap > .dwc-awards-select:hover {
  border-color: #bbb;
}

.dwc-awards-select-wrap > .dwc-awards-select:focus {
  outline: 2px solid #222;
  outline-offset: 2px;
}

.dwc-awards-panel[hidden] {
  display: none !important;
}

.dwc-awards-table-wrap {
  max-height: 360px;
  overflow: auto;
  border: 1px solid var(--awards-line);
  border-radius: var(--awards-radius);
  background: #fff;
  box-shadow: var(--awards-shadow);
}

.dwc-awards-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.dwc-awards-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 0.75rem 1rem;
  background: #fafafa;
  border-bottom: 1px solid var(--awards-line);
  text-align: left;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--awards-muted);
}

.dwc-awards-table td {
  padding: 0.8rem 1rem;
  border-bottom: 1px solid var(--awards-line);
  vertical-align: middle;
  color: var(--awards-body);
}

.dwc-awards-table tr:last-child td {
  border-bottom: 0;
}

.dwc-awards-place-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  font-weight: 700;
  color: #666;
  background: transparent;
}

.dwc-awards-place-num.is-first {
  background: var(--awards-accent);
  color: #fff;
}

.dwc-awards-country {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
}

.dwc-awards-flag {
  width: 22px;
  height: 16px;
  object-fit: cover;
  border-radius: 2px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08);
  background: var(--awards-soft);
}

.dwc-awards-flag-fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 16px;
  border-radius: 2px;
  background: var(--awards-soft);
  font-size: 0.55rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #888;
}

@media (max-width: 1100px) {
  .dwc-awards-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 800px) {
  .dwc-awards-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 600px) {
  .dwc-awards {
    padding: 28px 16px 64px;
  }

  .dwc-awards-head h1 {
    font-size: 1.55rem;
  }

  .dwc-awards-bar {
    flex-wrap: wrap;
    padding: 0.4rem;
  }

  .dwc-awards-dds {
    flex-wrap: wrap;
  }

  .dwc-awards-grid {
    grid-template-columns: 1fr;
  }
}
