* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}


:root {
  --module: 12.2pt;
  --font-size: 12pt;
  --page-bottom-margin: var(--module);

  --black: #000000;
  --grey: #9a9a9a;

  --grid-color: rgba(0, 0, 0, 0.22);

  --small-column-width: 100px;
  --large-column-width: 300px;

  --gutter-width: 20px;

  --column-system-width: 700px;

  --selection-image-height: 100px;

  --map-height: 400px;

  --table-id-width: 60px;
  --table-country-width: 100px;
  --table-type-width: 100px;
  --table-project-width: 200px;
  --table-author-width: 200px;
  --table-decade-width: 80px;
}


html,
body {
  width: 100%;
  min-height: 100%;
}


body {
  background: #ffffff;

  font-family:
    "Times New Roman",
    Times,
    serif;

  font-size: var(--font-size);
  line-height: var(--module);

  color: var(--black);
}


body::after {
  content: "";
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  height: var(--page-bottom-margin);
  background: #ffffff;
  pointer-events: none;
  z-index: 1001;
}


/* ============================================== */
/* RETÍCULA                                       */
/* ============================================== */

.grid {
  position: fixed;

  inset: 0;

  width: 100vw;
  height: calc(100vh - var(--page-bottom-margin));

  background-size:
    var(--module) var(--module);

  background-image:
    linear-gradient(
      to right,
      var(--grid-color) 0.5px,
      transparent 0.5px
    ),
    linear-gradient(
      to bottom,
      var(--grid-color) 0.5px,
      transparent 0.5px
    );

  pointer-events: none;

  z-index: 0;
}


.grid-baseline {
  position: fixed;
  left: 0;
  bottom: calc(var(--page-bottom-margin) - 1px);
  width: 100vw;
  height: 1px;
  background-image: linear-gradient(
    to bottom,
    var(--grid-color) 0.5px,
    transparent 0.5px
  );
  pointer-events: none;
  z-index: 1002;
}


/* ============================================== */
/* CONTENIDO                                      */
/* ============================================== */

.content {
  position: relative;

  width: 100%;
  min-height: 100vh;

  z-index: 1;
}


.layout {
  position: relative;

  width: 100%;

  padding-top: var(--module);
  padding-left: var(--module);
  padding-right: var(--module);
  padding-bottom: var(--page-bottom-margin);
}


/* ============================================== */
/* BOTONES                                        */
/* ============================================== */

.text-button {
  display: block;

  width: max-content;
  max-width: 100%;

  height: var(--module);

  margin: 0;
  padding: 0;

  border: 0;

  background: transparent;

  font-family:
    "Times New Roman",
    Times,
    serif;

  font-size: var(--font-size);
  font-weight: normal;

  line-height: var(--module);

  color: var(--black);

  text-align: left;

  white-space: nowrap;

  cursor: pointer;
}


#main-menu {
  position: fixed;
  top: calc(2 * var(--module));
  left: var(--module);
  width: var(--small-column-width);
  z-index: 30;
}


#site-name {
  position: fixed;
  top: var(--module);
  left: var(--module);
  z-index: 31;
}


/* ============================================== */
/* DESPLEGABLES                                   */
/* ============================================== */

.collapsible-content {
  display: none;
}


.collapsible-content.is-open {
  display: block;
}


.collapsible-content.flyout-content {
  position: fixed;

  top: var(--module);

  z-index: 10;
}


/* ============================================== */
/* COLUMNAS                                       */
/* ============================================== */

.flyout-content[data-column="2"] {
  left:
    calc(
      var(--module)
      + var(--small-column-width)
      + var(--gutter-width)
    );

  width: var(--small-column-width);
}


.flyout-content[data-column="3"] {
  left:
    calc(
      var(--module)
      + (2 * var(--small-column-width))
      + (2 * var(--gutter-width))
    );

  width: var(--small-column-width);
}


.flyout-content[data-column="4"] {
  left:
    calc(
      var(--module)
      + (3 * var(--small-column-width))
      + (3 * var(--gutter-width))
    );

  width:
    calc(
      var(--large-column-width)
      + var(--module)
    );
}


/* ============================================== */
/* TEXTO                                          */
/* ============================================== */

.line {
  min-height: var(--module);

  font-family:
    "Times New Roman",
    Times,
    serif;

  font-size: var(--font-size);
  font-weight: normal;

  line-height: var(--module);

  color: var(--black);

  white-space: nowrap;
}


.paragraph {
  width: 100%;

  font-family:
    "Times New Roman",
    Times,
    serif;

  font-size: var(--font-size);
  font-weight: normal;

  line-height: var(--module);

  color: var(--black);

  white-space: normal;

  text-align: justify;
  text-align-last: left;

  hyphens: none;
}


/* ============================================== */
/* HORTART                                        */
/* ============================================== */

#hortart-content .project-media {
  position: fixed;

  top: var(--module);

  left:
    calc(
      var(--module)
      + (3 * var(--small-column-width))
      + (3 * var(--gutter-width))
    );

  width:
    calc(
      var(--large-column-width)
      + var(--module)
    );

  z-index: 20;
}


.project-image-test {
  display: block;

  width: 100%;

  aspect-ratio: 3 / 2;

  background: #000000;
}


/* ============================================== */
/* MAPA                                           */
/* ============================================== */

#map-content .map-panel {
  position: fixed;

  top: var(--module);

  left:
    calc(
      var(--module)
      + (3 * var(--small-column-width))
      + (3 * var(--gutter-width))
    );

  width:
    calc(
      var(--large-column-width)
      + var(--module)
    );

  height: var(--map-height);

  overflow: hidden;

  background: transparent;

  z-index: 20;
}


#europe-map {
  width: 100%;
  height: 100%;

  background: transparent;
  border: 0.5px solid #000000;
}


.maplibregl-map {
  background: transparent;
}


.maplibregl-canvas {
  outline: none;
}


.map-border-country-label {
  display: block;
  color: #000000;
  background: rgba(255, 255, 255, 0.85);
  font: 12px "Times New Roman", Times, serif;
  white-space: nowrap;
  padding: 1px 3px;
  pointer-events: none;
  user-select: none;
}


.map-expanded-view {
  position: absolute;
  inset: 0;

  z-index: 2;

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

  background: #000000;
}

.map-expanded-view[hidden] {
  display: none;
}

.map-expanded-image {
  display: block;

  width: 80%;
  height: 80%;

  object-fit: contain;
}

.map-expanded-credit {
  position: absolute;
  left: 0;
  bottom: 0;
  z-index: 3;
  font-family: "Times New Roman", Times, serif;
  font-size: 12pt;
  font-weight: normal;
  line-height: var(--module);
  color: #ffffff;
  white-space: nowrap;
  pointer-events: none;
  user-select: none;
}

.map-image-navigation-cursor {
  position: fixed;

  z-index: 1000;
  pointer-events: none;

  font-family: "Times New Roman", Times, serif;
  font-size: var(--font-size);
  line-height: var(--module);

  color: #ffffff;
  mix-blend-mode: difference;
  white-space: nowrap;
}

.map-image-navigation-cursor[hidden] {
  display: none;
}

body.has-expanded-image .map-expanded-view.has-navigation-action,
body.has-expanded-image .map-expanded-view.has-navigation-action * {
  cursor: none !important;
}

body.has-expanded-image .map-selection-image.has-image,
body.has-expanded-image .map-selection-gallery-image,
body.has-expanded-image .map-selection-coordinates {
  cursor: pointer !important;
}


/* ============================================== */
/* FICHA                                          */
/* ============================================== */

#map-content {
  width:
    calc(
      (2 * var(--small-column-width))
      + var(--gutter-width)
    );
}


.map-selection {
  display: none;

  width: 100%;
}


.map-selection.is-visible {
  display: block;
}


.map-selection-header,
.map-selection-preview {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: var(--gutter-width);

  height: var(--selection-image-height);
}


.map-selection-details {
  position: relative;

  min-width: 0;
  height: var(--selection-image-height);
}

.map-selection-more {
  position: absolute;
  right: 0;
  bottom: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--grey);
  font: inherit;
  font-size: var(--font-size);
  line-height: var(--module);
  cursor: pointer;
}

.map-selection-more[hidden] {
  display: none;
}


.map-selection-code {
  position: absolute;
  top: 0;
  left: 0;

  font-size: var(--font-size);
  line-height: var(--module);
  color: #000000;
  white-space: nowrap;
}


.map-selection-information {
  position: absolute;
  top: 0;
  right: 0;

  max-width: calc(100% - (5 * var(--module)));
  text-align: right;
}


.map-selection-image {
  width: 100%;
  height: var(--selection-image-height);

  background: #000000;

  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}


.map-selection-preview-image {
  pointer-events: none;
}

.map-selection-preview {
  display: none;
}

.map-selection.is-preview .map-selection-preview {
  display: grid;
}

.map-selection.is-preview > :not(.map-selection-preview) {
  display: none;
}


.map-selection-image.has-image,
.map-selection-gallery-image {
  cursor: pointer;
}

.map-selection-image.has-image:hover,
.map-selection-gallery-image:hover {
  opacity: 0.5;
}


.map-selection-title {
  width: 100%;

  font-family:
    "Times New Roman",
    Times,
    serif;

  font-size: var(--font-size);
  font-weight: normal;

  line-height: var(--module);

  color: #000000;

  text-align: right;

  white-space: normal;
  overflow-wrap: anywhere;
}


.map-selection-author {
  width: 100%;

  font-family:
    "Times New Roman",
    Times,
    serif;

  font-size: var(--font-size);
  font-style: italic;
  line-height: var(--module);

  color: #000000;

  text-align: right;
  white-space: normal;
  overflow-wrap: anywhere;
}


.map-selection-decade {
  font-size: var(--font-size);
  line-height: var(--module);
  color: #000000;
  text-align: right;
}


.map-selection-coordinates {
  display: block;

  width: max-content;
  max-width: 100%;

  font-family: "Times New Roman", Times, serif;
  font-size: var(--font-size);
  font-style: normal;
  line-height: var(--module);

  color: #000000;
  text-decoration: none;
  cursor: pointer;
}

.map-selection-coordinates[hidden] {
  display: none;
}

.map-selection-coordinates:hover {
  color: var(--grey);
}


.map-selection-gallery[hidden] {
  display: none;
}

.map-selection-gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--module) var(--gutter-width);
  align-content: start;

  margin-top: var(--module);

  overflow-x: hidden;
  overflow-y: auto;
  scroll-snap-type: y mandatory;

  scrollbar-width: none;
}

.map-selection-gallery::-webkit-scrollbar {
  display: none;
}

.map-selection-gallery-image {
  display: block;

  width: 100%;
  height: var(--selection-image-height);
  scroll-snap-align: start;

  object-fit: cover;
  background: #000000;
}


/* En las fotos el gris debe ser opaco para conservar el mismo tono visible. */
.project-image-test,
.map-selection-image,
.map-selection-gallery-image {
  border: 0.5px solid #c7c7c7;
}


.map-expanded-image,
.map-selection-image,
.map-selection-gallery-image {
  -webkit-user-select: none;
  user-select: none;
  -webkit-user-drag: none;
}


/* ============================================== */
/* TABLA                                          */
/* ============================================== */

.map-table {
  position: fixed;

  top:
    calc(
      (2 * var(--module))
      + var(--map-height)
    );

  left:
    calc(
      var(--module)
      + (3 * var(--small-column-width))
      + (3 * var(--gutter-width))
    );

  width:
    calc(
      var(--large-column-width)
      + var(--module)
    );

  height:
    calc(
      100vh
      - var(--map-height)
      - (2 * var(--module))
      - var(--page-bottom-margin)
    );

  z-index: 20;

  overflow: visible;
}


/* ============================================== */
/* CABECERA                                       */
/* ============================================== */

.map-table-header {
  display: grid;

  grid-template-columns:
    var(--table-id-width)
    var(--table-country-width)
    var(--table-type-width)
    var(--table-project-width)
    var(--table-author-width)
    var(--table-decade-width);

  column-gap: var(--module);

  width: 100%;

  height: var(--module);
}


.map-table-header-cell {
  position: relative;

  min-width: 0;

  height: var(--module);

  font-family:
    "Times New Roman",
    Times,
    serif;

  font-size: var(--font-size);
  font-weight: normal;

  line-height: var(--module);

  color: #000000;

  white-space: nowrap;

  overflow: hidden;

  text-overflow: ellipsis;
}


.map-table-header-cell:last-child {
  overflow: visible;
  text-overflow: clip;
  text-align: right;
}


.map-table-header-cell:first-child {
  overflow: visible;
  z-index: 1;
}


.map-random-button {
  display: block;
  width: 100%;
  height: var(--module);
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  line-height: var(--module);
  text-align: left;
  white-space: nowrap;
  cursor: pointer;
}

.map-random-button::before {
  content: "(#)";
}

.map-random-button:hover::before,
.map-random-button:focus-visible::before {
  content: "(random)";
}

.map-random-button.is-randomized:hover::before,
.map-random-button.is-randomized:focus-visible::before {
  content: "(sort)";
}


/* ============================================== */
/* COUNTRY / TYPE                                 */
/* ============================================== */

.filter-cell {
  overflow: visible;
}


.map-filter-button {
  display: flex;

  align-items: baseline;

  width: 100%;
  height: var(--module);

  margin: 0;
  padding: 0;

  border: 0;

  background: transparent;

  font-family:
    "Times New Roman",
    Times,
    serif;

  font-size: var(--font-size);
  font-weight: normal;

  line-height: var(--module);

  color: #000000;

  text-align: left;

  white-space: nowrap;

  cursor: pointer;
}


.map-filter-button:hover {
  color: var(--grey);
}


.map-filter-label {
  flex: 0 0 auto;
}


.map-filter-status {
  display: flex;

  align-items: baseline;

  margin-left: auto;

  text-align: right;
}


.map-filter-current {
  text-align: right;
}


/* ============================================== */
/* MENÚ HACIA ARRIBA                              */
/* ============================================== */

.map-filter-menu {
  display: none;

  position: absolute;

  left: 0;

  bottom: var(--module);

  width: 100%;

  background: transparent;

  z-index: 50;
}


.map-filter-menu.is-open {
  display: block;
}


/* ============================================== */
/* OPCIONES                                       */
/* ============================================== */

.map-filter-option {
  display: block;

  width: 100%;
  height: var(--module);

  margin: 0;
  padding: 0;

  border: 0;

  background: transparent;

  font-family:
    "Times New Roman",
    Times,
    serif;

  font-size: var(--font-size);
  font-weight: normal;

  line-height: var(--module);

  color: var(--grey);

  text-align: right;

  white-space: nowrap;

  cursor: pointer;
}


.map-filter-option:hover,
.map-filter-option.is-selected {
  color: #000000;
}


/* ============================================== */
/* CUERPO                                         */
/* ============================================== */

.map-table-body {
  width: 100%;

  height:
    calc(
      100%
      - (2 * var(--module))
    );

  margin-top: var(--module);

  overflow-y: auto;
  overflow-x: hidden;
  scroll-snap-type: y mandatory;
  overscroll-behavior-y: none;

  scrollbar-width: none;
}


.map-table-body::-webkit-scrollbar {
  display: none;
}


/* ============================================== */
/* FILAS                                          */
/* ============================================== */

.map-table-row {
  display: grid;
  scroll-snap-align: start;

  grid-template-columns:
    var(--table-id-width)
    var(--table-country-width)
    var(--table-type-width)
    var(--table-project-width)
    var(--table-author-width)
    var(--table-decade-width);

  column-gap: var(--module);

  width: 100%;

  min-height: var(--module);

  cursor: pointer;
}


.map-table-cell {
  min-width: 0;

  height: var(--module);

  font-family:
    "Times New Roman",
    Times,
    serif;

  font-size: var(--font-size);
  font-weight: normal;

  line-height: var(--module);

  color: #000000;

  white-space: nowrap;

  overflow: hidden;

  text-overflow: ellipsis;
}


.map-table-row .map-table-cell:first-child {
  overflow: visible;
  text-overflow: clip;
}


.map-table-row .map-table-cell:last-child {
  overflow: visible;
  text-overflow: clip;
  text-align: right;
}


/* FILA SELECCIONADA */

.map-table-row.is-selected {
  background-color: #000000;
}


.map-table-row.is-selected
.map-table-cell {
  color: #ffffff;
}


.map-table-row:not(.is-selected):hover,
.map-table-row:not(.is-selected).is-hovered {
  background-color: var(--grey);
}

.map-table-row:not(.is-selected):hover .map-table-cell,
.map-table-row:not(.is-selected).is-hovered .map-table-cell {
  color: #ffffff;
}


/* ============================================== */
/* ATRIBUCIÓN                                     */
/* ============================================== */

.maplibregl-ctrl-attrib {
  font-family:
    "Times New Roman",
    Times,
    serif;

  font-size: 8px;

  line-height: 10px;
}


.maplibregl-ctrl-attrib-button {
  border-radius: 0;
}


/* ============================================== */
/* MODO DE FOCO                                   */
/* ============================================== */

body.focus-mode .text-button,
body.focus-mode .line,
body.focus-mode .paragraph {
  color: var(--grey);
}


#site-name,
body.focus-mode #site-name {
  color: var(--black);
}


body.focus-mode .active-title {
  color: var(--black);
}


body.focus-mode .active-content,
body.focus-mode .active-content .text-button,
body.focus-mode .active-content .line,
body.focus-mode .active-content .paragraph {
  color: var(--black);
}


/* ============================================== */
/* HOVER                                          */
/* ============================================== */

body.focus-mode .text-button:hover,
body.focus-mode .line:hover,
body.focus-mode .paragraph:hover {
  color: var(--black);
}
