.links-page .masthead {
  margin-bottom: 10px;
}

.links-frame {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  overflow: hidden;
  margin-left: 28px;
  border: 4px double #87171d;
  background: #fff;
}

.links-sidebar {
  display: flex;
  flex-direction: column;
  padding: 18px 14px;
  border-right: 3px double #87171d;
  text-align: center;
}

.links-sidebar h1 {
  margin: 0 0 4px;
  color: #87171d;
  font: italic 700 26px/1 Georgia, "Times New Roman", serif;
  text-shadow: 0 1px 1px rgba(135, 23, 29, 0.16);
}

.links-sidebar h1 img {
  display: block;
  width: min(100%, 130px);
  height: auto;
  margin: 0 auto;
}

.links-directory {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
}

.links-directory a {
  width: 100%;
  margin-left: 0;
  display: grid;
  min-height: 34px;
  place-items: center;
  padding: 4px 9px;
  border: 3px solid transparent;
  color: #fff;
  background: #651017 url("/assets/backgrounds/bg-red-02.jpg") center / 230px auto;
  text-align: center;
  text-decoration: none;
  font: italic 700 14px/1.1 Georgia, "Times New Roman", serif;
  text-shadow: 0 1px 2px #39060b;
  filter: drop-shadow(0 4px 4px rgba(190, 190, 190, 0.65));
}

.links-directory a:link,
.links-directory a:visited {
  color: #fff;
}

.links-directory a:hover,
.links-directory a:focus-visible {
  color: #fff;
  border-color: transparent;
}

.links-directory a:hover,
.links-directory a:focus-visible {
  transform: translateY(-4px);
  filter: drop-shadow(0 4px 4px rgba(190, 190, 190, 0.65));
}

.links-directory a.is-active,
.links-directory a.is-active:link,
.links-directory a.is-active:visited {
  color: #87171d;
  border: 3px double #87171d;
  background: #fff url("/assets/backgrounds/bg-white-01.gif") center / 230px auto;
  text-shadow: 0 1px 1px rgba(135, 23, 29, 0.14);
  cursor: default;
  pointer-events: none;
}

.links-directory a.is-active:hover,
.links-directory a.is-active:focus-visible {
  color: #87171d;
  border-color: #87171d;
  transform: none;
}

.sidebar-usakumya {
  display: block;
  width: min(100%, 155px);
  height: auto;
  margin: 12px auto 0;
  pointer-events: none;
  transform-origin: center;
  transition: none;
}

.sidebar-usakumya.is-hover-ready {
  pointer-events: auto;
}

.sidebar-usakumya.is-hover-ready:hover {
  content: url("/assets/png/usakumya-07.png");
  transform: rotate(3deg);
}

.links-main {
  min-width: 0;
  padding: 18px;
}

.link-section {
  margin: 0;
  scroll-margin-top: 12px;
}

.link-section[hidden] {
  display: none;
}

.link-section h2 {
  margin: 0 0 9px;
  padding: 5px 9px;
  color: #fff;
  background: #87171d;
  text-align: center;
  font: italic 700 19px/1.1 Georgia, "Times New Roman", serif;
  text-shadow: 0 1px 2px #39060b;
}

.link-section p,
.link-section li,
.link-section a {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 13px;
  line-height: 1.5;
}

.link-section p {
  margin: 0 0 10px;
  color: var(--rose);
}

.link-section ul {
  margin: 0;
  padding-left: 20px;
  color: var(--rose);
}

.credits-list {
  color: var(--rose);
  font: 400 13px/1.5 Georgia, "Times New Roman", serif;
}

.credits-list:last-of-type {
  padding-bottom: 8px;
}

.link-section .misc-links {
  padding-left: 0;
  list-style: none;
}

.link-section a {
  color: #87171d;
  text-underline-offset: 2px;
}

.link-section a:hover,
.link-section a:focus-visible {
  color: #ff0000;
}

#resources a:hover,
#resources a:focus-visible,
#credits a:hover,
#credits a:focus-visible,
#misc a:hover,
#misc a:focus-visible {
  color: #ff0000;
}

.affiliate-table {
  width: 100%;
  margin: 14px 0;
  border: 3px double #87171d;
  border-collapse: collapse;
  color: var(--rose);
  font: 400 12px/1.4 Georgia, "Times New Roman", serif;
}

.affiliate-table td {
  padding: 8px;
  border: 1px solid #87171d;
  vertical-align: middle;
}

.affiliate-table tr:nth-child(odd) {
  background: #fdf5f6;
}

.affiliate-table .affiliate-badge {
  width: 108px;
  text-align: center;
  vertical-align: top;
}

.affiliate-table .affiliate-badge a,
.affiliate-table .affiliate-badge img {
  display: block;
}

.affiliate-table .affiliate-badge a:hover img,
.affiliate-table .affiliate-badge a:focus-visible img,
.cool-sites-grid a:hover img,
.cool-sites-grid a:focus-visible img,
.resource-badge-row > a:hover img,
.resource-badge-row > a:focus-visible img {
  transform: translateY(-3px);
}

.affiliate-table .affiliate-badge a {
  width: 88px;
  margin: 0 auto;
}

.affiliate-table .affiliate-badge img {
  width: 88px;
  height: 31px;
  object-fit: fill;
}

.affiliate-table strong {
  color: #87171d;
}

.affiliate-table strong a {
  display: inline;
  width: auto;
  margin: 0;
}

.cool-sites-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, 88px);
  justify-content: center;
  gap: 8px;
  margin: 14px auto;
}

.cool-sites-grid a,
.cool-sites-grid img {
  display: block;
  width: 88px;
  height: 31px;
}

.cool-sites-grid img {
  object-fit: fill;
}

.resource-sections {
  margin-top: 14px;
  width: 100%;
  max-height: 390px;
  box-sizing: border-box;
  overflow-x: hidden;
  overflow-y: auto;
}

.resource-sections::-webkit-scrollbar {
  width: 5px;
}

.resource-sections::-webkit-scrollbar-track {
  background: transparent;
}

.resource-sections::-webkit-scrollbar-thumb {
  background: transparent;
  border: 0;
  border-radius: 0 !important;
  box-shadow: none;
}

.resource-sections.is-scrolling::-webkit-scrollbar-thumb {
  background: rgba(135, 23, 29, 0.5);
}

.resource-sections::-webkit-scrollbar-button {
  display: none;
  width: 0;
  height: 0;
  background: transparent;
}

.resource-sections::-webkit-scrollbar-button:single-button,
.resource-sections::-webkit-scrollbar-button:vertical:start:decrement,
.resource-sections::-webkit-scrollbar-button:vertical:end:increment {
  display: none;
  width: 0;
  height: 0;
  min-height: 0;
  background: transparent;
}

.resource-sections section {
  margin: 0 0 10px;
}

.resource-sections section:last-child {
  margin-bottom: 0;
}

.resource-sections h3 {
  width: 100%;
  box-sizing: border-box;
  margin: 0;
  padding: 4px 8px;
  color: #b92f51;
  background: #f7e1e3;
  font: 400 14px/1.15 Georgia, "Times New Roman", serif;
}

.resource-links {
  padding: 5px 8px 0;
  color: var(--rose);
  font: 400 13px/1.5 Georgia, "Times New Roman", serif;
}

.resource-badge-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.resource-badge-row {
  display: grid;
  grid-template-columns: 100px minmax(0, 1fr);
  align-items: center;
  column-gap: 12px;
}

.resource-badge-row > a {
  display: flex;
  align-items: center;
}

.resource-badge-row img {
  width: 88px;
  height: 31px;
  object-fit: fill;
}

.resource-badge-row span {
  min-width: 0;
}

.resource-badge-list .resource-badge-row span {
  white-space: nowrap;
}

.resource-text-list p {
  margin: 0;
}

.webdev-resource-list {
  display: grid;
  grid-template-columns: 135px minmax(0, 1fr);
  gap: 6px 0.3em;
}

.webdev-resource-list .resource-text-row {
  display: contents;
}

.resource-text-row {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  align-items: start;
  column-gap: 0.3em;
  margin: 0;
}

.resource-description {
  min-width: 0;
}

.affiliate-note,
.site-note,
.credits-note {
  padding-top: 10px;
  border-top: 2px dotted #efc4cb;
}

.credits-note {
  margin: 0;
  padding-top: 8px;
}

.links-return {
  display: flex;
  justify-content: center;
  margin-top: 12px;
  padding-top: 0;
}

.links-return a {
  border-bottom: 1px solid #87171d;
  color: #87171d;
  text-decoration: none;
  font: italic 700 13px/1.2 Georgia, "Times New Roman", serif;
}

.links-return a:hover,
.links-return a:focus-visible {
  border-bottom-color: #ff0000;
  color: #ff0000;
  text-decoration: none;
}

.links-page .site-footer {
  margin-top: 26px;
}

@media (max-width: 620px) {
  .links-frame {
    grid-template-columns: 1fr;
  }

  .links-sidebar {
    border-right: 0;
    border-bottom: 3px double #87171d;
  }

  .links-directory {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

}

@media (max-width: 560px) {
  .links-frame {
    margin-left: 0;
  }
}
