/* Text pages (family "tp"): the ONE stylesheet of every redesigned text page, loaded from /Text_Pages/text.css.
   It only adds what the unchanged Standard_Text_Page template does not have; every rule is scoped to .tp so nothing else on a page changes,
   and every colour comes from the template's own variables (--primary --accent --text-color --bg-color --link-color), so all 14 themes work.
   Change the look HERE, then run `tp.py build` (every page gets the new version number) and `tp.py check`, `e2e`, `layout` on EVERY page. */

/* ---- no layout shift when the template's web fonts arrive ------------------------------------------------------------------------ */
/* The template loads Lato (text) and Gabriela (titles) from Google Fonts with display=swap. Until they arrive the browser draws a system font whose letters
   are wider or narrower, so lines wrap differently and everything below jumps. These stand-in faces are the SAME system fonts scaled to the width of the web
   fonts (measured on this text), so lines break in the same places before and after the swap. The gate `font-fallback` fails if the template changes its fonts. */
@font-face { font-family: "TP Lato Fallback"; src: local("Arial"), local("Helvetica"), local("Liberation Sans"); font-weight: 400; size-adjust: 96.5%; }
@font-face { font-family: "TP Lato Fallback"; src: local("Arial Bold"), local("Arial-BoldMT"), local("Helvetica-Bold"), local("Liberation Sans Bold"); font-weight: 700; size-adjust: 92.4%; }
@font-face { font-family: "TP Gabriela Fallback"; src: local("Times New Roman"), local("Liberation Serif"), local("Times"); size-adjust: 115%; }

/* ---- reading column ------------------------------------------------------------------------------------------------------------ */
.tp { text-align: left; font-family: 'Lato', 'TP Lato Fallback', sans-serif; }
.tp p { line-height: 1.8; margin: 0 0 1.15rem; text-align: left; }
.tp strong, .tp b { font-weight: 700; }
.content-body .tp h2 {
    clear: both;
    font-family: 'Gabriela', 'TP Gabriela Fallback', serif;
    margin: 2.4rem 0 1rem;
    padding: .15rem 0 .15rem .85rem;
    border: 0;
    border-left: 4px solid var(--primary);
    text-align: left;
    font-size: 1.3rem;
    line-height: 1.35;
    letter-spacing: .02em;
    scroll-margin-top: 1rem;
}
.content-body .tp h2:first-child { margin-top: .5rem; }

/* ---- the standard notice box on top (kind "under_review" and every later kind): ONE component for every page ------------------------ */
.tp-notice {
    margin: 0 0 1.4rem;
    border: 1px solid var(--primary);
    border-radius: var(--border-radius);
    background: rgba(127, 127, 127, .07);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}
.tp-notice-pic { display: block; line-height: 0; background: rgba(127, 127, 127, .12); }
.tp-notice-pic img { display: block; width: 100%; height: auto; margin: 0; border: 0; border-radius: 0; }
.tp-notice-body { padding: 1rem 1.35rem 1.1rem; border-top: 3px solid var(--primary); }
.tp-notice-body p { margin: 0 0 .6rem; font-size: .95rem; line-height: 1.65; }
.tp-notice-body p:last-child { margin-bottom: 0; }
.tp .tp-notice-body p.tp-notice-title {
    margin: 0 0 .5rem;
    color: var(--primary);
    font-family: 'Gabriela', 'TP Gabriela Fallback', serif;
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: .01em;
}
.tp-notice-body a { text-decoration: underline; text-underline-offset: 2px; }

/* ---- chips: the series row of sibling pages, the short contents, related testimonies ------------------------------------------- */
.tp-chips {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: .5rem .6rem;
    margin: 0 0 1.1rem;
    text-align: center;
}
.tp-series { margin: 0 0 1.5rem; }
.tp-chip {
    display: inline-block;
    padding: .3em .95em;
    border: 1px solid var(--primary);
    border-radius: var(--border-radius-pill);
    color: var(--primary);
    background: transparent;
    font-size: .92rem;
    font-weight: 600;
    line-height: 1.4;
    text-decoration: none;
    transition: background var(--transition-fast), color var(--transition-fast);
}
.tp a.tp-chip, .tp a.tp-chip:hover, .tp a.tp-chip:focus-visible { text-decoration: none; }
.tp a.tp-chip:hover, .tp a.tp-chip:focus-visible { background: var(--primary); color: var(--bg-color); }
.tp-chip-current { background: var(--primary); color: var(--bg-color); cursor: default; }
.tp-chips-accent .tp-chip { border-color: var(--accent); color: var(--accent); border-style: dashed; }
.tp .tp-chips-accent a.tp-chip:hover, .tp .tp-chips-accent a.tp-chip:focus-visible { background: var(--accent); color: var(--bg-color); }
.tp-chips-accent .tp-chip-current { background: var(--accent); color: var(--bg-color); border-style: solid; }
.tp-credit { margin: 0 0 1.2rem; text-align: center; font-weight: 700; }

/* ---- long contents: a closed <details> with two columns ----------------------------------------------------------------------- */
.tp-contents-list { margin: 0 0 1.6rem; padding: .7rem 1.1rem; }
.tp-contents-list summary { cursor: pointer; font-weight: 700; color: var(--primary); list-style: none; }
.tp-contents-list summary::-webkit-details-marker { display: none; }
.tp-contents-list summary::before { content: "\25B8"; display: inline-block; width: 1.2em; transition: transform var(--transition-fast); }
.tp-contents-list[open] summary::before { transform: rotate(90deg); }
.tp-contents-list ol {
    margin: .8rem 0 .2rem;
    padding-left: 1.6rem;
    columns: 2 17rem;
    column-gap: 2rem;
}
.tp-contents-list li { margin: 0 0 .45rem; break-inside: avoid; text-align: left; line-height: 1.4; font-size: .93rem; }

/* ---- pictures: floated, the longest edge 300 px at most (the width/height attributes ARE the displayed size and keep the space: no layout shift), centred on a phone --------- */
.tp-pic { margin: .35rem 0 1rem; max-width: 100%; }
.tp-pic img {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 0 auto;
    border: 1px solid rgba(127, 127, 127, .4);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    background: #fff;
}
.tp-pic figcaption { margin-top: .4rem; font-size: .85rem; font-style: italic; text-align: center; opacity: .85; }
.tp-pic-right { float: right; margin-left: 1.5rem; max-width: 300px; }
.tp-pic-left { float: left; margin-right: 1.5rem; max-width: 300px; }
.tp-pic-center { float: none; margin-left: auto; margin-right: auto; max-width: 600px; }
.tp-rule { clear: both; margin: 1.6rem 0; }
.tp-quote { margin: 1.4rem 0; }
.tp-quote cite { display: block; margin-top: .4rem; font-style: normal; font-size: .9rem; opacity: .85; }

/* ---- the closing contact block ------------------------------------------------------------------------------------------------ */
.tp-signoff {
    clear: both;
    margin: 2.2rem 0 1rem;
    padding: 1rem 1.2rem;
    border: 1px dashed rgba(127, 127, 127, .6);
    border-radius: var(--border-radius);
    background: rgba(127, 127, 127, .06);
    font-size: .95rem;
}
.tp-signoff p { margin: 0 0 .6rem; line-height: 1.6; overflow-wrap: anywhere; }
.tp-signoff p:last-child { margin-bottom: 0; }

/* ---- audio ----------------------------------------------------------------------------------------------------------------------- */
.tp-audio { clear: both; margin: 1.2rem 0; }
.tp-audio .audio-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem 1rem; margin-bottom: .5rem; }
.tp-audio-title { font-weight: 700; }
.tp-audio audio { display: block; width: 100%; }

/* ---- click-to-play YouTube picture inside the template's 16:9 .video-wrapper (nothing is requested from YouTube before the click) -- */
.tp .yt-facade { position: absolute; inset: 0; display: block; color: #fff; text-decoration: none; cursor: pointer; }
.tp .yt-facade img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .9; border: 0; border-radius: 0; box-shadow: none; margin: 0; }
.tp .yt-play { position: absolute; left: 50%; top: 50%; width: 68px; height: 48px; margin: -24px 0 0 -34px; border-radius: 12px; background: rgba(200, 0, 0, .93); }
.tp .yt-play::after { content: ""; position: absolute; left: 27px; top: 14px; border: 10px solid transparent; border-left: 18px solid #fff; border-right: 0; }
.tp .yt-facade:hover .yt-play, .tp .yt-facade:focus .yt-play { background: #f00; }
.tp .yt-facade:focus-visible { outline: 3px solid #fc0; outline-offset: -3px; }

/* ---- downloads: one line of circled kinds per document, e.g.  Title [PDF] [DOC] [MP3]  ---------------------------------------------- */
.tp-files { display: flex; flex-direction: column; gap: .55rem; margin: .5rem 0 1.25rem; }
.tp-file-group { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .5rem; margin: 0; text-align: left; }
.tp-file-title { margin-right: .25rem; font-weight: 600; }
.tp .tag.tp-file { margin: 0; padding: .12em .75em; line-height: 1.4; white-space: nowrap; text-decoration: none; cursor: pointer; }

/* ---- language list: [flag] Name  [WEB] [PDF] [DOC] ------------------------------------------------------------------------------ */
.tp-langs { list-style: none; margin: .5rem 0 1.25rem; padding: 0; }
.tp-langs li { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .5rem; margin: 0 0 .5rem; text-align: left; }
.tp-lang-name { display: inline-flex; align-items: center; gap: .45rem; min-width: 9.5rem; font-weight: 600; }
.tp .flag { display: inline-block; width: 20px; height: 15px; margin: 0; border: 0; border-radius: 2px; box-shadow: none; background: transparent; }
.tp .flag-slot { display: inline-block; width: 20px; height: 15px; }

/* ---- phones: no floats, pictures centred, chips a little smaller ------------------------------------------------------------------ */
@media (max-width: 640px) {
    .tp-pic-right, .tp-pic-left { float: none; margin: .5rem auto 1rem; }
    .tp-notice-body { padding: .9rem 1rem 1rem; }
    .tp-chip { font-size: .88rem; }
    .content-body .tp h2 { font-size: 1.18rem; margin-top: 2rem; }
    .tp-contents-list ol { columns: 1; }
}
