* {
  font-family: 'Montserrat', sans-serif;
  box-sizing: border-box;
}

html { scroll-behavior: smooth }

body { 
  margin: 0; 
  background: var(--body-color) 
}

header { background-color: #fff; 
  /* display: flex;} */}

h1 { 
  color: var(--h1-color); 
  font-size: var(--h1-size);
  line-height: var(--h1-line-height);
}

h2 { 
  color: var(--h2-color); 
  font-size: var(--h2-size);
  line-height: var(--h2-line-height);
}

h3 { 
  color: var(--h3-color); 
  font-size: var(--h3-size);
  line-height: var(--h3-line-height);
}

h4 { 
  color: var(--h4-color); 
  font-size: var(--h4-size);
  line-height: var(--h4-line-height);
}

h5 { 
  color: var(--h5-color); 
  font-size: var(--h5-size);
  line-height: var(--h5-line-height);
}

h2, h3, h4, h5 {
  margin-block-start: var(--h-margin-start);
  margin-block-end: var(--h-margin-end);
  padding: var(--h-padding);
}

.text-center {
  text-align: center !important;
}

hr {
  border: 0;
  border-bottom: 1px dashed var(--secondary-color);
  margin-block-start: var(--hr-margin-start);
  margin-block-end: var(--hr-margin-end);
}

hr.referencias {
  background-color: var(--tertiary-color);
  border: 0;
  height: 2px;
  margin: 3rem 0 1.5rem 0;
  max-width: 3rem;
  text-align: left;
}

p, li { 
  word-wrap: break-word;
  line-height: var(--p-line-height);
  font-weight: var(--p-weight);
  font-size: var(--p-size);
  margin: var(--p-margin);
}

a {
  color: var(--a-color);
  font-weight: var(--a-weight);
  font-size: var(--p-size);
  text-decoration: none;
}

sup {
  position: relative;
  display: inline-flex;
  line-height: 0;
  font-size: var(--sup-size);
}

sup a {
  font-size: var(--sup-size);
  position: relative;
  display: inline-flex;
  /*top: -0.5rem;*/
  align-items: center;
  justify-content: center;
  margin: 0px 2px;
  min-width: 14px;
  height: 14px;
  background: var(--lightest-contrast);
  border-radius: 3px;
}
sup a:hover {
  background: var(--lightest-secondary);
}

img {
  max-width: 100%;
}

/* Listas */

ol {
  padding-inline-start: 25px;

  & li {
    padding: 0;
    background-image: none;
    list-style: auto;
  }
}

ol > li > ul {
  & li {
    list-style: none;
    background-image: url(https://www.aemps.gob.es/assets/icons/listas/li-02.svg);
    background-repeat: no-repeat;
  }
}

ul > li > ol > li > ul {
  & li {
    list-style: none;
    background-image: url(https://www.aemps.gob.es/assets/icons/listas/li-02.svg);
    background-repeat: no-repeat;
    padding-left: 20px;
  }
}

ul {
  padding: 0;

  & li {
    list-style: none;
    background-image: url(https://www.aemps.gob.es/assets/icons/listas/li-01.svg);
    background-repeat: no-repeat;
    background-size: 10px;
    background-position-y: 6px;    
    padding-left: 20px;

    & ol li {
      background-image: none;
      list-style: auto;
      padding: 0;
    }
  }
}

ul > li > ul {

  & li {
    list-style: none;
    background-image: url(https://www.aemps.gob.es/assets/icons/listas/li-02.svg);
    background-repeat: no-repeat;

    & ol li {
      background-image: none;
      list-style: auto;
      padding: 0;
    }
  }
}

ul > li > ul > li > ul {

  & li {
    list-style: none;
    background-image: url(https://www.aemps.gob.es/assets/icons/listas/li-03.svg);
    background-repeat: no-repeat;
    background-size: 11px;
    background-position-y: 6px;

    & ol li {
      background-image: none;
      list-style: auto;
      padding: 0;
    }
  }
}

/*** Post Control ***/

#main > div {
  margin-top: 2rem;
  position: relative;
  z-index: 1;
  background-color: var(--post-bg-color); 
  box-shadow: 0 0 0 15px white; 
}

.cabecera {
  position: relative;
  height: auto;
  margin: 2rem -30px 0; 
}

.cabecera__img {
  width: 100%;
  margin-top: -15px;
  height: auto;
}

.cabecera div {
  position: absolute;
  width: 100%;
  left: 0;
  bottom: 0;
  padding: 0 30px; 
  background-color: rgb(0 0 0 / 65%);
}

/*** Breadcrumbs Control ***/

.pan {
  font-size: var(--p-size-xs);
  padding: .6rem 20px;
  color: #000;
  background: var(--lightest-bg);
  font-weight: 500;
  line-height: 1rem;
  border-radius: 8px;
  margin-top: 1rem;
  outline: solid 1px var(--lightest-secondary);
  border-radius: 8px;
}

.pan a {
  font-size: var(--p-size-xs);
  color: var(--hyperlink-color);
}

/*** Publication Date ***/

.publicacion__container {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  margin: 0.1rem 0;
  font-weight: var(--p-weight);
  font-size: var(--p-size);
  /*text-align: right;*/
  text-align: left;
}
.publicacion__container a {
  background-color: var(--secondary-color);
  color: #FFF;
  /*display: flex;*/
  display: inline-flex;
  /* justify-content: center;
  align-items: center;
  flex-wrap: wrap; */
  width: fit-content;
  padding: 0.6rem 1rem;
  text-align: center;
  font-size: 0.8rem;
  font-weight: 500;
  line-height: 1.25;
  border-radius: 20px;
  cursor: pointer;
  margin: 0.3rem 0;
}
.publicacion__container a:hover {
  background-color: var(--lighter-secondary);
}
.publicacion__container a:focus {
  background-color: var(--darker-secondary);
}
.publicacion__container a::after {
  content: '';
  background-image: url(/assets/icons/link.svg);
  background-repeat: no-repeat;
  background-size: 14px;
  background-position: center;
  width: 24px;
  height: 14px;
  position: relative;
  bottom: 1px;
}
.publicacion__container div {
  margin: var(--p-margin);
}
.publicacion__container div:not(:has(a)) {
  margin: var(--p-margin);
  flex-grow: 1;
  align-self: end;
  text-align: right;
}
.publicacion__container a:first-of-type {
  margin-right: .2rem;
}

.publicacion__fecha {
  text-align: right;
  line-height: var(--p-line-height);
  align-self: flex-end;
}

.separador {
  border: 0;
  border-bottom: 1px dashed var(--secondary-color);
}

/*** Button Control ***/

.aemps-btn__container,
.aemps-tags__container {
  display: flex;
  justify-content: center;
  gap: 1.2rem 1rem;
  flex-wrap: wrap;
  padding: 1rem 0;
}

.aemps-tags__container {
  justify-content: start;
  gap: 1rem .6rem;
}

.aemps-container__sweet-secondary,
.aemps-container__sweet-primary {
  display: grid;
  place-content: center;
  background: var(--lightest-bg);
  min-height: 4rem;
  border-radius: var(--radius-md);
  outline: 1px solid var(--lightest-secondary);
  padding: 1rem;
  margin: 1rem 0;

}

.aemps-btn, 
.aemps-btn-secondary,
.aemps-btn-tertiary,
.tags {
  cursor: pointer;
  padding: 0.6rem 1rem;
  text-align: center;
  font-size: var(--p-size-btn);
  font-weight: var(--p-weight);
  line-height: var(--p-btn-line-height);
  border-radius: var(--radius-xl);
}
.aemps-btn__container {
  & .aemps-btn, 
  & .aemps-btn-secondary,
  & .aemps-btn-tertiary {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    width: 200px;
  }
}
.aemps-btn__container-grid {
  margin: 1rem 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: .6rem;
}
.aemps-btn {
  background-color: var(--secondary-color);
  color: #FFF;
}

.btn-lg {
  width: fit-content !important;
  max-width: 416px; /* +16px para compensar el gap de 1rem de dos botones */
  padding: 0.6rem 1.5rem;
}

.btn-full {
  width: fit-content !important;
  padding: 0.6rem 1.5rem;
}

.aemps-btn-secondary {
  background: var(--primary-color);
  color: #FFF;
}

.aemps-btn-tertiary {
  background: var(--hyperlink-color);
  color: #FFF;
}

.aemps-btn:hover {
  background-color: var(--lighter-secondary);
}
.aemps-btn:focus{
  background-color: var(--darker-secondary);
}

.aemps-btn-secondary:hover {
  background-color: var(--lighter-primary);
}
.aemps-btn-secondary:focus{
  background-color: var(--darker-primary);
}

.aemps-btn-tertiary:hover {
  background-color: var(--tertiary-color);
}
.aemps-btn-tertiary:focus{
  background-color: var(--darker-tertiary);
  color: #FFF;
  font-weight: 500;
}

.tags { 
  width: fit-content;
  background: var(--secondary-color);
  color: #fff;
  padding: .2rem 1rem;
  font-size: var(--p-size-xs);
  font-weight: var(--p-weight);
  line-height: var(--p-line-height);
  border-radius: var(--radius-md);
}
/*ul > li:has(> a.tag) {
  padding: 0;
  background-image: none;
  margin: 0;

  & a.tag {
    font-size: var(--p-size-xs);
    font-weight: var(--p-weight);
    line-height: var(--p-line-height);
    color: #fff;
  }
}*/
.tags:hover {
  background-color: var(--lighter-secondary);
}
.tags {
  &:focus-within  {
    box-shadow: 0 0 0 4px var(--lightest-secondary);
    transition: box-shadow .2s;
  }
}

/*** Image Control ***/

.img-aemps-gallery img {
  border-radius: 8px;
}
.img-aemps-gallery {
  margin-top: 1rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: center; 
}
.img-aemps-gallery + .img-aemps-gallery {
  margin-top: 0;
}
.img-aemps {
  margin: 0.4rem 0.5rem;
}
.img-aemps img {
  width: 100%;
  height: auto;
  overflow: hidden;
  border-radius: 8px;
}
img.img-aemps {
  border-radius: 8px;
}
.img-aemps p {
  text-align: center;
  margin: 0.4rem 0;
}
.img-xs {
  width: 10%;
}
.img-sm {
  width: 20%;
}
.img-md {
  width: 30%;
}
.img-lg {
  width: 40%;
}
.img-xl {
  width: 60%;
}
.img-xxl {
  width: 90%;
}
.img-full {
  width: 100%;
  margin: 0.5rem auto;
}
.img-spaced {
  column-gap: 2rem;
}
.img-text {
  & img {
    margin-top: .8rem;
  }
}
.img-outline {
  outline: solid 1px var(--lighter-tertiary);
}

/* Imagen con texto adaptativo */

@media only screen and (max-width: 768px) {
  .img-text {
    display: grid;
  }
  .img-text .col-1,
  .img-text .col-2,
  .img-text .col-3,
  .img-text .col-4,
  .img-text .col-5,
  .img-text .col-6,
  .img-text .col-7,
  .img-text .col-8,
  .img-text .col-9,
  .img-text .col-10,
  .img-text .col-11,
  .img-text .col-12 {
    max-width: 100%;
    margin: auto;
    display: grid;
    & img {
      max-width: 60%;
      margin: 1rem auto;
    }
  }
}

/*** Perfiles ***/

.aemps-profile__container {
  display: flex;
  justify-content: center;
  padding: .4rem;
  margin: 1.5rem;
}
.aemps-profile__avatar {
  margin: 0 1.2rem;
  display: flex;
  align-items: center;
  gap: .8rem;
}
.aemps-profile__avatar img {
  width: var(--icon-size, 100px);
  height: var(--icon-size, 100px);
  border-radius: 50%;
  outline: 3px solid var(--lighter-secondary);
  outline-offset: 4px;
}
.aemps-profile__info {
  margin-left: .4rem;
}
.aemps-profile__info-name {
  color: var(--secondary-color);
  font-size: var(--h4-size);
  font-weight: var(--a-weight);
  line-height: var(--h4-line-height);
}
.aemps-profile__info-title {
  color: var(--tertiary-color);
  font-size: var(--h5-size);
  font-weight: var(--a-weight);
  line-height: 1rem;
}
.aemps-profile__data {
  display: grid;
  padding: .5rem 1rem;
  border-left: 3px solid var(--secondary-color);
}
.aemps-profile__data-info {
  display: flex;
  align-items: center;
  gap: .5rem;
}
.aemps-profile__data-tel, 
.aemps-profile__data-email {
  display: flex;
  height: 28px;
  width: 28px;
  background-color: var(--secondary-color);
  border-radius: 50%;
  background-position: center;
  background-size: 16px 16px;
  background-repeat: no-repeat;
}
.aemps-profile__data-tel {
  background-image: url(https://www.aemps.gob.es/assets/icons/sm-tel.png);
}
.aemps-profile__data-email {
  background-image: url(https://www.aemps.gob.es/assets/icons/sm-en.png);
}
@media screen and (max-width: 768px) {
  .aemps-profile__container {
    display: grid;
  }
  .aemps-profile__avatar {
    display: grid;
    text-align: center;
    & img {
      margin: auto;
    }
  }
  .aemps-profile__data {
    border-left: none;
    border-top: 3px solid var(--secondary-color);
    padding: 1rem 1rem 0 1rem;
    margin-top: .4rem;
    gap: .5rem;
  }
}

/*** Row Content ***/

.row-container .row {
  padding: 0.5rem 0;
  word-wrap: break-word; 
  line-height: var(--p-line-height);
  font-weight: var(--p-weight);
  font-size: var(--p-size);
}

/*** Calendarios ***/

.slider-aemps-container {
  position: relative;
  overflow: hidden;
}
.slider {
  display: flex;
  transition: transform 0s;
}
.slide {
  width: 100%;
  box-sizing: border-box;
}
.slider-items {
  display: flex;
  flex-wrap: wrap;
  outline: solid 1px var(--lighter-tertiary);
  background-color: var(--lightest-tertiary);
  border-radius: 28px;
  justify-content: center;
  gap: 0 0.8rem;
  padding: 0 1.5rem;
  margin: 1.5rem auto 1rem;
  width: fit-content;
  width: -moz-fit-content;
}
.slider-items a {
  padding: 0.5rem;
  font-size: var(--h4-size);
  line-height: 2rem;
  font-weight: 600;
}

/*** Carrousel Fechas Calendarios ***/

.calendar-container {
  position: relative;
  overflow: hidden;
  width: 85%;
  margin: 1.5rem auto 1rem;
  background-color: var(--lightest-bg);
  border-radius: 28px;
  outline: solid 1px var(--lightest-secondary);
  outline-offset: -1px;
}
.calendar-container:hover {
  transition: 0.1s;
  transition-timing-function: ease-in-out;
  box-shadow: 0 0 0 1px var(--lighter-secondary);
  outline: solid 2px var(--lighter-secondary);
}
.arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  padding: 16px;
  background-color: transparent;
  color: var(--lighter-secondary);
  text-align: center;
}
.arrow:hover {
  transition: 0.1s;
  background-color: var(--lighter-secondary);
  color: white;
}
.prev {
  left: 0;
  width: 5%;
}
.next {
  right: 0;
  width: 5%;
}
.calendar {
  display: flex;
  overflow-x: hidden;
  scroll-snap-type: x mandatory;
  width: 90%;
  margin: auto;
  justify-content: center;
}
.calendar-item {
  flex: 0 0 calc(100% / 10); /* 10 items visibles */
  scroll-snap-align: start;
  text-align: center;
  padding: 0.8rem;
}
.calendar-item:hover {
  transition: 0.1s;
  background-color: var(--lighter-secondary);
  & a {
    color: white;
  }
}
.calendar-item a {
  font-size: var(--h4-size);
  font-weight: bold;
  line-height: var(--h4-line-height);
  cursor: pointer;
  color: var(--hyperlink-color);
}
.active {
  color: var(--hyperlink-color);
  background-color: white;
}

/*** Video / iFrame ***/

.iframe-container {
  position: relative;
  width: calc(80% - 1px);
  height: 0;
  padding-bottom: 45%; /* Proporción 16:9 (9 dividido por 16 = 0.5625 o 56.25%) / 56% para evitar px vacío en bottom */
  margin: 1.5em auto 1em;
  & iframe {
    position: absolute;
    top: 0;
    left: 0;
    margin: 0 auto;
  }
}

iframe {
  position: relative;
  width: 100%;
  margin: 1.5em auto 1em;
  border-radius: 8px;
  outline: 1px solid var(--lightest-secondary);
  /*outline-offset: -1px;*/
  /*box-shadow: 0 0 0 1px var(--lightest-secondary);*/
}
.video-container {
  display: flex;
  justify-content: center;
  margin-top: 1.5em;
  margin-bottom: 1em;
}
video {
  margin-right: -1px;
  /*box-shadow: 0 0 0 1px var(--lightest-secondary);*/
  outline: 1px solid var(--lightest-secondary);
  border-radius: 8px;
}

/*** Swiper ***/

aemps-swiper {
  margin-top: 1.5rem;
  margin-bottom: 1.5rem;
}

/*** Correcciones particulares ***/

.text-left {
  text-align: left;
}
.text-center {
  text-align: center;
}
.text-right {
  text-align: right;
}
.text-justify {
  text-align: justify;
}
.align-self-center {
  align-self: center;
}
.text-primary {
  color: var(--primary-color);
}
.text-secondary {
  color: var(--secondary-color);
}
.text-tertiary {
  color: var(--tertiary-color);
}
.icon-inline {
  width: 15px;
  display: inline;
  margin: 0 .2rem;
}

/*** Fórmulas ***/

.formula {
  display: -webkit-box; 
  display: -ms-flexbox; 
  display: flex; 
  -webkit-box-pack: center; 
  -ms-flex-pack: center; 
  justify-content: center; 
  -webkit-box-align: center; 
  -ms-flex-align: center; 
  align-items: center;
  padding: 1rem 0;
  font-weight: bold;
  text-align: center;
  & .recta {
    border-bottom: 1px solid black; 
    padding: 0 10px 5px; 
    margin-bottom: 5px;
  }
}

/*** Medicamento ***/

.estructura {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  padding: 1rem;
  margin: 1rem 0;
  outline: solid 1px var(--lightest-secondary);
  background-color: var(--lightest-bg);
  gap: .5rem;
    & .aemps-btn > a {
      color: #fff;
      font-weight: var(--p-weight);
    }
}
.suma {
  height: 20px;
  width: 20px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  background: var(--lighter-secondary);
  color: #fff;
}

/********/

@media only screen and (max-width: 1024px) {
  .calendar-item {
  flex: 0 0 calc(100% / 6); 
  }
  .prev {
    width: 8.5%;
  }
  .next {
    width: 8.5%;
  }
  .calendar {
    width: 83%;
  }
}
@media only screen and (max-width: 768px) {
  .calendar-item {
    flex: 0 0 calc(100% / 4); 
  }
  .prev {
    width: 10%;
  }
  .next {
    width: 10%;
  }
  .calendar {
    width: 80%;
  }
}

.aemps-tabla__menor.outline {
  animation: fadeOut 0.8s forwards;
}

.row {
  /*padding: 0.5rem 0;*/
  word-wrap: break-word; 
  line-height: var(--p-line-height);
  font-weight: var(--p-weight);
  font-size: var(--p-size);
}

.col-lg-4 strong, .col-lg-4 p {
  padding-right: 2rem;
}

.oculto {
  display: none;
}

@keyframes fadeOut {
  0% {
    opacity: 0;
    box-shadow: 0 0 0 2px var(--lightest-secondary);
  }
  50% {
    opacity: 1;
    box-shadow: 0 0 0 2px var(--lightest-secondary);
  }
  100% {
    opacity: 1;
    box-shadow: none;
  }
}

/*** Mobile Adjustments ***/

@media only screen and (max-width: 768px) {
  :root {
  --h1-size: 1.2rem;
  --h2-size: 1.1rem;
  --h3-size: 1rem;
  --h4-size: 0.9rem;
  --h5-size: 0.8rem;

  --p-size: 0.8rem; 
  --p-line-height: 1.4rem;
  }

  .img-sm {
    width: 30%;
  }
  .img-md {
    width: 45%;
  }
  .img-lg,
  .img-xl,
  .img-xxl {
    width: 100%;
  }
  
  .publicacion__fecha {
    flex-grow: 1;
    text-align: start;
  }
}

/* Correcciones rápidas */

.main-menu > li {
  background-image: none;
}
li .dropdown-content > * {
  background-image: none;
  padding-left: 0;
  margin-top: 0;
}
.dropdown .dropdown-item {
  margin-top: 0;
  background-image: none;
}
.aemps-social-icons li {
  background-image: none;
  padding-left: 0;
}
@media not print {
  .entry-content
  a[target="_blank"]:not(.aemps-btn):not(.aemps-btn-secondary):not(.aemps-btn-tertiary):not(a:has(img)):not(.publicacion__container a)::after {
    background: url(/assets/icons/ext-link.svg) no-repeat center right;
    content: '‎';
    padding-right: 26px;
    padding-top: 2px;
    background-repeat: no-repeat;
    background-size: 24px 24px;
    & img::after {
      content: none;
    }
  }
}