/* ================== 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;
}

/* ===== Formazione & insegnamento: supplementary-material override — R series ===== */
main.supplement{
  max-width: 82ch;
  margin: 0 auto;
  padding: 1.5rem 1rem 4rem;
}

.supplement-frontmatter{
  border-top: 4px solid #A60046;
  border-bottom: 1px solid #c8ccd0;
  padding: 1.25rem 0 1.4rem;
  margin-bottom: 2rem;
}

.supplement-frontmatter .journal-line{
  color: var(--muted);
  margin: 0 0 .35rem;
  text-align: left;
  font-style: normal;
}
.supplement-frontmatter .journal-line em{
  font-style: italic;
}

.supplement-kicker{
  font-family: var(--sans,Arial,sans-serif);
  font-weight: 700;
  color: #A60046;
  letter-spacing: .06em;
  text-transform: uppercase;
  margin: 0 0 .45rem;
}

.supplement-title{
  font-family: var(--sans,Arial,sans-serif);
  font-size: 1.9rem;
  line-height: 1.18;
  font-weight: 700;
  margin: .15rem 0 1rem;
}

/* Structured author block */
.supplement-authors{
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: .7rem 1rem;
  margin: .9rem 0 1.15rem;
}
.supplement-author{
  border-left: 2px solid #c8ccd0;
  padding: .15rem 0 .15rem .8rem;
  min-width: 0;
}
.supplement-author p{ margin: 0; }
.supplement-author .author-name{
  font-family: var(--sans,Arial,sans-serif);
  font-size: 1.02em;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: .18rem;
}
.supplement-author .author-affiliation{
  color: var(--muted);
  font-size: .90em;
  line-height: 1.4;
  margin-bottom: .22rem;
}
.supplement-author .author-contact{
  font-size: .86em;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

/* Parent article: APA-style citation */
.supplement-parent{
  font-size: .94em;
  color: #333;
  margin: .85rem 0;
  padding-top: .7rem;
  border-top: 1px solid #e0e2e4;
}
.supplement-parent-label{
  font-family: var(--sans,Arial,sans-serif);
  font-weight: 700;
  margin: 0 0 .2rem;
}
.supplement-parent .apa-citation{
  margin: 0;
}
.supplement-parent .apa-citation em{
  font-style: italic;
}

/* Supplement-specific metadata */
.supplement-meta{
  font-size: .9em;
  line-height: 1.45;
  border-left: 3px solid #A60046;
  padding-left: .85rem;
  margin: 1rem 0 0;
}
.supplement-meta-row{
  display: grid;
  grid-template-columns: minmax(9.5rem, max-content) 1fr;
  column-gap: .55rem;
  margin: .12rem 0;
}
.supplement-meta dt{
  font-weight: 700;
}
.supplement-meta dd{
  margin: 0;
  min-width: 0;
  overflow-wrap: anywhere;
}

.supplement-body{max-width:100%;}
.supplement-table{margin:1.35rem auto .3rem;}
.supplement-table table{
  width:auto;
  max-width:100%;
  margin:0 auto;
  border-collapse:collapse;
}
.supplement-table th,
.supplement-table td{
  padding:.42rem .55rem;
  vertical-align:top;
}

/* Header row: left-aligned, italic and bold. */
.supplement-table thead th{
  text-align:left;
  font-style:italic;
  font-weight:700;
  border-bottom:2px solid var(--rule);
}

/* First logical column (authors/year): italics only, never bold. */
.supplement-table td.stub{
  font-style:italic;
  font-weight:400;
}
.supplement-table td.stub *,
.supplement-table td.stub em,
.supplement-table td.stub i,
.supplement-table td.stub strong,
.supplement-table td.stub b{
  font-style:italic !important;
  font-weight:400 !important;
}

/* Elsewhere in supplementary tables, Word emphasis is rendered as boldface. */
.supplement-table td:not(.stub) em,
.supplement-table td:not(.stub) i{
  font-style:normal;
  font-weight:700;
}

.supplement-table caption.table-caption{
  caption-side:bottom;
  text-align:left;
  font-size:.94em;
  color:#333;
  padding-top:.45rem;
  font-style:normal;
}

.supplement-page-break{break-after:page;border:0;margin:0;}
figure{break-inside:avoid;}

@media (max-width: 700px){
  .supplement-authors{grid-template-columns:1fr;}
  .supplement-meta-row{grid-template-columns:1fr;}
  .supplement-meta dt{margin-top:.15rem;}
}

@media print{
  .supplement-page-break{page-break-after:always;}
}
