/* ====================================================================
   epbcn.css — Hoja de estilos del EPBCN
   ====================================================================
   Sustituye Bootstrap 3.3.7, jQuery 1.12.4 y Font Awesome 4.7.
   Fase 1: paridad visual con el aspecto actual.
   Fase 2: rediseño (nuevos layouts, tipografía, home, subweb formación).

   Estructura:
     1. Custom properties
     2. Reset / base
     3. Layout (container, grid)
     4. Navbar
     5. Panels
     6. Botones
     7. Tablas
     8. Breadcrumbs
     9. Formularios (input-group, form-control)
    10. Utilidades
    11. Iconos SVG
    12. Componentes EPBCN
    13. Textos para pensar
    14. Print
   ==================================================================== */


/* ====================================================================
   1. CUSTOM PROPERTIES
   ==================================================================== */

:root {
  /* --- Paleta EPBCN (de biblioteca.css) --- */
  --epbcn-granate:        #952424;
  --epbcn-purpura:        #a569bd;
  --epbcn-purpura-dark:   #6c3483;
  --epbcn-purpura-light:  #c39bd3;
  --epbcn-verde:          #45b39d;
  --epbcn-verde-dark:     #138d75;
  --epbcn-verde-accent:   #16a085;
  --epbcn-verde-bg:       #d4efdf;
  --epbcn-gris-light:     #e5e8e8;
  --epbcn-gris-section:   #808b96;
  --epbcn-bg:             #eee;
  --epbcn-bg-white:       #fff;

  /* --- Colores de clínica (SecNav propio) --- */
  --epbcn-clinica:        #8e44ad;
  --epbcn-clinica-btn:    #c39bd3;

  /* --- Colores del navbar principal (logo) --- */
  --epbcn-nav-active-bg:  #e5e8e8;

  /* --- Tipografía --- */
  --epbcn-font-body:      -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
                          "Helvetica Neue", Arial, sans-serif;
  --epbcn-font-logo:      "Century Gothic", "Helvetica Neue", Helvetica, Arial,
                          sans-serif;
  --epbcn-font-textos:    "Times New Roman", Times, serif;

  /* --- Espaciado base --- */
  --epbcn-gap:            15px;  /* = Bootstrap 3 gutter / 2 */

  /* --- Breakpoints (referencia, se usan en media queries) ---
     xs: < 768px
     sm: 768px - 991px
     md: 992px - 1199px
     lg: >= 1200px
  */
}


/* ====================================================================
   2. RESET / BASE
   ==================================================================== */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 14px;           /* Bootstrap 3 base */
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--epbcn-font-body);
  font-size: 1rem;
  line-height: 1.42857;      /* Bootstrap 3: 20/14 */
  color: #333;
  background-color: var(--epbcn-bg);
}

a {
  color: #337ab7;             /* Bootstrap 3 link color */
  text-decoration: none;
}
a:hover,
a:focus {
  color: #23527c;
  text-decoration: underline;
}

img {
  max-width: 100%;
  height: auto;
}

h1, h2, h3, h4, h5, h6 {
  font-family: inherit;
  font-weight: 500;
  line-height: 1.1;
  margin-top: 20px;
  margin-bottom: 10px;
}
h1 { font-size: 36px; }
h2 { font-size: 30px; }
h3 { font-size: 24px; }
h4 { font-size: 18px; }

p  { margin: 0 0 10px; }
hr { border: 0; border-top: 1px solid #eee; margin: 20px 0; }

small, .small { font-size: 85%; }

ul, ol { margin-top: 0; margin-bottom: 10px; }


/* ====================================================================
   3. LAYOUT (container, grid)
   ==================================================================== */

.container {
  width: 100%;
  max-width: 1170px;
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--epbcn-gap);
  padding-right: var(--epbcn-gap);
}

/* Cuando el container está dentro de una navbar, hereda el flex layout */
.navbar > .container {
  margin-left: calc(-1 * var(--epbcn-gap));
  margin-right: calc(-1 * var(--epbcn-gap));
  width: calc(100% + 2 * var(--epbcn-gap));
}
@media (min-width: 768px) {
  .navbar > .container {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
  }
}

/* --- Grid: row + columnas --- */

.row {
  display: flex;
  flex-wrap: wrap;
  margin-left: calc(-1 * var(--epbcn-gap));
  margin-right: calc(-1 * var(--epbcn-gap));
}

.row > [class*="col-"] {
  padding-left: var(--epbcn-gap);
  padding-right: var(--epbcn-gap);
  min-width: 0;
  flex-shrink: 0;
}

/* --- Default: todas las columnas a 100% (mobile first) --- */
.col-xs-6, .col-xs-12,
.col-sm-4, .col-sm-5, .col-sm-7,
.col-md-3, .col-md-4, .col-md-6, .col-md-8, .col-md-9, .col-md-12,
.col-lg-3, .col-lg-9 {
  width: 100%;
}

/* xs: siempre activo */
.col-xs-6  { width: 50%; }
.col-xs-12 { width: 100%; }

/* sm: >= 768px */
@media (min-width: 768px) {
  .col-sm-4 { width: 33.3333%; }
  .col-sm-5 { width: 41.6667%; }
  .col-sm-7 { width: 58.3333%; }
}

/* md: >= 992px */
@media (min-width: 992px) {
  .col-md-3  { width: 25%; }
  .col-md-4  { width: 33.3333%; }
  .col-md-6  { width: 50%; }
  .col-md-8  { width: 66.6667%; }
  .col-md-9  { width: 75%; }
  .col-md-12 { width: 100%; }
}

/* lg: >= 1200px */
@media (min-width: 1200px) {
  .col-lg-3 { width: 25%; }
  .col-lg-9 { width: 75%; }
}


/* ====================================================================
   4. NAVBAR
   ====================================================================
   Reemplaza la navbar de Bootstrap 3. Requiere ~15 líneas de JS vanilla
   para el toggle en móvil (ver epbcn.js).
   ==================================================================== */

/* --- Navbar genérica (principal y SecNavs) --- */

.navbar {
  min-height: 50px;
  margin-bottom: 20px;
  border: 1px solid transparent;
  border-radius: 4px;
}
@media (min-width: 768px) {
  .navbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
  }
}
.navbar::after {
  content: "";
  display: table;
  clear: both;
}

.navbar-default {
  background-color: #f8f8f8;
  border-color: #e7e7e7;
}

/* --- Header (marca + botón hamburguesa) --- */

.navbar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
@media (min-width: 768px) {
  .navbar-header {
    flex-shrink: 0;
  }
}

.navbar-brand {
  display: inline-flex;
  align-items: center;
  padding: 15px;
  font-size: 18px;
  line-height: 20px;
  height: 50px;
  color: #777;
  text-decoration: none;
}
.navbar-brand:hover,
.navbar-brand:focus {
  color: #5e5e5e;
  text-decoration: none;
}

/* --- Botón hamburguesa --- */

.navbar-toggle {
  display: block;
  order: 1;
  padding: 9px 10px;
  margin: 8px 15px 8px 0;
  background-color: transparent;
  border: 1px solid #ddd;
  border-radius: 4px;
  cursor: pointer;
}
.navbar-toggle:hover,
.navbar-toggle:focus {
  background-color: #ddd;
}
@media (min-width: 768px) {
  .navbar-toggle {
    display: none;
  }
}

.navbar-toggle .icon-bar {
  display: block;
  width: 22px;
  height: 2px;
  background-color: #888;
  border-radius: 1px;
}
.navbar-toggle .icon-bar + .icon-bar {
  margin-top: 4px;
}

/* --- Collapse: menú plegable --- */

.navbar-collapse {
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.3s ease;
  border-top: 1px solid #e7e7e7;
}
.navbar-collapse.open {
  max-height: 2000px;         /* Suficiente para cualquier menú */
}
@media (min-width: 768px) {
  .navbar-collapse {
    max-height: none;
    overflow: visible;
    border-top: 0;
    display: flex;
    align-items: center;
    flex: 1;
  }
  /* Solo la navbar principal (con navbar-right) alinea a la derecha */
  .navbar-collapse:has(.navbar-right) {
    justify-content: flex-end;
  }
}

/* --- Navegación (ul/li/a) --- */

.navbar .nav {
  list-style: none;
  margin: 0;
  padding: 0;
}
@media (min-width: 768px) {
  .navbar .nav {
    display: flex;
    flex-wrap: wrap;
  }
}

.navbar .nav > li > a {
  display: block;
  padding: 10px 15px;
  color: #777;
  text-decoration: none;
  line-height: 20px;
}
.navbar .nav > li > a:hover,
.navbar .nav > li > a:focus {
  color: #333;
  background-color: transparent;
  text-decoration: none;
}
.navbar .nav > li.active > a {
  color: #555;
  background-color: #e7e7e7;
}

.navbar-nav.navbar-right {
  margin-left: auto;
}

.navbar-text {
  margin: 0;
  padding: 10px 15px;
  color: #777;
  font-size: inherit;
}

/* --- Dropdowns --- */

.dropdown {
  position: relative;
}
.dropdown-toggle .caret {
  display: inline-block;
  width: 0;
  height: 0;
  margin-left: 2px;
  vertical-align: middle;
  border-top: 4px dashed #777;
  border-right: 4px solid transparent;
  border-left: 4px solid transparent;
}
.dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 1000;
  min-width: 160px;
  padding: 5px 0;
  margin: 2px 0 0;
  list-style: none;
  background-color: #fff;
  border: 1px solid #ccc;
  border-radius: 4px;
  box-shadow: 0 6px 12px rgba(0,0,0,.175);
}
.dropdown-menu > li > a {
  display: block;
  padding: 3px 20px;
  white-space: nowrap;
  color: #333;
  text-decoration: none;
}
.dropdown-menu > li > a:hover,
.dropdown-menu > li > a:focus {
  background-color: #f5f5f5;
  color: #262626;
  text-decoration: none;
}
.dropdown-menu > .divider {
  height: 1px;
  margin: 9px 0;
  overflow: hidden;
  background-color: #e5e5e5;
}
.dropdown-menu > .active > a,
.dropdown-menu > .active > a:hover {
  color: #fff;
  background-color: #337ab7;
}

/* En móvil, los dropdowns se muestran inline */
@media (max-width: 767px) {
  .navbar .dropdown-menu {
    position: static;
    float: none;
    width: auto;
    border: 0;
    box-shadow: none;
    background-color: transparent;
  }
  .navbar .dropdown-menu > li > a {
    padding: 5px 15px 5px 25px;
    color: #777;
  }
  .navbar .dropdown-menu > .divider {
    background-color: #e7e7e7;
  }
}

/* En desktop, los dropdowns se abren con click (ver epbcn.js) */
.dropdown.open > .dropdown-menu {
  display: block;
}

/* --- navbar-inverse (solo se usa para un override de fondo) --- */
.navbar-inverse {
  background-color: #ebedef;
  border: none;
}

/* --- sr-only (accesibilidad) --- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}


/* ====================================================================
   5. PANELS
   ==================================================================== */

.panel {
  margin-bottom: 20px;
  background-color: #fff;
  border: 1px solid #ddd;
  border-radius: 4px;
}
.panel-default {
  border-color: #ddd;
}

.panel-heading {
  padding: 10px 15px;
  border-bottom: 1px solid #ddd;
  border-radius: 3px 3px 0 0;
  background-color: #f5f5f5;
}
.panel-title {
  margin-top: 0;
  margin-bottom: 0;
  font-size: 16px;
  color: inherit;
}

.panel-body {
  padding: 15px;
}

.panel-footer {
  padding: 10px 15px;
  border-top: 1px solid #ddd;
  border-radius: 0 0 3px 3px;
  background-color: #f5f5f5;
}


/* ====================================================================
   6. BOTONES
   ==================================================================== */

.btn {
  display: inline-block;
  padding: 6px 12px;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.42857;
  text-align: center;
  white-space: nowrap;
  vertical-align: middle;
  cursor: pointer;
  user-select: none;
  border: 1px solid transparent;
  border-radius: 4px;
  color: #333;
  background-color: #fff;
  text-decoration: none;
}
.btn:hover,
.btn:focus {
  text-decoration: none;
  opacity: 0.9;
}

.btn-primary {
  color: #fff;
  background-color: #337ab7;
  border-color: #2e6da4;
}
.btn-primary:hover,
.btn-primary:focus {
  color: #fff;
  background-color: #286090;
  text-decoration: none;
}

.btn-default {
  color: #333;
  background-color: #fff;
  border-color: #ccc;
}
.btn-default:hover,
.btn-default:focus {
  background-color: #e6e6e6;
  border-color: #adadad;
}

.btn-danger {
  color: #fff;
  background-color: #d9534f;
  border-color: #d43f3a;
}
.btn-danger:hover,
.btn-danger:focus {
  background-color: #c9302c;
}

.btn-small {
  padding: 5px 10px;
  font-size: 12px;
  border-radius: 3px;
}

.btn-block {
  display: block;
  width: 100%;
}
.btn-block + .btn-block {
  margin-top: 5px;
}


/* ====================================================================
   7. TABLAS
   ==================================================================== */

.table {
  width: 100%;
  max-width: 100%;
  margin-bottom: 20px;
  border-collapse: collapse;
}
.table > thead > tr > th,
.table > thead > tr > td,
.table > tbody > tr > th,
.table > tbody > tr > td {
  padding: 8px;
  line-height: 1.42857;
  vertical-align: top;
  border-top: 1px solid #ddd;
}
.table > thead > tr > th {
  vertical-align: bottom;
  border-bottom: 2px solid #ddd;
}

.table-bordered {
  border: 1px solid #ddd;
}
.table-bordered > thead > tr > th,
.table-bordered > thead > tr > td,
.table-bordered > tbody > tr > th,
.table-bordered > tbody > tr > td {
  border: 1px solid #ddd;
}

.table-striped > tbody > tr:nth-child(odd) {
  background-color: #f9f9f9;
}


/* ====================================================================
   8. BREADCRUMBS
   ==================================================================== */

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  padding: 8px 15px;
  margin-bottom: 20px;
  list-style: none;
  background-color: #f5f5f5;
  border-radius: 4px;
}
.breadcrumb > li + li::before {
  content: "/ ";
  padding: 0 5px;
  color: #ccc;
}
.breadcrumb > .active {
  color: #777;
}


/* ====================================================================
   9. FORMULARIOS (input-group, form-control)
   ==================================================================== */

.form-control {
  display: block;
  width: 100%;
  height: 34px;
  padding: 6px 12px;
  font-size: 14px;
  line-height: 1.42857;
  color: #555;
  background-color: #fff;
  border: 1px solid #ccc;
  border-radius: 4px;
}

.input-group {
  display: flex;
  position: relative;
}
.input-group .form-control {
  flex: 1 1 auto;
  border-radius: 4px 0 0 4px;
}
.input-group-btn {
  display: flex;
}
.input-group-btn .btn {
  border-radius: 0 4px 4px 0;
}

.badge {
  display: inline-block;
  min-width: 10px;
  padding: 3px 7px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  color: #fff;
  text-align: center;
  white-space: nowrap;
  vertical-align: middle;
  background-color: #777;
  border-radius: 10px;
}


/* ====================================================================
   10. UTILIDADES
   ==================================================================== */

/* --- Texto --- */
.text-center { text-align: center; }
.text-left   { text-align: left; }
.text-right  { text-align: right; }

/* --- Flotación --- */
.pull-left  { float: left; }
.pull-right { float: right; }
.center-block {
  display: block;
  margin-left: auto;
  margin-right: auto;
}

/* --- Imágenes --- */
.img-responsive {
  display: block;
  max-width: 100%;
  height: auto;
}

/* --- Visibilidad por breakpoint --- */

/* hidden-xs: oculto en < 768px */
@media (max-width: 767px) {
  .hidden-xs { display: none !important; }
}

/* hidden-sm: oculto en 768px – 991px */
@media (min-width: 768px) and (max-width: 991px) {
  .hidden-sm { display: none !important; }
}

/* visible-sm-block: visible SOLO en 768px – 991px */
.visible-sm-block { display: none !important; }
@media (min-width: 768px) and (max-width: 991px) {
  .visible-sm-block { display: block !important; }
}

/* visible-xs-inline-block: visible SOLO en < 768px */
.visible-xs-inline-block { display: none !important; }
@media (max-width: 767px) {
  .visible-xs-inline-block { display: inline-block !important; }
}

/* --- Print --- */
.hidden-print { /* definido en @media print abajo */ }
.visible-print-inline-block { display: none !important; }


/* ====================================================================
   11. ICONOS SVG
   ====================================================================
   Sustituyen Glyphicons y Font Awesome 4.7.
   Sprite en /imagenes/icons.svg, uso:
     <svg class="icon"><use href="/imagenes/icons.svg#phone"/></svg>
   ==================================================================== */

.icon {
  display: inline-block;
  width: 1em;
  height: 1em;
  vertical-align: -0.125em;
  fill: currentColor;
  stroke: currentColor;       /* Para iconos con stroke (angle-left, etc.) */
  stroke-width: 0;            /* Desactivado por defecto; los que usan stroke lo definen en el SVG */
  flex-shrink: 0;
}

/* Tamaños (equivalentes a fa-lg, fa-2x, fa-3x) */
.icon-lg { width: 1.33em; height: 1.33em; vertical-align: -5px; }
.icon-2x { width: 2em;    height: 2em; }
.icon-3x { width: 3em;    height: 3em; }

/* Alineación en botones (equivalente a pull-left dentro de .btn) */
.btn .icon.pull-left {
  margin-right: 0.5em;
}


/* ====================================================================
   12. COMPONENTES EPBCN
   ====================================================================
   Clases propias del EPBCN, previamente definidas como CSS inline
   en epbcn_h5_b3_v1.cls.
   ==================================================================== */

/* --- Fondo del contenedor principal --- */
.bg-white {
  background-color: var(--epbcn-bg-white);
}

/* --- Micrologo (EPBCN en la navbar móvil) --- */
.micrologo {
  font-family: var(--epbcn-font-logo);
  font-size: larger;
}

/* --- Título de sección (h1 de cada página) --- */
h1.websection {
  color: var(--epbcn-gris-section);
}

/* --- Navegación secundaria: enlaces morados --- */
.navbar-default .navbar-nav > li > a.secundario,
.navbar-default .secundario {
  color: var(--epbcn-purpura);
}

/* --- Cabecera: enlaces morados --- */
.navbar-default .cabecera > li > a.cabecera,
.navbar-default .cabecera {
  color: var(--epbcn-purpura);
}

/* --- Texto larger --- */
.text-larger {
  font-size: larger;
}

/* --- Well blanco (si queda alguno) --- */
.well-white {
  background-color: var(--epbcn-bg-white);
}

/* --- Versalitas --- */
span.versalita {
  font-variant: small-caps;
}

/* --- Panel Clínica (portada) --- */
.panel-clinica {
  border-color: var(--epbcn-purpura-dark);
}
.panel-clinica .panel-heading {
  background: var(--epbcn-purpura);
  color: #fff;
}
.panel-clinica .btn-primary {
  background: var(--epbcn-purpura);
  border-color: var(--epbcn-purpura-dark);
  font-size: 16px;
  margin-bottom: 10px;
}

/* --- Panel Formación (portada) --- */
.panel-formacion {
  border-color: var(--epbcn-verde-dark);
}
.panel-formacion .panel-heading {
  background: var(--epbcn-verde);
  color: #fff;
}
.panel-formacion .btn-primary {
  background: var(--epbcn-verde);
  border-color: var(--epbcn-verde-dark);
  font-size: 16px;
  margin-bottom: 10px;
}

/* --- Doctoralia --- */
div.hasDoctoraliaButton iframe {
  height: 40px;
}


/* ====================================================================
   13. TEXTOS PARA PENSAR
   ====================================================================
   Previamente definido como CSS inline en textos_page.cls.
   Se mantiene el namespace div.textos para evitar colisiones.
   ==================================================================== */

div.textos {
  font-size: 20px;
  font-family: var(--epbcn-font-textos);
  text-align: justify;
}
div.textos h1 { margin-bottom: 20px; font-weight: bold; }
div.textos h2 { margin-top: 35px; margin-bottom: 20px; font-weight: bold; }
div.textos h3 { margin-top: 30px; margin-bottom: 20px; font-weight: bold; }
div.textos h4 { margin-top: 25px; margin-bottom: 20px; font-weight: bold; }

div.textos p              { text-indent: 3.5%; margin: 0; }
div.textos p.noindent     { text-indent: 0%; }
div.textos p.destacado    { text-indent: 0%; margin: 20px 0; }
div.textos li p           { text-indent: 0%; }
div.textos li p + p       { text-indent: 0%; margin-top: 5px; }
div.textos p.persona      { text-indent: 0%; margin-top: 20px; }
div.textos p.verso        { text-indent: 0%; margin: 20px 0 20px 7%; }
div.textos p.inlinenote   { text-indent: 0%; font-size: smaller; margin: 20px 5%; }
div.textos div.inlinenote { font-size: smaller; margin-left: 5%; margin-right: 5%; }
div.textos div.inlinenote p { text-indent: 0%; }

div.textos sup.fn   { font-size: 65%; }
div.textos em       { font-style: italic; }
div.textos em em    { font-style: normal; }
div.textos .epigrafe em       { font-style: normal; }
div.textos .epigrafe .autor em { font-style: italic; }
div.textos em em em    { font-style: italic; }
div.textos em em em em { font-style: normal; }

div.textos blockquote {
  margin: 20px 0;
  font-style: italic;
  font-size: 20px;
}
div.textos blockquote em { font-style: normal; }
div.textos pre  { margin: 20px 0; }
div.textos code.pre { background: white; color: black; }
div.textos ol   { margin: 20px 0; }
div.textos li   { margin: 10px; }

p.small { font-size: smaller; }

div.epigrafe {
  margin-left: 40%;
  font-style: italic;
  margin-bottom: 25px;
}
div.epigrafe div.autor {
  font-style: normal;
  margin-top: 5px;
}
div.epigrafe div.autor span.apellido {
  font-variant: small-caps;
}


/* ====================================================================
   14. PRINT
   ==================================================================== */

@media print {
  .hidden-print { display: none !important; }
  .visible-print-inline-block { display: inline-block !important; }

  /* Eliminar decoración innecesaria */
  body { background: #fff; }
  .navbar { display: none; }
  .panel { border: 1px solid #ddd; break-inside: avoid; }

  /* Calendario: colores de fondo para impresión */
  a[href]::after { content: none !important; }
}