/* ===================================================================
   Intimacy Series – Modern CSS
   ===================================================================
   Preserves legacy intent (italic/center H1, teal H2, navy H3, maroon italics)
   while improving readability, responsiveness, and accessibility.
   Background textures moved to opt‑in utilities.
   =================================================================== */

/* Reset & box model */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html:focus-within { scroll-behavior: smooth; }
body, h1, h2, h3, h4, h5, h6, p, figure, blockquote, dl, dd { margin: 0; }

/* Theme tokens */
:root {
  --bg: #ffffff;
  --text: #111827;
  --muted: #4b5563;
  --accent: #0b6b6e;        /* teal (H2) */
  --accent-2: #134074;      /* navy (H3) */
  --maroon: #800000;        /* emphasis color */
  --link: #0f52ba;
  --link-hover: #0a3a82;
  --border: #e5e7eb;
  --maxw: 72ch;
  --radius: 14px;
  --paper-img: url("_res/Back3.jpg");
}

/* Base */
body {
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans",
               "Noto Sans Ethiopic", "Helvetica Neue", Arial, ui-sans-serif;
  line-height: 1.7;
  font-size: 1rem;
  padding: min(5vw, 28px);
  -webkit-font-smoothing: antialiased;
}

/* Optional legacy paper texture (opt‑in) */
.paper-bg { background-image: var(--paper-img); background-size: 512px auto; }
.paper-bg p, .paper-bg td { background-image: var(--paper-img); background-size: 512px auto; }

/* Content column */
main, article, .content, .wrapper, .page, #content {
  max-width: var(--maxw);
  margin-inline: auto;
}

/* Headings */
h1, h2, h3, h4, h5, h6 {
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: 0.01em;
}

h1 {
  color: #000;
  font-style: italic; /* legacy */
  font-size: clamp(1.875rem, 2.2vw + 1.2rem, 2.5rem);
  text-align: center;
  margin: 0 0 0.6em;
}

h2 {
  color: var(--accent);
  font-weight: 800;
  font-size: clamp(1.25rem, 1.2vw + 1rem, 1.6rem);
  font-family: Arial, Helvetica, Geneva, Swiss, SunSans-Regular, "Times New Roman", Georgia, Times, serif;
  text-align: center;
  margin: 0.8em auto 0.6em;
  padding-inline: 1rem;
  max-width: 60ch;               /* replaces hard 5em side margins */
}

h3 {
  color: var(--accent-2);        /* navy */
  font-size: clamp(1.125rem, 1vw + 0.9rem, 1.4rem);
  margin: 1.1em 0 0.4em;
  text-align: left;
}

h4 {
  color: #000;
  font-size: clamp(1.0625rem, 0.8vw + 0.9rem, 1.25rem);
  line-height: 1.5;
  margin: 1em 0 0.4em;
}

h5 { font-weight: 600; margin: 0.6em 0; }
h6 { font-weight: 500; font-size: 0.85rem; margin: 0.4em 0; }

/* Paragraphs */
p {
  font-family: Verdana, Arial, Geneva, Helvetica, sans-serif; /* legacy leaning */
  line-height: 1.7;
  margin: 0.6em 0;
  text-align: start;               /* avoid forced justify across site */
  background-image: none;          /* move texture to .paper-bg */
}

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
  margin: 1rem 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}
td, th {
  text-align: left;
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--border);
  font-weight: 400;               /* raise from 300 for legibility */
  line-height: 1.4;
  background-image: none;         /* remove global texture by default */
}
.tablenor { font-weight: 400; font-family: "Times New Roman", Georgia, Times, serif; text-align: left; }

/* Emphasis */
i, em {
  color: var(--maroon);           /* preserve maroon italics */
  font-style: italic;
  margin-left: 0;                 /* remove 1px nudge */
}
strong, b { font-weight: 700; }

/* Blockquotes */
blockquote {
  color: #630000;                 /* legacy tone */
  font-style: italic;
  font-weight: 400;
  font-size: 0.95rem;
  border-left: 4px solid var(--maroon);
  padding: 0.75rem 1rem;
  margin: 0.8rem 0;
  background: #f8fafc;
  border-radius: 8px;
  text-align: justify;            /* preserve legacy */
  text-indent: 0;                 /* neutral default */
}
/* optional: old long-indent variant */
.blockquote-indent { text-indent: 4em; }

/* Links */
a {
  color: var(--link);
  font-size: 0.95em;              /* normalize from 0.85em */
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-thickness: 1.5px;
}
a:hover, a:focus-visible { color: var(--link-hover); }

/* Media & lists */
img, video, iframe { max-width: 100%; height: auto; }
ul, ol { padding-left: 1.2rem; margin: 0.6rem 0; }
li { margin: 0.25rem 0; }

/* HR */
hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 1.5rem 0;
}

/* Utilities */
.text-center { text-align: center; }
.text-right { text-align: right; }
.muted { color: var(--muted); }
.lead { font-size: clamp(1.0625rem, 0.6vw + 0.95rem, 1.25rem); line-height: 1.8; }
.rounded { border-radius: var(--radius); }
.shadow { box-shadow: 0 8px 20px rgba(0,0,0,.06); }

/* Legacy helpers */
.center { text-align: center; }
.small { font-size: 0.875rem; }
