:root {
  --color-bg: #f7f7f2;
  --color-surface: #ffffff;
  --color-primary: #3f2a6d;
  --color-secondary: #121212;
  --color-accent: #d4af37;
  --color-border: #808080;
  --color-sidebar: #ff19f0;
  --color-sidebar-link-text: #1a1400;
  --color-sidebar-link-bg: #ffd700;
  --color-sidebar-link-bg-hover: #ffe566;
  --color-sidebar-link-bg-visited: #e6c84a;
}

body {
  margin: 0;
  font-family: "Times New Roman", Arial, Helvetica, sans-serif;
  font-size: 16px;
  background-color: var(--color-bg);
  color: var(--color-secondary);
  line-height: 1.55;
}

/* Masthead: logo (start) | site title (true center) | menu (end) */
.site-top {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px 16px;
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-bottom: 2px solid var(--color-border);
  padding: 12px 16px;
  box-sizing: border-box;
}

.site-top-brand {
  justify-self: start;
  display: flex;
  align-items: center;
}

.site-title {
  margin: 0;
  justify-self: center;
  text-align: center;
  color: var(--color-primary);
  font-family: "Times New Roman", serif, "Lora";
  font-size: clamp(1.05rem, 2.2vw, 1.65rem);
  font-weight: 600;
  line-height: 1.2;
  max-width: 100%;
  overflow-wrap: break-word;
}

.site-top-nav {
  justify-self: end;
  display: flex;
  align-items: center;
  min-width: 0;
}

.site-top .logo-link {
  background-color: white;
  padding: 8px;
  text-decoration: none;
  border: 1px solid var(--color-border);
  display: flex;
  justify-content: center;
  align-items: center;
  width: fit-content;
  margin: 0;
}

.site-top .logo-link img {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.site-top .logo-link:hover img,
.site-top .logo-link:focus-visible img {
  transform: scale(1.06) rotate(-2deg);
  box-shadow: 0 4px 12px rgba(63, 42, 109, 0.35);
}

header h2 {
  margin: 6px 0 0;
  color: var(--color-secondary);
  font-size: 1.1rem;
  font-weight: 600;
  text-align: center;
}

/* Primary navigation: CSS-only dropdown (hover + :checked for tap/keyboard) */
.site-nav {
  background-color: var(--color-surface);
  position: relative;
  border: 1px solid var(--color-border);
  padding: 10px;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  z-index: 50;
}

.nav-dropdown {
  position: relative;
  display: inline-block;
  margin: 0;
}

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

.menu-trigger {
  display: block;
  margin: 0;
  padding: 10px 20px;
  border: 1px solid var(--color-border);
  background-color: var(--color-surface);
  color: var(--color-secondary);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  cursor: pointer;
  box-sizing: border-box;
  min-width: 140px;
  font-family: inherit;
  transition: color 0.25s ease, background-color 0.25s ease, transform 0.2s ease;
}

.menu-trigger:hover {
  color: #ffd700;
  background-color: #2f2f2f;
  transform: translateY(-1px);
}

.menu-checkbox:focus-visible + .menu-trigger {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

.dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  /* Menu sits on the right (.site-nav flex-end); anchor panel to the right so it
     grows left into the viewport instead of off the right edge of the window. */
  left: auto;
  right: 0;
  margin: 0;
  padding: 0;
  list-style: none;
  min-width: 100%;
  width: max-content;
  max-width: min(100vw - 32px, 320px);
  max-height: min(70vh, 22rem);
  overflow-x: hidden;
  overflow-y: auto;
  border: 1px solid var(--color-border);
  background-color: var(--color-surface);
  z-index: 300;
  box-sizing: border-box;
}

@keyframes dropdown-reveal {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.nav-dropdown:hover .dropdown-menu,
.nav-dropdown:focus-within .dropdown-menu,
.menu-checkbox:checked ~ .dropdown-menu {
  display: block;
  animation: dropdown-reveal 0.28s ease-out;
}

.nav-dropdown:hover .menu-trigger,
.nav-dropdown:focus-within .menu-trigger,
.menu-checkbox:checked + .menu-trigger {
  color: #ffd700;
  background-color: #2f2f2f;
}

.dropdown-menu li {
  display: block;
  margin: 0;
  padding: 0;
  border-bottom: 1px solid var(--color-border);
}

.dropdown-menu li:last-child {
  border-bottom: none;
}

.dropdown-menu a {
  display: block;
  margin: 0;
  padding: 12px 16px;
  color: var(--color-secondary);
  text-decoration: none;
  font-size: 0.98rem;
  font-weight: 600;
  line-height: 1.25;
  border: none;
  background-color: var(--color-surface);
  overflow-wrap: break-word;
  transition: color 0.25s ease, background-color 0.25s ease, padding-left 0.2s ease;
}

.dropdown-menu a:hover {
  color: #ffd700;
  background-color: #2f2f2f;
  padding-left: 20px;
}

.page-layout {
  display: flex;
  margin: 10px auto;
  padding: 0 10px;
  /*max-width: 1600px;*/
  box-sizing: border-box;
}

aside {
  background-color: var(--color-sidebar);
  padding: 12px;
  border: 1px solid var(--color-border);
}

/* High-contrast sidebar links: dark text on yellow (readable on magenta sidebar) */
aside a {
  color: var(--color-sidebar-link-text);
  background-color: var(--color-sidebar-link-bg);
  padding: 0.12em 0.4em;
  border-radius: 3px;
  text-decoration: underline;
  text-underline-offset: 2px;
  font-weight: 700;
  transition: color 0.2s ease, background-color 0.2s ease;
}

aside a:hover,
aside a:focus-visible {
  color: #000000;
  background-color: var(--color-sidebar-link-bg-hover);
  outline: 2px solid #1a1400;
  outline-offset: 2px;
}

aside a:visited {
  color: var(--color-sidebar-link-text);
  background-color: var(--color-sidebar-link-bg-visited);
}

.left-sidebar,
.right-sidebar {
  flex-basis: 20%;
}

section {
  flex-basis: 60%;
  padding: 16px;
  margin: 0 10px;
  border: 1px solid var(--color-border);
  background-color: #ffd700;
}

section h2 {
  color: var(--color-primary);
}

section h3 {
  color: var(--color-primary);
}

section h4,
section h5,
section h6,
aside h4 {
  color: var(--color-primary);
}

figure {
  margin: 20px 0;
  border: 1px solid var(--color-border);
  padding: 10px;
  background-color: #fafaf6;
}

figure img {
  display: block;
  width: 100%;
  height: auto;
}

figcaption {
  margin-top: 8px;
  font-size: 0.95rem;
}

.media-source {
  display: block;
  margin-top: 4px;
  font-size: 0.85rem;
  font-style: italic;
  color: #444;
}

figure img {
  transition: transform 0.35s ease;
}

figure:hover img {
  transform: scale(1.02);
}

.relations-table-wrapper {
  overflow-x: auto;
  margin-top: 10px;
}

.relations-table {
  width: 100%;
  border: 2px solid var(--color-border);
  border-collapse: collapse;
  border-spacing: 0;
  empty-cells: show;
  table-layout: fixed;
  background-color: #fffdf2;
}

.relations-table col.country-col {
  width: 40%;
}

.relations-table col.type-col {
  width: 20%;
}

.relations-table col.website-col {
  width: 40%;
}

.relations-table caption {
  caption-side: top;
  font-weight: bold;
  color: var(--color-primary);
  margin-bottom: 8px;
  text-align: left;
}

.relations-table th,
.relations-table td {
  border: 1px solid var(--color-border);
  padding: 10px;
  vertical-align: top;
}

.relations-table thead th {
  background-color: #efe8cc;
}

.relations-table tbody tr:nth-child(even) {
  background-color: #f8f3da;
}

.relations-table tbody tr:hover {
  background-color: #e5ddba;
}

.relations-table tfoot td {
  font-style: italic;
}

.resources-table-wrapper {
  overflow-x: auto;
  margin-top: 10px;
}

.resources-table {
  width: 100%;
  border: 2px solid var(--color-border);
  border-collapse: collapse;
  border-spacing: 0;
  empty-cells: show;
  table-layout: fixed;
  background-color: #fffdf2;
}

.resources-table col.resource-col {
  width: 45%;
}

.resources-table col.type-col {
  width: 15%;
}

.resources-table col.link-col {
  width: 40%;
}

.resources-table caption {
  caption-side: top;
  font-weight: bold;
  color: var(--color-primary);
  margin-bottom: 8px;
  text-align: left;
}

.resources-table th,
.resources-table td {
  border: 1px solid var(--color-border);
  padding: 10px;
  vertical-align: top;
}

.resources-table thead th {
  background-color: #efe8cc;
}

.resources-table tbody tr:nth-child(even) {
  background-color: #f8f3da;
}

.resources-table tbody tr:hover {
  background-color: #e5ddba;
}

.resources-table tfoot td {
  font-style: italic;
}

footer {
  background-color: var(--color-secondary);
  font-size: 10px;
  text-align: center;
  color: var(--color-surface);
  padding: 7px;
  margin-top: 10px;
  border-top: 2px solid var(--color-accent);
}

footer p {
  margin: 0;
}

.No_show {
  display: none;
}

/* Smartphone: smaller than 768px — single column layout */
@media (max-width: 767px) {
  .site-top {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }

  .site-top-brand {
    justify-self: center;
  }

  .site-title {
    order: 2;
  }

  .site-top-nav {
    order: 3;
    justify-self: stretch;
    width: 100%;
  }

  .site-nav {
    justify-content: stretch;
    width: 100%;
    box-sizing: border-box;
  }

  .nav-dropdown {
    display: block;
    width: 100%;
  }

  .menu-trigger {
    width: 100%;
    min-width: 0;
  }

  .dropdown-menu {
    position: absolute;
    left: 0;
    right: 0;
    width: 100%;
    max-width: none;
  }

  .page-layout {
    display: block;
    padding: 0 8px;
  }

  section {
    margin: 10px 0;
  }

  .relations-table,
  .relations-table thead,
  .relations-table tbody,
  .relations-table tfoot,
  .relations-table tr,
  .relations-table th,
  .relations-table td {
    display: block;
    width: 100%;
  }

  .relations-table thead {
    margin-bottom: 8px;
  }

  .relations-table tr {
    border: 1px solid var(--color-border);
    margin-bottom: 10px;
  }

  .relations-table th,
  .relations-table td {
    border: none;
    border-bottom: 1px solid var(--color-border);
  }

  .resources-table,
  .resources-table thead,
  .resources-table tbody,
  .resources-table tfoot,
  .resources-table tr,
  .resources-table th,
  .resources-table td {
    display: block;
    width: 100%;
  }

  .resources-table thead {
    margin-bottom: 8px;
  }

  .resources-table tr {
    border: 1px solid var(--color-border);
    margin-bottom: 10px;
  }

  .resources-table th,
  .resources-table td {
    border: none;
    border-bottom: 1px solid var(--color-border);
  }

  .signup-form-grid {
    grid-template-columns: 1fr;
  }

  .signup-form-grid .full-width {
    grid-column: auto;
  }
}

/* Tablet: min-width 768px — two columns */
@media (min-width: 768px) and (max-width: 991px) {
  .page-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .left-sidebar {
    grid-column: 1 / 2;
  }

  section {
    grid-column: 2 / 3;
    margin: 0;
  }

  .right-sidebar {
    grid-column: 1 / 3;
  }

}

/* Desktop: min-width 992px — two to three columns (flex: side / main / side) */
@media (min-width: 992px) and (max-width: 1199px) {
  .page-layout {
    display: flex;
  }

  .left-sidebar,
  .right-sidebar {
    width: 25%;
  }

  section {
    width: 50%;
  }

}

/* Large desktop: min-width 1200px — at least three columns */
@media (min-width: 1200px) {
  .page-layout {
    display: grid;
    grid-template-columns: 1fr 2fr 1fr;
    gap: 12px;
    max-width: 1400px;
  }

  .left-sidebar,
  .right-sidebar,
  section {
    margin: 0;
    width: auto;
  }

}

span {
  font-weight: bold;
}

.ambassador-form {
  width: 100%;
  margin: 16px 0;
  border: 1px solid var(--color-border);
  padding: 16px;
  background: #fffdf2;
  box-sizing: border-box;
}

.ambassador-form fieldset {
  margin: 0;
  border: 2px solid var(--color-border);
  padding: 16px;
  background: #ffffff;
}

.ambassador-form legend {
  padding: 0 8px;
  font-weight: 700;
  color: var(--color-primary);
}

.signup-form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.form-group {
  width: 100%;
  margin: 0;
}

.form-group label,
.field-label {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
}

.form-group input[type="text"],
.form-group select,
.form-group textarea {
  width: 100%;
  margin: 0;
  border: 1px solid var(--color-border);
  padding: 10px;
  background: #fffdf8;
  box-sizing: border-box;
}

.form-group textarea {
  resize: vertical;
}

.form-group input[type="radio"],
.form-group input[type="checkbox"] {
  margin-right: 8px;
}

.form-group.full-width {
  width: 100%;
}

.form-group.full-width label {
  display: block;
  margin: 6px 0;
}

.form-actions {
  width: 100%;
  margin-top: 14px;
  border-top: 1px solid var(--color-border);
  padding-top: 12px;
  background: transparent;
}

.form-actions input[type="submit"],
.form-actions input[type="reset"] {
  width: auto;
  margin: 4px 8px 4px 0;
  border: 1px solid var(--color-border);
  padding: 10px 16px;
  background: #efe8cc;
  cursor: pointer;
}

.form-actions input[type="submit"],
.form-actions input[type="reset"] {
  transition: background-color 0.25s ease, transform 0.2s ease;
}

.form-actions input[type="submit"]:hover,
.form-actions input[type="reset"]:hover {
  background: #e5ddba;
  transform: translateY(-1px);
}

@media (min-width: 768px) and (max-width: 991px) {
  .signup-form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .signup-form-grid .full-width {
    grid-column: 1 / -1;
  }
}

@media (min-width: 992px) and (max-width: 1199px) {
  .signup-form-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .signup-form-grid .full-width {
    grid-column: 1 / -1;
  }
}

@media (min-width: 1200px) {
  .signup-form-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .signup-form-grid .full-width {
    grid-column: 1 / -1;
  }
}


