/* === Dark header === */

.md-header {
  background-color: #212121;
  color: white;
}

/* Make logo icon and text white */
.md-header .md-logo img,
.md-header .md-logo svg {
  filter: brightness(0) invert(1);
}

.md-header__title .md-header__topic img {
  filter: brightness(0) invert(1);
}

/* White icons and text in header */
.md-header .md-header__button,
.md-header .md-header__title {
  color: white;
}

/* Show search icon (Material hides it at desktop since search is normally inline) */
.md-header__button[for="__search"] {
  display: inline-flex;
}

/* Hide trigger icon when search is open */
[data-md-toggle=search]:checked ~ .md-header .md-header__button[for="__search"] {
  display: none;
}

/* Hide search form until icon is clicked */
.md-search {
  display: none;
}

[data-md-toggle=search]:checked ~ .md-header .md-search {
  display: block;
}

/* EpistemiCast: show heading/text before logo on mobile */
@media screen and (max-width: 767px) {
  .epistemicast-logo { order: 2; }
  .epistemicast-text { order: 1; }
}

/* Back/close button in mobile search — ensure it's visible */
.md-search__icon[for="__search"] {
  display: flex !important;
}

/* Desktop nav: shown only on wide screens */
.phaidra-nav-desktop {
  display: none;
  align-items: center;
  gap: 1.25rem;
  margin-left: 0.5rem;
}

@media screen and (min-width: 76.25em) {
  .phaidra-nav-desktop {
    display: flex;
  }
}

.md-header__button[for="__search"] svg {
  fill: white;
}

/* Match arrow/back icon color to search text */
.md-search__icon {
  color: rgba(0, 0, 0, 0.54);
}

/* Nav links */
.phaidra-nav-link {
  color: rgba(255, 255, 255, 0.88);
  text-decoration: none;
  font-size: 0.75rem;
  font-weight: 500;
  white-space: nowrap;
  letter-spacing: 0.01em;
  transition: color 0.15s;
}

.phaidra-nav-link:hover {
  color: white;
}

/* Documentation dropdown */
.phaidra-dropdown {
  position: relative;
}

.phaidra-dropdown-toggle {
  display: flex;
  align-items: center;
  gap: 0.2rem;
}

.phaidra-chevron {
  width: 1.1rem;
  height: 1.1rem;
  fill: currentColor;
  flex-shrink: 0;
}

.phaidra-dropdown-menu {
  display: none;
  position: absolute;
  right: 0;
  top: 100%;
  padding-top: 0.5rem;
  background-color: transparent;
  min-width: 175px;
  list-style: none;
  margin: 0;
  z-index: 200;
}

.phaidra-dropdown-menu::before {
  content: '';
  display: block;
  position: absolute;
  inset: 0.5rem 0 0 0;
  background-color: #2a2a2a;
  border-radius: 0.375rem;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
  z-index: -1;
}

.phaidra-dropdown:hover .phaidra-dropdown-menu {
  display: block;
}

.phaidra-dropdown-menu li {
  margin: 0;
  padding: 0;
}

.phaidra-dropdown-menu a {
  display: block;
  color: rgba(255, 255, 255, 0.82);
  padding: 0.5rem 1rem;
  text-decoration: none;
  font-size: 0.75rem;
  transition: background-color 0.12s, color 0.12s;
}

.phaidra-dropdown-menu a:hover {
  background-color: #3a3a3a;
  color: white;
}

/* === Hot pink brand color === */

:root {
  --md-accent-fg-color: #EE2C52;
  --md-accent-fg-color--transparent: rgba(238, 44, 82, 0.1);
  --md-typeset-a-color: #EE2C52;
}

.phaidra-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: #E9616F;
  color: white !important;
  border-radius: 9999px;
  text-decoration: none;
  font-size: 0.875rem;
}

@media screen and (min-width: 768px) {
  .phaidra-btn {
    font-size: 1rem;
  }
}

/* Hero text — fluid scaling */
.phaidra-hero-title {
  font-size: clamp(1.75rem, 5.8vw, 4.5rem);
}

.phaidra-hero-subtitle {
  font-size: clamp(1rem, 2.9vw, 2.25rem);
}

@media screen and (min-width: 768px) {
  .phaidra-hero-title,
  .phaidra-hero-subtitle {
    white-space: nowrap;
  }
}

.phaidra-hero-description {
  color: #212121;
  font-weight: 400;
  line-height: 1.7;
}

/* Partner logos */
#partner-logos img {
  max-height: 3rem;
  width: auto;
}

/*
  NAV Adjustments for:
*/

/* 1. Nice relation of top Logo + Text to one another */
.md-header__button.md-logo img,
.md-header__button.md-logo svg {
  height: 1.8rem;
}

.md-header__title {
  font-size: 1.2rem;
}

/* set height for logo text (FF browser needs this as it does not apply height: auto */
.md-header__title .md-header__topic img {
  height: 1rem;
}

[dir=ltr] .md-header__title {
  margin-left: .4rem;
  margin-right: .4rem
}

/* 2. nav shadow -> is the same as on the main uni website */
.md-header {
  -webkit-box-shadow: 0 8px 40px -6px rgba(70,70,70,.4);
  box-shadow: 0 8px 40px -6px rgba(70,70,70,.4)
}

/* Icon color — all gray icons use #212121, green ones are unaffected */
section span[class*="text-gray"],
section a[class*="text-gray"] {
  color: #212121;
}

/* Section headings */
.phaidra-section-heading {
  font-weight: 700 !important;
  text-transform: uppercase;
  color: #212121 !important;
}

/* Add margins to paragraphs - without this texts quickly become a long word salad */
article p {
  margin: 1rem 0;
}

/* Add padding-bottom for nicer cushion towards footer */
article:last-child {
  padding-bottom: 4rem;
}

/* 
  Fill all svg icons with the currentColor - this is needed when including icons via mkdocs-material

  you can add a tailwind class to the container element (eg: <span class="text-red-500">
  and then the included icon will take over that color
 */
svg {
  fill: currentColor;
}

/* Showcase article section headings — hot pink */
/* .phaidra-showcase-heading {
  color: #EE2C52 !important;
  font-weight: 700;
} */

/* somehow tailwind class did not get taken, so putting it in here */
hr {
  border: 1px solid #e5e7eb;
  box-sizing: border-box;
}

/* Automatically add an external arrow icon ::after every outgoing link */
main a[href^="http"]:not([href*="phaidra.org"]):not([href*="localhost"]):after {
  background-image: url('/assets/external/icons/material/arrow-top-right.svg');
  display: inline-block;
  height: 15px;
  width: 1rem;
  content: "";
  background-repeat: no-repeat;
  background-position-y: 2px;
  background-position-x: 2px;
  background-size: 14px;
  margin-left: auto;
  flex-shrink: 0;
}

/* since color of the external icon has to be hardcoded into the svg we created a second one for the hover color */
main a[href^="http"]:hover:not([href*="phaidra.org"]):not([href*="localhost"]):after {
  background-image: url('/assets/external/icons/material/arrow-top-right.svg');
}

/* === Footer === */

.md-footer {
  background-color: #1a1a1a;
}

.phaidra-footer {
  max-width: 1280px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

.phaidra-footer-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 1.5rem;
}

.phaidra-footer-logo img {
  height: 3.5rem;
  width: auto;
}

.phaidra-footer-social {
  display: flex;
  gap: 0.75rem;
}

.phaidra-social-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  background-color: #333;
  border-radius: 50%;
  color: white;
  transition: background-color 0.15s;
}

.phaidra-social-btn:hover {
  background-color: #444;
}

.phaidra-social-btn svg {
  width: 1.25rem;
  height: 1.25rem;
  fill: white;
}

.phaidra-footer-divider {
  border-top: 1px solid #3a3a3a;
}

.phaidra-footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 1.5rem;
  color: rgba(255, 255, 255, 0.65);
  font-size: 0.875rem;
}

.phaidra-footer-nav {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.phaidra-footer-nav a {
  color: rgba(255, 255, 255, 0.65);
  text-decoration: none;
  font-size: 0.875rem;
  transition: color 0.15s;
}

.phaidra-footer-nav a:hover {
  color: white;
}

@media screen and (max-width: 640px) {
  .phaidra-footer-top {
    flex-direction: column;
    gap: 1.5rem;
  }

  .phaidra-footer-bottom {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }

  .phaidra-footer-nav {
    justify-content: center;
    gap: 0.5rem 1rem;
  }
}
