/*!
Theme Name: ecosenda
Theme URI: http://underscores.me/
Author: Oliver Udeküll
Author URI: http://underscores.me/
Description: Description
Version: 1.0.0
Tested up to: 5.4
Requires PHP: 5.6
License: GNU General Public License v2 or later
License URI: LICENSE
Text Domain: ecosenda
Tags: custom-background, custom-logo, custom-menu, featured-images, threaded-comments, translation-ready

This theme, like WordPress, is licensed under the GPL.
Use it to make something cool, have fun, and share what you've learned.

ecosenda is based on Underscores https://underscores.me/, (C) 2012-2020 Automattic, Inc.
Underscores is distributed under the terms of the GNU GPL v2 or later.

Normalizing styles have been helped along thanks to the fine work of
Nicolas Gallagher and Jonathan Neal https://necolas.github.io/normalize.css/
*/

body {
  color: var(--color-primary);
  background-color: var(--color-bg);
}

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100dvw;
  height: var(--sizes-header-height);
  border-bottom: var(--border);

  display: flex;
  gap: var(--padding-lg);
  justify-content: space-between;
  align-items: center;

  background-color: var(--color-bg);
  z-index: var(--z-index-top);
}

.site-header__hgroup {
  position: relative;
  padding: var(--padding-sm-semi) var(--padding);
}

.site-title {
  text-transform: uppercase;
}

.site-header__subtitle {
  position: absolute;
  padding: var(--padding-sm-semi) var(--padding);

  height: 100%;
  left: 50%;
  transform: translateX(-50%);

  display: flex;
  flex-flow: column;
  justify-content: center;
  align-items: center;
  gap: var(--padding-xs);

  line-height: var(--font-line-height-trim) !important;
}

.site-header__subtitle ul {
  position: relative;
  width: 100%;

  display: flex;
  justify-content: center;
  gap: var(--padding-lg);
}

.nav-menu {
  height: 100%;
  margin-inline-start: auto;
  flex-shrink: 0;
  overflow: visible;
}

.nav-menu__list {
  position: relative;
  height: 100%;
  width: max-content;

  display: flex;
  flex-flow: column-reverse wrap;
  justify-content: flex-end;
  align-items: flex-start;
  direction: rtl;
}

.nav-menu__list li {
  display: flex;
  width: 12.5ch;
  height: 100%;
  min-width: 0;
  min-height: 0;

  flex: 0 0 50%;
}

.nav-menu__list li a,
.nav-menu__toggle {
  position: relative;
  width: 100%;
  height: 100%;
  padding: 0 var(--padding-lg);
  border-left: var(--border);
  border-bottom: var(--border);
  box-sizing: border-box;

  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  text-wrap: balance;
  min-width: 0;

  font-weight: var(--font-weight-bold);
}

.nav-menu__toggle {
  display: none;
}

.nav-menu__list .current-menu-item a {
  color: var(--color-primary-muted);
}

.nav-menu__list li:first-child a {
  border-bottom: none;
}

.nav-menu__list li:nth-child(odd):not(:last-child) a {
  border-bottom: none;
}

main {
  position: relative;
  top: var(--sizes-header-height);
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.map {
  position: sticky;
  top: var(--sizes-header-height);
  width: 100%;
  height: var(--sizes-content-height);
  overflow: hidden;

  display: flex;
  justify-content: center;
  align-items: center;

  background-color: var(--color-bg);
  animation: fadeIn 1s ease-in;
}

.map__list {
  position: relative;
  width: 100%;
  height: 100%;
  list-style: none;
  margin: 0;
  padding: 0;
}

.map__connections {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
  z-index: 0;
}

.map__connections-path {
  fill: none;
  stroke: var(--color-primary);
  stroke-width: 2;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.map__item {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 1;
  /* padding: var(--padding-lg); */
  padding: var(--padding-lg);
  aspect-ratio: 1;

  display: flex;
  justify-content: center;
  align-items: center;

  transform-origin: center;
  will-change: transform;
  transition: all 0.4s ease-out;
}

.map__city {
  position: relative;
  width: 100%;
  height: 100%;
  /* max-width: 15dvw;
  max-height: 15dvh; */

  display: flex;
  justify-content: center;
  align-items: center;
}

.map__city img {
  display: block;
  width: 85%;
  height: 85%;

  object-position: center;
  object-fit: contain;
}

.map__city p {
  position: absolute;
  top: 50%;
  left: 50%;
  padding: var(--padding-sm) var(--padding);
  border: var(--border);

  white-space: nowrap;
  background-color: var(--color-bg);
  color: var(--color-primary);

  transform: translate(-50%, -50%);
  opacity: 0;

  transition: opacity var(--transition-hover);
}

@media screen and (pointer: fine) {
  .map__item:hover .map__city p {
    opacity: 1;
  }
}

.map__label {
  display: block;
  margin-top: var(--padding-xs);
}

/* PAGE */

.page-container {
  position: relative;
  display: flex;
}

.page__article {
  position: relative;
  max-width: 44ch;
  min-width: 30ch;
  height: fit-content;
  min-height: var(--sizes-content-height);
  border-right: var(--border);
}

.article__header {
  position: sticky;
  top: var(--sizes-header-height);
  padding: var(--padding);
  border-bottom: var(--border);

  text-transform: uppercase;
  background-color: var(--color-bg);
  z-index: 100;
}

.article__map-wrapper {
  position: relative;
  width: 100%;
  padding: var(--padding-lg);
  padding-top: var(--padding-sm);

  display: flex;
  justify-content: center;
  align-items: center;
}

.article__map {
  width: 100%;
  /* max-height: var(--padding-xxl); */
  max-height: var(--padding-xxl);

  object-fit: contain;
}

.article__body {
  position: relative;
  padding: var(--padding-lg) var(--padding);
}

.article__body p:not(:last-child) {
  margin-bottom: var(--sizes-paragraph-gap-body);
}

.podcast-player {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  min-height: 0;
  padding: var(--padding-lg);
  box-sizing: border-box;
  overflow: hidden;
}

.podcast-player__embed {
  flex: 1 1 auto;
  width: 100%;
  height: 100%;
  min-height: 0;
  border: 0;

  display: block;
}

.podcast-player__audio {
  display: block;
  width: 100%;
  margin-top: auto;
  accent-color: var(--color-primary);
  background-color: var(--color-bg);
}

.podcast-player__audio::-webkit-media-controls-enclosure {
  background: transparent;
}

.page__gallery {
  position: sticky;
  top: var(--sizes-header-height);
  width: 100%;
  min-width: 50dvw;
  height: var(--sizes-content-height);

  overflow-y: auto;
}

.page__gallery:has(> .podcast-player) {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.page__gallery-item {
  position: relative;
  width: 100%;
  height: fit-content;

  display: flex;
}

.page__gallery-item:not(:last-child) {
  border-bottom: var(--border);
}

.page__gallery--single {
  position: sticky;
  top: var(--sizes-header-height);
  height: var(--sizes-content-height);
}

.page__gallery--single .page__gallery-item {
  height: var(--sizes-content-height);
}

.page__gallery--single .page__gallery-item__img {
  height: 100%;

  object-fit: cover;
}

.page__gallery-item__img {
  position: relative;
  width: 100%;
  height: auto;
  object-fit: contain;
}

.page__aside {
  position: sticky;
  top: var(--sizes-header-height);
  height: var(--sizes-content-height);
  /* width: fit-content; */
  min-width: 25ch;
  max-width: 30ch;
  width: 30ch;
  border-left: var(--border);

  display: flex;
  flex-flow: column;
  overflow-y: auto;
}

.aside__section {
  position: relative;
  padding: var(--padding);
  border-bottom: var(--border);

  background-color: var(--color-bg);
}

.aside__section p:not(:last-child) {
  margin-bottom: var(--sizes-paragraph-gap-section);
}

.aside__section--logos {
  /* display: flex;
  flex-flow: row wrap;
  gap: var(--padding); */

  padding: var(--padding-md);

  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--padding-lg);
}

.section__logo {
  width: 100%;
  max-width: var(--padding-xxl);
  aspect-ratio: 1;
  height: auto;

  align-self: center;
  justify-self: center;
  object-fit: contain;
}

.page__section-nav {
  display: none;
}

.aside__section-nav {
  position: sticky;
  top: 0;

  font-weight: var(--font-weight-bold);
  z-index: 100;
}

@media screen and (max-width: 1000px) {
  .nav-menu__list {
    position: fixed;
    top: var(--sizes-header-height);
    left: 0;
    right: 0;
    width: 100%;
    height: auto;
    /* border-bottom: var(--border); */

    display: flex;
    flex-flow: column-reverse;
    direction: ltr;
    grid-auto-flow: unset;
    grid-template-rows: unset;
    grid-auto-columns: unset;

    background-color: var(--color-bg);
    transition: opacity var(--transition-hover--long);
    opacity: 0;
    z-index: 999;
    overflow: hidden;
    pointer-events: none;
  }

  .nav-menu__list--open {
    opacity: 1;
    pointer-events: auto;
    overflow: visible;
  }

  .nav-menu__list li {
    display: flex;
    width: 100%;
    height: auto;
    flex: 0 0 auto;
    min-width: unset;
    min-height: unset;
    grid-row: unset;
    grid-column: unset;
  }

  .nav-menu__list li a {
    flex: 1 0 auto;
    height: var(--sizes-header-height);
    border-left: none;
    border-bottom: var(--border) !important;
  }

  .nav-menu__toggle {
    display: flex;
    border-bottom: none;

    z-index: 100;
  }

  .site-title__date {
    display: none;
  }

  .site-title__date:is(.front-page) {
    position: fixed;
    width: 100%;
    top: var(--sizes-header-height);
    left: 0;
    right: 0;
    padding: var(--padding-sm-semi) var(--padding);
    border-bottom: var(--border);

    display: flex;
  }

  .site-header__subtitle {
    display: none;
  }

  .site-header__subtitle:is(.front-page) {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: fit-content;
    border-top: var(--border);
    padding: var(--padding);

    display: flex;
    transform: none;

    font-size: var(--font-size-body);
    background-color: var(--color-bg);
  }

  /* PAGE */

  .page-container {
    width: 100%;
    flex-flow: column;
  }

  .page__article {
    border: none;
    width: 100%;
    min-width: unset;
    max-width: unset;
    min-height: unset;
    border-bottom: var(--border);
  }

  .article__map-wrapper {
    padding: var(--padding-lg);
    padding-top: var(--padding-sm);
  }

  .article__map {
    max-height: var(--padding-xl);
  }

  .page__gallery {
    position: relative;
    top: 0;
    min-width: unset;
    height: fit-content;
    border-top: var(--border);

    order: 2;
  }

  .page__gallery:has(> .map),
  .page__gallery:not(:has(> *)) {
    display: none;
  }

  .podcast-player {
    padding: var(--padding-lg) var(--padding);
  }

  .page__gallery:has(> .podcast-player) {
    border: none;
    height: var(--sizes-content-height);
    min-height: var(--sizes-content-height);
    overflow: hidden;
  }

  .page__aside {
    position: relative;
    top: 0;
    width: 100%;
    max-width: unset;
    min-width: unset;
    height: fit-content;
    border: none;

    overflow: hidden;
  }

  .aside__section:last-child {
    border: none;
  }

  .aside__section-nav {
    position: relative;
    top: unset;
    z-index: unset;

    display: none;
  }

  .page__section-nav {
    display: flex;
  }
}
