/*
  DigitalDreamers hub site styles.
  Fonts, sizes, and colors follow the original hub (main.css): Oswald ("ddfnt") for the menu and headings, the system
  UI stack for body text at 100%, and the slateblue/white scheme with #fcc hover and a black footer band.
*/

@font-face { font-family: 'ddfnt'; src: url('../fonts/Oswald-ExtraLight.woff') format('woff'); font-weight: 200; font-display: swap; }
@font-face { font-family: 'ddfnt'; src: url('../fonts/Oswald-Light.woff') format('woff'); font-weight: 300; font-display: swap; }
@font-face { font-family: 'ddfnt'; src: url('../fonts/Oswald-Regular.woff') format('woff'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'ddfnt'; src: url('../fonts/Oswald-Medium.woff') format('woff'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'ddfnt'; src: url('../fonts/Oswald-SemiBold.woff') format('woff'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'ddfnt'; src: url('../fonts/Oswald-Bold.woff') format('woff'); font-weight: 700; font-display: swap; }

:root {
  --ddblue: slateblue;
  --textcolor: white;
  --menuseltext: deeppink;
  --menuhilite: #fcc;

  --body-text: black;
  --body-bg: white;
  --muted: slategray;
  --rule: silver;
  --card-border: rgba(0, 0, 0, 0.2);

  --header-height: 4rem;
  --std-fontsize: 100%;
}

* { box-sizing: border-box; }

html { scroll-padding-top: calc(var(--header-height) + 0.75rem); }

body {
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, Noto Sans, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol, Noto Color Emoji;
  font-size: var(--std-fontsize);
  line-height: 1.5;
  margin: 0;
  color: var(--body-text);
  background: var(--body-bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.page-content {
  flex: 1;
  padding: 0 10% 1rem;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 10000;
  background: white;
  color: var(--ddblue);
  padding: 0.5rem 1rem;
}
.skip-link:focus { left: 0.5rem; top: 0.5rem; }

/* ---------------------------------------------------------------------------------------------------------------------
   Header / menu
*/

header.nav {
  position: sticky;
  top: 0;
  z-index: 1000;
  display: flex;
  align-items: stretch;
  min-height: var(--header-height);
  background-color: var(--ddblue);
  color: var(--textcolor);
  font-family: ddfnt, sans-serif;
  font-size: 1.5em;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}

header.nav a.home {
  display: flex;
  align-items: center;
  padding: 0 20px;
  color: var(--ddblue);
  background-color: var(--textcolor);
  border: 2px solid var(--ddblue);
  text-decoration: none;
  white-space: nowrap;
}
header.nav a.home:hover { font-weight: normal; }

header.nav .menu {
  display: flex;
  flex: 1;
  align-items: stretch;
}

header.nav .item {
  display: flex;
  align-items: center;
  padding: 10px 20px;
  color: var(--textcolor);
  background-color: var(--ddblue);
  border: 2px solid var(--ddblue);
  text-decoration: none;
  white-space: nowrap;
}
header.nav .item.right { margin-left: auto; }

header.nav .item:hover,
header.nav .item:focus-visible {
  background-color: var(--menuhilite);
  color: var(--textcolor);
  text-shadow: 0 0 3px black, 0 0 5px var(--ddblue);
  font-weight: normal;
}

header.nav .item.current,
header.nav [aria-current="page"] {
  box-shadow: inset 0 -4px 0 white;
}

header.nav .item:focus-visible,
header.nav a.home:focus-visible {
  outline: 3px solid white;
  outline-offset: -5px;
}

header.nav .hamburger {
  display: none;
  margin-left: auto;
  padding: 0 20px;
  font: inherit;
  font-size: 1.25em;
  color: var(--textcolor);
  background: none;
  border: 0;
  cursor: pointer;
}

/* Narrow screens: the menu drops below the header as a vertical list. */
@media (max-width: 600px) {
  header.nav { flex-wrap: wrap; font-size: 1.25em; }
  header.nav .hamburger { display: block; }
  header.nav .menu {
    display: none;
    flex-basis: 100%;
    flex-direction: column;
    border-top: 1px solid rgba(255, 255, 255, 0.5);
  }
  header.nav.menu-open .menu { display: flex; }
  header.nav .item.right { margin-left: 0; justify-content: flex-end; }
  header.nav .item.current,
  header.nav [aria-current="page"] { box-shadow: inset -6px 0 0 white; }
}

/* ---------------------------------------------------------------------------------------------------------------------
   Footer
*/

footer.site-footer {
  margin-top: 32px;
  background-color: black;
  color: var(--textcolor);
  text-align: center;
}
footer.site-footer a { color: var(--textcolor); }
footer.site-footer .backtotop {
  display: block;
  padding-top: 8px;
  font-family: ddfnt, sans-serif;
  font-size: 1.5em;
  text-decoration: none;
}
footer.site-footer .footer-content {
  padding: 16px 10% 24px;
  display: grid;
  gap: 0.25rem;
  justify-items: center;
}
footer.site-footer .footer-wordmark {
  font-family: ddfnt, sans-serif;
  font-size: 2em;
  font-weight: bold;
  line-height: 1.2;
  text-decoration: none;
}

/* ---------------------------------------------------------------------------------------------------------------------
   Headings and text
*/

h1.banner {
  font-family: ddfnt, sans-serif;
  font-weight: bold;
  font-size: 3.25em;
  line-height: 1.15;
  margin: 1.5rem 0 1rem;
}

.page-content h2 {
  font-family: ddfnt, sans-serif;
  font-size: 2em;
  line-height: 1.2;
  margin: 2rem 0 0.75rem;
}

hr {
  border-top: none;
  border-bottom: solid 1px var(--rule);
}

a { color: var(--ddblue); }
a:hover { font-weight: bold; }
a:active { color: var(--menuseltext); }

.center { text-align: center; }

/* ---------------------------------------------------------------------------------------------------------------------
   Home: site cards
*/

ul.site-cards {
  list-style: none;
  padding: 0;
  margin: 1.5rem 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 24px;
}
ul.site-cards li { margin: 0; }

a.site-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: min(300px, calc(100vw - 32px));
  height: 100%;
  padding: 10px 10px 1rem;
  color: inherit;
  text-align: center;
  text-decoration: none;
  border: 1px solid var(--card-border);
  box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2);
  transition: box-shadow 0.3s;
}
a.site-card:hover, a.site-card:focus-visible {
  box-shadow: 0 8px 16px 0 rgba(0, 0, 0, 0.2);
  font-weight: normal;
}
a.site-card:focus-visible { outline: 3px solid var(--ddblue); outline-offset: 2px; }
a.site-card img {
  display: block;
  width: 100%;
  aspect-ratio: 280 / 185;
  object-fit: cover;
  object-position: top left;
}
a.site-card .site-card-title {
  font-family: ddfnt, sans-serif;
  font-weight: 600;
  font-size: 1.5em;
  margin-top: 0.5rem;
  padding-bottom: 0.25rem;
  border-bottom: 1px solid var(--rule);
  align-self: stretch;
}
a.site-card:hover .site-card-title, a.site-card:focus-visible .site-card-title { color: var(--ddblue); }
a.site-card .site-card-text { margin-top: 0.4rem; max-width: 15rem; }

/* ---------------------------------------------------------------------------------------------------------------------
   About: contributors
*/

article.contrib {
  padding: 1rem;
  border: 1px solid var(--card-border);
  box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2);
}
article.contrib + article.contrib { margin-top: 1rem; }
article.contrib h3 { margin: 0; font-size: 1em; }
article.contrib .role {
  margin: 0 0 0 1rem;
  padding-bottom: 0.25rem;
  border-bottom: 1px solid var(--rule);
  color: var(--muted);
  font-weight: bold;
  font-style: italic;
}
article.contrib p:not(.role) { margin: 1rem 0 0 1rem; }

/* ---------------------------------------------------------------------------------------------------------------------
   Small screens
*/

@media (max-width: 700px) {
  .page-content { padding: 0 16px 1rem; }
  footer.site-footer .footer-content { padding: 16px 16px 24px; }
  h1.banner { font-size: 2.4em; }
  .page-content h2 { font-size: 1.7em; }
}

@media print {
  header.nav, footer.site-footer .backtotop, .skip-link { display: none; }
  .page-content { padding: 0; }
}
