/* Franskportal central stylesheet — Release 1.23 */
/* =========================================================
   Franskportal central print component
   Release 1.23 (documentation only)
   Browser cache versioning is automatic via filemtime() in functions.php.
   ========================================================= */

/* =========================================================
   FARVETEMAER
   ========================================================= */

.fp-theme-red {
  --fp-button-color: #D44813;
  --fp-button-hover: #D4481390;
  --fp-border-color: #C81E0F;
  --fp-divider-color: #C81E0F;
  --fp-answer-color: #275317;
  --fp-radio-border-color: #E87310;
  --fp-radio-background-color: #E87310A6;
}

.fp-theme-blue {
  --fp-button-color: #00b3b8;
  --fp-button-hover: #00b3b880;
  --fp-check-button-color: #0066cc;
  --fp-check-button-hover: #0066cc90;
  --fp-attempt-color: #0066cc;
  --fp-border-color: #0066cc;
  --fp-divider-color: #0066ee;
  --fp-answer-color: #1F4E79;
  --fp-radio-border-color: #0066cc;
  --fp-radio-background-color: #00b3b840;
}

.fp-theme-beginner {
  --fp-button-color: #244ae0;
  --fp-button-hover: #244ae060;
  --fp-check-button-color: #244ae0;
  --fp-check-button-hover: #244ae060;
  --fp-attempt-color: #244ae0;
  --fp-border-color: #244ae0;
  --fp-divider-color: #244ae0;
  --fp-answer-color: #244ae0;
  --fp-attempt-print-bg: #244ae060;
}


.fp-theme-amis {
  --fp-button-color: #323E4C;
  --fp-button-hover: #323E4C80;
  --fp-check-button-color: #873937;
  --fp-check-button-hover: #87393780;
  --fp-attempt-color: #873937;
  --fp-border-color: #873937;
  --fp-divider-color: #873937;
  --fp-answer-color: #323E4C;
  --fp-attempt-print-bg: #F7EAE5;
  --fp-radio-border-color: #750000;
  --fp-radio-background-color: #daa6a4;
  --fp-truefalse-radio-color: #daa6a4;
  --fp-truefalse-header-color: #873937;
}

/* =========================================================
   SCREEN

   IMPORTANT:
   Outer exercise border, padding and page spacing are managed
   in Themify Builder. The central fp CSS intentionally does
   not set border/padding/margin on .fp-exercise itself.
   ========================================================= */

.fp-print-only {
  display: none !important;
}

.fp-exercise textarea,
.fp-exercise input[type="text"],
.fp-exercise .fp-answer {
  color: var(--fp-answer-color) !important;
  border: none !important;
  overflow: hidden;
  resize: none;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  padding: 10px !important;
  font-family: Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
}

.fp-exercise textarea::placeholder,
.fp-exercise input[type="text"]::placeholder,
.fp-exercise .fp-answer::placeholder {
  color: var(--fp-answer-color) !important;
  opacity: 0.5;
}

.fp-answer-singleline {
  min-height: 30px !important;
}

.fp-answer-textarea {
  min-height: 120px !important;
}

.fp-answer-word {
  min-height: 30px !important;
}

/* Ordbank over udfyldningsopgaver */
.fp-word-bank {
  text-align: center;
  font-weight: bold;
  border-bottom: 2px solid var(--fp-divider-color);
  padding-bottom: 20px;
  margin-bottom: 20px;
}

/* Inline udfyldningsfelter i løbende tekst */
.fp-exercise input[type="text"].fp-answer-inline {
  display: inline-block;
  width: 120px;
  max-width: 100%;
  min-height: 26px !important;
  padding: 4px 8px !important;
  margin: 10px;
  vertical-align: baseline;
  background-color: #ffffff;
  border-radius: 3px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.16);
}


.fp-exercise input[type="text"].fp-answer-inline-medium {
  width: 150px;
}

.fp-exercise input[type="text"].fp-answer-inline-wide {
  width: 170px;
}

.fp-print-button-container {
  text-align: right !important;
  margin-top: 10px;
  margin-bottom: 20px;
}

.fp-print-button {
  border-radius: 8px !important;
  background-color: var(--fp-button-color) !important;
  border: none !important;
  color: #ffffff !important;
  padding: 10px 20px !important;
  font-size: 18px !important;
  font-family: Montserrat, Arial, sans-serif !important;
  width: 160px;
  cursor: pointer;
  transition: background-color 0.5s;
}

.fp-print-button:hover {
  background-color: var(--fp-button-hover) !important;
}

.fp-print-root {
  display: none;
}

/* =========================================================
   INTERAKTIVE OPGAVER
   ========================================================= */

.fp-exercise input[type="text"].fp-correct,
.fp-exercise textarea.fp-correct {
  color: #198754 !important;
}

.fp-exercise input[type="text"].fp-incorrect,
.fp-exercise textarea.fp-incorrect {
  color: #cc0000 !important;
}

.fp-check-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: stretch;
  margin-top: 20px;
}

/* Fælles handlingsrække: TJEK / Fjern fejl / forsøg / Print */
.fp-action-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 20px;
  flex-wrap: nowrap;
}

.fp-action-row .fp-check-buttons {
  display: flex;
  flex-wrap: nowrap;
  gap: 10px;
  margin-top: 0;
}

.fp-action-row .fp-print-button-container {
  margin: 0;
  flex-shrink: 0;
}

@media (max-width: 850px) {
  .fp-action-row {
    flex-wrap: wrap;
  }

  .fp-action-row .fp-check-buttons {
    flex-wrap: wrap;
  }
}

.fp-check-button {
  border-radius: 8px !important;
  background-color: var(--fp-check-button-color, #712A12) !important;
  border: 2px solid var(--fp-check-button-color, #712A12) !important;
  color: white !important;
  padding: 10px 20px !important;
  font-size: 18px !important;
  font-family: Montserrat, Arial, sans-serif !important;
  text-transform: none !important;
  font-weight: normal !important;
  width: 160px;
  cursor: pointer;
  box-sizing: border-box;
}

.fp-check-button:hover {
  background-color: var(--fp-check-button-hover, #712A1290) !important;
  border-color: var(--fp-check-button-hover, #712A1290) !important;
}

.fp-attempts-screen {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  border-radius: 8px;
  background-color: var(--fp-attempt-color, #712A12);
  padding: 0 12px;
  color: white;
  font-size: 18px;
  font-family: Montserrat, Arial, sans-serif;
  text-align: center;
  box-sizing: border-box;
}

.fp-attempt-count-screen {
  display: inline-block;
  background-color: white;
  color: black;
  font-weight: bold;
  padding: 4px 10px;
  margin: 0 6px;
  border: none;
  border-radius: 4px;
  line-height: 1.2;
}

.fp-attempts-print {
  width: 100%;
  box-sizing: border-box;
  margin-top: 24px;
  padding: 12px 10px;
  background: var(--fp-attempt-print-bg, #FEEECC);
  border-top: 2px solid var(--fp-divider-color);
  text-align: center;
  font-size: 16px;
  break-inside: avoid;
  page-break-inside: avoid;
}

/* =========================================================
   RADIOKNAP-OPGAVER
   ========================================================= */

.fp-radio-group {
  width: auto;
  min-height: 26px;
  padding: 1px 8px;
  border: 2px solid var(--fp-radio-border-color, #E87310);
  border-radius: 6px;
  background-color: var(--fp-radio-background-color, #E87310A6);
  display: inline-flex;
  align-items: baseline;
  line-height: 1.2;
  vertical-align: baseline;
  box-sizing: border-box;
  margin: 0 3px 4px 3px;
  transition: border-color 0.2s, background-color 0.2s;
}

.fp-radio-group label {
  display: inline-flex;
  align-items: baseline;
  white-space: nowrap;
  line-height: 1.2;
  margin: 0 4px 0 0;
  padding: 0;
}

/* Native radio skjules helt visuelt */
.fp-radio-group input[type="radio"] {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  margin: 0 !important;
  padding: 0 !important;
  opacity: 0 !important;
  appearance: none !important;
  -webkit-appearance: none !important;
}

.fp-radio-group input[type="radio"] + strong {
  position: relative;
  margin-left: 20px;
  line-height: inherit;
}

.fp-radio-group input[type="radio"] + strong::before {
  content: "";
  position: absolute;
  left: -18px;
  top: 50%;
  width: 13px;
  height: 13px;
  transform: translateY(-50%);
  border: 2px solid #555;
  border-radius: 50%;
  background-color: #ffffff;
  box-sizing: border-box;
}

.fp-radio-group input[type="radio"]:checked + strong::after {
  content: "";
  position: absolute;
  left: -14px;
  top: 50%;
  width: 5px;
  height: 5px;
  transform: translateY(-50%);
  border-radius: 50%;
  background-color: #333333;
}

.fp-radio-group input[type="radio"]:focus-visible + strong::before {
  outline: 2px solid #333333;
  outline-offset: 2px;
}

.fp-radio-group strong,
.fp-radio-group em {
  line-height: inherit;
}

.fp-radio-group.fp-radio-correct {
  border-color: #33CC33 !important;
  background-color: #CFF3CF !important;
}

.fp-radio-group.fp-radio-incorrect {
  border-color: #CC0000 !important;
  background-color: #F6CACA !important;
}


/* =========================================================
   SANDT / FALSK
   ========================================================= */

.fp-truefalse-table-wrap {
  width: 100%;
  overflow-x: auto;
}

.fp-truefalse-table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
  background-color: #ffffff;
  table-layout: fixed;
}

.fp-truefalse-table col.fp-truefalse-col-number {
  width: 6%;
}

.fp-truefalse-table col.fp-truefalse-col-statement {
  width: 61%;
}

.fp-truefalse-table col.fp-truefalse-col-choice,
.fp-truefalse-table col.fp-truefalse-col-result {
  width: 11%;
}

.fp-truefalse-table th,
.fp-truefalse-table td {
  border: 1px solid #000000;
  padding: 9px 10px;
  vertical-align: middle;
}

.fp-truefalse-table thead th {
  background-color: var(--fp-truefalse-header-color, #873937);
  color: #ffffff;
  text-align: center;
  font-weight: 600;
}

.fp-truefalse-number {
  background-color: var(--fp-truefalse-header-color, #873937);
  color: #ffffff;
  text-align: center;
}

.fp-truefalse-choice,
.fp-truefalse-result-cell {
  text-align: center;
}

.fp-truefalse-choice label {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  position: relative !important;
  width: 30px !important;
  height: 30px !important;
  min-width: 30px !important;
  min-height: 30px !important;
  max-width: 30px !important;
  max-height: 30px !important;
  margin: 0 auto !important;
  padding: 0 !important;
  line-height: 0 !important;
  vertical-align: middle !important;
  cursor: pointer;
}

/* Sandt/Falsk: stor, fyldt og positionsfast radiocirkel. */
.fp-truefalse-choice input[type="radio"] {
  display: block !important;
  position: relative !important;
  box-sizing: border-box !important;
  flex: 0 0 24px !important;
  width: 24px !important;
  height: 24px !important;
  min-width: 24px !important;
  min-height: 24px !important;
  max-width: 24px !important;
  max-height: 24px !important;
  margin: 0 !important;
  padding: 0 !important;
  opacity: 1 !important;
  visibility: visible !important;
  appearance: none !important;
  -webkit-appearance: none !important;
  clip: auto !important;
  float: none !important;
  vertical-align: middle !important;
  inset: auto !important;
  top: auto !important;
  right: auto !important;
  bottom: auto !important;
  left: auto !important;
  transform: none !important;
  translate: none !important;
  scale: none !important;
  transform-origin: center center !important;
  border: 0 !important;
  border-radius: 50% !important;
  background-color: var(--fp-truefalse-radio-color, #daa6a4) !important;
  background-image: none !important;
  box-shadow: inset 0 0 0 1px rgba(135, 57, 55, 0.18) !important;
  outline: 0 !important;
  transition: none !important;
  cursor: pointer;
  -webkit-print-color-adjust: exact !important;
  print-color-adjust: exact !important;
}

.fp-truefalse-choice input[type="radio"]:hover,
.fp-truefalse-choice input[type="radio"]:active,
.fp-truefalse-choice input[type="radio"]:checked,
.fp-truefalse-choice input[type="radio"]:focus {
  display: block !important;
  position: relative !important;
  flex: 0 0 24px !important;
  width: 24px !important;
  height: 24px !important;
  min-width: 24px !important;
  min-height: 24px !important;
  max-width: 24px !important;
  max-height: 24px !important;
  margin: 0 !important;
  padding: 0 !important;
  inset: auto !important;
  top: auto !important;
  right: auto !important;
  bottom: auto !important;
  left: auto !important;
  transform: none !important;
  translate: none !important;
  scale: none !important;
  border: 0 !important;
  border-radius: 50% !important;
  background-color: var(--fp-truefalse-radio-color, #daa6a4) !important;
  box-shadow: inset 0 0 0 1px rgba(135, 57, 55, 0.18) !important;
  outline: 0 !important;
}

.fp-truefalse-choice input[type="radio"]:checked {
  background-image: radial-gradient(
    circle at center,
    var(--fp-truefalse-header-color, #873937) 0 5px,
    transparent 5.5px
  ) !important;
}

.fp-truefalse-choice input[type="radio"]:focus-visible {
  box-shadow:
    inset 0 0 0 1px rgba(135, 57, 55, 0.18),
    0 0 0 2px rgba(135, 57, 55, 0.30) !important;
  outline: 0 !important;
}

.fp-truefalse-result {
  display: inline-block;
  min-width: 1em;
  font-size: 32px;
  line-height: 1;
  font-weight: 700;
}

.fp-truefalse-result.fp-truefalse-correct {
  color: #198754 !important;
}

.fp-truefalse-result.fp-truefalse-incorrect {
  color: #cc0000 !important;
}

.fp-visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* =========================================================
   MATCH / FLYT KASSER
   ========================================================= */

.fp-match-grid {
  display: grid;
  gap: 10px;
  width: 100%;
}

.fp-match-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 14px;
  align-items: stretch;
}

.fp-match-prompt,
.fp-match-answer {
  min-height: 48px;
  padding: 10px 12px;
  border: 2px solid var(--fp-border-color, #873937);
  border-radius: 4px;
  background-color: var(--fp-attempt-print-bg, #F7EAE5);
  color: #222222 !important;
  opacity: 1 !important;
  box-sizing: border-box;
  line-height: 1.35;
  transition: border-color 0.15s, background-color 0.15s, box-shadow 0.15s;
}

.fp-match-slot {
  min-width: 0;
}

.fp-match-answer {
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.fp-match-answer:active,
.fp-match-answer.fp-match-dragging {
  cursor: grabbing;
}

.fp-match-answer.fp-match-dragging {
  opacity: 1 !important;
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.24);
  position: relative;
  z-index: 20;
  will-change: transform;
  pointer-events: none;
}

.fp-match-slot.fp-match-target {
  border-radius: 5px;
  box-shadow: 0 0 0 3px rgba(135, 57, 55, 0.28);
}

.fp-match-slot.fp-match-target .fp-match-answer:not(.fp-match-dragging) {
  box-shadow: inset 0 0 0 2px rgba(135, 57, 55, 0.35);
}

/* Bevægelsesanimationen udføres med Web Animations API i answer-check.js. */
.fp-match-answer.fp-match-moving {
  will-change: transform;
}

@media (prefers-reduced-motion: reduce) {
  .fp-match-answer {
    transition: none;
  }
}

.fp-match-prompt.fp-match-correct,
.fp-match-answer.fp-match-correct {
  border-color: #198754 !important;
  background-color: #DDF3E5 !important;
  box-shadow: inset 0 0 0 1px #198754;
}

.fp-match-prompt.fp-match-incorrect,
.fp-match-answer.fp-match-incorrect {
  border-color: #CC0000 !important;
  background-color: #F9DDDD !important;
  box-shadow: inset 0 0 0 1px #CC0000;
}

@media (max-width: 700px) {
  .fp-match-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }
}

/* =========================================================
   PRINT
   ========================================================= */

@media print {

  @page {
    size: A4;
    margin: 16mm;
  }

  body.fp-printing > *:not(.fp-print-root) {
    display: none !important;
  }

  html,
  body {
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
    min-height: 0 !important;
    background: #ffffff !important;
  }

  .fp-print-root {
    display: block !important;
    position: static !important;
    float: none !important;
    clear: both !important;
    transform: none !important;
    width: 100% !important;
    max-width: none !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    font-family: Arial, sans-serif !important;
    font-size: 16px !important;
    line-height: 1.35 !important;
    color: #000000 !important;
    background: #ffffff !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
    box-sizing: border-box !important;
  }

  .fp-print-box {
    display: block !important;
    position: static !important;
    float: none !important;
    transform: none !important;
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    border: 4px solid var(--fp-border-color) !important;
    border-radius: 8px !important;
    padding: 16px !important;
    background: #ffffff !important;
    box-sizing: border-box !important;
  }

  .fp-print-only {
    display: block !important;
    visibility: visible !important;
    position: static !important;
    float: none !important;
    transform: none !important;
    margin: 0 0 12px 0 !important;
    padding: 0 !important;
  }

  .fp-print-title {
    font-size: 24px !important;
    line-height: 1.25 !important;
    text-decoration: underline;
    margin-bottom: 6px !important;
  }

  .fp-print-instruction {
    font-size: 18px !important;
    line-height: 1.4 !important;
  }

  .fp-divider {
    border: 0 !important;
    height: 2px !important;
    background: var(--fp-divider-color) !important;
    margin: 12px 0 18px 0 !important;
  }

  .fp-printed-answer {
    display: block !important;
    min-height: 30px !important;
    margin: 0 0 18px 0 !important;
    padding: 10px !important;
    color: var(--fp-answer-color) !important;
    white-space: pre-wrap !important;
    overflow-wrap: anywhere !important;
    font-family: Arial, sans-serif !important;
    font-size: 16px !important;
    line-height: 1.5 !important;
    box-sizing: border-box !important;
  }

  .fp-printed-answer.fp-answer-textarea {
    min-height: 120px !important;
  }

  .fp-printed-answer.fp-printed-answer-inline {
    display: inline-block !important;
    min-width: 80px !important;
    min-height: 0 !important;
    margin: 0 2px !important;
    padding: 0 6px !important;
    vertical-align: baseline !important;
    white-space: pre-wrap !important;
    overflow-wrap: normal !important;
    line-height: inherit !important;
  }

  .fp-printed-answer.fp-printed-answer-inline:empty {
    border-bottom: 1px solid #333 !important;
  }

  .fp-inline-exercise .fp-answer-flow {
    line-height: 2.15 !important;
  }

  .fp-printed-answer.fp-correct {
    color: #198754 !important;
  }

  .fp-printed-answer.fp-incorrect {
    color: #cc0000 !important;
  }

  /* Specifik printafstand for radioknap-opgaver */
  .fp-radio-exercise form {
    line-height: 2.0 !important;
  }

  .fp-radio-exercise .fp-radio-group {
    margin-top: 2px !important;
    margin-bottom: 6px !important;
  }


  .fp-truefalse-table-wrap {
    overflow: visible !important;
  }

  .fp-truefalse-table {
    width: 100% !important;
    font-size: 13px !important;
  }

  .fp-truefalse-table th,
  .fp-truefalse-table td {
    padding: 6px !important;
  }

  .fp-truefalse-row {
    break-inside: avoid !important;
    page-break-inside: avoid !important;
  }

  .fp-truefalse-choice label {
    width: 28px !important;
    height: 28px !important;
    min-width: 28px !important;
    min-height: 28px !important;
    max-width: 28px !important;
    max-height: 28px !important;
    margin: 0 auto !important;
    padding: 0 !important;
    line-height: 0 !important;
  }

  .fp-truefalse-choice input[type="radio"] {
    display: block !important;
    position: relative !important;
    box-sizing: border-box !important;
    flex: 0 0 22px !important;
    width: 22px !important;
    height: 22px !important;
    min-width: 22px !important;
    min-height: 22px !important;
    max-width: 22px !important;
    max-height: 22px !important;
    margin: 0 !important;
    padding: 0 !important;
    opacity: 1 !important;
    visibility: visible !important;
    appearance: none !important;
    -webkit-appearance: none !important;
    clip: auto !important;
    float: none !important;
    inset: auto !important;
    transform: none !important;
    translate: none !important;
    scale: none !important;
    border: 0 !important;
    border-radius: 50% !important;
    background-color: var(--fp-truefalse-radio-color, #daa6a4) !important;
    background-image: none !important;
    box-shadow: inset 0 0 0 1px rgba(135, 57, 55, 0.18) !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  .fp-truefalse-choice input[type="radio"]:checked {
    background-color: var(--fp-truefalse-radio-color, #daa6a4) !important;
    background-image: radial-gradient(
      circle at center,
      var(--fp-truefalse-header-color, #873937) 0 4.5px,
      transparent 5px
    ) !important;
    box-shadow: inset 0 0 0 1px rgba(135, 57, 55, 0.18) !important;
  }


  .fp-match-row {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
    gap: 8px !important;
    margin-bottom: 6px !important;
    break-inside: avoid !important;
    page-break-inside: avoid !important;
  }

  .fp-match-prompt,
  .fp-match-answer {
    min-height: 0 !important;
    padding: 6px 8px !important;
    font-size: 13px !important;
    line-height: 1.3 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .fp-match-answer {
    cursor: default !important;
  }

  .fp-no-print {
    display: none !important;
  }
}

/* =========================================================
   RELEASE 1.23 - Sandt/Falsk: fjern native/theme-markering
   ========================================================= */

/*
 * WordPress/Themify kan tilføje en ekstra sort checked-indikator
 * via pseudo-elementer på radio eller label. I Sandt/Falsk bruges
 * kun Franskportals egen mørkerøde radial-markering.
 */
.fp-truefalse-choice label::before,
.fp-truefalse-choice label::after,
.fp-truefalse-choice input[type="radio"]::before,
.fp-truefalse-choice input[type="radio"]::after,
.fp-truefalse-choice input[type="radio"]:checked::before,
.fp-truefalse-choice input[type="radio"]:checked::after {
  content: none !important;
  display: none !important;
  background: none !important;
  box-shadow: none !important;
}

.fp-truefalse-choice input[type="radio"]:checked {
  background-color: var(--fp-truefalse-radio-color, #daa6a4) !important;
  background-image: radial-gradient(
    circle at center,
    var(--fp-truefalse-header-color, #873937) 0 5px,
    transparent 5.5px
  ) !important;
}

