/* ===================================================================
   INGENIERÍA FERROVIARIA — hoja de estilos
   Identidad: panel de salidas de andén (split-flap) + vía férrea
   =================================================================== */

@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500;600;700&family=IBM+Plex+Sans:wght@400;500;600;700&display=swap');

:root{
  --graphite:      #f7f5ef;   /* fondo de página, papel cálido */
  --panel:         #ffffff;   /* tarjetas y paneles */
  --panel-raised:  #efeae0;   /* hover / filas alternas */
  --rail-line:     #cdc6b6;   /* bordes y separadores */
  --steel:         #6b6559;   /* texto terciario / etiquetas */
  --paper:         #201d17;   /* texto principal */
  --paper-dim:     #514c40;   /* texto secundario */
  --amber:         #9a5b00;   /* acento principal (enlaces, cifras) */
  --amber-dim:     #b8791c;   /* acento secundario, más suave */
  --signal-green:  #1f7a4d;
  --signal-red:    #b8451f;
  --blue:          #2f6f8f;   /* energía / electrificación */
  --teal:          #1f8f7a;   /* señalización y telecomunicaciones */
  --violet:        #6b4c9a;   /* ciberseguridad */
  --radius:        3px;
  --max:           1040px;
}

*{ box-sizing: border-box; }

html{ scroll-behavior: smooth; }

body{
  margin: 0;
  background: var(--graphite);
  color: var(--paper);
  font-family: 'IBM Plex Sans', system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a{ color: inherit; }

.mono{
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
}

.wrap{
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- rail divider: two rails + sleepers ---------- */
.rail-divider{
  height: 16px;
  margin: 0;
  background-image:
    repeating-linear-gradient(90deg, var(--steel) 0 4px, transparent 4px 26px),
    linear-gradient(var(--amber), var(--amber)),
    linear-gradient(var(--blue), var(--blue));
  background-repeat: repeat-x, no-repeat, no-repeat;
  background-position: center, top, bottom;
  background-size: auto 8px, 100% 2px, 100% 2px;
  opacity: .9;
}

/* ---------- hero illustration banner ---------- */
.hero-banner{
  width: 100%;
  border: 1px solid var(--rail-line);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 30px;
  line-height: 0;
}
.hero-banner svg{ display: block; width: 100%; height: auto; }

/* ---------- category color chips ---------- */
.chip{
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  margin-right: 7px;
  vertical-align: middle;
  flex-shrink: 0;
}
.chip.c-amber{ background: var(--amber); }
.chip.c-blue{ background: var(--blue); }
.chip.c-teal{ background: var(--teal); }
.chip.c-green{ background: var(--signal-green); }
.chip.c-red{ background: var(--signal-red); }
.chip.c-violet{ background: var(--violet); }
.chip.c-steel{ background: var(--steel); }

.legend{
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin: 4px 0 26px;
  font-size: 13px;
  color: var(--paper-dim);
}
.legend span{ display: inline-flex; align-items: center; }

.mod.cat-infra{ border-left: 4px solid var(--amber); }
.mod.cat-energia{ border-left: 4px solid var(--blue); }
.mod.cat-senal{ border-left: 4px solid var(--teal); }
.mod.cat-rodante{ border-left: 4px solid var(--signal-green); }
.mod.cat-seguridad{ border-left: 4px solid var(--signal-red); }
.mod.cat-ciber{ border-left: 4px solid var(--violet); }
.mod.cat-core{ border-left: 4px solid var(--steel); }

/* ---------- header / nav ---------- */
header.site{
  border-bottom: 1px solid var(--rail-line);
  background: var(--graphite);
  position: sticky;
  top: 0;
  z-index: 20;
}

.nav-row{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 0;
  flex-wrap: wrap;
}

.brand{
  display: flex;
  align-items: baseline;
  gap: 10px;
  text-decoration: none;
  color: var(--paper);
}

.brand-mark{
  font-family: 'IBM Plex Mono', monospace;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: .08em;
  color: #fff;
  background: var(--amber);
  padding: 4px 7px;
  border-radius: var(--radius);
}

.brand-name{
  font-weight: 600;
  letter-spacing: .01em;
  font-size: 17px;
}

nav.main{
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

nav.main a{
  text-decoration: none;
  color: var(--paper-dim);
  font-size: 14.5px;
  padding: 8px 12px;
  border-radius: var(--radius);
  transition: color .15s ease, background .15s ease;
}

nav.main a:hover{ color: var(--paper); background: var(--panel); }
nav.main a.active{ color: var(--amber); }

.btn-virtual{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: 1px solid var(--signal-green);
  color: var(--signal-green) !important;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 13px;
  letter-spacing: .03em;
  padding: 8px 14px !important;
  border-radius: var(--radius);
}
.btn-virtual:hover{ background: rgba(31,122,77,.10); }
.btn-virtual .dot{
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--signal-green);
  box-shadow: 0 0 6px var(--signal-green);
}
@media (prefers-reduced-motion: no-preference){
  .btn-virtual .dot{ animation: pulse 2.4s ease-in-out infinite; }
}
@keyframes pulse{ 0%,100%{ opacity: 1; } 50%{ opacity: .35; } }

/* ---------- hero ---------- */
.hero{
  padding: 64px 0 40px;
}
.eyebrow{
  font-family: 'IBM Plex Mono', monospace;
  color: var(--amber);
  font-size: 13px;
  letter-spacing: .12em;
  text-transform: uppercase;
  margin: 0 0 14px;
}
h1.display{
  font-family: 'IBM Plex Mono', monospace;
  font-weight: 700;
  font-size: clamp(32px, 5.4vw, 54px);
  line-height: 1.05;
  letter-spacing: -.01em;
  margin: 0 0 18px;
  color: var(--paper);
}
.lede{
  color: var(--paper-dim);
  font-size: 17.5px;
  max-width: 62ch;
  margin: 0 0 6px;
}

/* ---------- section titles ---------- */
.section-title{
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin: 56px 0 22px;
}
.section-title .idx{
  font-family: 'IBM Plex Mono', monospace;
  color: var(--amber-dim);
  font-size: 14px;
}
.section-title h2{
  font-family: 'IBM Plex Mono', monospace;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: .02em;
  margin: 0;
  text-transform: uppercase;
  color: var(--paper);
}

/* ---------- departure board ---------- */
.board{
  border: 1px solid var(--rail-line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--panel);
}
.board-head, .board-row{
  display: grid;
  grid-template-columns: 2.3fr .9fr 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 16px 20px;
}
.board-head{
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11.5px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--steel);
  border-bottom: 1px solid var(--rail-line);
}
.board-row{
  border-bottom: 1px solid var(--rail-line);
  text-decoration: none;
  color: var(--paper);
}
.board-row:last-child{ border-bottom: none; }
.board-row:hover{ background: var(--panel-raised); }
.board-row.acc-amber{ border-left: 4px solid var(--amber); }
.board-row.acc-blue{ border-left: 4px solid var(--blue); }

.prog-name{
  font-weight: 600;
  font-size: 16px;
}
.prog-sub{
  display: block;
  color: var(--paper-dim);
  font-size: 13px;
  margin-top: 3px;
  font-weight: 400;
}
.status{
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12.5px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--signal-green);
}
.status .dot{
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--signal-green);
}
.mono-val{
  font-family: 'IBM Plex Mono', monospace;
  font-size: 14px;
  color: var(--paper-dim);
}
.go{
  font-family: 'IBM Plex Mono', monospace;
  font-size: 13px;
  color: var(--amber);
  white-space: nowrap;
}

@media (max-width: 720px){
  .board-head{ display: none; }
  .board-row{
    grid-template-columns: 1fr;
    gap: 6px;
  }
  .go{ margin-top: 6px; }
}

/* ---------- cards / links row ---------- */
.linkbar{
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 22px 0 8px;
}
.pill{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  padding: 10px 16px;
  border-radius: var(--radius);
  font-size: 14.5px;
  border: 1px solid var(--rail-line);
  color: var(--paper);
  background: var(--panel);
  transition: border-color .15s ease, transform .1s ease;
}
.pill:hover{ border-color: var(--amber-dim); }
.pill.primary{
  background: var(--amber);
  color: #fff;
  border-color: var(--amber);
  font-weight: 600;
}
.pill.primary:hover{ background: #b8691c; }
.pill .arr{ font-family: 'IBM Plex Mono', monospace; }

/* ---------- structure block (itinerarios / módulos) ---------- */
.stack{
  display: flex;
  flex-direction: column;
  gap: 0;
  border-top: 1px solid var(--rail-line);
}
.stack-item{
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 18px;
  padding: 18px 0;
  border-bottom: 1px solid var(--rail-line);
}
.stack-item .tag{
  font-family: 'IBM Plex Mono', monospace;
  color: var(--amber-dim);
  font-size: 13px;
  padding-top: 2px;
}
.stack-item h3{
  margin: 0 0 6px;
  font-size: 16.5px;
  font-weight: 600;
}
.stack-item p{
  margin: 0;
  color: var(--paper-dim);
  font-size: 14.5px;
}
.stack-item ul{
  margin: 8px 0 0;
  padding-left: 18px;
  color: var(--paper-dim);
  font-size: 14.5px;
}
.stack-item li{ margin-bottom: 3px; }

/* ---------- module timetable (contenidos) ---------- */
.mod{
  border: 1px solid var(--rail-line);
  border-radius: var(--radius);
  margin-bottom: 14px;
  overflow: hidden;
}
.mod summary{
  cursor: pointer;
  list-style: none;
  display: grid;
  grid-template-columns: 56px 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 15px 18px;
  background: var(--panel);
  font-weight: 600;
}
.mod summary::-webkit-details-marker{ display:none; }
.mod summary .num{
  font-family: 'IBM Plex Mono', monospace;
  color: var(--amber);
  font-size: 15px;
}
.mod summary .when{
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12.5px;
  color: var(--paper-dim);
  font-weight: 400;
  white-space: nowrap;
}
.mod[open] summary{ border-bottom: 1px solid var(--rail-line); }
.mod .items{
  padding: 6px 18px 14px 90px;
}
.mod .items div{
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 0;
  border-bottom: 1px dashed var(--rail-line);
  font-size: 14px;
  color: var(--paper-dim);
}
.mod .items div:last-child{ border-bottom: none; }
.mod .items span.when{
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  white-space: nowrap;
  color: var(--steel);
}

/* ---------- info notes ---------- */
.note{
  border-left: 3px solid var(--amber-dim);
  background: var(--panel);
  padding: 14px 18px;
  border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--paper-dim);
  font-size: 14.5px;
  margin: 24px 0;
}

/* ---------- info table (módulos / precios) ---------- */
.itin-label{
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--amber-dim);
  margin: 30px 0 8px;
}
.itin-label:first-child{ margin-top: 0; }

.mtable{
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 10px;
  font-size: 14px;
}
.mtable th, .mtable td{
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--rail-line);
}
.mtable th{
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--steel);
  font-weight: 500;
}
.mtable td.num, .mtable th.num{ font-family:'IBM Plex Mono', monospace; white-space: nowrap; }
.mtable tr:last-child td{ border-bottom: none; }
.mtable a{ color: var(--paper); text-decoration: underline; text-decoration-color: var(--rail-line); text-underline-offset: 3px; }
.mtable a:hover{ color: var(--amber); text-decoration-color: var(--amber); }
.mtable-wrap{ overflow-x: auto; border: 1px solid var(--rail-line); border-radius: var(--radius); margin-bottom: 18px; background: var(--panel); }
.mtable-wrap .mtable{ margin-bottom: 0; }
.mtable-wrap .mtable th:first-child, .mtable-wrap .mtable td:first-child{ padding-left: 16px; }
.mtable-wrap .mtable thead th{ background: var(--panel-raised); }
.mtable-wrap .mtable tbody tr:nth-child(even){ background: var(--panel-raised); }

.price-box{
  display: flex;
  gap: 28px;
  flex-wrap: wrap;
  border: 1px solid var(--rail-line);
  background: var(--panel);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin: 22px 0;
}
.price-box .figure{ font-family:'IBM Plex Mono', monospace; }
.price-box .figure .amt{ font-size: 26px; color: var(--amber); font-weight: 700; display:block; }
.price-box .figure .lbl{ font-size: 12px; color: var(--paper-dim); }

/* ---------- contacto ---------- */
.contact-grid{
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 16px;
  margin: 18px 0 8px;
}
.contact-card{
  border: 1px solid var(--rail-line);
  border-radius: var(--radius);
  padding: 16px 18px;
  background: var(--panel);
}
.contact-card h4{
  margin: 0 0 8px;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--steel);
  font-weight: 500;
}
.contact-card .phone{
  display: block;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 16px;
  color: var(--paper);
  text-decoration: none;
  margin-bottom: 4px;
}
.contact-card .phone:hover{ color: var(--amber); }
.contact-card .meta{ color: var(--paper-dim); font-size: 13px; }

/* ---------- footer ---------- */
footer.site{
  border-top: 1px solid var(--rail-line);
  margin-top: 80px;
  padding: 34px 0 44px;
  color: var(--steel);
  font-size: 13.5px;
}
footer.site .wrap{
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
footer.site a{ color: var(--paper-dim); text-decoration: none; }
footer.site a:hover{ color: var(--amber); }

.back-link{
  display: inline-block;
  margin-bottom: 20px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 13px;
  color: var(--paper-dim);
  text-decoration: none;
}
.back-link:hover{ color: var(--amber); }
