/*
Theme Name: Truth Is One
Theme URI: https://truthis.one
Description: Custom child theme for truthis.one - a documentary site by Alfio Salvatore Lanuto. Sober editorial design in slate grey and black, based on the original two-column Timber layout.
Author: webworld.ai
Author URI: https://webworld.ai
Template: twentytwentyfive
Version: 1.0.0
Requires at least: 6.4
Tested up to: 6.7
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: truthisone
*/

/* -------------------------------------------------
   Global typography + base
   -------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { overflow-x: hidden; max-width: 100%; }

/* Front page: full-viewport fixed layout, no page-level scroll */
/* html:has() targets Chrome/Safari; body.home alone covers IE/Edge legacy */
html:has(body.home) { overflow: hidden; height: 100vh; }
body.home { overflow: hidden; height: 100vh; }

/* Kill WordPress global padding that causes overflow */
.wp-site-blocks { padding-left: 0 !important; padding-right: 0 !important; }
.wp-block-post-content { padding-left: 0 !important; padding-right: 0 !important; }

:root {
  --t1-slate:    #A2ABB3;
  --t1-slate-2:  #B6BFC6;
  --t1-slate-dk: #8a939c;
  --t1-navy:     #2b58a6;
  --t1-navy-dk:  #1a3a78;
  --t1-navy-deep:#374958;
  --t1-warning:  #c0392b;
  --t1-ink:      #0e0e0e;
  --t1-paper:    #f3f4f5;
  --t1-line:     rgba(0,0,0,0.15);
  --t1-line-2:   rgba(0,0,0,0.30);
}

body {
  background-color: var(--t1-slate) !important;
  color: var(--t1-ink) !important;
  font-family: "EB Garamond", "Cormorant Garamond", Georgia, serif !important;
  font-size: 20px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  letter-spacing: 0;
}

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

a, a:visited { color: var(--t1-ink); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Crisp headings in EB Garamond bold */
h1, h2, h3, h4, h5, h6 {
  font-family: "EB Garamond", "Cormorant Garamond", Georgia, serif;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.1;
  color: var(--t1-ink);
}

em, i { font-style: italic; }
strong, b { font-weight: 700; }

p { margin: 0 0 1em; }

.mono, .t1-mono {
  font-family: "JetBrains Mono", "Roboto Mono", ui-monospace, SFMono-Regular, monospace;
  font-size: 13px;
  letter-spacing: 0.02em;
}

/* -------------------------------------------------
   Header
   -------------------------------------------------- */
.t1-header {
  border-bottom: 1px solid #000;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  padding: 16px clamp(28px, 5vw, 72px) 14px;
  gap: 24px;
  background: var(--t1-slate);
  position: sticky; top: 0; z-index: 30;
}
.t1-header__title {
  font-size: clamp(22px, 2.4vw, 30px);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0;
}
.t1-header__title a { color: var(--t1-ink); }
.t1-header__menu {
  display: flex;
  gap: 24px;
  font-size: 16px;
  font-weight: 400;
}
.t1-header__menu a {
  position: relative;
  padding-bottom: 2px;
}
.t1-header__menu a:hover { text-decoration: none; }
.t1-header__menu a:hover::after,
.t1-header__menu a[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -2px;
  height: 1px;
  background: #000;
}

/* -------------------------------------------------
   Homepage two-column layout
   -------------------------------------------------- */
.t1-home {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  height: calc(100vh - 70px);
  width: 100%;
  overflow: hidden;
}
.t1-home__left {
  min-width: 0;
  padding: clamp(18px, 2.6vw, 34px) clamp(20px, 3vw, 40px);
  border-right: 1px solid #000;
  overflow-y: auto;
  overflow-x: hidden;
  max-height: calc(100vh - 70px);
  scrollbar-width: thin;
  scrollbar-color: rgba(0,0,0,0.35) transparent;
}
.t1-home__left::-webkit-scrollbar { width: 6px; }
.t1-home__left::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.35); border-radius: 4px; }

.t1-home__right {
  min-width: 0;
  padding: 0;
  background: var(--t1-slate-2);
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 70px);
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: rgba(0,0,0,0.35) transparent;
}

/* Left column: narrative typography */
.t1-narrative {
  max-width: 620px;
  margin: 0 auto;
  padding-top: 6px;
}
.t1-narrative > :first-child { margin-top: 0; }
.t1-narrative p,
.t1-narrative div {
  font-size: 18px;
  line-height: 1.55;
  margin-bottom: 1em;
}
.t1-narrative a {
  color: var(--t1-navy);
  border-bottom: 1px solid var(--t1-navy);
}
.t1-narrative a:hover { color: var(--t1-navy-dk); border-color: var(--t1-navy-dk); text-decoration: none; }
.t1-narrative em {
  font-style: italic;
  color: #2a2a2a;
}
.t1-narrative strong {
  font-weight: 700;
  font-style: italic;
}
.t1-narrative h2 {
  font-size: 28px;
  margin: 1.6em 0 0.6em;
  padding-bottom: 0.4em;
  border-bottom: 1px solid var(--t1-line);
}
.t1-narrative .quote-block {
  text-align: center;
  font-size: 22px;
  font-style: italic;
  margin: 1.6em 0;
  padding: 0.8em 0;
  border-top: 1px solid var(--t1-line);
  border-bottom: 1px solid var(--t1-line);
}
.t1-narrative .lead {
  font-size: 22px;
  line-height: 1.4;
  margin-bottom: 1.2em;
}
.t1-narrative .lead em { display: block; font-size: 16px; margin-top: 4px; color: #2a2a2a; }

/* -------------------------------------------------
   Right column: evidence archive table
   -------------------------------------------------- */
.t1-archive__header {
  display: grid;
  grid-template-columns: 3.6fr 0.7fr 0.55fr 0.85fr;
  align-items: end;
  padding: 16px 22px 10px;
  border-bottom: 1px solid #000;
  font-family: "JetBrains Mono", "Roboto Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 500;
  color: #1a1a1a;
  background: var(--t1-slate-2);
  position: sticky; top: 0; z-index: 5;
}
.t1-archive__header span { white-space: nowrap; }
.t1-archive__header .col-warning { white-space: normal; line-height: 1.2; }
.t1-archive__list {
  overflow-y: auto;
  max-height: calc(100vh - 70px - 50px);
  scrollbar-width: thin;
  scrollbar-color: rgba(0,0,0,0.35) transparent;
}
.t1-archive__list::-webkit-scrollbar { width: 6px; }
.t1-archive__list::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.35); border-radius: 4px; }

.t1-item {
  border-bottom: 1px solid var(--t1-line-2);
  background: transparent;
  transition: background 0.2s ease;
}
.t1-item:hover { background: rgba(0,0,0,0.05); }
.t1-item__row {
  display: grid;
  grid-template-columns: 3.6fr 0.7fr 0.55fr 0.85fr;
  align-items: center;
  padding: 14px 22px;
  gap: 12px;
  font-family: "JetBrains Mono", "Roboto Mono", monospace;
  font-size: 13px;
  cursor: pointer;
  user-select: none;
}
.t1-item__name {
  font-family: "EB Garamond", Georgia, serif;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.25;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.t1-item__name span {
  display: block;
  line-height: 1.25;
  overflow-wrap: break-word;
  min-width: 0;
  hyphens: auto;
}
.t1-item__name svg {
  flex: 0 0 18px;
  width: 18px; height: 18px;
  stroke-width: 2.4;
  color: var(--t1-navy);
  transition: transform 0.2s ease;
  opacity: 1;
}
.t1-item.is-open .t1-item__name svg { transform: rotate(90deg); opacity: 1; color: var(--t1-navy-dk); }
.t1-item__date { color: #2a2a2a; font-variant-numeric: tabular-nums; }
.t1-item__type {
  display: inline-block;
  padding: 2px 8px;
  border: 1px solid var(--t1-navy);
  color: var(--t1-navy);
  border-radius: 999px;
  text-transform: uppercase;
  font-size: 10px;
  letter-spacing: 0.12em;
  background: transparent;
  width: max-content;
}
.t1-item__type.is-audio { background: var(--t1-navy); color: var(--t1-slate); border-color: var(--t1-navy); }
.t1-item__warning {
  font-family: "EB Garamond", Georgia, serif;
  font-size: 14px;
  font-style: italic;
  color: var(--t1-navy-dk);
  display: flex;
  align-items: center;
  gap: 8px;
  line-height: 1.3;
  font-weight: 500;
}
.t1-item__warning::before {
  content: "";
  flex: 0 0 8px;
  min-width: 8px;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--t1-navy);
  box-shadow: 0 0 0 2px rgba(43,88,166,0.18);
}
/* Violence gets a red warning dot */
.t1-item__row:has(.t1-item__warning--violence)::before {
  background: var(--t1-warning, #b91c1c);
  box-shadow: 0 0 0 2px rgba(185,28,28,0.15);
}
.t1-item__warning--empty { color: rgba(0,0,0,0.2); font-style: normal; font-size: 12px; }
.t1-item__warning--empty::before { display: none; }

.t1-item__body {
  display: none;
  padding: 0 24px 22px;
  font-size: 15px;
  line-height: 1.55;
}
.t1-item.is-open .t1-item__body { display: block; }
.t1-item__body p { margin-bottom: 0.8em; }
.t1-item__body .t1-download {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  padding: 9px 16px;
  background: #000;
  color: var(--t1-slate);
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border-radius: 999px;
  transition: background 0.2s ease, transform 0.2s ease;
}
.t1-item__body .t1-download:hover { background: var(--t1-navy-dk); text-decoration: none; transform: translateY(-1px); }
.t1-item__body audio { width: 100%; margin-top: 8px; max-width: 480px; display: block; }
.t1-item__body audio::-webkit-media-controls-panel { background: var(--t1-slate); }

/* -------------------------------------------------
   Sub page (Badge of Liberty etc.)
   -------------------------------------------------- */
.t1-page {
  max-width: 760px;
  margin: 0 auto;
  padding: 60px clamp(20px, 4vw, 40px) 100px;
}
.t1-page h1 {
  font-size: clamp(36px, 5vw, 56px);
  font-weight: 700;
  margin-bottom: 0.4em;
}
.t1-page .sub {
  font-style: italic;
  font-size: 22px;
  margin-bottom: 1.6em;
  color: #2a2a2a;
}
.t1-page p { font-size: 19px; line-height: 1.6; margin-bottom: 1.1em; }
.t1-page blockquote {
  margin: 1.5em 0;
  padding: 4px 0 4px 22px;
  border-left: 3px solid #000;
  font-style: italic;
  font-size: 21px;
}

/* -------------------------------------------------
   Footer
   -------------------------------------------------- */
.t1-footer {
  border-top: 1px solid #000;
  padding: 22px clamp(20px, 4vw, 36px);
  font-family: "JetBrains Mono", "Roboto Mono", monospace;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  display: flex;
  justify-content: space-between;
  background: var(--t1-slate);
  flex-wrap: wrap;
  gap: 12px;
}

/* -------------------------------------------------
   Responsive
   -------------------------------------------------- */
@media (max-width: 980px) {
  .t1-home {
    grid-template-columns: 1fr;
    min-height: 0;
  }
  .t1-home__left, .t1-home__right {
    max-height: none;
    overflow-y: visible;
    border-right: 0;
  }
  .t1-home__left {
    border-bottom: 1px solid #000;
    padding: 24px clamp(16px, 4vw, 28px);
  }
  .t1-archive__list {
    max-height: none;
  }
  .t1-archive__header,
  .t1-item__row {
    grid-template-columns: 3fr 0.9fr 0.7fr;
    gap: 8px;
  }
  .t1-archive__header .col-warning,
  .t1-item__warning { display: none; }
  .t1-archive__header { padding: 14px 18px 10px; font-size: 11px; }
  .t1-item__row { padding: 14px 18px; }
  .t1-item__body { padding: 0 18px 18px; }
  .t1-header { padding: 12px 16px; }
}
@media (max-width: 540px) {
  body { font-size: 18px; }
  .t1-narrative p, .t1-narrative div { font-size: 17px; }
  .t1-header__menu { gap: 14px; font-size: 14px; }
  .t1-header__title { font-size: 20px; }
}

/* -------------------------------------------------
   Twenty Twenty Five overrides for block content edited in WP
   -------------------------------------------------- */
.wp-site-blocks {
  padding-left: 0 !important;
  padding-right: 0 !important;
}
:root {
  --wp--preset--color--base: #A2ABB3;
  --wp--preset--color--contrast: #0e0e0e;
}
.has-base-background-color { background-color: var(--t1-slate) !important; }
.has-contrast-color { color: var(--t1-ink) !important; }
