/* === FONT FACES === */
@font-face {
  font-family: 'saira';
  src: url('SairaUNSAM-Medium.otf') format('opentype');
  font-display: swap;
}
@font-face {
  font-family: 'sairaitalic';
  src: url('SairaUNSAM-MediumItalic.otf') format('opentype');
  font-display: swap;
}
@font-face {
  font-family: 'faustina';
  src: url('Faustina-Medium.ttf') format('truetype');
  font-display: swap;
}
@font-face {
		font-family: "Roboto Slab";
		src: url('RobotoSlab.ttf') format('truetype');
    font-style: normal;
	}

  /* === GLOBAL === */
html {
  cursor: url("https://files.catbox.moe/rim72s.cur"), auto;
}
body {
  min-height: 100vh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  background-image: url('hoyerdoble5.png'); 
  background-size: 50vw 1500px;
  background-repeat: repeat;
  background-position: top center;
  color: rgb(0, 0, 0);
}
.do-not-split {
  break-inside: avoid;
}
p, a {
  color: #c7dac6;
}

/* === TYPOGRAPHY === */
h1 {
  font-family: 'faustina', Arial, sans-serif;
  font-size: 1.8em;
  color: #c7dac6;
  letter-spacing: 0.03em;
  margin: 0.4em 0;
  text-align: center;
}
h2 {
  font-family: 'saira', monospace, sans-serif;
  font-size: 1em;
  color: #c7dac6;
  letter-spacing: 0.02em;
  margin: 2em 0;
  text-align: justify;
}
h3 {
  font-family: 'saira', monospace, sans-serif;
  font-size: 0.9em;
  color: #c7dac6;
  letter-spacing: 0.02em;
  margin: 2em 0;
  column-count: 2;
  column-gap: 2em; 
}
h4 {
  font-family: 'Roboto Slab', monospace, sans-serif;
  font-size: 1.2em;
  color: #000;
  letter-spacing: 0.02em; 
  font-weight: 500;
  margin-bottom: 0.5em;
}
h5 {
  font-family: 'Roboto Slab', monospace, sans-serif;
  font-size: 0.9em;
  color: #000;
  letter-spacing: 0.02em;
  line-height: 1.4em;
  margin: 1em 0;
  font-weight: 400;
}

b {
  font-weight: 700;
}

/* === LAYOUT === */
.center-box {
  width: 100%;
  max-width: 45vw;
  background: rgba(0, 61, 41, 0.7);
  border: 2px solid rgba(0, 48, 32, 0.8);
  margin: 11vh 0 5em 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding: 0 2vw;
  box-sizing: border-box;
  text-align: left;
}

/* === MAP & FULLSCREEN BUTTON === */
#map {
  position: relative;
}
#fullscreen-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 1001;
  background: #fff;
  border: 1px solid #888;
  border-radius: 6px;
  padding: 8px 14px;
  font-size: 1.1em;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  transition: background 0.2s;
}
#fullscreen-btn:hover {
  background: #f0f0f0;
}
#map.fullscreen {
  position: fixed !important;
  top: 0; left: 0; right: 0; bottom: 0;
  width: 100vw !important;
  height: 100vh !important;
  min-width: 100vw !important;
  min-height: 100vh !important;
  max-width: 100vw !important;
  max-height: 100vh !important;
  z-index: 1000;
  background: #000; 
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: none;
}

/* === SIDEBAR === */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: 10vw;
  height: 100vh;
  background: #003D29;
  border-right: 2px solid #003020;
  padding-top: 2em;
  z-index: 2000;
  box-shadow: 2px 0 8px rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  overflow: auto;
}
.sidebar-logo {
  width: 9vw;
  max-width: 100%;
  margin: 0;
  height: auto;
  align-self: center;
}
.sidebar ul {
  list-style: none;
  padding: 0;
  margin: 0;
  width: 100%;
}
.sidebar li {
  width: 100%;
}
.sidebar a {
  display: block;
  width: 100%;
  padding: 1em 0.5em;
  color: #c7dac6;
  text-decoration: none;
  font-family: 'sairaitalic', Arial, sans-serif;
  font-size: 1.1em;
  letter-spacing: 0.04em;
  transition: background 0.2s, color 0.2s;
}
.sidebar a:hover,
.sidebar a:focus {
  background: #004F35;
  color: #76a188;
}

/* === SIDEBAR RESPONSIVE TOGGLING === */
.sidebar-mobile { display: none; }
.sidebar-desktop { display: block; }

/* === SIDEBAR DESKTOP === */
.sidebar-desktop {
  position: fixed;
  top: 0;
  left: 0;
  width: 96vw;
  height: auto;
  background: #003D29;
  border-right: none;
  border-bottom: 2px solid #003020;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  z-index: 2000;
  padding: 0vw 2vw 0vw 2vw;
  overflow-x: hidden;
}
.sidebar-desktop .sidebar-logo {
  width: 11vw;
  height: auto;
  margin: 0.5vw 0 0 0;
  align-self: center;
}
.sidebar-desktop ul {
  display: flex;
  flex-direction: row;
  align-items: center;
  margin: 0;
  padding: 0;
  list-style: none;
  height: auto;
}
.sidebar-desktop li {
  width: auto;
  margin: 0 1vw;
  text-align: center;
}
.sidebar-desktop a {
  padding: 0vw 0vw;
  font-size: 1.1em;
  width: auto;
  display: block;
  font-family: 'saira', Arial, sans-serif;
}

/* === BACK BUTTON === */
.back-btn {
  position: relative;
  align-self: flex-end;
  bottom: 15px;
  padding: 0.5em 1em;
  background: #003020;
  color: #fff;
  border: 3px solid #003020;
  border-radius: 5px;
  font-size: 1.1em;
  cursor: pointer;
  z-index: 10;
  transition: background 0.2s;
  font-family: 'saira', Arial, sans-serif;
}
.back-btn:hover {
  background: #003321;
}

/* === GALLERY === */
.gallery {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin: 10px 0;
  justify-items: center;
}
.gallery img {
  width: 100%;
  max-width: 420px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.18);
  background: #eee;
  transition: transform 0.2s, box-shadow 0.2s;
  display: block;
}
.gallery > div {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.img-caption {
  text-align: center;
  font-size: 0.80em;
  color: #818181;
  margin: 0;
  font-style: italic;
  font-family: 'saira', Arial, sans-serif;
}

/* === LIGHTBOX === */
.lightbox {
  display: none;
  position: fixed;
  z-index: 3000;
  left: 0; top: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0,0,0,0.85);
  justify-content: center;
  align-items: center;
  cursor: zoom-out;
}
.lightbox img {
  max-width: 90vw;
  max-height: 90vh;
  width: auto;
  height: auto;
  box-shadow: 0 8px 40px rgba(0,0,0,0.30);
  display: block;
}

/* === BOSQUECITO IMAGE === */
.bosquecito-img {
  width: 300px;
  height: auto;
  object-fit: cover;
  display: block;
  margin-left: auto;
  margin-right: auto;
  max-width: 100%;
}

/* === MANDARINA POPUP === */
.mandarina-container {
  position: relative; 
  display: inline-block;
}
#gracias {
  display: block; 
  position: relative;  
  margin-left: auto; 
  margin-right: 0; 
  width: 5em; 
  height: auto; 
  cursor: pointer;
  font-size: 1em;
  background: #1c5a46; 
  border: solid 2px #003323; 
  border-radius: 6px; 
  padding: 7px 9px; 
  color: #fff5da; 
  font-family: 'sairaitalic', monospace, sans-serif;
}
.agradecimientos {
  display: none; 
  position: absolute; 
  bottom: 55px; 
  right: -5em; 
  background: rgba(255, 255, 255, 0.8); 
  color: #222; 
  border-radius: 4px; 
  box-shadow: 0 2px 12px rgba(0,0,0,0.15); 
  padding: 10px 15px; 
  z-index: 2000; 
  min-width: 200px; 
  max-width: 200px; 
  text-align: center;
}

/* === LEAFLET POPUP & INTERACTIVE === */
.leaflet-popup-content {
  letter-spacing: 0.05em;
  line-height: 1.5em;
  word-spacing: 0.001em;
}
.leaflet-interactive:focus {
  outline: none !important;
  box-shadow: none !important;
}

/* === RESPONSIVE: MOBILE === */
@media (max-width: 700px) {
  .sidebar-mobile { display: block; }
  .sidebar-desktop { display: none; }
  body {
    padding: 0;
    margin: 0;
    box-sizing: border-box;
    background-image: url('hoyerdoblemovil.png');
    background-size: 100vw 750px;
    background-repeat: repeat;
    background-position: center center;
  }
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    border-bottom: 2px solid #003020;
    max-width: 100vw;
    min-width: 0;
    height: auto;
    border-right: none;
    box-shadow: none;
    padding: 0;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    z-index: 2000;
  }
  .sidebar ul {
    display: flex;
    flex-direction: row;
    width: 100%;
    justify-content: space-around;
    margin: 0;
    padding: 0;
    flex-wrap: nowrap;
    align-content: center;
    align-items: stretch;
  }
  .sidebar li {
    width: 100%;
    font-size: 0.8em;
    margin-left: 0;
    text-align: center;
  }
  .sidebar a {
    padding: 0;
    font-size: 0.95em;
    width: 100%;
    font-family: 'saira', Arial, sans-serif;
  }
  .sidebar-logo {
    width: 130px;
    margin: 0.5vw 0 0 4vw;
    align-self: center;
    align-items: center;
  }
  .center-box {
    display: block;
    margin: 7em 5vw 4em 5vw;
    width: 100%;
    max-width: 88vw;
    min-width: 0;
    padding: 0 3vw 1em 3vw;
    box-sizing: border-box;  
  }
  .center-box img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto 18px auto;
    box-sizing: border-box;
  }
  h1 { font-size: 1.4em; }
  h2 { font-size: 0.9em; }
  h3 { font-size: 0.9em; column-count: 1 !important; column-gap: 0 !important; }
  h4 { font-size: 1.1em; }
  h5 { font-size: 0.9em; line-height: 1.4em; }
 .mandarina-container { position: relative; display: inline-block; }
  #gracias {
    display: block; 
    position: relative; 
    margin-left: auto; 
    margin-right: auto; 
    width: 20vw; 
    height: auto; 
    cursor: pointer;
    font-size: 0.9em;
    background: #1c5a46; 
    border: solid 2px #003323; 
    border-radius: 6px; 
    padding: 5px 7px; 
    color: #fff5da; 
    font-family: 'sairaitalic', monospace, sans-serif;
  }
  .agradecimientos {
    display: none; 
    position: absolute; 
    bottom: 11vw; 
    right: 12vw; 
    background: rgba(255, 255, 255, 0.8); 
    color: #222; 
    border-radius: 4px; 
    box-shadow: 0 2px 12px rgba(0,0,0,0.15); 
    padding: 10px 10px; 
    z-index: 2000; 
    min-width: 170px; 
    max-width: 170px; 
    text-align: center;
  }

  #map {
    width: 81vw !important;
    height: 70vw !important;
    min-height: 300px;
    max-height: 70vh;
    margin: 0 auto;
    border-radius: 1vw;
  }
  .leaflet-tooltip { display: none !important; }
  .leaflet-interactive {
    stroke-width: 9px !important;
    stroke-dasharray: 1,10;
  }
  audio,
  audio::-webkit-media-controls-panel {
    width: 100% !important;
  }
  .contacto-box {
    flex-direction: column !important;
    width: 95% !important;
    gap: 5px !important;
    padding: 10px 2vw 10px 2vw !important;
  }
  .contacto-box > div {
    min-width: 0 !important;
    width: 100% !important;
    align-items: stretch !important;
    justify-content: flex-start !important;
  }
  .contacto-box .mandarina-container {
    width: 100%;
    display: flex;
    justify-content: center;
    margin-top: 5px;
  }
}