/* História e fontes · touradasacorda.com — the hub's tile system laid out as a reference page.
   Loaded after styles.css, terceira.css and letreiro.css; type only from their tokens (--t-small 18, --t-body 20,
   --t-lead 24, --t-h2 44, --t-display). */

/* older readers first: running text 20px on every screen, in the full ink */
body.hub.hist { --t-body: 20px; --t-small: 18px; }
.hist { color: var(--ink); }
.hist [id] { scroll-margin-top: 104px; }

/* ---- one wall: the white tile field on the course of the blue walls, and the calçada band between them
   (copied from terceira.css, where the hub lays it) ---- */
.h-abertura, .hist .sec {
  background: #F8F9FB url("../azores/azulejo-branco-512.jpg") 0 0 / calc(var(--step) * 4) calc(var(--step) * 4) repeat;
}
.junta { height: calc(var(--step) * 2); background: #1E1F22 url("../azores/calcada-grega-1600.jpg") repeat-x 0 0 / var(--rep, 520px) 100%; }
.hist main > section { position: relative; }
.sec { padding: clamp(72px, 8vw, 128px) var(--m); }
.sec-in { position: relative; z-index: 1; max-width: 1376px; margin: 0 auto; }
.escuro { background: var(--navy); color: var(--on-dark); overflow: clip; }
.escuro :focus-visible { outline-color: var(--paper); }

/* ---- the opening ---- */
.h-abertura { padding: 20px var(--m) clamp(56px, 6vw, 96px); }
.ab-in { max-width: 1376px; margin: 0 auto; container-type: inline-size; }
.h-abertura h1 { font-size: min(10cqi, 124px); white-space: nowrap; margin: clamp(24px, 4vw, 56px) 0 0; line-height: .95; letter-spacing: -.025em; }
.ab-lado { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); align-items: start; gap: 28px clamp(32px, 4vw, 64px); margin-top: clamp(24px, 3vw, 40px); }
.ab-txt { display: grid; gap: 20px; }
.ab-txt .lead { max-width: 40ch; }
.como { max-width: 62ch; }
.indice { display: grid; gap: 10px; align-content: start; }
.indice-t { font-size: var(--t-lead); font-weight: 600; line-height: 1.3; }
.indice ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.indice a { display: block; padding: 8px 0; text-decoration: none; font-size: var(--t-body); }
.indice a:focus-visible { color: var(--cobalt); text-decoration: underline; text-underline-offset: 5px; }
@media (hover: hover) and (pointer: fine) { .indice a:hover { color: var(--cobalt); text-decoration: underline; text-underline-offset: 5px; } }

/* eight painted tiles, each a way in; one course of the wall */
.friso { list-style: none; margin: clamp(40px, 5vw, 72px) 0 0; padding: 0; display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: clamp(8px, 1.4vw, 20px); }
.friso a { display: grid; gap: 10px; text-decoration: none; }
.friso img { width: 100%; height: auto; aspect-ratio: 1; transform: rotate(var(--rot, 0deg)); transition: transform .25s var(--ease); }
.friso a:focus-visible img { transform: rotate(0deg) scale(1.03); }
@media (hover: hover) and (pointer: fine) { .friso a:hover img { transform: rotate(0deg) scale(1.03); } }
.friso-ano { font-size: var(--t-small); font-weight: 600; font-style: italic; color: var(--cobalt); }

/* ---- every section opens the hub's way: the plaque on the left, its one sentence beside it ---- */
.cab { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: end; column-gap: clamp(32px, 4vw, 64px); row-gap: 18px; margin: 0 0 clamp(40px, 4vw, 56px); }
.cab > .az-placa { grid-column: 1; justify-self: start; }
.cab > .lead { grid-column: 2; max-width: 34ch; margin: 0; }
.escuro .lead { color: var(--on-dark); }

/* ---- text ---- */
.par { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(32px, 4vw, 64px); align-items: start; margin-top: clamp(40px, 5vw, 72px); }
.cab + .par { margin-top: 0; }
.col > * + * { margin-top: 20px; }
.col p, .ab-txt p { max-width: 64ch; }
.sub-t { font-size: var(--t-lead); font-weight: 600; line-height: 1.3; margin: 0; max-width: 40ch; }
.col > .sub-t:not(:first-child) { margin-top: 36px; }
.nota { font-size: var(--t-small); max-width: 64ch; }
.sec-in > .nota { margin-top: 28px; }
.lista { margin: 0; padding-left: 1.2em; display: grid; gap: 12px; max-width: 64ch; }
.atual { max-width: 56ch; }

/* sources inline: author, work, volume, page; every one a link to the bibliography */
.ref { font-size: var(--t-small); color: var(--cobalt); text-underline-offset: 4px; white-space: normal; }
@media (hover: hover) and (pointer: fine) { .ref:hover { color: var(--ink); } }
.escuro .ref, .escuro .fac-link, .escuro a { color: var(--soft); }
@media (hover: hover) and (pointer: fine) { .escuro .ref:hover, .escuro a:hover { color: var(--on-dark); } }
.grau { font-size: var(--t-small); font-weight: 600; font-style: normal; color: var(--manganes); white-space: nowrap; }
.escuro .grau { color: var(--soft); }
.contacto { font-weight: 600; text-underline-offset: 4px; }

/* the quotation, set large */
.cit { margin: 0; padding: 0; }
.cit p { font-size: var(--t-lead); font-style: italic; line-height: 1.45; max-width: 44ch; }
.cit-fonte { margin-top: 12px; font-size: var(--t-small); }

/* ---- a facsimile: the page itself, on paper, with its source ---- */
.fac { margin: 0; display: grid; gap: 14px; }
.fac-img { display: block; background: var(--paper); padding: clamp(10px, 1.4vw, 18px); }
.fac-img img { width: 100%; height: auto; }
.fac figcaption { font-size: var(--t-small); max-width: 64ch; }
.fac-link { font-weight: 600; text-underline-offset: 4px; margin-left: 4px; }
.fac-larga { margin-top: 24px; max-width: 760px; }
.escuro .fac figcaption { color: var(--soft); }
.col-fig > * + * { margin-top: 24px; }

/* ---- ledgers: the year large, in the tile blue and italic; the story beside it ---- */
.cr { list-style: none; margin: 0; padding: 0; display: grid; gap: clamp(28px, 3vw, 44px); }
.cr > li { display: grid; grid-template-columns: minmax(130px, 15rem) minmax(0, 1fr); column-gap: clamp(20px, 3vw, 48px); align-items: start; }
.cr-curto > li { grid-template-columns: minmax(110px, 10rem) minmax(0, 1fr); }
.cr-ano { font-size: var(--t-h2); font-style: italic; font-weight: 500; line-height: 1; letter-spacing: -.02em; color: var(--cobalt); font-variant-numeric: lining-nums; overflow-wrap: anywhere; }
.cr-dia { font-size: var(--t-small); color: var(--muted); margin-top: 8px; max-width: 18ch; }
.cr-corpo > * + * { margin-top: 14px; }
.cr-corpo p { max-width: 64ch; }
.cr-q { margin: 0; padding: 0; }
.cr-q p { font-style: italic; max-width: 60ch; }
.cr-grupo { margin-top: clamp(48px, 5vw, 80px); }
.cr-grupo > .sub-t { margin-bottom: 28px; max-width: 60ch; }
.sec-in > .nota + .cr-grupo { margin-top: 40px; }

/* ---- the Salga: three versions in three columns, rows aligned ---- */
.tres { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(16px, 2vw, 32px); }
.tres-c { background: var(--wall); padding: 24px clamp(20px, 2vw, 28px) 28px; display: grid; grid-template-rows: auto 1fr; gap: 18px; }
.tres-c dl { margin: 0; display: grid; gap: 18px; align-content: start; }
.tres-c dt { font-size: var(--t-small); font-weight: 600; color: var(--manganes); }
.tres-c dd { margin: 4px 0 0; }

/* ---- the numbers ---- */
.numeros { margin-top: clamp(56px, 6vw, 96px); }
.numeros > .sub-t { margin-bottom: 24px; }
.num { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); gap: 12px; }
.num li { background: var(--wall); padding: 20px 20px 22px; display: grid; gap: 6px; align-content: start; }
.num-n { font-size: var(--t-h2); font-weight: 600; line-height: 1; font-variant-numeric: tabular-nums; }
.num-a { font-size: var(--t-small); font-style: italic; font-weight: 600; color: var(--cobalt); }
.num-t { font-size: var(--t-small); }

/* ---- people: flat lilac tiles, as the festas ---- */
.pe-grupo { margin-top: clamp(40px, 4vw, 64px); }
.pe-grupo > .sub-t { margin-bottom: 20px; }
.pessoas { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.pe { background: var(--lilas-claro); padding: 22px 24px 26px; display: grid; gap: 10px; align-content: start; }
.pe-nome { margin: 0; font-size: var(--t-body); font-weight: 600; color: var(--manganes); line-height: 1.3; }
.pe-meta { font-size: var(--t-small); color: var(--muted); }

/* ---- bibliography ---- */
.b-grupo { margin-top: clamp(40px, 4vw, 64px); }
.b-grupo > .sub-t { margin-bottom: 20px; max-width: 60ch; }
.biblio { list-style: none; margin: 0; padding: 0; columns: 2 30rem; column-gap: clamp(32px, 4vw, 64px); }
.biblio li { break-inside: avoid; margin: 0 0 18px; font-size: var(--t-small); line-height: 1.5; }
.b-filhos { list-style: none; margin: 10px 0 0; padding: 0 0 0 18px; display: grid; gap: 10px; }
.b-filhos li { margin: 0; }
.b-link { font-weight: 600; color: var(--cobalt); text-underline-offset: 4px; margin-left: 4px; }
.b-nota { color: var(--muted); }
.biblio li:target { background: var(--lilas-claro); }

/* ---- tablet and phone ---- */
@media (max-width: 1080px) {
  .pessoas { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tres { grid-template-columns: 1fr; }
  .friso { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .ab-lado, .cab, .par { grid-template-columns: 1fr; }
  .cab > .lead { grid-column: 1; }
  .pessoas { grid-template-columns: 1fr; }
  .cr > li, .cr-curto > li { grid-template-columns: 1fr; row-gap: 8px; }
  .cr-dia { max-width: none; }
  .biblio { columns: 1; }
  .h-abertura h1 { white-space: normal; font-size: min(11cqi, 124px); }
  .indice a { padding: 10px 0; }
  .friso-ano { font-size: var(--t-small); }
}
@media (prefers-reduced-motion: reduce) { .friso img { transition: none; } }

/* phones and tablets: this page has no bar at the foot, so the Menu button stays in the top bar */
@media (max-width: 1280px) { .hub-bar .menu-btn { display: inline-flex; } }

/* /legal: a detail not filled in yet stays off the page, and so does the line that points to the e-mail */
.lista li:has(.por-preencher) { display: none; }
.sec:has(.lista .por-preencher) .se-contacto { display: none; }
