/* ================== OJS HTML Galley — Publisher grade =======================
   Type system: Source Serif 4 (body) + Inter (headings), fallback to Times.
   If external fonts are not allowed, comment out the @import and the look
   will gracefully fall back to Times New Roman.
============================================================================= */

/* Optional fonts (safe, high legibility). Remove if you need zero external calls. */
@import url('https://fonts.googleapis.com/css2?family=Source+Serif+4:ital,wght@0,400;0,600;0,700;1,400&family=Inter:wght@600;700&display=swap');

/* ---------- Root scale ---------- */
:root{
  --measure: 72ch;
  --base: 18px;           /* body size */
  --lh: 1.65;             /* body line-height */
  --rule: #c8ccd0;        /* hairline color */
  --ink:  #111;           /* text */
  --muted:#555;           /* secondary */
  --link:#1545a5;         /* link */
  --link-visited:#6b2fbf;

  --sans: Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --serif: "Source Serif 4", "Times New Roman", Times, serif;
}

/* ---------- Page frame ---------- */
main.article{
  max-width: var(--measure);
  padding: 1.5rem 1rem 4rem;
  margin: 0 auto;
  hyphens: auto;
}
main.article::before{
  content: "";
  display: block;
  height: 4lh;           /* spacing below site header */
}

/* ---------- Typography ---------- */
html, body{
  font-family: var(--serif) !important;
  font-size: var(--base);
  line-height: var(--lh);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

p{ margin: 0 0 0.95em; }
p:empty{ display:none; }

a{ color: var(--link); text-decoration: underline; }
a:visited{ color: var(--link-visited); }
a:focus{ outline: 2px solid var(--link); outline-offset: 2px; }

strong, b{ font-weight: 700; }
em, i{ font-style: italic; }

/* ---------- Article titles (both languages) ---------- */
.frontmatter{ margin-bottom: 1.25rem; }
.frontmatter .article-title{
  font-family: var(--sans) !important;
  font-size: 1.9rem;
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: .002em;
  margin: 0 0 0.75rem;
  color: var(--ink);
}
/* Titolo tradotto: stesso stile e dimensione; leggermente ravvicinato */
.frontmatter .article-title.translated{
  font-size: 1.9rem;
  margin-top: .25rem;
}

/* If you want the IT title slightly stronger than EN (optional): */
/* .frontmatter .article-title.lang-it{ font-weight:800; } */

/* ---------- Byline ---------- */
.byline{
  margin: 0 0 1.1rem;
  color: var(--muted);
}
.byline .author-name{
  font-size: 1.1em;
  font-weight: 700;
}
.byline br{ display: block; content: ""; }

/* ---------- Section headings (numbered in-body) ---------- */
main.article h1, main.article h2, main.article h3{
  font-family: var(--sans) !important;
  font-weight: 700;
  letter-spacing: .0015em;
  color: var(--ink);
}
main.article h1{ font-size:1.65rem; line-height:1.25; margin:1.1em 0 .5em; }
main.article h2{ font-size:1.35rem; line-height:1.30; margin:1.2em 0 .55em; }
main.article h3{ font-size:1.20rem; line-height:1.30; margin:1.0em 0 .45em; }

/* Hoverable anchors for headings with IDs (converter patch below adds IDs) */
main.article h1[id]::after,
main.article h2[id]::after,
main.article h3[id]::after{
  content:"";
  margin-left: .4em;
  border-bottom: 1px dotted transparent;
}
main.article h1[id]:hover::after,
main.article h2[id]:hover::after,
main.article h3[id]:hover::after{
  content:"#"; color:#666;
}

/* ---------- Lists ---------- */
ul, ol{ margin: 0 0 1rem 1.25rem; padding-left: 1.25rem; }
li{ margin: .25rem 0; }

/* ---------- Figures ---------- */
img{ max-width: 100%; height: auto; }
figure{ margin: 1rem 0; }
figcaption{
  font-size: .95em;
  color: #333;
  margin-top: .35rem;
}

/* ---------- Tables ---------- */
.table-scroll{ overflow-x:auto; -webkit-overflow-scrolling:touch; margin:1rem 0; }
.table-scroll table{ width:100%; border-collapse: collapse; }
.table-scroll th, .table-scroll td{
  padding: .55rem .75rem;
  vertical-align: top;
  border-top: 1px solid var(--rule);
}
.table-scroll thead th{
  border-bottom: 2px solid var(--rule);
  font-weight: 700;
}
.table-scroll tbody tr:nth-child(even) td{ background: #fafafa; }

/* ---------- Long direct quotes ---------- */
.long-quote{
  margin: 1rem 0;
  padding-left: 1rem;
  border-left: 3px solid #999;
}

/* ---------- References & Notes: guaranteed divider ---------- */
/* Hard rule (inserted by converter patch): */
hr.ref-notes-divider{
  border: none;
  border-top: 2px solid var(--rule);
  margin: 2.5rem 0 1.25rem;
}
/* Defensive styling if a heading got the class but no hr exists */
.endnotes-heading{
  margin-top: 2.5rem;
  padding-top: 1rem;
  border-top: 2px solid var(--rule);
}
.endnotes-heading + ol,
.endnotes-heading + ul{
  margin-top: .75rem;
  font-size: .97em;
  line-height: 1.6;
  padding-left: 1.25rem;
}
.references-heading{ margin-bottom: .35rem; }

/* Scroll offset per ancore di note e rimandi */
:target{ scroll-margin-top: 2.5rem; }
[id^="footnote-"], [id^="fn-"], [id^="fnref-"]{ scroll-margin-top: 2.5rem; }

/* ---------- Reader mode (bigger text / calmer rhythm) ---------- */
body.reader{ font-size: 19px; line-height: 1.75; }
body.reader p{ margin: 0 0 1.05em; }
body.reader h1{ font-size: 1.85rem; }
body.reader h2{ font-size: 1.50rem; }

/* ---------- Microtypography ---------- */
p{ orphans:3; widows:3; }

/* ---------- Print polish ---------- */
@media print{
  a{ text-decoration:none; color: inherit; }
  hr.ref-notes-divider{ border-top: 1px solid #000; }
  .table-scroll{ overflow: visible; }
}

/* --- Wide tables: overflow horizontally, minimal wrapping --- */
.table-scroll.wide { 
  overflow-x: auto; 
  -webkit-overflow-scrolling: touch; 
  margin: 1rem 0;
  padding-bottom: .25rem;              /* tiny pad so scrollbar doesn't overlay border */
}

/* Let content define the width so it can exceed the page */
.table-scroll.wide > table{
  width: max-content;                  /* key: allow table to be wider than page */
  table-layout: auto;                  /* natural sizing */
  border-collapse: collapse;
}

/* Tighter cell padding on very wide matrices */
.table-scroll.wide th,
.table-scroll.wide td{
  padding: .4rem .6rem;
  vertical-align: top;
}

/* Minimise wrapping (use with care) */
.table-scroll.wide th,
.table-scroll.wide td,
.table-scroll.wide th p,
.table-scroll.wide td p{
  white-space: nowrap;
}

/* If you ever need wrapping back for a specific column, add class="wrap" on that <th>/<td> */
.table-scroll.wide .wrap,
.table-scroll.wide .wrap p{
  white-space: normal;
  overflow-wrap: anywhere;
}

.table-scroll.wide{ mask-image: linear-gradient(to right, black 90%, transparent); }
.table-scroll.wide:focus-within, .table-scroll.wide:hover{ mask-image: none; }

/* Force a line break right after any ORCID link */
.byline a[href*="orcid.org"]::after{
  content:"";
  display:block;
}

/* Journal line (selezionabile) */
.frontmatter .journal-line{
  font-style: italic;
  color: var(--muted);
  margin: 0 0 .35rem;
  text-align: left;
}

/* Neutralise accidental all-italic headings imported from Word */
main.article h1 > em:only-child,
main.article h2 > em:only-child,
main.article h3 > em:only-child,
main.article h1 > i:only-child,
main.article h2 > i:only-child,
main.article h3 > i:only-child{
  font-style: normal;
}

/* (Optional, broader) also cancel partial italics inside headings */
main.article h1 em, main.article h1 i,
main.article h2 em, main.article h2 i,
main.article h3 em, main.article h3 i{
  font-style: normal;
}



