/* The theme sets body{width:57.6%;float:left} globally (unscope to layout),
   which traps the whole page at 57.6% of the window with a huge right gap.
   Reset it so the body spans the full window and our #main margins frame it. */
body {
  width: 100%;
  float: none;
  max-width: none;
  padding: 0;
}

/* Layout: sidebar left, body flush-right of it; the rest is window margin.
 * Overrides minimal-mistakes' fixed-px sidebar and the 20% left padding
 * in .franklin-content that was crushing images. */

@media (min-width: 64em) {

  /* Center the TEXT in the WINDOW (including the sidebar's space): lay out
     [sidebar X%] [sidebar X% spacer] so the text's center is the window
     center. The text width is set by these proportions (the ch max-width
     only kicks in on very wide screens). Shrink X to widen the text. */
  #main {
    display: flex;
    align-items: flex-start;
    gap: 0;
    /* text flush against the sidebar's right edge (no gap) */
    width: auto;
    /* fill window minus the left/right margins (so shrinking a margin widens the content) */
    max-width: none;
    margin-left: 6%;
    /* same as the masthead's left margin (was 7.5%) */
    margin-right: 19%;
    /* same as the masthead's right margin (was 22.5%) */
  }

  .sidebar {
    float: none;
    position: static;
    flex: 0 0 25%;
    /* fixed 21.42% — same width on every page */
    width: 25%;
    opacity: 1;
    font-size: 0.8em;
    /* scale the sidebar text down to ~21.6px (was 27px) */
    padding-top: 16em;
    /* 7x the original 2em, +2em */
  }

  .franklin-content {
    flex: 1 1 auto;
    /* grow to fill the available space in #main */
    width: 100%;
    /* 100% of #main (= 75% of window) */
    min-width: 0;
    max-width: none;
    text-align: left;
    padding-left: 0;
    /* override Franklin framework's default 12.5% side padding */
    padding-right: 0;
    padding-top: 2em;
    /* distance from the top menu bar */
  }

  .franklin-content h1 {
    margin-left: 0;
    width: auto;
    font-size: 1.5em;
    /* 1.5 x the framework's 24px default = ~36px page title */
    color: rgb(98, 30, 76);
    /* title text in the brand color */
  }
}

/* Remove the default per-page footer ("CC BY-SA 4.0 ... built with
   Franklin.jl") — that credit already lives in the general site footer. */
.page-foot {
  display: none;
}

/* ---- Masthead: logo next to brand text ---- */
.site-logo-img {
  height: 1.6em;
  width: auto;
  vertical-align: middle;
  margin-right: 0.4em;
  border-radius: 4px;
}

/* ---- Home feature cards: 4 across in one row ---- */
.feature__wrapper .feature__item {
  float: left;
  width: 23.5%;
  margin-left: 1.5%;
  margin-bottom: 0;
  clear: none;
}

.feature__wrapper .feature__item:first-child {
  margin-left: 0;
}

/* ---- Home feature cards: brand color (98,30,76) on titles + buttons ---- */
.feature__item .archive__item-title {
  color: rgb(98, 30, 76);
}

.feature__item .btn--primary,
.feature__item .btn--primary:visited,
.feature__item .btn--primary:focus {
  background-color: rgb(98, 30, 76);
  color: #fff !important;
}

.feature__item .btn--primary:hover,
.feature__item .btn--primary:active {
  background-color: rgb(78, 24, 61);
  color: #fff !important;
}

/* ---- Top nav: allow dropdown to escape .visible-links overflow:hidden ---- */
.greedy-nav .visible-links {
  overflow: visible;
}

/* ---- Top nav: Actividades dropdown (click to open) ---- */
.has-dropdown {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.has-dropdown>a {
  display: inline-block;
}

.dropdown-toggle {
  background: none;
  border: 0;
  padding: 0 0 0 0.15em;
  margin: 0;
  cursor: pointer;
  color: inherit;
  font: inherit;
  line-height: 1;
}

.dropdown-arrow {
  font-size: 0.7em;
  vertical-align: middle;
  display: inline-block;
  transition: transform 0.15s ease;
}

.has-dropdown.open .dropdown-arrow {
  transform: rotate(180deg);
}

.dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 11em;
  margin: 0;
  padding: 0.3em 0;
  list-style: none;
  background: #fff;
  border: 1px solid rgb(224, 199, 215);
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
  z-index: 50;
}

.dropdown-menu li {
  margin: 0;
}

.dropdown-menu li a {
  display: block;
  padding: 0.5em 1em;
  white-space: nowrap;
  color: #1c1c1c;
}

.dropdown-menu li a:hover {
  background: rgb(244, 235, 240);
  text-decoration: none;
}

.has-dropdown.open .dropdown-menu {
  display: block;
}

/* ---- Activity cards: 2 across in one row ---- */
.activity-card {
  background: rgb(244, 235, 240);
  border: 1px solid rgb(224, 199, 215);
  border-radius: 8px;
  overflow: hidden;
  margin: 0;
  width: 48.7%;
  /* (100% - 2.6% gap) / 2 */
  display: inline-block;
  vertical-align: top;
}

.activity-cards-row {
  display: flex;
  flex-wrap: wrap;
  gap: 2.6%;
  margin: 1em 0 2em;
}

.activity-card img {
  width: 100%;
  height: auto;
  display: block;
  padding: 0;
}

.activity-card-body {
  padding: 0.8em 1em 1em;
}

.activity-card-body h3 {
  margin-top: 0;
  font-size: 1.35em;
  /* a little bigger than default */
}

.activity-card-body p {
  margin: 0.4em 0;
}

/* Activity-card buttons: a little smaller than the theme default (.75em) */
.activity-card .btn--primary {
  font-size: 0.6em;
  padding: 0.4em 0.9em;
}

/* Brand-colored primary buttons (background = (98,30,76)) with white text
   in every state. The theme's a:visited is blue and wins for
   already-visited links, so we force white text; the underline-on-hover
   (global a:hover) is preserved. */
.activity-card .btn--primary,
.activity-card .btn--primary:visited,
.activity-card .btn--primary:focus {
  background-color: rgb(98, 30, 76);
  color: #fff !important;
}

.activity-card .btn--primary:hover,
.activity-card .btn--primary:active {
  background-color: rgb(78, 24, 61);
  color: #fff !important;
}

/* ---- Section photos (Juegos / Posters / Talleres) ---- */
.section-photo {
  display: flex;
  flex-wrap: wrap;
  gap: 1em;
  margin: 1.5em 0 2em;
}

.section-photo img {
  max-width: 100%;
  width: auto;
  height: 260px;
  object-fit: cover;
  border-radius: 6px;
  padding: 0;
}

/* ---- Headerless tables (wrap Markdown table in @@ctable-no-header ... @@) ---- */
/* Franklin emits the header as the first <tr><th> (no <thead>), so hide th cells. */
.ctable-no-header {
  display: table;
  /* override theme's display:block */
  width: auto;
  /* shrink to content instead of full width */
  margin: 1.5em auto;
  /* center horizontally */
  font-size: 1.5em;
  /* larger text inside the table */
  border-collapse: collapse;
}

.ctable-no-header th {
  display: none;
  /* hide the (dummy) header row */
}

.ctable-no-header td {
  text-align: center;
  /* center the content of each cell */
  border-bottom: none;
  /* remove horizontal lines between rows */
  padding: .4em 1.4em;
  /* a bit more space between columns */
  font-size: inherit;
  /* take the table's enlarged font-size */
}

/* keep the sidebar at ~15% instead of ballooning to 300px on very wide screens */
@media (min-width: 80em) {
  .sidebar {
    width: 22%;
  }
}

/* ---- Home hero: grey scrim over banner for text contrast ---- */
.page__hero--overlay {
  position: relative;
}

/* banner image: relative URL so it resolves under any deploy subpath
   (e.g. /~extension/) and also on localhost. Adjust.css is at /css/,
   so ../assets points to the site assets root. */
.hero-banner {
  background-image: url(../assets/nosotros/banner.jpg);
  background-size: cover;
  background-position: center;
}

.page__hero--overlay::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(40, 40, 40, 0.5);
  z-index: 1;
}

.page__hero--overlay .wrapper {
  position: relative;
  z-index: 2;
}

pre {
  font-size: 17px;
}

.franklin-content code {
  font-size: 14px;
}

.franklin-content .hljs {
  font-size: 14px;
}

blockquote {
  font-size: 90%;
}

.fndef-content {
  line-height: 1.5em;
}

.franklin-content h1 {
  padding-bottom: 0.3em;
  margin-top: 0.5em;
  margin-bottom: 0.25em;
  border-bottom: 3px solid rgb(98, 30, 76);
  /* single full-width line under the title, spanning the body column */
}

/* (no underline on the title text itself) */
.franklin-content h1 a {
  display: inline-block;
  padding-bottom: 0.12em;
  border-bottom: none;
}

/* Subtitles (h2/h3/h4) share the brand color */
.franklin-content h2,
.franklin-content h3,
.franklin-content h4 {
  color: rgb(98, 30, 76);
}

.franklin-content h2 a,
.franklin-content h3 a,
.franklin-content h4 a,
.franklin-content h2 a:visited,
.franklin-content h3 a:visited,
.franklin-content h4 a:visited {
  color: rgb(98, 30, 76) !important;
}

/* keep the gap between the title and the first element (photo/pdf) to ~one line */
/* Game/poster hero image: fill the content column, flush, no padding */
.game-hero img {
  display: block;
  width: 100%;
  height: auto;
  padding: 0;
}

.franklin-content h1+.game-hero,
.franklin-content h1+.game-pdf,
.franklin-content h1+.game-pdfs,
.franklin-content h1+.poster-hero {
  margin-top: 0;
}

.franklin-content a {
  text-decoration: none;
}

/* For some reason,
 * `h1, h2, h3 { a { color: ... } a:visited { color: ... } }` didn't work.
 */
h1 a {
  color: rgb(98, 30, 76) !important;
}

h1 a:visited {
  color: rgb(98, 30, 76) !important;
}

h3 a {
  color: #1c1c1c !important;
}

h4 a {
  color: #1c1c1c !important;
}

h5 a {
  color: #1c1c1c !important;
}

h1 a:visited {
  color: #1c1c1c !important;
}

h2 a:visited {
  color: #1c1c1c !important;
}

h3 a:visited {
  color: #1c1c1c !important;
}

h4 a:visited {
  color: #1c1c1c !important;
}

h5 a:visited {
  color: #1c1c1c !important;
}

/* ---- Nosotros: team grid ---- */
.team-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.5em;
  margin: 1.5em 0 2.5em;
}

.team-card {
  flex: 0 1 calc((100% - 2 * 1.5em) / 3);
  max-width: calc((100% - 2 * 1.5em) / 3);
  text-align: center;
  background: rgb(244, 235, 240);
  border: 1px solid rgb(224, 199, 215);
  border-radius: 8px;
  padding: 1em 0.75em;
}

.team-card img {
  width: 240px;
  aspect-ratio: 1 / 1;
  height: auto;
  object-fit: cover;
  object-position: center;
  border-radius: 50%;
  overflow: hidden;
  display: block;
  margin: 0 auto 0.6em;
  padding: 0;
  border: 3px solid #ffffff;
  box-shadow: 0 0 0 1px rgb(224, 199, 215);
}

.team-card p {
  margin: 0.1em 0;
  line-height: 1.3;
}

.team-card strong {
  font-size: 1.05em;
}

.team-card em {
  color: rgb(98, 30, 76);
  font-style: normal;
  font-size: 0.72em;
}

.team-card p strong {
  color: rgb(98, 30, 76);
  /* team member names in the brand color */
}

/* ---- Nosotros: "En acción" single-photo slider ---- */
.gallery-slider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75em;
  margin: 1em 0 2em;
}

.slider-track {
  position: relative;
  width: 100%;
  max-width: 460px;
  height: 460px;
  overflow: hidden;
  border-radius: 6px;
  background: #eee;
}

.slider-track .slider-slide {
  display: none;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  margin: 0;
  object-fit: cover;
  object-position: center;
  border-radius: 6px;
}

.slider-track .slider-slide.is-active {
  display: block;
}

.slider-arrow {
  flex: 0 0 auto;
  width: 2.4em;
  height: 2.4em;
  border: 1px solid rgb(224, 199, 215);
  border-radius: 50%;
  background: #fff;
  color: rgb(98, 30, 76);
  font-size: 1.2em;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease;
}

.slider-arrow:hover {
  background: rgb(244, 235, 240);
}

/* ---- Nosotros: featured portrait above the grid ---- */
.team-featured {
  text-align: center;
  margin: 0 auto 2.5em;
}

.team-featured img {
  width: 420px;
  aspect-ratio: 1 / 1;
  height: auto;
  object-fit: cover;
  object-position: center;
  border-radius: 50%;
  overflow: hidden;
  display: block;
  margin: 0 auto;
  padding: 0;
  border: 4px solid #ffffff;
  box-shadow: 0 0 0 1px rgb(224, 199, 215);
}

.team-featured-caption {
  margin-top: 0.7em;
  font-size: 0.95em;
  font-weight: bold;
  color: rgb(98, 30, 76);
}

/* ---- Poster pages: hero image (2x the game hero) ---- */
.poster-hero {
  text-align: center;
  margin: 0 auto 1.5em;
}

.poster-hero img {
  max-width: 640px;
  width: 100%;
  height: auto;
  border-radius: 8px;
  padding: 0;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

/* ---- Authors in the left sidebar (from {{ autores }}) ---- */
/* Each author from hfun_autores() is wrapped in .author__wrapper so that
   multiple authors stack cleanly. Layout: circular photo on the left,
   author name beside it; contact links below. */
.author__wrapper {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  text-align: left;
  margin: 0 0 1.2em;
}

.author__wrapper .author__avatar {
  flex: 0 0 auto;
  /* circular photo, ~2.4em */
  width: 2.4em;
  height: 2.4em;
}

.author__wrapper .author__avatar img {
  width: 2.4em;
  height: 2.4em;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  object-position: center;
  border-radius: 50%;
  padding: 0;
  border: 1px solid #f2f3f3;
  display: block;
}

.author__wrapper .author__content {
  display: block;
  flex: 1 1 auto !important;
  /* keep name on the SAME row as the photo (beat minimal-mistakes' width:100% at >=64em) */
  width: auto !important;
  max-width: none;
  /* use the full sidebar width; don't squeeze to 7em */
  min-width: 0;
  padding: 0 0 0 0.6em;
  text-align: left;
}

.author__wrapper .author__name {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Roboto", "Segoe UI", "Helvetica Neue", "Lucida Grande", Arial, sans-serif;
  font-size: 0.85em;
  font-weight: normal;
  line-height: 1.2;
}

.author__wrapper .author__urls-wrapper {
  flex: 0 0 100%;
  position: relative;
  display: block;
  cursor: default;
  margin-top: 0.4em;
}

.author__wrapper .author__urls-wrapper button,
.author__wrapper .author__urls-wrapper button {
  display: none;
}

.author__wrapper .author__urls {
  display: flex;
  flex-wrap: wrap;
  /* keep icons on one line; wrap only if cramped */
  gap: 0.5em;
  position: relative;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  list-style: none;
  text-align: left;
}

.author__wrapper .author__urls::before,
.author__wrapper .author__urls::after {
  display: none;
}

.author__wrapper .author__urls li {
  white-space: nowrap;
  display: inline-flex;
}

.author__wrapper .author__urls a {
  display: inline-block;
  margin: 2px 0;
  font-size: 0.9em;
  color: inherit;
  text-decoration: none;
}

.author__wrapper .author__urls a:hover {
  text-decoration: underline;
}

.game-pdfs {
  margin: 1.5em 0 2em;
}

.game-pdf {
  margin-bottom: 1.5em;
}

.game-pdf iframe {
  display: block;
  width: 100%;
  max-width: 640px;
  height: 80vh;
  min-height: 480px;
  margin: 0 auto;
  border: 1px solid rgb(224, 199, 215);
  border-radius: 6px;
  background: #fff;
}

.game-pdf a[download] {
  display: inline-block;
  margin-top: 0.4em;
  font-size: 0.9em;
  color: rgb(98, 30, 76);
}

/* ---- Card grid (reusable: Juegos index, Posters index, ...) ---- */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  /* force 3 cards per row */
  gap: 1.5em;
  margin: 1.5em 0 2em;
}

/* Narrow screens: force 1 card/button per row everywhere */
@media (max-width: 48em) {

  /* Juegos / Talleres / Posters */
  .cards-grid {
    grid-template-columns: 1fr;
  }

  /* Nosotros: team grid */
  .team-card {
    flex: 0 0 100%;
    max-width: 100%;
  }

  /* Actividades: activity cards (2-across -> 1-across) */
  .activity-card {
    width: 100%;
  }

  /* Home: feature cards with buttons (4-across -> 1-across) */
  .feature__wrapper .feature__item {
    width: 100%;
    margin-left: 0;
    clear: both;
  }

  /* Sliders (Nosotros / Sala de Escape): overlay arrows on the photo
     so they don't shrink it on narrow screens */
  .gallery-slider {
    display: block;
    position: relative;
    gap: 0;
  }

  .slider-track {
    margin: 0 auto;
    /* keep the photo centered, full content width */
  }

  .slider-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    /* transparent overlay: just a delicate arrow glyph, no white button */
    width: auto;
    height: auto;
    padding: 0.1em 0.3em;
    border: none;
    border-radius: 0;
    background: transparent;
    color: #fff;
    font-size: 2.2em;
    line-height: 1;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.55);
  }

  .slider-arrow:hover {
    background: transparent;
  }

  .slider-arrow.slider-prev {
    left: 0.3em;
  }

  .slider-arrow.slider-next {
    right: 0.3em;
  }
}

.game-card {
  display: block;
  text-align: center;
  text-decoration: none;
  color: inherit;
  background: rgb(244, 235, 240);
  border: 1px solid rgb(224, 199, 215);
  border-radius: 8px;
  overflow: hidden;
  padding: 0;
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.game-card:hover {
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
  transform: translateY(-2px);
}

.game-card img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  object-position: center;
  display: block;
  padding: 0;
  border-radius: 0;
}

.game-card-title {
  display: block;
  padding: 0.6em 0.4em;
  font-weight: bold;
  font-size: 0.95em;
  color: rgb(98, 30, 76);
}

/* ---- Fonts: EB Garamond (body text) + Lato (titles) ---- */
body {
  font-family: "EB Garamond", Georgia, "Times New Roman", serif;
  font-size: 27px;
  line-height: 1.6;
}

.franklin-content,
.page__content,
p,
li,
td,
th,
dd,
dt,
blockquote,
figcaption {
  font-family: "EB Garamond", Georgia, "Times New Roman", serif;
  font-size: 27px;
}

/* Titles, cards, buttons, dropdown, author name: Lato (default size, not shrunk).
   NOTE: the masthead/nav is intentionally EXCLUDED here so the top menu keeps
   the theme's normal size — shrinking it (0.75em) made the whole bar tiny. */
h1,
h2,
h3,
h4,
h5,
h6,
.page__title,
.archive__item-title,
.archive__item-body,
.archive__item-excerpt,
.game-card,
.game-card-title,
.author__name,
.dropdown-menu,
.dropdown-menu li,
.dropdown-menu a,
.dropdown-toggle,
.btn,
button,
.greedy-nav .visible-links,
.sidebar .author__name {
  font-family: "Lato", -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

/* Masthead uses Lato too, but at the theme's normal size (no 0.75em shrink) */
.masthead,
.masthead__menu,
.masthead__menu-item,
.site-title {
  font-family: "Lato", -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

/* Masthead (top menu) spans the same horizontal space as the page content
   (sidebar + text column): 7.5% left / 22.5% right margins, matching #main. */
.masthead__inner-wrap {
  width: auto;
  /* fill window minus the left/right margins (match #main) */
  max-width: none;
  margin-left: 7%;
  /* same as the page content's left margin (was 7.5%) */
  margin-right: 21%;
  /* same as the page content's right margin (was 22.5%) */
}

code,
pre,
.katex,
.katex * {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

/* ---- Mobile masthead: reclaim the dead 22.5% right margin so the logo
   + site title fit on one line instead of being squeezed into ~70% of
   the screen. Placed last so it overrides the base rule above. ---- */
@media (max-width: 48em) {
  .masthead__inner-wrap {
    margin-left: 5%;
    margin-right: 5%;
  }
}