/* 3615 TETALAB
   Le site est un service Minitel : palette télétexte sur fond noir, où le jaune et le rouge
   du logo sont chez eux. Cette feuille remplace celles d'Antimatter. */

@font-face {
  font-family: "VT323";
  src: url(fonts/vt323-400-normal.woff2) format("woff2");
  font-display: swap;
}

:root {
  --noir: #050505;
  --blanc: #f2f2ea;
  --jaune: #ffcb08;
  --rouge: #e3202f;
  --rouge-logo: #bf1e2e;
  --cyan: #2ee6e6;
  --vert: #39e75f;
  --magenta: #ff5cdc;
  --plastique: #cdbb98;
  --plastique-clair: #e6dcc4;
  --plastique-fonce: #8f7c5e;
  --terminal: "VT323", "Courier New", monospace;
  /* Une rangée de pavés, pour séparer les rubriques. */
  --mosaique: repeating-linear-gradient(90deg,
    var(--rouge) 0 16px, transparent 16px 20px,
    var(--jaune) 20px 36px, transparent 36px 40px,
    var(--cyan) 40px 56px, transparent 56px 60px);
}

/* --- Base ------------------------------------------------------------------ */

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

html { font-size: 22px; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  /* Les nervures du boîtier. */
  background: repeating-linear-gradient(90deg, var(--plastique) 0 5px, #c4b28e 5px 7px);
  color: var(--blanc);
  font-family: var(--terminal);
  line-height: 1.3;
}

button, input, select, textarea { font: inherit; color: inherit; }

img, iframe, video { max-width: 100%; }

img { height: auto; }

::selection { background: var(--jaune); color: #000; }

:focus-visible { outline: 3px solid var(--magenta); outline-offset: 2px; }

.hidden {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

h1, h2, h3, h4, h5, h6 { font-weight: 400; line-height: 1.1; margin: 1.4em 0 0.5em; }

h1, h2 { color: var(--jaune); text-transform: uppercase; }

h1 { font-size: 2.3rem; }
h2 { font-size: 1.9rem; }
h3 { color: var(--cyan); font-size: 1.5rem; }
h4 { color: var(--cyan); font-size: 1.3rem; }
h5 { color: var(--vert); font-size: 1.15rem; }
h6 { color: var(--vert); font-size: 1rem; }

p { margin: 0 0 0.9em; }

strong, b { color: #fff; font-weight: 400; text-shadow: 0.5px 0 0 currentColor; }

a { color: var(--cyan); text-decoration-skip-ink: none; text-underline-offset: 0.15em; }

a:hover { background: var(--cyan); color: #000; text-decoration: none; }

ul, ol { margin: 0 0 0.9em; padding-left: 1.6em; }

hr { border: 0; height: 10px; margin: 1.5em 0; background: var(--mosaique); }

blockquote {
  border-left: 8px solid var(--cyan);
  color: var(--cyan);
  margin: 1em 0;
  padding: 0.1em 0 0.1em 1em;
}

code, kbd, samp { color: var(--vert); font-family: inherit; }

pre {
  background: #0b1a0e;
  border: 2px solid var(--vert);
  color: var(--vert);
  font-family: inherit;
  line-height: 1.15;
  overflow-x: auto;
  padding: 0.75em;
}

table { border-collapse: collapse; margin-bottom: 1em; width: 100%; }

th { background: var(--cyan); color: #000; font-weight: 400; text-align: left; text-transform: uppercase; }

th, td { border: 2px solid #33504f; padding: 0.15em 0.5em; overflow-wrap: anywhere; }

/* Les champs de saisie vidéotex : une ligne de points. */
input[type="text"], input[type="email"], input[type="search"], textarea, select {
  background: transparent;
  border: 0;
  border-bottom: 3px dotted var(--cyan);
  border-radius: 0;
  color: var(--blanc);
  width: 100%;
}

.button, input[type="submit"], button[type="submit"] {
  background: var(--jaune);
  border: 0;
  color: #000;
  cursor: pointer;
  display: inline-block;
  padding: 0.05em 0.6em;
  text-decoration: none;
  text-transform: uppercase;
}

.button:hover, input[type="submit"]:hover, button[type="submit"]:hover { background: var(--blanc); color: #000; }

/* --- Le Minitel ---------------------------------------------------------------- */

#minitel {
  margin: 0 auto;
  max-width: 1240px;
  padding: 1.2rem 1.2rem 1.5rem;
}

#ecran {
  background: var(--noir);
  border: 20px solid #2b241a;
  border-radius: 34px;
  box-shadow: 0 0 0 4px var(--plastique-fonce), 0 0 0 7px var(--plastique-clair);
  overflow: hidden;
  position: relative;
}

/* Le balayage du tube cathodique. */
#ecran::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  background: repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.13) 0 1px, transparent 1px 3px);
}

/* La ligne zéro, avec le C de « connecté » dans le coin, comme sur le vrai. */
#ligne-zero {
  background: var(--blanc);
  color: #000;
  display: flex;
  font-size: 0.9rem;
  justify-content: space-between;
  gap: 1rem;
  padding: 0 0.75rem;
}

#etat { background: #000; color: var(--vert); padding: 0 0.4em; }

#header {
  align-items: center;
  display: flex;
  gap: 1.5rem;
  padding: 0.5rem 1.5rem 0.25rem;
}

/* Le logo passe devant le balayage : il reste tel quel. Son PNG a 50 px de vide en haut. */
#logo { flex: 0 0 auto; margin: -50px 0 0; position: relative; z-index: 4; }

#logo a, #logo a:hover { background: none; display: block; }

#logo img { display: block; height: 150px; width: auto; }

#titre-mosaique { flex: 1; min-width: 0; max-height: 88px; }

#navbar { border-bottom: 10px solid transparent; border-image: var(--mosaique) 10; padding: 0 1.5rem 0.5rem; }

.navigation {
  counter-reset: rubrique;
  display: flex;
  flex-wrap: wrap;
  gap: 0.15rem 1rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.navigation li { counter-increment: rubrique; }

.navigation a { color: var(--blanc); display: block; text-decoration: none; }

.navigation a::before {
  background: var(--blanc);
  color: #000;
  content: counter(rubrique);
  margin-right: 0.35em;
  padding: 0 0.3em;
}

.navigation a:hover { background: none; color: var(--jaune); }

.navigation a:hover::before { background: var(--jaune); }

.navigation .active a { background: var(--jaune); color: #000; padding-right: 0.3em; }

.navigation .active a::before { background: #000; color: var(--jaune); }

/* --- La devise : un menu où le service attend votre choix ------------------------ */

.blog-header {
  align-items: center;
  display: flex;
  gap: 2rem;
  justify-content: space-between;
  padding: 1rem 1.5rem 1.25rem;
}

.devise::before { color: var(--cyan); content: "SOMMAIRE DU SERVICE"; display: block; }

.blog-header h2 { font-size: 2rem; margin: 0.4rem 0 0; }

.art-minitel { flex: 0 0 auto; width: 200px; }

h2.sequenceur { display: grid; font-size: 1.5rem; gap: 0.1rem 2.5rem; grid-template-columns: repeat(2, auto); justify-content: start; }

.sequenceur .pas { display: block; height: 2.6rem; line-height: 2.6rem; padding: 0 0.5em 0 0; white-space: nowrap; }

/* Le double hauteur du vidéotex : la même lettre, étirée. */
.sequenceur .mot { display: inline-block; transform: scaleY(1.45); }

.sequenceur .num { background: var(--jaune); color: #000; display: inline-block; line-height: 1.5rem; margin-right: 0.5em; padding: 0 0.35em; }

.sequenceur .pas.allume { background: var(--jaune); color: #000; }

.sequenceur .pas.allume .num { background: #000; color: var(--jaune); }

.invite { color: var(--blanc); margin: 0.6rem 0 0; }

.invite .saisie { background: var(--blanc); color: #000; display: inline-block; min-width: 0.9em; padding: 0 0.15em; text-align: center; }

.invite .envoi { background: var(--cyan); color: #000; margin-left: 0.4em; padding: 0 0.3em; }

/* --- Contenu ------------------------------------------------------------------------ */

#body { padding: 0.75rem 1.5rem 2rem; }

#body > :first-child { margin-top: 0.25em; }

#breadcrumbs { color: var(--blanc); height: auto; line-height: inherit; margin-bottom: 0.75rem; padding: 0; }

#breadcrumbs::before { color: var(--cyan); content: "3615 TETALAB > "; }

#breadcrumbs span { display: inline; padding: 0; }

#breadcrumbs > i { color: var(--cyan); font-size: 0.6em; margin: 0 0.4em; width: auto; }

.blog-content-list, .blog-content-item {
  display: grid;
  gap: 2rem;
  grid-template-columns: minmax(0, 1fr) 19rem;
}

#listing:only-child, #item:only-child { grid-column: 1 / -1; }

.list-item { margin-bottom: 2.25rem; }

.list-item .list-blog-header::before { background: var(--mosaique); content: ""; display: block; height: 10px; margin-bottom: 0.6rem; }

#item .list-item .list-blog-header::before { display: none; }

.list-blog-date { color: var(--cyan); float: right; margin-left: 1em; }

.list-item .p-name { font-size: 1.9rem; margin: 0 0 0.2em; text-transform: uppercase; }

.list-item .p-name a { color: var(--jaune); text-decoration: none; }

.list-item .p-name a:hover { background: var(--jaune); color: #000; }

/* La date remplace l'icône calendrier des titres. */
.list-item .p-name .fa-calendar-o { display: none; }

.list-blog-header img { display: block; margin: 0.6rem 0; }

.list-blog-padding { overflow-wrap: anywhere; }

.tags { display: block; }

.tags a { color: var(--magenta); display: inline-block; margin-right: 0.6em; text-decoration: none; }

.tags a::before { content: "#"; }

.tags a:hover { background: var(--magenta); color: #000; }

/* Le lien de suite d'un article devient la touche du même nom. */
.p-summary > p:last-child > a:only-child {
  background: var(--jaune);
  color: #000;
  padding: 0 0.4em;
  text-decoration: none;
}

.p-summary > p:last-child > a:only-child::after { content: " [SUITE]"; }

.p-summary > p:last-child > a:only-child:hover { background: var(--blanc); }

.prev-next { display: flex; flex-wrap: wrap; gap: 0.5rem; justify-content: space-between; margin-top: 1.5rem; }

.image-credit-wrapper { max-width: 1000px; overflow: hidden; position: relative; }

.image-credit { background: #000; bottom: 0; color: var(--blanc); font-size: 0.75rem; padding: 0 0.4em; position: absolute; right: 0; }

.image-credit a { color: inherit; }

/* Les liens externes : la petite icône du plugin disparaît sur fond noir. */
#ecran a.external-link, #ecran a.external { background-image: none; padding-right: 0; }

#ecran a.external-link::after, #ecran a.external::after { content: "*"; font-size: 0.8em; vertical-align: super; line-height: 0; }

/* Le plugin pose un raccourci `background` qui remet la couleur de fond à zéro et l'emporte
   sur a:hover : sans ceci, ses liens passent en noir sur noir au survol. */
a.external-link.icon:hover, a.external-link.no-image:hover, a.external:hover, a.mailto:hover { background-color: var(--cyan); }

/* --- Avis ------------------------------------------------------------------------------ */

.notices, .notices.yellow, .notices.red, .notices.blue, .notices.green {
  border: 0;
  color: #000;
  margin: 0 0 1.75rem;
  padding: 0.5rem 1rem;
}

.notices.yellow { background: var(--jaune); }
.notices.red { background: var(--rouge); color: #fff; }
.notices.blue { background: var(--cyan); }
.notices.green { background: var(--vert); }

.notices h1, .notices h2, .notices h3, .notices h4, .notices h5, .notices h6, .notices strong, .notices a { color: inherit; text-shadow: none; }

.notices h5 { font-size: 1.5rem; margin: 0 0 0.2em; }

.notices h6 { font-size: 1.05rem; margin: 0; }

.notices p { margin: 0; }

.notices.yellow::before { content: "AVIS À LA POPULATION"; display: block; font-size: 0.85rem; letter-spacing: 0.15em; margin-bottom: 0.2em; }

/* --- Colonne de droite -------------------------------------------------------------------- */

#sidebar { font-size: 0.95rem; min-width: 0; overflow-wrap: anywhere; }

#sidebar::before { background: var(--blanc); color: #000; content: "GUIDE DU SERVICE"; display: block; padding: 0 0.4em; text-align: center; }

#sidebar h1, #sidebar h2, #sidebar h3, #sidebar h4, #sidebar h5, #sidebar h6 {
  background: var(--cyan);
  color: #000;
  font-size: 1rem;
  margin: 1.1em 0 0.4em;
  padding: 0.05em 0.4em;
  text-transform: uppercase;
}

#sidebar ul { list-style: none; margin: 0 0 0.6em; padding: 0; }

#sidebar li::before { color: var(--jaune); content: "> "; }

#sidebar a { color: var(--jaune); }

#sidebar a:hover { background: var(--jaune); color: #000; }

#sidebar .tags a { color: var(--magenta); }

#sidebar .tags a:hover { background: var(--magenta); color: #000; }

#sidebar .syndicate .button { color: #000; margin: 0 0.3em 0.3em 0; }

#sidebar .syndicate .button:hover { background: var(--blanc); }

/* --- Pagination, 404, pied de page --------------------------------------------------------- */

.pagination { display: flex; flex-wrap: wrap; gap: 0.4rem; justify-content: center; list-style: none; margin: 2rem 0 0; padding: 0; }

.pagination li { border: 0; display: block; }

.pagination a, .pagination span { background: #222; color: var(--blanc); display: block; padding: 0 0.6em; text-decoration: none; }

.pagination a:hover { background: var(--jaune); color: #000; }

.pagination .active { background: var(--jaune); color: #000; }

/* « et » deviennent les touches RETOUR et SUITE. */
.pagination li:first-child > *, .pagination li:last-child > * { font-size: 0; }

.pagination li:first-child > *::before { content: "RETOUR"; font-size: 1rem; }

.pagination li:last-child > *::before { content: "SUITE"; font-size: 1rem; }

.pagination li:first-child > span, .pagination li:last-child > span { background: none; color: #777; }

#error { padding: 2rem 0; text-align: center; }

#error h1 { color: var(--rouge); margin-top: 0; }

#error .gag { color: var(--cyan); }

#footer { color: var(--blanc); font-size: 0.95rem; padding: 0.35rem 1.5rem 0.75rem; text-align: center; }

#footer::before { background: var(--mosaique); content: ""; display: block; height: 10px; margin: 0 -1.5rem 0.75rem; }

#footer p { margin: 0; }

/* --- Le clavier ------------------------------------------------------------------------------ */

#clavier {
  display: grid;
  gap: 0.5rem;
  grid-template-columns: repeat(9, minmax(0, 1fr));
  margin-top: 1.4rem;
}

.touche {
  background: linear-gradient(var(--plastique-clair), #d3c8ad);
  border: 0;
  border-radius: 4px;
  box-shadow: 0 4px 0 #6b5c44, 0 5px 3px rgba(0, 0, 0, 0.35);
  color: #000;
  cursor: pointer;
  display: block;
  font-size: 0.85rem;
  padding: 0.35rem 0.15rem;
  text-align: center;
  text-decoration: none;
  text-transform: uppercase;
}

.touche:hover { background: var(--blanc); color: #000; }

.touche:active { box-shadow: 0 1px 0 #6b5c44; transform: translateY(3px); }

.touche-fin { background: var(--rouge-logo); box-shadow: 0 4px 0 #6d0f18, 0 5px 3px rgba(0, 0, 0, 0.35); color: #fff; }

.touche-fin:hover { background: var(--rouge); color: #fff; }

/* --- Écran de fin ------------------------------------------------------------------------------ */

#fin {
  align-items: center;
  background: #000;
  color: var(--blanc);
  display: flex;
  flex-direction: column;
  inset: 0;
  justify-content: center;
  padding: 1rem;
  position: fixed;
  text-align: center;
  z-index: 10;
}

#fin[hidden] { display: none; }

#fin .fin-titre { color: var(--jaune); font-size: 2.3rem; }

#fin .touche { font-size: 1rem; margin-top: 1rem; padding: 0.35rem 1rem; }

html.fin-active { overflow: hidden; }

/* --- Sans habillage (intégration en iframe) ------------------------------------------------------ */

.sans-minitel { background: var(--noir); }

.sans-minitel #minitel { max-width: none; padding: 0; }

.sans-minitel #ecran { border: 0; border-radius: 0; box-shadow: none; }

/* --- Animations ----------------------------------------------------------------------------------- */

/* La page se peint ligne par ligne, à la vitesse du modem. */
html.balayage::after {
  animation: balayage 1s steps(25) forwards;
  background: #000;
  content: "";
  inset: 0;
  pointer-events: none;
  position: fixed;
  z-index: 9;
}

@keyframes balayage { to { clip-path: inset(100% 0 0 0); } }

@keyframes curseur { 50% { background: transparent; color: transparent; } }

.invite .saisie { animation: curseur 1s steps(1) infinite; }

@media (prefers-reduced-motion: reduce) {
  html.balayage::after { display: none; }
  .invite .saisie { animation: none; }
}

/* --- Petits écrans : on sort le Minitel du boîtier ---------------------------------------------------- */

@media (max-width: 1000px) {
  .blog-content-list, .blog-content-item { grid-template-columns: minmax(0, 1fr); }

  #clavier { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 700px) {
  html { font-size: 20px; }

  #minitel { padding: 0; }

  #ecran { border: 0; border-radius: 0; box-shadow: none; }

  #ligne-zero .facultatif { display: none; }

  #header { gap: 0.75rem; padding: 0 1rem; }

  #logo { margin: -35px 0 0; }

  #logo img { height: 105px; }

  #navbar { padding: 0 1rem 0.5rem; }

  .blog-header { padding: 0.75rem 1rem 1rem; }

  .art-minitel { display: none; }

  h2.sequenceur { gap: 0.1rem 0.75rem; font-size: 1.3rem; }

  #body { padding: 0.75rem 1rem 1.5rem; }

  .list-item .p-name { font-size: 1.6rem; }

  #clavier { margin: 0; padding: 1rem; }
}

@media (max-width: 360px) {
  .touche { font-size: 0.72rem; }
}
