/* ================================================================
   Osadía y Tecnología
   ================================================================ */

@import url('https://fonts.googleapis.com/css2?family=Rubik:ital,wght@0,400;0,500;0,600;0,700;1,400&display=swap');

/* === TOKENS === */
:root {
  --bg:         #deeefa;
  --surface:    #ffffff;
  --ink:        #07111f;
  --navy:       #002952;
  --blue:       #1565c0;
  --green:      #00e676;
  --green-dim:  #00c853;
  --muted:      #516475;
  --border:     rgba(0, 41, 82, 0.12);
  --header-bg:  #ffffff;

  --f-display:  'Rubik', system-ui, sans-serif;
  --f-body:     'Rubik', system-ui, sans-serif;

  --max:        1060px;
  --r:          6px;
  --t:          0.2s ease;
}

/* === RESET === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--f-body);
  font-size: 16px;
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

/* === UTIL === */
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 1.5rem; }

.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;
}

:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 3px;
  border-radius: var(--r);
}

.skip-link {
  position: absolute; top: -100%; left: 1rem;
  background: var(--ink); color: #fff;
  padding: 0.5rem 1rem; border-radius: 0 0 var(--r) var(--r);
  font-size: 0.82rem; z-index: 999; transition: top 0.2s;
}
.skip-link:focus { top: 0; outline: none; }

/* ================================================================
   HEADER
   ================================================================ */

.site-header {
  background: var(--header-bg);
  padding: 0.9rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 12px rgba(0,41,82,0.07);
}

.site-header__inner {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.site-header__logo-link { display: flex; align-items: center; flex-shrink: 0; }

.site-header__logo {
  height: 44px;
  width: auto;
}

.site-header__divider {
  width: 1px;
  height: 28px;
  background: var(--border);
  flex-shrink: 0;
}

.site-header__text { display: flex; flex-direction: column; gap: 0.1rem; }

.site-header__name {
  font-family: var(--f-display);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--navy);
  letter-spacing: 0.04em;
  line-height: 1.1;
  text-transform: uppercase;
}

.site-header__host {
  font-size: 0.72rem;
  font-weight: 500;
  color: rgba(255,255,255,0.45);
  letter-spacing: 0.02em;
}

/* ================================================================
   PAGE INTRO
   ================================================================ */

.page-intro {
  padding: 2.5rem 0 2rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: auto auto;
  column-gap: 3rem;
  align-items: start;
}

.page-intro__eyebrow {
  grid-column: 1 / -1;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--green);
  margin-bottom: 0.85rem;
}

.page-intro__eyebrow::before {
  content: '';
  display: block;
  width: 22px;
  height: 2px;
  background: var(--green);
}

.page-intro__title {
  font-family: var(--f-display);
  font-size: clamp(1.8rem, 4vw, 3rem);
  font-weight: 700;
  color: var(--navy);
  line-height: 1.08;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  grid-column: 1;
  align-self: center;
}

.page-intro__desc {
  font-size: 0.97rem;
  line-height: 1.75;
  color: var(--muted);
  grid-column: 2;
  text-align: justify;
  hyphens: auto;
  align-self: center;
  padding-top: 0.15rem;
}

/* ================================================================
   HERO — EPISODIO DESTACADO
   ================================================================ */

.hero-section {
  margin-bottom: 3rem;
}

.hero-section__label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.hero-section__label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.hero-card {
  display: block;
  border-radius: 10px;
  overflow: hidden;
  text-decoration: none;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card, 0 2px 12px rgba(0,41,82,0.10));
  transition: box-shadow var(--t), transform var(--t);
}

.hero-card:hover {
  text-decoration: none;
  box-shadow: 0 10px 32px rgba(7,17,31,0.14);
  transform: translateY(-3px);
}

/* Thumbnail — ancho completo, altura natural de la imagen */
.hero-card__thumb {
  position: relative;
  overflow: hidden;
  line-height: 0;
}

.hero-card__thumb img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.5s ease;
}

.hero-card:hover .hero-card__thumb img { transform: scale(1.03); }

/* Play overlay */
.hero-card__play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(7,17,31,0.18);
  opacity: 0;
  transition: opacity var(--t);
}

.hero-card:hover .hero-card__play { opacity: 1; }

.hero-card__play-btn {
  width: 64px; height: 64px;
  border-radius: 50%;
  background: var(--green);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(0,230,118,0.55);
}

.hero-card__play-icon {
  width: 0; height: 0;
  border-style: solid;
  border-width: 11px 0 11px 20px;
  border-color: transparent transparent transparent var(--ink);
  margin-left: 4px;
}

/* Card body — debajo del thumbnail */
.hero-card__body {
  padding: 1.1rem 1.4rem 1.3rem;
  border-top: 2px solid var(--green);
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.hero-card__tag {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: var(--green);
  color: var(--ink);
  font-size: 0.67rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.22rem 0.6rem;
  border-radius: 20px;
  width: fit-content;
}

.hero-card__tag::before {
  content: '';
  width: 6px; height: 6px;
  background: var(--ink);
  border-radius: 50%;
  animation: pulse 1.8s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.5; transform: scale(0.7); }
}

.hero-card__title {
  font-family: var(--f-display);
  font-size: clamp(1.1rem, 2.5vw, 1.55rem);
  font-weight: 600;
  color: var(--navy);
  line-height: 1.2;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  margin: 0;
}

.hero-card__cta {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  background: var(--navy);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.55rem 1.1rem;
  border-radius: 40px;
  width: fit-content;
  transition: background var(--t);
}

.hero-card:hover .hero-card__cta { background: var(--blue); }

.hero-card__cta-icon {
  width: 0; height: 0;
  border-style: solid;
  border-width: 4px 0 4px 7px;
  border-color: transparent transparent transparent currentColor;
  flex-shrink: 0;
}

/* ================================================================
   EPISODES GRID
   ================================================================ */

.episodes-section { margin-bottom: 3.5rem; }

.episodes-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.episodes-header__title {
  font-family: var(--f-display);
  font-size: 1rem;
  font-weight: 700;
  color: var(--navy);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.episodes-header__count {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--muted);
  background: rgba(0,41,82,0.08);
  padding: 0.15rem 0.5rem;
  border-radius: 20px;
}

.episodes-header::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.ep-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(295px, 1fr));
  gap: 1.1rem;
}

/* Episode card */
.ep-card {
  background: var(--surface);
  border-radius: var(--r);
  overflow: hidden;
  border: 1px solid var(--border);
  transition: transform var(--t), box-shadow var(--t);

  opacity: 0;
  transform: translateY(14px);
}

.ep-card.visible {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.36s ease, transform 0.36s ease, box-shadow var(--t);
}

.ep-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(7,17,31,0.12);
}

.ep-card__link {
  display: block;
  text-decoration: none;
  color: inherit;
}

.ep-card__link:hover { text-decoration: none; }

/* Thumbnail */
.ep-card__thumb-wrap {
  position: relative;
  aspect-ratio: 16/9;
  overflow: hidden;
  background: var(--ink);
}

.ep-card__thumb {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.ep-card:hover .ep-card__thumb { transform: scale(1.05); }

.ep-card__num {
  position: absolute;
  top: 0; right: 0;
  font-family: var(--f-display);
  font-size: 3.5rem;
  font-weight: 800;
  color: rgba(255,255,255,0.18);
  line-height: 1;
  padding: 0.15rem 0.5rem;
  letter-spacing: -0.05em;
  pointer-events: none;
  user-select: none;
}

/* Play overlay on hover */
.ep-card__play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(7,17,31,0.25);
  opacity: 0;
  transition: opacity var(--t);
}

.ep-card:hover .ep-card__play { opacity: 1; }

.ep-card__play-btn {
  width: 50px; height: 50px;
  background: var(--green);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 18px rgba(0,230,118,0.55);
}

.ep-card__play-icon {
  width: 0; height: 0;
  border-style: solid;
  border-width: 8px 0 8px 14px;
  border-color: transparent transparent transparent var(--ink);
  margin-left: 3px;
}

/* Card body */
.ep-card__body {
  padding: 0.95rem 1.1rem 1.1rem;
  border-top: 2px solid var(--green);
}

.ep-card__title {
  font-family: var(--f-display);
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.35;
  margin-bottom: 0.5rem;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ep-card__date {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.45rem;
}

.ep-card__excerpt {
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Empty state */
.empty-state {
  grid-column: 1/-1;
  text-align: center;
  padding: 4rem 1rem;
  color: var(--muted);
  font-size: 1rem;
}

/* ================================================================
   VIDEO PAGE
   ================================================================ */

.video-page { padding-bottom: 4rem; }

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 1.75rem 0 1.5rem;
  transition: color var(--t);
}

.back-link:hover { color: var(--ink); text-decoration: none; }
.back-link__arrow { font-size: 1.1em; }

/* Video stage */
.video-stage {
  background: var(--ink);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 2rem;
}

.video-stage__player {
  position: relative;
  padding-top: 56.25%;
}

.video-stage__player iframe {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  border: 0;
}

/* Video header */
.video-header { margin-bottom: 1.75rem; }

.video-header__ep {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--green);
  margin-bottom: 0.6rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.video-header__ep::before {
  content: '';
  width: 18px; height: 2px;
  background: var(--green);
}

.video-title {
  font-family: var(--f-display);
  font-size: clamp(1.5rem, 4.5vw, 2.4rem);
  font-weight: 400;
  color: var(--navy);
  line-height: 1.15;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 0.6rem;
}

.video-date {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
}

/* Description */
.video-desc {
  background: var(--surface);
  border-radius: var(--r);
  border: 1px solid var(--border);
  padding: 1.5rem 1.75rem;
  margin-bottom: 1.5rem;
}

.video-desc__label {
  font-size: 0.67rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  margin-bottom: 0.8rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.video-desc__label::before {
  content: '';
  width: 14px; height: 2px;
  background: var(--blue);
}

.video-desc__text {
  font-size: 0.97rem;
  line-height: 1.78;
  color: var(--ink);
  white-space: pre-line;
}

/* Share */
.video-share {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.share-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
}

.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.42rem 0.9rem;
  border-radius: 40px;
  font-size: 0.8rem;
  font-weight: 600;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  transition: border-color var(--t), background var(--t);
  text-decoration: none;
  font-family: var(--f-body);
}

.share-btn:hover { border-color: var(--navy); background: #f5f8fc; text-decoration: none; }

.share-btn--yt { background: #ff0000; color: #fff; border-color: #cc0000; }
.share-btn--yt:hover { background: #cc0000; border-color: #990000; }

/* 404 */
.error-page { text-align: center; padding: 5rem 1rem; }
.error-page__code {
  font-family: var(--f-display);
  font-size: 7rem;
  font-weight: 400;
  color: var(--blue);
  line-height: 1;
  opacity: 0.2;
}
.error-page__title { font-family: var(--f-display); font-size: 1.6rem; font-weight: 700; letter-spacing: 0.03em; text-transform: uppercase; color: var(--navy); margin: 1rem 0 0.5rem; }
.error-page__text { color: var(--muted); margin-bottom: 2rem; }

/* ================================================================
   FOOTER
   ================================================================ */

.site-footer {
  background: var(--ink);
  color: rgba(255,255,255,0.4);
  text-align: center;
  padding: 1.5rem 1.5rem;
  font-size: 0.8rem;
  letter-spacing: 0.02em;
}

.site-footer a { color: rgba(255,255,255,0.6); }
.site-footer a:hover { color: var(--green); }
.site-footer__brand { color: rgba(255,255,255,0.8); font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; font-family: var(--f-display); }

/* ================================================================
   RESPONSIVE
   ================================================================ */

@media (max-width: 720px) {
  .page-intro {
    padding: 2rem 0 1.75rem;
    grid-template-columns: 1fr;
  }
  .page-intro__title,
  .page-intro__desc { grid-column: 1; }
  .page-intro__title { margin-bottom: 0.85rem; }
  .ep-grid { grid-template-columns: 1fr 1fr; gap: 0.85rem; }
  /* hero height auto desde proporción 16:9 */
}

@media (max-width: 500px) {
  .ep-grid { grid-template-columns: 1fr; }
  .ep-card__num { font-size: 2.8rem; }
  .site-header__logo { height: 34px; }
  .back-link { padding: 1.25rem 0 1rem; }
}

/* ================================================================
   ANIMATIONS
   ================================================================ */

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}

.page-intro  { animation: fadeUp 0.45s ease both; }
.hero-section { animation: fadeUp 0.45s 0.08s ease both; }

.video-header  { animation: fadeUp 0.4s ease both; }
.video-stage   { animation: fadeUp 0.4s 0.07s ease both; }
.video-desc    { animation: fadeUp 0.4s 0.13s ease both; }
