/* Base layout */
html, body {
  height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  font-family: sans-serif;
  background-color: #131313;
  color: white;
  overflow-x: hidden;
}

/* Header */
header {
  text-align: center;
  background-color: transparent;
}

.header-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1.5rem 1rem 0.5rem;
}

.logo-title {
  display: flex;
  align-items: center;
  gap: clamp(0.3rem, 2vw, 0.8rem);
  white-space: nowrap;
}

.logo {
  height: clamp(20px, 7vw, 40px);
}

header h1 {
  margin: 0;
  font-size: clamp(1.5rem, 7vw, 2.5rem);
  color: white;
}

.digest {
  color: #00c4b4;
}

.subtitle {
  font-size: 1rem;
  color: #ccc;
  margin-top: 0.25rem;
  margin-bottom: 1rem;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}

/* Main Content */
main {
  flex: 1;
  width: 100%;
  max-width: 1000px;
  margin: 0 auto;
  padding: 0rem;
}

section {
  margin-bottom: 1.25rem;
}

section h2 {
  margin: 0 auto 0.75rem auto;
  border-bottom: 1px solid #555;
  padding-bottom: 0.25rem;
  font-size: 1.5rem;
  max-width: 580px;
  text-align: left;
}

/* Layout for subjects */
.row {
  display: flex;
  gap: 0.7rem;
  justify-content: center;
  flex-wrap: wrap;
  max-width: 100%;
  box-sizing: border-box;
}

.subject {
  flex: 0 0 284px;
  max-width: 284px;
  background-color: #2a2a2a;
  border: 1px solid #2a2a2a;
  padding: 0.75rem;
  border-radius: 10px;
  box-sizing: border-box;
  margin-bottom: 0rem;
}

.subject:hover {
  border: 1px solid #00c4b4;
}

.subject h3 {
  margin-top: 0;
  margin-bottom: 0.5rem;
  color: #00c4b4;
  font-size: 1.25rem;
}

.subject ul {
  margin-top: 0;
  padding: 0;
  list-style-type: none;
}

/* Links */
li {
  margin-bottom: 0.5rem;
}

li a,
li span {
  font-size: 1rem;
}

li a {
  color: white;
  text-decoration: underline;
}

li a:hover {
  color: #66fff8;
}

.inactive-link {
  color: #777;
  font-style: italic;
  cursor: default;
}

.inactive-link:hover {
  text-decoration: underline dotted;
}

.collapsible-container {
  position: relative;
  height: 500px;
  margin-top: 20px;
  z-index: 1;
}

details {
  width: 544px;
  margin: 0 auto 0 auto;
  background-color: #2a2a2a;
  border: 1px solid #2a2a2a;
  border-radius: 10px;
  color: white;
  padding: 1rem;
  cursor: pointer;
  overflow: hidden;
}

details:hover {
  border: 1px solid #00c4b4;
}

summary {
  font-weight: bold;
  font-size: 1.1rem;
  cursor: pointer;
  color: #00c4b4;
}

details[open] {
  border: 1px solid #00c4b4;
}

.details-content {
  margin-top: 0.5rem;
}

#usage-policy {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  padding: 1rem;
}

#usage-policy[open] {
  z-index: 10;
  animation: slideDown 0.3s ease-out;
}

.social-icons {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin: 1rem auto 0.75rem auto;
}

.social-icons a {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  padding: 0.25rem 0.25rem;
  background-color: #2a2a2a;
  border-radius: 8px;
  border: 2px solid #2a2a2a;
  transition: transform 0.2s ease;
  text-decoration: none;
  color: white;
}

.social-icons a:hover {
  background-color: #4d837e;
  border: 2px solid #00c4b4;
}

.social-icons a img {
  width: 16px;
  height: 16px;
  transition: transform 0.2s ease;
}

.social-icons a:hover img {
  transform: scale(1.35);
}

.handle {
  font-size: 0.95rem;
  color: white;
}

/* Footer */
footer {
  text-align: center;
  padding: 2px;
  margin: 0;
  line-height: 0;
  background-color: #0a0a0a;
  color: #aaa;
}

/* Responsive tweaks */
@media (max-height: 920px) {
  #usage-policy {
    position: static;
    top: auto;
    left: auto;
    transform: none;
  }
}

@media (max-width: 610px) {
  .subtitle {
    font-size: 1rem;
    color: #ccc;
    margin-top: 0.25rem;
    margin-bottom: 1rem;
    max-width: 90%;
    margin-left: auto;
    margin-right: auto;
  }

  section h2 {
    margin: 0 20px 0.75rem 20px;
    border-bottom: 1px solid #555;
    padding-bottom: 0.25rem;
    font-size: 1.5rem;
    max-width: 90%;
    text-align: left;
  }

  .row {
    display: block;
    margin: 0 auto 0 auto;
    max-width: 610px;
  }

  .subject {
    width: 90%;
    max-width: 100%;
    margin: 0 auto 0.75rem auto;
  }

  .social-icons {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin: 0.5rem auto 0.75rem auto;
  }

  details {
    width: 82.5%;
    margin-bottom: 1rem;
    cursor: pointer;
  }

  #usage-policy {
    position: static;
    top: auto;
    left: auto;
    transform: none;
  }

  .social-icons {
    gap: 0.5rem 0.5rem;
  }
}

@keyframes slideDown {
  from {
    max-height: 10%;
  }
  to {
    max-height: 100%;
  }
}
