/* ===============================
   CABECERA / RIBBON SOBRE LA OLA
=============================== */
.bio-header {
    position: relative;
    background: var(--color-yellow); 
    height: 250px; 
    display: flex;
    justify-content: center;
    align-items: flex-end;
    overflow: hidden;
  }
  .bio-header__inner{
    position: relative;
    z-index: 5;                            
    display: grid;
    place-items: center;
    padding: clamp(200px, 3.2vw, 36px) 16px 0;
  }
  .ribbon {
    position: absolute;
    bottom: 90%; 
    background-color: #F4E172;
    padding: 1rem 2rem;
    border-radius: 0 40px 0 40px;
    box-shadow: 0 6px 0 rgba(0,0,0,.25);
    z-index: 10;
  }
  .ribbon h1{
    font-family: 'Tiki Tako', sans-serif;
    font-size: clamp(28px, 4.4vw, 64px);
    line-height: 1;
    margin: 0;
  }
  
  /* ola oscura */
  .header-wave {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 160px;
    fill: var(--color-dark); 
  }
  .header-wave path{ fill: #2A3A1C; }
  
  /* ===============================
     LIENZO PRINCIPAL
  =============================== */
  .bio-page{                                 
    min-height: 100vh; min-height: 100dvh;
    background: #2A3A1C;                     
    display: flex; flex-direction: column;
  }
  .bio-main{
    flex: 1 1 auto;
  }
  
  /* ===============================
     GRID DE TARJETAS (centrado)
  =============================== */
  .cards{
    max-width: 1240px;                      
    margin: 0 auto;
    padding: clamp(22px, 4vw, 46px) 20px clamp(40px, 6vw, 80px);
    display: grid;
    grid-template-columns: repeat(4, minmax(260px, 1fr));
    gap: clamp(16px, 2.2vw, 28px);
    justify-items: stretch;
  }
  
  /* ===============================
     TARJETA
  =============================== */
  .card{
    position: relative;
    background: var(--bg, #7CC5AD);
    border-radius: 22px;
    padding: clamp(20px, 2.6vw, 28px);
    box-shadow: 0 8px 22px rgba(0,0,0,.16), 0 2px 0 rgba(0,0,0,.25);
    overflow: hidden;
    isolation: isolate;
    transform: translateY(0) scale(1);
    transition:
      transform .38s cubic-bezier(.22,.7,.12,.99),
      box-shadow .38s cubic-bezier(.22,.7,.12,.99),
      filter .38s ease;
  }
  
  .card::before{
    content:"";
    position:absolute; inset:0;
    background:
      radial-gradient(circle at 20% 15%, rgba(255,255,255,.12) 0 20%, transparent 21%),
      radial-gradient(circle at 80% 85%, rgba(0,0,0,.06) 0 20%, transparent 21%);
    mix-blend-mode: soft-light;
    opacity:.45;
    pointer-events:none;
    z-index:0;
  }
 
  .card::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background-image: url('../img/Texturatartarjetas.svg');
    background-repeat: repeat;
    background-size: 400px; 
    opacity: .15;         
    transition: opacity .3s ease;
  }

  /* foto que aparece al hover */
  .card__photo{
    position:absolute; inset:0;
    background: var(--photo, none) center/cover no-repeat;
    opacity:0;
    transform: scale(1.06);
    transition: opacity .45s ease, transform .6s cubic-bezier(.22,.7,.12,.99);
    z-index: 0;
    filter: saturate(1.05) contrast(1.02);
  }
  
  /* cuerpo centrado */
  .card__body{
    position: relative;
    z-index: 1;
    display: grid;
    place-items: center;                     
    gap: clamp(12px, 2vw, 20px);
    text-align: center;                    
    min-height: 220px;
  }
  
  /* título */
  .card__title{
    font-family: 'Gotham Ultra', sans-serif;  
    color:#2A3A1C;
    font-size: clamp(18px, 1.4vw, 22px);
    line-height: 1.15;
    letter-spacing: .02em;
    margin: 0;
  }
  .card__title span{
    display:block;
    opacity:.95;
  }
  
  /* Botón CTA (recto, naranja) */
  .btn--cta{
    appearance: none;
    border: 0;
    border-radius: 0;                         
    background: #E97E16;
    color: #EFECD1;                           
    font-family: 'Gotham Ultra', sans-serif; 
    font-size: clamp(14px, 1.05vw, 16px);
    padding: .9rem 1.6rem;
    box-shadow: 0 4px 0 #B45E0F;
    transition: filter .2s ease, transform .06s linear, box-shadow .2s ease;
    cursor: pointer;
  }
  .btn--cta:hover{ filter: brightness(.94); }
  .btn--cta:active{
    transform: translateY(2px);
    box-shadow: 0 2px 0 #8A460B;
  }
  
  /* Hover suave profesional */
  .card:hover{
    transform: translateY(-6px) scale(1.015);
    box-shadow:
      0 14px 28px rgba(0,0,0,.20),
      0 6px 0 rgba(0,0,0,.22);
    filter: saturate(1.02);
  }
  .card:hover .card__photo{
    opacity:1;
    transform: scale(1);
  }

  .card:hover::after,
  .card:hover .card__title {
    opacity: 0;  
  }
  
  /* ===============================
   AJUSTES DE CABECERA 
=============================== */
:root{
    --header-h: 300px; 
  }
  
  .bio-header__inner{
    padding: clamp(34px, 4.2vw, 56px) 16px 0;
  }
  
  .header-wave{
    height: clamp(150px, 18vw, 210px);
    bottom: -4px;         
    z-index: 2;
  }
  
  .ribbon{ z-index: 6; }
  
  /* ===============================
     CENTRADO VERTICAL DEL GRID
  =============================== */
  
  .bio-main{
    min-height: calc(100vh - var(--header-h));
    min-height: calc(100dvh - var(--header-h));
    display: flex;
    align-items: center;    
    justify-content: center; 
    padding-block: clamp(16px, 3vw, 32px);
  }
  
  /* ===============================
     TARJETAS MÁS LARGAS + MÁS ESPACIO
  =============================== */
  

  .cards{
    max-width: 1320px; 
    gap: clamp(22px, 3vw, 42px);
    grid-template-columns: repeat(4, minmax(280px, 1fr));
  }
  

  .card{
    padding: clamp(24px, 2.8vw, 32px);
    min-height: clamp(360px, 42vh, 460px); 
  }
  
  .card__body{
    min-height: clamp(280px, 34vh, 380px);
    gap: clamp(14px, 2.4vw, 22px);
  }
  
  .card{
    transition:
      transform .48s cubic-bezier(.2,.8,.14,1),
      box-shadow .48s cubic-bezier(.2,.8,.14,1),
      filter .48s ease;
  }
  .card:hover{
    transform: translateY(-8px) scale(1.012);
    box-shadow:
      0 18px 36px rgba(0,0,0,.22),
      0 8px 0 rgba(0,0,0,.22);
  }
  .card:hover .card__photo{
    opacity:.88;
    transform: scale(1.015);
    transition: opacity .5s ease, transform .6s cubic-bezier(.2,.8,.14,1);
  }

  .btn-home {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: var(--color-orange);
    color: #EFECD1;
    font-family: 'Gotham Ultra', sans-serif;
    font-size: 1rem;
    text-decoration: none;
    padding: 0.8rem 1.6rem;
    border: none;
    border-radius: 6px; /* opcional, si prefieres recto pon 0 */
    box-shadow: 3px 3px 0 rgba(0,0,0,0.25);
    transition: background 0.25s ease, transform 0.2s ease;
    z-index: 100;
  }
  .btn-home:hover{
    background: #c95f0f;
    transform: translateY(-3px);
  }
  .btn-home:active{
    transform: translateY(0);
    box-shadow: 2px 2px 0 rgb(0, 0, 0, 0.25);
  }

/* ===========================
   MODALS BIOREYES — FINAL CSS
=========================== */
:root{
  --bio-dark:  #2A3A1C;
  --bio-paper: #EFECD1;
  --close-h: 40px; 
  --modal-pad: 28px;     
  --rail-w:    40px;    
  --rail-gap:  12px;     
  --rail-gap-top: 8px;
}

/* Overlay */
.modal{
  position: fixed; inset: 0; z-index: 1000;
  display: none; align-items: center; justify-content: center;
  background: rgba(0,0,0,.38); backdrop-filter: blur(2px);
}
.modal.is-open{ display: flex; }

.modal__dialog{
  width: min(1200px, 92vw);
  max-height: min(88vh, 900px);
  position: relative;
  border-radius: 24px;
  overflow: hidden;                     
  padding: var(--modal-pad);
  padding-right: calc(var(--modal-pad) + var(--rail-w) + var(--rail-gap));
  box-sizing: border-box;
  background: var(--modal-color,#7CC5AD);
  box-shadow: 0 18px 46px rgba(0,0,0,.45);
}
.modal__dialog::before{
  content: "";
  position: absolute; inset: 0;
  background-image: url("../img/Texturatartarjetas.svg");
  background-size: 800px auto;
  background-repeat: repeat;
  opacity: .10;
  pointer-events: none;
  border-radius: inherit;                
  z-index: 0;
}

.modal__close{
  position: absolute;
  top: var(--modal-pad);
  right: var(--modal-pad);
  width: var(--rail-w);
  height: var(--rail-w);
  background: var(--bio-paper);
  color: var(--bio-dark);
  border: 0; border-radius: 0;
  box-shadow: 0 2px 0 rgba(0,0,0,.15);
  font-size: 22px; line-height: 1;
  z-index: 2;
  cursor: pointer;
}


.modal__panel{
  position: relative; z-index: 1;
  background: var(--panel-color,#ABD7C6);
  border-radius: 24px;
  height: 100%;
  margin-right: 20px;  
  display: grid;
  grid-template-columns: 520px minmax(0,1fr);         
  align-items: stretch;
  gap: 28px;
  padding: 28px 20px 28px 28px;
  box-sizing: border-box;
  overflow: hidden; 
  max-height: calc(100% - 2 * var(--modal-pad));
}

/* Foto */
.modal__figure{
  margin: 0;
  border-radius: 18px;
  overflow: hidden;            
  height: 100%;                
  display: block;
  align-items: center;         
  justify-content: center;
}
.modal__figure img{
  display: block;                   
  width: 100%;
  height: auto;                   
  max-height: 100%;                  
  object-fit: contain;               
  object-position: top center;  
}

.modal__content{
  min-width: 0;                           
  height: 100%;
  position: relative;
}
.modal__text{
  height: 100%;
  max-height: 100%;
  overflow: auto;
  padding: 12px 28px 56px 16px;      
  box-sizing: border-box;
  color: var(--bio-dark);
  line-height: 1.6;
  text-align: justify;
}
.modal__text::-webkit-scrollbar{ width: 0; height: 0; } 

.modal__rail{
  position: absolute;
  top: calc(var(--modal-pad) + var(--rail-w) + var(--rail-gap-top));
  right: var(--modal-pad);
  bottom: var(--modal-pad);
  width: var(--rail-w);
  background: var(--bio-paper);
  border-radius: 0;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.08);
  display: grid;
  grid-template-rows: 40px 1fr 40px;  
  align-items: center;
  justify-items: center;
  z-index: 1;
}

.modal__btn{
  width: 40px; height: 40px;           
  border: 0; border-radius: 0;
  background: var(--bio-paper);
  cursor: pointer; position: relative;
}
.modal__btn::before{
  content: "";
  position: absolute; inset: 0; margin: auto;
  width: 0; height: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
}
.modal__btn--up::before   { border-bottom: 14px solid var(--bio-dark); }
.modal__btn--down::before { border-top:    14px solid var(--bio-dark); }

.modal__track{
  position: relative;
  width: 14px;              
  height: 100%;
  margin: 6px auto;
  background: var(--bio-paper);
}
.modal__thumb{
  position: absolute;
  left: 50%; transform: translateX(-50%);
  width: 12px; min-height: 38px;
  background: var(--bio-dark);
  border-radius: 0;
  cursor: grab;
}
.modal__thumb:active{ cursor: grabbing; }

.modal__dialog[data-theme="embajador"] { background:#7CC5AD; }
.modal__dialog[data-theme="agregada"]  { background:#8EAE48; }
.modal__dialog[data-theme="rector"]    { background:#C2C057; }
.modal__dialog[data-theme="personeros"]{ background:#EEBB6F; }

/* ===========================
   RESPONSIVE MODALS
=========================== */

@media (max-width: 1024px){
  .modal__dialog{
    --modal-pad: 24px;
    --rail-w:   36px;
  }
  .modal__panel{
    grid-template-columns: 420px minmax(0,1fr);
    gap: 22px;
    padding: 22px 16px 22px 22px;
  }
  .modal__close{ width: 36px; height: 36px; font-size: 20px; }
  .modal__rail  { grid-template-rows: 36px 1fr 36px; }
  .modal__btn   { width: 36px; height: 36px; }
}

@media (max-width: 820px){
  .modal{
    align-items: flex-start;
    padding: 12px 0;
    overflow: auto;
  }

  .modal__dialog{
    width: min(740px, 96vw);
    max-height: none;
    padding: 18px;
    padding-right: 18px;   
  }

  /* >>> CLAVES PARA QUE NO COLAPSE <<< */
  .modal__panel{
    height: auto;           
    max-height: none;
    margin-right: 0;         
    grid-template-columns: 1fr;  
    gap: 16px;
    padding: 18px;
    overflow: visible;       
  }
  .modal__content{ height: auto; }
  .modal__text{
    max-height: none;
    overflow: visible;      
    padding: 8px 4px 4px 4px;
  }
  .modal__figure{
    height: auto;
    max-height: 48vh;
    display: block;
  }
  .modal__figure img{
    width: 100%;
    height: auto;
    object-fit: contain;
  }

  .modal__rail{ display: none; }
  .modal__close{
    right: 18px; top: 18px;
    width: 28px; height: 28px; font-size: 18px;
  }
}

@media (max-width: 560px){
  .modal__dialog{
    width: 94vw;
    padding: 14px;
  }
  .modal__close{
    right: 12px; top: 12px;
    width: 24px; height: 24px; font-size: 16px;
    box-shadow: 0 1px 0 rgba(0,0,0,.15);
  }
  .modal__panel{
    border-radius: 16px;
    padding: 14px;
    gap: 12px;
  }
  .modal__figure{
    max-height: 42vh;
    border-radius: 12px;
  }
  .modal__text{
    font-size: 0.95rem;
    line-height: 1.55;
  }
}

@media (max-width: 1200px){
  .cards{ grid-template-columns: repeat(3, minmax(260px,1fr)); }
}
@media (max-width: 900px){
  .cards{ grid-template-columns: repeat(2, minmax(260px,1fr)); }
}
@media (max-width: 560px){
  .cards{ grid-template-columns: minmax(260px, 1fr); max-width: 520px; }
  .ribbon{ border-radius: 0 22px 0 22px; }

  .modal__dialog{ width: 94vw; padding: 14px; }
  .modal__close{ right: 12px; top: 12px; width: 24px; height: 24px; font-size: 16px; }
  .modal__panel{ padding: 14px; gap: 12px; border-radius: 16px; }
  .modal__figure{ max-height: 42vh; border-radius: 12px; }
}

  