/*
 * Standalone stylesheet for index/tab pages.
 * This file includes only the page foundation and index interface.
 */

/* ---------- Fonts ---------- */

@font-face {
  font-family: "Dioszeghiensis";
  src: url("https://dahliaduvide.neocities.org/fonts/DIOSZEGHIENSIS.TTF")
    format("truetype");
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "FrescoStamp";
  src: url("https://dahliaduvide.neocities.org/fonts/FRESCOSTAMP.TTF")
    format("truetype");
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

/* ---------- Index page foundation ---------- */

html {
  min-height: 100%;
}

body {
  position: relative;
  min-height: 100vh;
  margin: 0;
  padding: 0;
  color: #ede5f3;
  font-family: "FrescoStamp", sans-serif;
  font-size: 1em;
  line-height: 1.5;
  background-color: #211927;
  background-image: url("https://dahliaduvide.neocities.org/images/dkbkgd.png");
  background-repeat: repeat;
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: none;
}

/* Sitewide texture above the page background and below the index UI. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  background-image: url("https://dahliaduvide.neocities.org/images/fabric-1-lighter.png");
  background-repeat: repeat;
  mix-blend-mode: hard-light;
  opacity: 0.4;
}

/*
 * Keep the index section flush with the navbar and footer.
 * display: flow-root prevents margins inside the loaded footer from
 * collapsing outside its black background.
 */
main,
#footer-placeholder,
footer {
  margin: 0;
  padding: 0;
}

footer {
  display: flow-root;
}

/* ---------- Index tabs and content ---------- */

.section.tabs {
  --tabs-panel: #211927;
  --tabs-button: #34283e;
  --tabs-button-hover: #4a3858;
  --tabs-accent: #8d0037;
  --tabs-text: #ede5f3;
  --tabs-muted: #cab1da;
  --tabs-border: #86649b;

  position: relative;
  z-index: 1;
  display: flex;
  width: 100%;
  min-height: calc(100vh - 130px);
  margin: 0;
  color: var(--tabs-text);
  font-family: "FrescoStamp", sans-serif;
  background: transparent;
  box-sizing: border-box;
}

.section.tabs,
.section.tabs * {
  box-sizing: border-box;
}

/* ---------- Dark-purple tab panel ---------- */

.section.tabs .tabs-container {
  display: flex;
  align-self: stretch;
  align-items: center;
  width: 240px;
  min-width: 240px;
  padding: 24px 14px;
  background-color: var(--tabs-panel);
  box-shadow: 8px 0 16px rgba(0, 0, 0, 0.45);
}

/* 27 tabs: three columns by nine rows. */
.section.tabs .tabs-container ul {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
  width: 100%;
  margin: 0;
  padding: 0;
  list-style: none;
}

.section.tabs .tabs-container ul li {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  height: 42px;
  padding: 4px;
  overflow: hidden;
  color: var(--tabs-text);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
  background-color: var(--tabs-button);
  border: 1px solid rgba(134, 100, 155, 0.55);
  border-radius: 3px;
  box-shadow:
    2px 3px 5px rgba(0, 0, 0, 0.65),
    inset 0 0 7px rgba(202, 177, 218, 0.08);
  cursor: pointer;
  transition:
    color 0.2s ease,
    background-color 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.2s ease;
}

.section.tabs .tabs-container ul li:hover {
  color: #ffffff;
  background-color: var(--tabs-button-hover);
  border-color: var(--tabs-muted);
  box-shadow:
    2px 3px 7px rgba(0, 0, 0, 0.75),
    0 0 9px rgba(134, 100, 155, 0.5);
  transform: translateY(-1px);
}

.section.tabs .tabs-container ul li:focus-visible {
  outline: 2px solid var(--tabs-muted);
  outline-offset: 3px;
}

.section.tabs .tabs-container ul li.active,
.section.tabs .tabs-container ul li[aria-selected="true"] {
  color: #ffffff;
  background-color: var(--tabs-accent);
  border-color: #c22361;
  box-shadow:
    2px 3px 7px rgba(0, 0, 0, 0.75),
    0 0 12px rgba(141, 0, 55, 0.75);
}

/* ---------- Index items ---------- */

.section.tabs .content {
  display: none;
  flex: 1 1 auto;
  flex-direction: column;
  min-width: 0;
  min-height: inherit;
  padding: clamp(28px, 5vw, 64px);
  overflow-y: auto;

  /* The site's body background remains visible behind the index items. */
  background: transparent;
}

.section.tabs .content.active,
.section.tabs .content[aria-hidden="false"] {
  display: flex;
}

.section.tabs .content h2 {
  margin: 0 0 24px;
  padding-bottom: 12px;
  color: #ffffff;
  font-family: "FrescoStamp", sans-serif;
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1;
  letter-spacing: 3px;
  text-shadow: 2px 2px 4px #000000;
  border-bottom: 1px solid var(--tabs-border);
}

.section.tabs .content ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.section.tabs .content ul li {
  padding: 12px 0;
  color: var(--tabs-text);
  font-size: clamp(1.05rem, 2vw, 1.35rem);
  border-bottom: 1px solid rgba(134, 100, 155, 0.35);
}

.section.tabs .content a:link {
  color: #86649b;
  background-color: transparent;
  text-decoration: none;
}

.section.tabs .content a:visited {
  color: #cab1da;
  background-color: transparent;
  text-decoration: none;
}

.section.tabs .content a:hover {
  color: #8d0037;
  background-color: transparent;
  text-decoration: underline;
}

.section.tabs .content a:active {
  color: #000000;
  background-color: #8d0037;
  text-decoration: none;
}

.section.tabs .content a:focus-visible {
  outline: 2px solid var(--tabs-muted);
  outline-offset: 3px;
}

/* ---------- Tablet and phone layout ---------- */

@media screen and (max-width: 991px) {
  .section.tabs {
    flex-direction: column;
    min-height: 100vh;
  }

  .section.tabs .tabs-container {
    align-items: stretch;
    width: 100%;
    min-width: 0;
    padding: 14px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.45);
  }

  .section.tabs .tabs-container ul {
    grid-template-columns: repeat(9, minmax(52px, 1fr));
    overflow-x: auto;
    padding: 2px 2px 10px;
    scrollbar-color: var(--tabs-border) var(--tabs-panel);
  }

  .section.tabs .content {
    min-height: 0;
    padding: 30px 22px;
    overflow: visible;
  }
}

@media screen and (max-width: 480px) {
  .section.tabs .tabs-container ul {
    grid-template-columns: repeat(9, 52px);
    gap: 7px;
  }

  .section.tabs .tabs-container ul li {
    height: 38px;
    font-size: 0.9rem;
  }

  .section.tabs .content {
    padding: 26px 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .section.tabs .tabs-container ul li {
    transition: none;
  }
}
