/* funcionamiento básico del sistema de pestañas */
.tab-content {
  display: none;
}

.tab:target .tab-content, .tab:last-of-type .tab-content {
  display: block;
}

.tab:target ~ .tab:last-of-type .tab-content {
  display: none;
}

/* parámetros para configurar las pestañas */
:root {
  --tabs-border-color: #daa520;
  --tabs-border-size: 3px;
/*  --tabs-text-color: #b22222;*/
  --tabs-dark-color: #faebd7;
  --tabs-lite-color: #fffaf0;
  --tabs-width: 200px;
  --tabs-height: 40px;
}

/* aspecto básico */
body {
  font-family: sans-serif;
  line-height: 1.2;
}
h2, p {
  margin: 100;
} 
a {
  color: inherit;
  text-decoration: none;
} 
.tabs * {
  box-sizing: border-box;
}

/* esto es para posicionar las pestañas correctamente */
.tab-container {
  position: relative;
  padding-top: var(--tabs-height); /* en esta zona colocaremos las pestañas */
} 
#main>a { --tabs-position: 0; }
#tab2>a { --tabs-position: 1; }
#tab3>a { --tabs-position: 2; }
#tab4>a { --tabs-position: 3; }
#tab5>a { --tabs-position: 4; }
#tab6>a { --tabs-position: 5; }
#tab7>a { --tabs-position: 6; }
#tab8>a { --tabs-position: 7; }
#tab9>a { --tabs-position: 8; }
.tab>a {
  text-align: center;
  position: absolute;
  width: calc(var(--tabs-width));
  height: calc(var(--tabs-height) + var(--tabs-border-size)); 
  top: 0;
  left: calc(var(--tabs-width) * var(--tabs-position)); /* posición de cada pestaña */
}

/* más aspecto */
.tabs { 
  padding: 10px;
  color: var(--tabs-text-color);
}
.tab-content {
  background-color: var(--tabs-lite-color); 
  padding: 20px;
  border: var(--tabs-border-size) solid var(--tabs-border-color);
  border-radius: 0 0 10px 10px;
  position: relative;
  z-index: 100;
}
.tab>a {
  background-color: var(--tabs-dark-color); 
  padding: 10px;
  border: var(--tabs-border-size) solid var(--tabs-border-color);
  border-radius: 10px 10px 0 0;
  border-bottom: 0;
}
.tab:target>a, .tab:last-of-type>a {
  background-color: var(--tabs-lite-color); 
  z-index: 200;
}
.tab:target ~ .tab:last-of-type>a {
  background-color: var(--tabs-dark-color); 
  z-index: 0; 
}