/* style.css — fixed presentation conditions. Keep image sizes identical for every participant.
   Visual language modelled on offporter.com: cream page, ink text, Lusitana serif, hairlines, no radius, no shadows.
   Only presentation lives here; wording is in items.js and logic in study.js. Fonts are self-hosted in lib/ (OFL). */

@font-face { font-family: "Lusitana"; font-style: normal; font-weight: 400; font-display: swap; src: url("lib/lusitana-400.woff2") format("woff2"); }
@font-face { font-family: "Lusitana"; font-style: normal; font-weight: 700; font-display: swap; src: url("lib/lusitana-700.woff2") format("woff2"); }

:root {
  --off-color-light: #FAF9F5;      /* page */
  --off-color-dark: #2E2D2A;       /* ink */
  --off-color-border: #B3B1A9;     /* hairlines */
  --off-color-grey: #9B9B9B;       /* muted labels */
  --off-color-stim: #D9D9D9;       /* neutral grey surround for stimuli — unchanged on purpose */
  --off-font: "Lusitana", Georgia, "Times New Roman", serif;
  --off-gap-0: 8px; --off-gap-1: 16px; --off-gap-2: 24px; --off-gap-3: 32px; --off-gap-4: 64px;
  --off-quick: 120ms; --off-fade: 250ms;
}

html, body { background: var(--off-color-light); color: var(--off-color-dark); font-family: var(--off-font); }
body { margin: 0; -webkit-font-smoothing: antialiased; }

/* ---- type ------------------------------------------------------------------------------- */
.jspsych-display-element { font-family: var(--off-font); font-size: 17px; line-height: 1.55; color: var(--off-color-dark); }
.jspsych-content { max-width: 960px; font-size: 17px; line-height: 1.55; text-align: left; padding: 45px 16px 64px; box-sizing: border-box; }
.jspsych-content h1, .jspsych-content h2, .jspsych-content h3 { font-family: var(--off-font); font-weight: 400; letter-spacing: 0; }
.jspsych-content h2 { font-size: 26px; line-height: 1.25; margin: 0 0 var(--off-gap-2); }
.jspsych-content h3 { font-size: 19px; margin: var(--off-gap-3) 0 var(--off-gap-1); }
.jspsych-content p, .jspsych-content li { margin: var(--off-gap-0) 0; }
.jspsych-content a { color: inherit; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--off-color-border); transition: opacity var(--off-quick) ease; }
.jspsych-content a:hover { opacity: .7; }
.jspsych-content ::selection { background: var(--off-color-dark); color: var(--off-color-light); }
.jspsych-content strong, .jspsych-content b { font-weight: 700; }
.jspsych-content hr { border: 0; border-top: 1px solid var(--off-color-border); margin: var(--off-gap-3) 0; }

/* section instruction: small, with a roman-numeral-style rule above it, like the offporter index */
.instr { font-weight: 400; font-size: 15px; line-height: 21px; color: var(--off-color-grey); margin: 0 0 var(--off-gap-3); padding-top: var(--off-gap-1); border-top: 1px solid var(--off-color-border); }

/* ---- stimuli -----------------------------------------------------------------------------------------------
   v2.4 (researcher's decision, CHANGE_REQUEST_v2.4 §2): the picture fills the screen while keeping its aspect ratio
   (78 % of the viewport height, never wider than the screen), centred, never cropped. Its displayed size therefore
   depends on the device; vw, vh, dpr and ua_class are recorded so this can be accounted for in the analysis.
   max-width is 100 % of the content box (the viewport minus the 16 px side gutters), so it never forces a side scroll. */
.stim-wrap { display: flex; justify-content: center; align-items: center; margin: 0 auto; }
.stim { display: block; width: auto; height: 78vh; max-width: 100%; max-height: 78vh; object-fit: contain; background: var(--off-color-stim); border-radius: 0; }
/* v2.7: the picture page has a Continue button under the picture; the picture gives up a little height so the button stays on screen
   (progress bar + paddings + button ≈ 190 px). svh = the small viewport (Safari's bars shown). */
.stim { height: auto; max-height: min(78vh, calc(100vh - 190px)); }
@supports (height: 100svh) { .stim { max-height: min(78vh, calc(100svh - 190px)); } }
/* thumbnail at the top of every rating page: at most 40 % of the viewport height */
.stim-small { display: block; width: auto; height: min(40vh, 320px); max-width: 100%; max-height: 40vh; object-fit: contain; background: var(--off-color-stim); border-radius: 0; }

/* ---- buttons ---------------------------------------------------------------------------- */
.jspsych-btn, .jspsych-fullscreen-btn {
  font-family: var(--off-font); font-size: 15px; font-weight: 400; line-height: 1.4;
  color: var(--off-color-light); background: var(--off-color-dark);
  border: 1px solid var(--off-color-dark); border-radius: 0; box-shadow: none;
  padding: 12px 24px; margin: var(--off-gap-2) 0 0; cursor: pointer;
  transition: opacity var(--off-quick) ease;
}
@media (hover: hover) { .jspsych-btn:hover, .jspsych-fullscreen-btn:hover { background: var(--off-color-dark); border-color: var(--off-color-dark); opacity: .7; } }
.jspsych-btn:active { background: var(--off-color-dark); border-color: var(--off-color-dark); opacity: .85; }
.jspsych-btn:focus-visible, .choice-btn:focus-visible, .jspsych-content input:focus-visible { outline: 2px solid var(--off-color-dark); outline-offset: 4px; }
.jspsych-btn:disabled { background: transparent; color: var(--off-color-border); border-color: var(--off-color-border); opacity: 1; cursor: not-allowed; }
.jspsych-instructions-nav { text-align: left; margin-top: var(--off-gap-2); }
.jspsych-instructions-nav .jspsych-btn { margin: 0 var(--off-gap-1) 0 0; }
#jspsych-html-button-response-btngroup { justify-content: flex-start; flex-wrap: wrap; margin-left: 0; }
#jspsych-html-button-response-btngroup .jspsych-btn { margin: var(--off-gap-2) var(--off-gap-1) 0 0; }

/* ---- likert: hairline scale, small labels, whole scale on one row --------------------------- */
.jspsych-survey-likert-preamble { text-align: left; }
.jspsych-survey-likert-statement { display: block; text-align: left; font-weight: 400; font-size: 17px; line-height: 1.45; padding-top: var(--off-gap-3); margin-bottom: var(--off-gap-1); }
.jspsych-survey-likert-opts { font-size: 12px; line-height: 16px; padding: 0 0 var(--off-gap-2); border-bottom: 1px solid var(--off-color-border); max-width: 700px; box-sizing: border-box; }
.jspsych-survey-likert-opt-label .lk-n, .jspsych-survey-likert-opt-label .lk-t { display: block; }   /* number above its words, as before */
.lk-ends { display: none; }
.jspsych-survey-likert-opts:before { background-color: var(--off-color-border); height: 1px; top: 9px; }
.jspsych-survey-likert-opt-label { color: var(--off-color-dark); line-height: 16px; }
.jspsych-survey-likert-opts li input[type=radio] { margin-left: -8px; margin-bottom: var(--off-gap-0); }
#jspsych-survey-likert-next { margin-top: var(--off-gap-3); }

/* ---- multiple choice / multi select: quiet list, hairline between questions ------------------ */
.jspsych-survey-multi-choice-preamble, .jspsych-survey-multi-select-preamble { text-align: left; }
.jspsych-survey-multi-choice-question, .jspsych-survey-multi-select-question { text-align: left; margin: 0; padding: var(--off-gap-2) 0; border-bottom: 1px solid var(--off-color-border); }
.jspsych-survey-multi-choice-question:first-of-type, .jspsych-survey-multi-select-question:first-of-type { border-top: 1px solid var(--off-color-border); }
.jspsych-survey-multi-choice-text, .jspsych-survey-multi-select-text { font-size: 17px; line-height: 1.45; margin: 0 0 var(--off-gap-1); }
.jspsych-survey-multi-choice-option, .jspsych-survey-multi-select-option { font-size: 15px; line-height: 2; }
.jspsych-survey-multi-choice-option label, .jspsych-survey-multi-select-option label { cursor: pointer; }
.jspsych-survey-multi-choice-text span.required, .jspsych-survey-multi-select-text span.required { color: var(--off-color-grey); font-size: 12px; vertical-align: super; }
#jspsych-survey-multi-choice-next, #jspsych-survey-multi-select-next { margin-top: var(--off-gap-3); }

/* ---- form controls: ink on cream, square ---------------------------------------------------- */
.jspsych-content input[type=radio], .jspsych-content input[type=checkbox] { accent-color: var(--off-color-dark); width: 14px; height: 14px; margin-right: var(--off-gap-0); vertical-align: -1px; }
.jspsych-display-element input[type=text], .jspsych-display-element textarea {
  font-family: var(--off-font); font-size: 15px; color: var(--off-color-dark); background: transparent;
  border: 0; border-bottom: 1px solid var(--off-color-border); border-radius: 0; padding: 6px 0; outline: none;
}
.jspsych-display-element input[type=text]:focus, .jspsych-display-element textarea:focus { border-bottom-color: var(--off-color-dark); }

/* ---- forced-choice buttons: six thumbnails in a row (wraps on narrower tablets) ------------- */
.choice-btn { background: none; border: 1px solid transparent; padding: 4px; margin: 6px; cursor: pointer; border-radius: 0; box-shadow: none; transition: border-color var(--off-quick) ease; }
@media (hover: hover) { .choice-btn:hover { border-color: var(--off-color-dark); } }   /* no sticky hover border after a tap on a tablet */
.choice-btn:focus { border-color: var(--off-color-dark); outline: none; }
/* Portrait box matching the 9:16 stimuli (720x1280): the picture is as large as in the old 200x200 box, without the grey
   side bars, and all six fit on one row from the 900 px minimum width up (6 x 135 px = 810 px). 200x200 overflowed below
   ~1340 px, so on a 1024 px tablet or a 1280 px laptop the last one or two images were off-screen. */
.choice-btn img { width: 113px; height: 200px; object-fit: contain; background: var(--off-color-stim); display: block; }

/* ---- claim code, progress ------------------------------------------------------------------- */
.code { font-size: 22px; letter-spacing: .02em; margin-top: 18px; padding: var(--off-gap-1) 0; border-top: 1px solid var(--off-color-border); border-bottom: 1px solid var(--off-color-border); }

#jspsych-progressbar-container { background: var(--off-color-light); color: var(--off-color-grey); border-bottom: 1px solid var(--off-color-border); font-family: var(--off-font); font-size: 12px; line-height: 16px; padding: 14px 16px; margin-bottom: 0; text-align: left; box-sizing: border-box; }
#jspsych-progressbar-container span { font-size: 12px; padding-right: var(--off-gap-1); }
#jspsych-progressbar-outer { background: transparent; border-bottom: 1px solid var(--off-color-border); height: 5px; width: 50%; box-shadow: none; }
#jspsych-progressbar-inner { background: var(--off-color-dark); height: 100%; transition: width var(--off-fade) ease; }

/* ---- v2.4: phones --------------------------------------------------------------------------------------------- */
html { -webkit-text-size-adjust: 100%; }
.jspsych-content img { max-width: 100%; }
/* multiple choice: every option is a tap target of at least 44 px */
.jspsych-survey-multi-choice-option label.jspsych-survey-multi-choice-text { display: flex; align-items: center; min-height: 44px; margin: 0; font-size: 16px; line-height: 1.35; cursor: pointer; }
.jspsych-survey-multi-choice-option input[type=radio] { flex: none; width: 20px; height: 20px; margin: 0 12px 0 0; }
.code-value { user-select: all; -webkit-user-select: all; word-break: break-all; }
.copy-btn { font: inherit; font-size: 15px; min-height: 44px; min-width: 72px; padding: 8px 14px; margin-left: 8px; border: 1px solid var(--off-color-dark); background: transparent; color: var(--off-color-dark); cursor: pointer; vertical-align: middle; }

@media (max-width: 699px) {
  .jspsych-content { padding: 24px 16px 48px; }
  .jspsych-content h2 { font-size: 23px; }
  .jspsych-btn { min-height: 48px; width: 100%; max-width: 420px; }
  .jspsych-instructions-nav .jspsych-btn { width: auto; min-width: 160px; }
  /* two-choice screens (end of questions, thank-you gift): the buttons stack, full width, never side by side */
  #jspsych-html-button-response-btngroup { display: flex; flex-direction: column; align-items: stretch; }
  #jspsych-html-button-response-btngroup .jspsych-btn { width: 100%; max-width: none; margin: 12px 0 0; white-space: normal; }
  #jspsych-progressbar-outer { width: 55%; }
  .stim { height: auto; width: auto; max-height: min(78vh, calc(100vh - 190px)); }
  @supports (height: 100svh) { .stim { max-height: min(78vh, calc(100svh - 190px)); } }
  /* v2.7: every button page (welcome, consent, preview, picture, end screens): one column of full-width buttons */
  #jspsych-html-button-response-btngroup { width: 100%; max-width: 420px; box-sizing: border-box; }
  #jspsych-html-button-response-btngroup .jspsych-btn { max-width: none; }

  /* Likert, end labels only (7-point): one row of large targets, end labels above the row */
  .lk-ends { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; line-height: 1.3; color: var(--off-color-grey); margin: 0 0 6px; max-width: 700px; }
  .lk-ends span:last-child { text-align: right; }
  ul.jspsych-survey-likert-opts.lk-row { display: flex !important; width: 100% !important; padding: 0 0 var(--off-gap-1); margin: 0; }
  ul.jspsych-survey-likert-opts.lk-row:before { display: none; }
  ul.lk-row li { flex: 1 1 0; width: auto !important; min-width: 0; }
  ul.lk-row .jspsych-survey-likert-opt-label { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 52px; padding: 4px 0; cursor: pointer; }
  ul.lk-row .lk-t { display: none !important; }
  ul.lk-row .lk-n { font-size: 15px; order: 2; margin-top: 4px; }
  ul.lk-row li input[type=radio] { position: static; left: auto; margin: 0; width: 24px; height: 24px; order: 1; }

  /* Likert, every point labelled (5-point BSSS): stacked full-width buttons */
  ul.jspsych-survey-likert-opts.lk-stack { display: block !important; width: 100% !important; padding: 0 0 var(--off-gap-1); margin: 0; }
  ul.jspsych-survey-likert-opts.lk-stack:before { display: none; }
  ul.lk-stack li { display: block !important; width: 100% !important; text-align: left !important; margin: 0 0 6px; }
  ul.lk-stack .jspsych-survey-likert-opt-label { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 6px 12px; border: 1px solid var(--off-color-border); font-size: 15px; line-height: 1.3; cursor: pointer; box-sizing: border-box; }
  ul.lk-stack .lk-n, ul.lk-stack .lk-t { display: inline; }
  ul.lk-stack .lk-n { min-width: 1.2em; }
  ul.lk-stack li input[type=radio] { position: static; left: auto; margin: 0; width: 22px; height: 22px; flex: none; }
  .jspsych-survey-likert-statement { padding-top: var(--off-gap-2); font-size: 16px; }

  /* debrief: language switch stays in reach while reading (sticky), large targets */
  .lang-switch { position: sticky; top: 0; z-index: 5; background: var(--off-color-light); padding: 8px 0; margin: -8px 0 var(--off-gap-1); gap: 8px; }
  .lang-btn { flex: 1 1 0; min-height: 48px; font-size: 16px; }
  .code { font-size: 20px; }
}

/* v2.3: skip note under the Continue button, the age page error, the debrief language switch, blank answers on the review page */
.skip-note { display: block; margin: var(--off-gap-1) 0 0; font-size: 14px; color: var(--off-color-grey); }
.form-error { color: #9b1c1c; font-size: 15px; margin: 0 0 var(--off-gap-2); }
.jspsych-content input[type=number] { font: inherit; font-size: 20px; padding: 6px 10px; width: 6em; border: 1px solid var(--off-color-border); }
.lang-switch { display: flex; gap: var(--off-gap-1); margin: 0 0 var(--off-gap-2); }
.lang-btn { font: inherit; font-size: 14px; padding: 6px 14px; border: 1px solid var(--off-color-dark); background: transparent; color: var(--off-color-dark); cursor: pointer; }
.lang-btn.active { background: var(--off-color-dark); color: #fff; }
.review-skipped { color: var(--off-color-grey); font-style: italic; }

/* ---- v2.7: notes, required answers, the preview, self-paced pictures, the language screen ---------------------------- */
/* every note or instruction line is smaller and grey, visibly different from the items (researcher's decision, Nov 2026) */
.note, .small, .skip-note { display: block; font-size: 14px; line-height: 1.45; color: var(--off-color-grey); }
.jspsych-content p.instr + p.note { margin-top: 0; margin-bottom: var(--off-gap-3); }
.required-note { margin: var(--off-gap-1) 0 0; color: #9b1c1c; }
.hidden-submit { display: none !important; }
.go-btn { margin-top: var(--off-gap-3); }
/* "Prefer not to say" under a Likert scale */
.pnts { display: inline-flex; align-items: center; gap: 8px; margin: 6px 0 0; font-size: 13px; color: var(--off-color-grey); cursor: pointer; min-height: 32px; }
.pnts input[type=checkbox] { width: 16px; height: 16px; margin: 0; }
/* a question still unanswered after Continue was pressed */
ul.jspsych-survey-likert-opts.missing, .jspsych-survey-multi-choice-question.missing { box-shadow: -4px 0 0 0 #9b1c1c; padding-left: 8px; }
/* the preview: six thumbnails in the participant's order, wrapping on phones */
.preview-grid { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 0 0 var(--off-gap-2); }
.preview-thumb { width: calc((100% - 16px) / 3); max-width: 150px; aspect-ratio: 9 / 16; object-fit: contain; background: var(--off-color-stim); }
@media (min-width: 700px) { .preview-thumb { width: calc((100% - 40px) / 6); max-width: 150px; } }
/* the picture page: the Continue button is kept out of sight until the minimum view time has passed */
#jspsych-html-button-response-btngroup.view-wait { visibility: hidden; }
/* the language screen (before jsPsych starts) */
.lang-page { margin: 0 auto; }
.lang-choice-group { display: flex; flex-direction: column; gap: 12px; max-width: 420px; }
.lang-choice { margin: 0; }

/* ---- the review page (v2.3 page; styled v2.7): index of sections, then each section as a definition list ------------- */
.review-index { display: flex; flex-wrap: wrap; gap: 8px 16px; margin: 0 0 var(--off-gap-3); padding: var(--off-gap-1) 0; border-top: 1px solid var(--off-color-border); border-bottom: 1px solid var(--off-color-border); }
.review-index__item { display: inline-flex; gap: 6px; font-size: 14px; color: var(--off-color-grey); text-decoration: none; }
.review-index__item:hover { color: var(--off-color-dark); }
.review-numeral { color: var(--off-color-grey); font-variant-numeric: lining-nums; }
.review-section h3 { margin: var(--off-gap-3) 0 var(--off-gap-1); }
.review-thumb { display: block; width: auto; height: 160px; max-width: 100%; object-fit: contain; background: var(--off-color-stim); margin: 0 0 var(--off-gap-1); }
.review-list { margin: 0; }
.review-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 16px; align-items: baseline; padding: 10px 0; border-bottom: 1px solid var(--off-color-border); }
.review-row dt { font-size: 15px; line-height: 1.4; margin: 0; }
.review-row dd { margin: 0; font-size: 15px; text-align: right; white-space: nowrap; }
.review-num { font-size: 17px; } .review-of { color: var(--off-color-grey); font-size: 13px; margin-left: 2px; } .review-scale { color: var(--off-color-grey); font-size: 13px; margin-left: 8px; }
.review-row dd img.review-thumb { height: 80px; margin: 0; }
@media (max-width: 699px) { .review-row { grid-template-columns: 1fr; } .review-row dd { text-align: left; white-space: normal; padding-left: 16px; } }

/* ---- v2.7.1: the portrait guard. Only a PHONE held sideways (touch pointer, landscape, short screen) sees it; tablets and
   computers never do. It covers the page until the phone is turned back; nothing underneath is lost. ---------------------- */
#rotate-guard { display: none; position: fixed; inset: 0; z-index: 10000; background: var(--off-color-light); color: var(--off-color-dark); align-items: center; justify-content: center; padding: 24px; box-sizing: border-box; text-align: center; font-family: var(--off-font); }
.rotate-guard__box { max-width: 420px; }
.rotate-guard__icon { font-size: 40px; line-height: 1; margin-bottom: 12px; color: var(--off-color-grey); }
.rotate-guard__box p { font-size: 18px; line-height: 1.45; margin: 0; }
@media (pointer: coarse) and (orientation: landscape) and (max-height: 500px) { #rotate-guard { display: flex; } }
