.amr-head-card {
  --amr-head-primary: #0758b7;
  --amr-head-heading: #08264d;
  --amr-head-bg: #fff;
  --amr-head-radius: 13px;
  --amr-head-photo-height: 190px;
  --amr-head-photo-fit: cover;
  width: 100%;
  height: auto;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 18px;
  color: #203b58;
  background: var(--amr-head-bg);
  border: 1px solid #e1e9f1;
  border-radius: var(--amr-head-radius);
  font-family: "Segoe UI", Arial, sans-serif;
}
.amr-head-card *, .amr-head-card *::before, .amr-head-card *::after { box-sizing: border-box; }
.amr-head-card--shadow { box-shadow: 0 10px 30px rgba(14, 48, 84, .1); }
.amr-head-card__heading { margin: 0 0 12px; color: var(--amr-head-heading); font: 700 1.08rem/1.25 "Segoe UI", Arial, sans-serif; }
.amr-head-card__photo-wrap { overflow: hidden; width: 100%; height: var(--amr-head-photo-height); flex: 0 0 auto; background: #edf3f8; border-radius: 8px; }
.amr-head-card__photo { width: 100%; height: 100%; display: block; object-fit: var(--amr-head-photo-fit); object-position: center top; }
.amr-head-card__placeholder { width: 100%; height: var(--amr-head-photo-height); display: grid; place-items: center; color: #7891aa; background: linear-gradient(145deg, #eef4f9, #dfe9f2); border-radius: 8px; }
.amr-head-card__placeholder svg { width: 72px; height: 72px; fill: none; stroke: currentColor; stroke-width: 1.4; }
.amr-head-card__identity { padding: 13px 5px 14px; text-align: center; }
.amr-head-card__name { margin: 0 0 5px; color: var(--amr-head-heading); font: 700 .91rem/1.35 "Segoe UI", Arial, sans-serif; }
.amr-head-card__position { margin: 0; color: #63788e; font-size: .72rem; line-height: 1.45; }
.amr-head-card__actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 5px; }
.amr-head-card__action { min-width: 0; min-height: 78px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px; padding: 10px 5px; color: var(--amr-head-heading); background: #fff; border: 1px solid #dbe5ef; border-radius: 0; text-decoration: none; text-align: center; font-size: .74rem; font-weight: 700; line-height: 1.22; transition: color .18s ease, border-color .18s ease, background .18s ease, transform .18s ease; }
.amr-head-card__action svg { width: 28px; height: 28px; fill: none; stroke: var(--amr-head-primary); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.amr-head-card__action:hover { color: var(--amr-head-primary); background: #f3f8fe; border-color: #9fc3e9; transform: translateY(-2px); }
.amr-head-card__action--disabled { cursor: default; opacity: .68; }
.amr-head-card__action--disabled:hover { color: var(--amr-head-heading); background: #fff; border-color: #dbe5ef; transform: none; }

/* Integration with the AMR portal template position. */
.portal-head-card:has(.amr-head-card) {
  align-self: start;
  display: grid;
  gap: 14px;
  overflow: visible;
  background: transparent;
  border: 0;
  box-shadow: none;
}
.portal-head-card .moduletable:has(.amr-head-card) { display: block; height: auto; margin: 0; }
.portal-head-card .moduletable > .amr-head-card { height: auto; padding: 18px; }

/* Optional modules placed under the district head card. */
.portal-head-card:has(.amr-head-card) > .moduletable:not(:has(.amr-head-card)) {
  margin: 0;
  padding: 16px;
  overflow: hidden;
  color: #203b58;
  background: #fff;
  border: 1px solid #e1e9f1;
  border-radius: var(--amr-head-radius, 13px);
  box-shadow: 0 8px 24px rgba(14, 48, 84, .07);
}
.portal-head-card:has(.amr-head-card) > .moduletable:not(:has(.amr-head-card)) > h3 {
  margin: 0 0 10px;
  padding: 0 0 9px;
  color: var(--amr-head-heading, #08264d);
  border-bottom: 1px solid #e5ecf3;
  font: 700 .92rem/1.3 "Segoe UI", Arial, sans-serif;
}
.portal-head-card:has(.amr-head-card) > .moduletable:not(:has(.amr-head-card)) > div {
  padding: 0;
  color: #536b82;
  font-size: .76rem;
  line-height: 1.55;
}
.portal-head-card:has(.amr-head-card) > .moduletable:not(:has(.amr-head-card)) p { margin: 0; }
.portal-head-card:has(.amr-head-card) > .moduletable:not(:has(.amr-head-card)) a { color: var(--amr-head-primary, #0758b7); font-weight: 700; text-decoration: none; }

@media (max-width: 1180px) and (min-width: 641px) {
  .portal-head-card .moduletable:has(.amr-head-card) { display: block; }
  .amr-head-card { display: grid; grid-template-columns: minmax(210px, 260px) minmax(220px, 1fr); grid-template-rows: auto 1fr auto; gap: 0 20px; }
  .amr-head-card__heading { grid-column: 1 / -1; }
  .amr-head-card__photo-wrap, .amr-head-card__placeholder { grid-row: 2 / 4; height: 190px; }
  .amr-head-card__identity { align-self: center; padding-inline: 0; text-align: left; }
  .amr-head-card__actions { align-self: end; }
}

@media (max-width: 640px) {
  .amr-head-card { padding: 15px; }
  .amr-head-card__actions { gap: 5px; }
  .amr-head-card__action { min-height: 72px; font-size: .68rem; }
}

@media (prefers-reduced-motion: reduce) {
  .amr-head-card__action { transition: none; }
}
