/* Shared look of the subdomain pages (teaching, teaching-admin, experiments,
   guides, diplomado): header, title band, footer and page components, matching
   the homepage (home.css). Directory search/filters live in directory.css.
   Cache: gamectl stamps ?v= on the directory pages; bump ?v= by hand on the
   guides and /diplomado/ (see SESSION_NOTES, "Subdomain redesign"). */
:root {
  --blue: #0039a6; --blue-dark: #002d82; --blue-mid: #3d6fd6; --blue-pale: #dbe6fb;
  --navy: #0b1f4d; --night: #07142f; --ink: #1d2330; --muted: #5b6475; --soft: #f3f6fb; --line: #e3e7ef;
  --bg: #ffffff;
  color-scheme: only light;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 116px; }
body { margin: 0; font-family: "Mulish", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--ink); background: #fff; line-height: 1.6; }
img { max-width: 100%; }
a { color: var(--blue); }
.wrap { max-width: 1160px; margin: 0 auto; padding: 0 16px; }
.eyebrow { font-size: .8rem; font-weight: 800; letter-spacing: .22em; text-transform: uppercase; margin: 0; }

/* header (same as the homepage) */
.site { position: sticky; top: 0; z-index: 20; background: #fff; border-bottom: 1px solid var(--line); }
.site .wrap { display: grid; grid-template-columns: max-content minmax(0, 1fr); align-items: center; column-gap: 24px; padding-top: 8px; }
.logos { grid-column: 1; grid-row: 1; display: flex; align-items: center; gap: 16px; text-decoration: none; }
.logos > * { flex: none; }
.logos .tec { height: 38px; }
.logos .bar { width: 1px; height: 40px; background: var(--line); }
.logos .beer { height: 52px; }
.menu { grid-column: 1 / -1; grid-row: 2; display: flex; gap: 18px; justify-content: space-between; min-width: 0; overflow-x: auto; scrollbar-width: none; border-top: 1px solid var(--line); }
.menu::-webkit-scrollbar { display: none; }
.menu a { flex: none; white-space: nowrap; color: var(--ink); text-decoration: none; font-size: .75rem; font-weight: 700; letter-spacing: .10em; text-transform: uppercase; padding: 8px 0; border-bottom: 2px solid transparent; }
.menu a:hover, .menu a[aria-current] { color: var(--blue); border-bottom-color: var(--blue); }
.lang { grid-column: 2; grid-row: 1; justify-self: end; font-size: .75rem; font-weight: 700; letter-spacing: .12em; white-space: nowrap; }
.lang a, .lang span { padding: 5px 8px; border-radius: 4px; text-decoration: none; }
.lang a { color: var(--blue); }
.lang a:hover { background: var(--soft); }
.lang span { background: var(--blue); color: #fff; }
@media (max-width: 1100px) {
  /* Keep both header rows; compact links and allow horizontal scrolling. */
  .menu { margin: 0 -16px; padding: 0 12px; gap: 10px; }
  .menu a { white-space: nowrap; font-size: .68rem; letter-spacing: .04em; padding: 11px 0 9px; }
}
@media (max-width: 385px) {
  /* narrowest phones: the row scrolls; fade the right edge so it reads as "more" */
  .menu { justify-content: flex-start; -webkit-mask-image: linear-gradient(to right, #000 82%, transparent); mask-image: linear-gradient(to right, #000 82%, transparent); }
}
@media (max-width: 480px) {
  .site .wrap { column-gap: 12px; }
  .logos { gap: 10px; }
  .logos .tec { height: 26px; }
  .logos .bar { height: 30px; }
  .logos .beer { height: 36px; }
}

/* title band: the lab photo under a blue gradient */
.page-hero, #beer-events .beer-hero { position: relative; color: #fff; background: var(--navy) url("https://beer-lab.org/img/laboratorio-aula.jpg") center 60% / cover no-repeat; }
.page-hero::before, #beer-events .beer-hero::before { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(7,20,47,.95) 0%, rgba(0,45,130,.86) 50%, rgba(0,57,166,.5) 100%); }
#beer-events .beer-hero .beer-wrap { position: relative; }
.page-hero .wrap { position: relative; padding-top: clamp(44px, 7vw, 84px); padding-bottom: clamp(44px, 7vw, 84px); }

.page-hero h1 { font-weight: 200; font-size: clamp(2.1rem, 5vw, 3.3rem); line-height: 1.1; margin: 0 0 16px; letter-spacing: -.01em; color: #fff; }
.page-hero h1 strong { font-weight: 800; }
.page-hero p { font-weight: 300; font-size: clamp(1rem, 1.6vw, 1.15rem); max-width: 720px; margin: 0 0 10px; color: #e6edfb; }
.page-hero p:last-child { margin-bottom: 0; }
.page-hero strong { font-weight: 700; color: #fff; }
.page-hero a { color: #fff; text-decoration: underline; text-decoration-color: rgba(255,255,255,.5); text-underline-offset: 3px; }
.page-hero a:hover { text-decoration-color: #fff; }
.page-hero .small { font-size: .95rem; color: #cfe0ff; }
.page-hero p.eyebrow { font-size: .8rem; font-weight: 800; color: #9fc0ff; margin: 0 0 14px; max-width: none; }

main.page { max-width: 1160px; margin: 0 auto; padding: 48px 16px 72px; }
.note { color: var(--muted); font-size: .95rem; }
code { background: #eef2f8; padding: 2px 6px; border-radius: 4px; font-size: .92em; }
:not(pre) > code { overflow-wrap: anywhere; }

/* buttons */
.btn { display: inline-block; background: var(--blue); color: #fff; text-decoration: none; font-weight: 700; font-size: .95rem; padding: 11px 20px; border-radius: 4px; border: 1px solid var(--blue); margin: 0 8px 8px 0; transition: background .15s, color .15s; }
.btn:hover { background: var(--blue-dark); border-color: var(--blue-dark); }
.btn.alt { background: #fff; color: var(--blue); }
.btn.alt:hover { background: var(--blue); color: #fff; }

/* directory cards (teaching, experiments, teaching-admin); the cards
   themselves are generated by games/gamectl */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 440px), 1fr)); gap: 24px; align-items: start; }
.cards > .note { grid-column: 1 / -1; }
.card { position: relative; background: #fff; border: 1px solid var(--line); border-top: 4px solid var(--blue); border-radius: 6px; padding: 24px 26px 20px; transition: box-shadow .2s; }
.card:hover { box-shadow: 0 14px 30px rgba(11,31,77,.10); }
.card[hidden] { display: none; }
.card h2 { margin: 0 0 10px; font-size: 1.2rem; font-weight: 800; line-height: 1.3; color: var(--ink); }
.card p { margin: 0 0 16px; color: var(--muted); font-size: .95rem; }
.card .note { font-size: .88rem; }
.card code { background: var(--soft); }
.check { display: flex; align-items: center; gap: 8px; margin: 6px 0 4px; font-size: .88rem; color: var(--muted); cursor: pointer; }
.check input { width: auto; margin: 0; accent-color: var(--blue); }
/* Extended version of a game: hidden until that card's checkbox is ticked. */
.ext { display: none; } .card.show-ext a.ext { display: inline-block; } .card.show-ext li.ext { display: list-item; }
/* teacher cards: participants + duration, the rest collapsed, then actions */
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0 0 16px; font-size: .9rem; }
.facts dt { margin: 0; color: var(--ink); font-weight: 800; font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; padding-top: 3px; }
.facts dd { margin: 0; color: var(--muted); }
details.more { margin: 0 0 16px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 8px 0; }
details.more summary { cursor: pointer; color: var(--blue); font-size: .9rem; font-weight: 700; padding: 4px 0; }
details.more[open] summary { margin-bottom: 6px; }
details.more dl { font-size: .9rem; margin: 0 0 8px; }
details.more dt { font-weight: 700; margin-top: 10px; }
details.more dd { margin: 2px 0 0; color: var(--muted); }
details.more dd ul { margin: 4px 0 0; padding-left: 20px; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin: 0 !important; }
.actions .btn { margin: 0; }
.guide-other { font-size: .85rem; font-weight: 800; letter-spacing: .08em; text-decoration: none; padding: 4px 6px; border-radius: 4px; }
.guide-other:hover { background: var(--soft); }

/* sections below the directory */
.section-head { margin: 64px 0 20px; }
.section-head h2 { font-weight: 300; font-size: clamp(1.5rem, 2.6vw, 2rem); color: var(--blue); margin: 8px 0 0; line-height: 1.2; }
.steps { list-style: none; counter-reset: s; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px 32px; }
.steps li { counter-increment: s; position: relative; padding: 0 0 0 52px; color: var(--muted); }
.steps li::before { content: counter(s); position: absolute; left: 0; top: -2px; width: 34px; height: 34px; border-radius: 50%; background: var(--blue-pale); color: var(--blue); font-weight: 800; display: grid; place-items: center; }
.steps strong { color: var(--ink); }
.band { margin-top: 56px; background: var(--soft); border-left: 4px solid var(--blue); border-radius: 0 6px 6px 0; padding: 20px 24px; }
.band p { margin: 0 0 6px; } .band p:last-child { margin: 0; }

/* guides: sticky table of contents on the left, text on the right */
main.guide { max-width: 1160px; margin: 0 auto; padding: 48px 16px 72px; display: grid; grid-template-columns: 250px minmax(0, 760px); column-gap: 56px; align-items: start; }
main.guide > * { grid-column: 2; }
main.guide > .toc { grid-column: 1; grid-row: 1 / span 400; position: sticky; top: 108px; }
.toc { border-left: 2px solid var(--line); padding: 2px 0 2px 18px; }
.toc::before { content: attr(data-title); display: block; font-size: .72rem; font-weight: 800; letter-spacing: .2em; text-transform: uppercase; color: var(--ink); margin-bottom: 10px; }
.toc ol { list-style: none; counter-reset: t; margin: 0; padding: 0; }
.toc li { counter-increment: t; margin: 0 0 8px; font-size: .92rem; line-height: 1.4; }
.toc li::before { content: counter(t) ". "; color: var(--muted); }
.toc a { color: var(--ink); text-decoration: none; }
.toc a:hover { color: var(--blue); text-decoration: underline; }
main.guide h2 { font-weight: 300; font-size: clamp(1.45rem, 2.4vw, 1.8rem); color: var(--blue); margin: 48px 0 14px; padding-top: 22px; border-top: 1px solid var(--line); line-height: 1.25; }
main.guide h2:first-of-type { margin-top: 0; padding-top: 0; border-top: 0; }
main.guide h3 { font-size: 1.05rem; font-weight: 800; margin: 26px 0 8px; }
main.guide ul, main.guide ol { padding-left: 22px; }
main.guide li { margin-bottom: 7px; }
main.guide li::marker { color: var(--blue); font-weight: 700; }
.box { background: var(--soft); border-left: 4px solid var(--blue); border-radius: 0 6px 6px 0; padding: 18px 24px; margin: 20px 0; }
.box > strong:first-child { display: block; font-size: .75rem; font-weight: 800; letter-spacing: .18em; text-transform: uppercase; color: var(--blue); margin-bottom: 6px; }
pre { background: var(--night); color: #e6edfb; padding: 14px 16px; border-radius: 6px; overflow-x: auto; font-size: .9em; }
pre code { background: none; padding: 0; color: inherit; }
table { border-collapse: collapse; width: 100%; margin: 14px 0; font-size: .95em; }
th, td { text-align: left; border-bottom: 1px solid var(--line); padding: 9px 8px; vertical-align: top; }
th { color: var(--ink); font-weight: 800; font-size: .75rem; letter-spacing: .12em; text-transform: uppercase; border-bottom: 2px solid var(--blue); }
@media (max-width: 900px) {
  main.guide { display: block; }
  main.guide > .toc { position: static; margin-bottom: 36px; }
}

/* footer (same as the homepage) */
footer { background: var(--night); color: #b9c3d8; font-size: .92rem; }
footer .wrap { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 40px; padding-top: 56px; padding-bottom: 40px; }
footer .flogos { display: flex; align-items: center; gap: 16px; margin-bottom: 18px; }
footer .flogos img { filter: brightness(0) invert(1); }
footer .flogos .tec { height: 30px; }
footer .flogos .beer { height: 44px; }
footer h4 { color: #fff; font-size: .72rem; font-weight: 800; letter-spacing: .2em; text-transform: uppercase; margin: 6px 0 14px; }
footer ul { list-style: none; margin: 0; padding: 0; }
footer li { margin-bottom: 8px; }
footer a { color: #fff; text-decoration: none; font-weight: 300; }
footer a:hover { text-decoration: underline; }
footer address { font-style: normal; }
footer .legal { border-top: 1px solid rgba(255,255,255,.1); padding: 18px 16px; text-align: center; font-size: .8rem; color: #8894ad; }
@media (max-width: 760px) { footer .wrap { grid-template-columns: 1fr; gap: 28px; } }

@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } .card { transition: none; } }
