/*
  Knights of Dol Amroth
  Shared stylesheet for every page.
*/

:root {
  --sea-950: #071a33;
  --sea-900: #0b2545;
  --sea-800: #13315c;
  --sea-700: #1d4e89;
  --silver-500: #8d99a8;
  --silver-300: #c4ccd6;
  --silver-200: #dde3ea;
  --silver-100: #eef1f5;
  --page: #f6f8fa;
  --card: #ffffff;
  --ink: #17202c;
  --ink-soft: #3d4a5a;
  --link: #1d4e89;
  --link-hover: #0b2545;
  --focus: #e0a526;

  --font-display: "Cinzel", "Trajan Pro", Georgia, serif;
  --font-body: "Source Serif 4", Georgia, "Times New Roman", serif;

  --measure: 44rem;
  --wide: 68rem;
  --radius: 6px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.125rem;
  line-height: 1.65;
}

img,
svg {
  max-width: 100%;
  height: auto;
}

a {
  color: var(--link);
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--link-hover);
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  color: var(--sea-900);
  line-height: 1.25;
  font-weight: 600;
}

h1 {
  font-size: clamp(2rem, 5vw, 2.75rem);
  margin: 0 0 0.5rem;
}

h2 {
  font-size: clamp(1.5rem, 3.5vw, 1.85rem);
  margin: 2.5rem 0 0.75rem;
}

h3 {
  font-size: 1.25rem;
  margin: 1.75rem 0 0.5rem;
}

p,
ul,
ol {
  margin: 0 0 1.1rem;
}

/* Skip link for keyboard and screen reader users */

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 100;
  padding: 0.6rem 1rem;
  background: var(--card);
  color: var(--sea-900);
  font-weight: 600;
  border-radius: var(--radius);
}

.skip-link:focus {
  top: 1rem;
}

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

/* Header and navigation */

.site-header {
  background: var(--sea-900);
  color: #ffffff;
  border-bottom: 4px solid var(--silver-300);
}

.header-inner {
  max-width: var(--wide);
  margin: 0 auto;
  padding: 0.85rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: #ffffff;
  text-decoration: none;
}

.brand:hover {
  color: #ffffff;
}

.brand img {
  width: 3.25rem;
  height: 3.25rem;
}

.brand-name {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.15;
}

.brand-name small {
  display: block;
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 400;
  letter-spacing: 0.02em;
  color: var(--silver-200);
}

.nav-toggle {
  display: none;
  font: inherit;
  font-family: var(--font-display);
  font-size: 1rem;
  background: transparent;
  color: #ffffff;
  border: 2px solid var(--silver-300);
  border-radius: var(--radius);
  padding: 0.4rem 0.9rem;
  cursor: pointer;
}

.site-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}

.site-nav a {
  display: block;
  padding: 0.4rem 0.65rem;
  color: #ffffff;
  text-decoration: none;
  font-family: var(--font-display);
  font-size: 0.95rem;
  border-radius: var(--radius);
}

.site-nav a:hover {
  background: var(--sea-800);
  color: #ffffff;
}

.site-nav a[aria-current="page"] {
  background: var(--silver-200);
  color: var(--sea-900);
}

/* On small screens the menu collapses behind a button, but only when
   JavaScript is running. Without it the full menu stays visible. */
@media (max-width: 52rem) {
  .js .nav-toggle {
    display: inline-block;
  }

  .js .site-nav {
    display: none;
    width: 100%;
  }

  .js .site-nav.is-open {
    display: block;
  }

  .site-nav ul {
    flex-direction: column;
  }

  .site-nav a {
    padding: 0.65rem 0.75rem;
  }
}

/* Page banner */

.banner {
  background:
    linear-gradient(180deg, var(--sea-800) 0%, var(--sea-900) 100%);
  color: #ffffff;
  text-align: center;
  padding: 3rem 1rem 3.5rem;
  position: relative;
}

.banner::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 14px;
  background: url("../images/wave.svg") repeat-x center bottom / auto 14px;
}

.banner h1 {
  color: #ffffff;
  margin: 0;
}

.banner p {
  max-width: var(--measure);
  margin: 0.75rem auto 0;
  color: var(--silver-100);
  font-size: 1.2rem;
}

.banner-home {
  padding: 3.5rem 1rem 4.5rem;
}

.banner-home img {
  width: 9rem;
  height: 9rem;
  margin-bottom: 1rem;
}

.banner-home h1 {
  font-size: clamp(2.2rem, 6vw, 3.4rem);
  letter-spacing: 0.04em;
}

.motto {
  font-family: var(--font-display);
  font-size: 1.1rem;
  letter-spacing: 0.08em;
  color: var(--silver-200);
}

/* Main content */

main {
  display: block;
}

.content {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 2.5rem 1rem 3.5rem;
}

.content-wide {
  max-width: var(--wide);
}

.content > :first-child,
.content-wide > :first-child {
  margin-top: 0;
}

.lead {
  font-size: 1.25rem;
  color: var(--ink-soft);
}

.divider {
  border: 0;
  height: 1px;
  background: var(--silver-300);
  margin: 2.5rem 0;
}

/* Cards and grids */

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 1.25rem;
  margin: 1.5rem 0 2rem;
}

.card {
  background: var(--card);
  border: 1px solid var(--silver-300);
  border-top: 4px solid var(--sea-700);
  border-radius: var(--radius);
  padding: 1.25rem 1.25rem 0.5rem;
}

.card h2,
.card h3 {
  margin-top: 0;
  font-size: 1.2rem;
}

.card-link {
  text-decoration: none;
  color: inherit;
  display: block;
  height: 100%;
}

.card-link:hover {
  color: inherit;
}

.card-link:hover .card,
.card-link:focus-visible .card {
  border-top-color: var(--sea-900);
  box-shadow: 0 4px 14px rgba(11, 37, 69, 0.12);
}

.card-link .card {
  height: 100%;
}

.card-list {
  list-style: none;
  padding: 0;
}

.card-link h3 {
  color: var(--link);
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

/* Proclamation style used by the Charter and Code of Honor */

.proclamation {
  background: var(--card);
  border: 1px solid var(--silver-300);
  border-radius: var(--radius);
  padding: 2rem 1.5rem;
  box-shadow: inset 0 0 0 6px var(--silver-100), inset 0 0 0 7px var(--silver-300);
}

@media (min-width: 40rem) {
  .proclamation {
    padding: 2.5rem 3rem;
  }
}

.proclamation h2:first-child {
  margin-top: 0;
}

.proclamation h2 {
  text-align: center;
}

.oaths {
  counter-reset: oath;
  list-style: none;
  padding: 0;
  margin: 1.5rem 0;
}

.oaths li {
  counter-increment: oath;
  position: relative;
  padding: 0.85rem 0 0.85rem 3.25rem;
  border-bottom: 1px solid var(--silver-200);
}

.oaths li:last-child {
  border-bottom: 0;
}

.oaths li::before {
  content: counter(oath, upper-roman);
  position: absolute;
  left: 0;
  top: 0.8rem;
  width: 2.4rem;
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--sea-700);
  text-align: right;
}

.closing-pledge {
  font-style: italic;
  text-align: center;
  margin-top: 1.5rem;
}

/* Ranks */

.rank {
  background: var(--card);
  border: 1px solid var(--silver-300);
  border-left: 6px solid var(--sea-700);
  border-radius: var(--radius);
  padding: 1.5rem 1.25rem 0.5rem;
  margin: 0 0 1.5rem;
}

@media (min-width: 40rem) {
  .rank {
    padding: 1.75rem 2rem 0.75rem;
  }
}

.rank h2 {
  margin-top: 0;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem 0.75rem;
}

.pips {
  display: inline-flex;
  gap: 0.25rem;
}

.pips span {
  display: inline-block;
  width: 0.7rem;
  height: 0.7rem;
  background: var(--silver-500);
  transform: rotate(45deg);
}

.rank-high {
  border-left-color: var(--silver-500);
}

.rank-high .pips span {
  background: var(--sea-700);
}

.facts {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.35rem 1rem;
  background: var(--silver-100);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin: 0 0 1.25rem;
  font-size: 1rem;
}

.facts dt {
  font-weight: 700;
}

.facts dd {
  margin: 0;
}

@media (max-width: 30rem) {
  .facts {
    grid-template-columns: 1fr;
  }

  .facts dd {
    margin-bottom: 0.5rem;
  }
}

.ladder {
  padding-left: 1.5rem;
}

.ladder li {
  margin-bottom: 0.35rem;
}

/* Leadership */

.leaders {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: 1rem;
}

.leaders li {
  background: var(--card);
  border: 1px solid var(--silver-300);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
}

.leaders .role {
  display: block;
  font-family: var(--font-display);
  font-size: 0.95rem;
  color: var(--sea-700);
}

.leaders .name {
  display: block;
  font-size: 1.3rem;
  font-weight: 700;
}

.company {
  display: inline-block;
  font-size: 0.9rem;
  font-weight: 700;
  padding: 0.1rem 0.6rem;
  border-radius: 999px;
  border: 1px solid var(--sea-700);
}

.company-blue {
  background: var(--sea-700);
  color: #ffffff;
}

.company-silver {
  background: var(--silver-200);
  color: var(--sea-900);
}

/* Steps on the Joining page */

.steps {
  counter-reset: step;
  list-style: none;
  padding: 0;
}

.steps > li {
  counter-increment: step;
  position: relative;
  padding: 0 0 1.25rem 3.5rem;
  min-height: 2.75rem;
}

.steps > li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background: var(--sea-900);
  color: #ffffff;
  font-family: var(--font-display);
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.steps h3 {
  margin: 0.35rem 0 0.35rem;
}

/* Callouts */

.callout {
  background: var(--silver-100);
  border-left: 5px solid var(--sea-700);
  border-radius: var(--radius);
  padding: 1rem 1.25rem 0.1rem;
  margin: 1.5rem 0;
}

/* Glossary */

.glossary dt {
  font-weight: 700;
  font-family: var(--font-display);
  color: var(--sea-900);
  margin-top: 1.25rem;
}

.glossary dd {
  margin: 0.25rem 0 0;
}

code,
kbd {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.95em;
  background: var(--silver-100);
  border: 1px solid var(--silver-200);
  border-radius: 4px;
  padding: 0.05em 0.35em;
}

/* News */

.news-item {
  border-bottom: 1px solid var(--silver-300);
  padding-bottom: 1.5rem;
  margin-bottom: 2rem;
}

.news-item h2 {
  margin: 0 0 0.25rem;
}

.news-item time {
  display: block;
  color: var(--ink-soft);
  margin-bottom: 0.75rem;
}

/* Sources */

.sources {
  font-size: 1rem;
  color: var(--ink-soft);
}

/* Buttons */

.button {
  display: inline-block;
  background: var(--sea-900);
  color: #ffffff;
  font-family: var(--font-display);
  font-weight: 600;
  text-decoration: none;
  padding: 0.7rem 1.4rem;
  border-radius: var(--radius);
  border: 2px solid var(--sea-900);
}

.button:hover {
  background: var(--sea-700);
  border-color: var(--sea-700);
  color: #ffffff;
}

.button-secondary {
  background: transparent;
  color: var(--sea-900);
}

.button-secondary:hover {
  background: var(--silver-200);
  border-color: var(--sea-900);
  color: var(--sea-900);
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 1.5rem 0;
}

/* Footer */

.site-footer {
  background: var(--sea-950);
  color: var(--silver-100);
  border-top: 4px solid var(--silver-300);
  font-size: 0.95rem;
}

.footer-inner {
  max-width: var(--wide);
  margin: 0 auto;
  padding: 2rem 1rem;
}

.site-footer a {
  color: #ffffff;
}

.site-footer p {
  margin: 0 0 0.6rem;
}
