/* Site palette and heading typeface. Shared rules below refer to these values with var(). */
:root {
  --ink: #2f272b;
  --wine: #562336;
  --link: #762c46;
  --line: #dbcebf;
  --paper: #faf7f0;
  --serif: Georgia, 'Times New Roman', serif;
}

/* Base layout, link styling and keyboard focus indicators. */
* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 1rem/1.65 system-ui, sans-serif;
}

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

a:hover {
  text-decoration-thickness: 2px;
}

:focus-visible {
  outline: 3px solid #aa681f;
  outline-offset: 4px;
}

/* Shared content width and side margins. Header, main content and footer use this wrapper. */
.wrap {
  width: min(1190px, 90%);
  margin-inline: auto;
}

/* Site header and navigation, including the circular initial and Find a notary button. */
header {
  border-top: 5px solid var(--wine);
  border-bottom: 1px solid var(--line);
}

.mast,
nav,
.brand,
.finder {
  display: flex;
  align-items: center;
}

.mast {
  justify-content: space-between;
  gap: 20px;
  padding-block: 22px;
}

.brand {
  gap: 13px;
  color: var(--wine);
  font: 600 clamp(18px,2vw,27px)/1.1 var(--serif);
  text-decoration: none;
}

.seal {
  background: var(--wine);
  color: var(--paper);
  display: grid;
  place-items: center;
  width: 43px;
  height: 43px;
  border-radius: 50%;
  border: 3px double var(--paper);
  outline: 1px solid var(--wine);
  font: italic 27px var(--serif);
}

.mast nav {
  gap: clamp(12px,2vw,28px);
}

.mast nav a {
  font-size: .9rem;
  font-weight: 600;
  text-decoration: none;
}

.mast nav a:hover {
  text-decoration: underline;
}

.cta {
  background: var(--wine);
  color: white;
  padding: 9px 16px;
  border-radius: 4px;
}

.cta span {
  margin-left: 7px;
}

/* Homepage introduction. Change the photograph in .photo below and its crop with background-position. */
.hero {
  margin: 36px 0;
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  color: #fff9ec;
  background: var(--wine);
  border-radius: 6px;
  overflow: hidden;
}

.intro {
  padding: clamp(28px,4vw,58px);
  align-self: center;
}

h1,
h2,
h3 {
  font-family: var(--serif);
  font-weight: 400;
  line-height: 1.12;
}

h1 {
  margin: 0;
  font-size: clamp(2.1rem,3.7vw,3.8rem);
  letter-spacing: -.034em;
}

.intro p {
  max-width: 43ch;
  margin: 1.2em 0 0;
  color: #f3e4da;
}

.photo {
  background: url('images/banner.jpg') 59% center / cover;
  min-height: 160px;
}

/* Directory search field, alphabet navigation and location lists. */
.directory {
  scroll-margin-top: 16px;
}

.finder {
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.finder h2 {
  font-size: clamp(2rem,3vw,2.8rem);
  margin: 0;
}

input {
  width: min(100%,340px);
  padding: 13px 16px;
  border: 1px solid #a99891;
  border-radius: 4px;
  font: inherit;
  background: #fffdf8;
  color: var(--ink);
}

.alphabet {
  flex-wrap: wrap;
  gap: 5px;
  margin: 18px 0;
}

.alphabet a {
  font: 600 1rem var(--serif);
  padding: 9px 11px;
  min-width: 35px;
  text-align: center;
  border: 1px solid var(--line);
  background: #fffdf8;
  border-radius: 3px;
  text-decoration: none;
}

.alphabet a:hover,
.letter li:hover {
  background: #f1e7df;
}

#status:empty {
  display: none;
}

/* Location groups. The first grid column holds the letter. The nested list sets the number of location columns. */
.letter {
  display: grid;
  grid-template-columns: minmax(50px,9%) 1fr;
  border-top: 1px solid var(--line);
  padding: 20px 0;
  scroll-margin: 15px;
}

.letter h3 {
  font-size: 2.6rem;
  margin: 0;
  color: var(--wine);
}

.letter ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(3,minmax(0,1fr));
  gap: 2px 18px;
  align-items: start;
}

.letter a {
  display: block;
  padding: 6px 0;
}

/* Newly listed notaries panel on the homepage. */
#solicitor {
  margin: 44px 0;
  padding: clamp(20px,4vw,40px);
  background: #f0e7de;
  border-left: 3px solid var(--wine);
}

#solicitor p {
  margin: 0;
}

#solicitor strong {
  font: 1.8rem var(--serif);
}

/* Long-form homepage text and individual listing pages. */
.reading,
.profile {
  max-width: 800px;
  margin: 56px auto;
  overflow-wrap: anywhere;
}

.reading h2,
.profile h2 {
  font-size: 2rem;
  margin-top: 1.5em;
}

.profile {
  background: #fffdf8;
  border: 1px solid var(--line);
  border-top: 4px solid var(--wine);
  padding: clamp(22px,5vw,64px);
}

.profile h1 {
  color: var(--wine);
  border-bottom: 1px solid var(--line);
  padding-bottom: 22px;
  margin-bottom: 24px;
}

.profile h6 {
  font: 600 1.05rem/1.5 system-ui,sans-serif;
  margin: 1em 0;
}

.profile h6 + br,
.profile h6 + br + br {
  display: none;
}

/* Shared footer colours, spacing and privacy link. */
footer {
  margin-top: 55px;
  background: #38202a;
  color: #f7eee4;
  padding: 28px 0;
  font-size: .9rem;
}

footer a {
  color: #fff1db;
}

footer p {
  margin: 0 0 10px;
}

/* Tablet and narrow desktop layouts. These rules override the defaults above. */
@media (max-width: 760px) {
  .mast {
    align-items: flex-start;
    flex-direction: column;
    gap: 14px;
    padding-block: 16px;
  }

  .mast nav {
    width: 100%;
    flex-wrap: wrap;
  }

  .cta {
    margin-left: auto;
  }

/* Homepage introduction. Change the photograph in .photo below and its crop with background-position. */
  .hero {
    grid-template-columns: 1.4fr 1fr;
  }

  .letter ul {
    grid-template-columns: repeat(2,minmax(0,1fr));
  }

}

/* Phone layout. These overrides stack the introduction, search and location links. */
@media (max-width: 520px) {
/* Homepage introduction. Change the photograph in .photo below and its crop with background-position. */
  .hero {
    grid-template-columns: 1fr;
    margin: 20px 0 28px;
  }

  .photo {
    min-height: 105px;
    background-position: center 58%;
  }

  .finder {
    display: grid;
  }

  input {
    width: 100%;
  }

/* Location groups. The first grid column holds the letter. The nested list sets the number of location columns. */
  .letter {
    grid-template-columns: 42px 1fr;
  }

  .letter ul {
    grid-template-columns: 1fr;
  }

  .mast nav a {
    font-size: .8rem;
  }

/* Long-form homepage text and individual listing pages. */
  .reading,
  .profile {
    margin: 26px auto;
  }

}
