@import "tailwindcss";

html {
  overflow-x: clip;
}

:root {
  --background: #ffffff;
  --foreground: #171717;
  --dark-bg: #15171a;
  --light-gray: #f8f9fa;
  --border-color: #dee2e6;
  --font-heading: var(--font-space-grotesk), sans-serif;
  --font-ui: var(--font-ibm-plex-mono), monospace;
  --site-foot-height: 72px;
  --chapter-toc-mobile-bottom: calc(var(--site-foot-height) + 2.75rem + 0.75rem);
}

body {
  background: var(--background);
  color: var(--foreground);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

/* Headings — Space Grotesk */
h1,
h2,
h3,
h4,
h5,
h6,
.post-feature-title,
.post-card-title,
.chapter-toc-panel-title,
.chapter-toc-link {
  font-family: var(--font-heading);
}

/* Buttons, nav, and chrome — IBM Plex Mono */
button,
input[type="submit"],
.btn-dark,
.btn-block,
.btn-secondary,
.commonBtn,
.chapter-pagination-btn,
.chapter-toc-toggle,
.chapter-toc-close,
.help-menu-item,
.chapter-dropdown-item,
.account-dropdown-item,
.account-dropdown-button,
.header,
.header a,
.header button,
.site-foot,
.site-foot a,
.site-foot button,
.access-card,
.access-card-body,
.access-card-subtitle,
.access-card-action,
.access-card-login,
.access-card-cta,
.access-card-notice,
.access-card a {
  font-family: var(--font-ui);
}

.embed-container {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  max-width: 100%;
}
.embed-container iframe,
.embed-container object,
.embed-container embed {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.vimeo-facade {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
  padding: 0;
  cursor: pointer;
  background-color: #15171a;
  background-image: radial-gradient(circle at center, #23272e 0%, #15171a 100%);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  transition: opacity 0.45s ease, transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Gentle zoom of the poster on hover (clipped by .embed-container overflow). */
.vimeo-facade.has-thumb:hover,
.vimeo-facade.has-thumb:focus-within {
  transform: scale(1.045);
}

.vimeo-facade.is-hidden {
  opacity: 0;
  pointer-events: none;
}

/* Subtle bottom gradient for depth / logo legibility (only over a real poster). */
.vimeo-facade-shade {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.38) 0%,
    rgba(0, 0, 0, 0) 34%
  );
}
.vimeo-facade:not(.has-thumb) .vimeo-facade-shade {
  display: none;
}

.vimeo-facade-logo {
  position: absolute;
  right: 30px;
  bottom: 24px;
  z-index: 1;
  width: 88px;
  height: auto;
  opacity: 0.9;
  pointer-events: none;
  filter: brightness(0) invert(1) drop-shadow(0 1px 3px rgba(0, 0, 0, 0.7));
}

/* Hidden until its src is set on scroll-into-view (so the logo animates on view). */
.vimeo-facade-logo:not([src]) {
  visibility: hidden;
}

.vimeo-facade-play {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 2;
  transform: translate(-50%, -50%);
  width: 84px;
  height: 56px;
  padding: 0;
  border: 0;
  border-radius: 14px;
  background-color: rgba(0, 173, 239, 0.92);
  cursor: pointer;
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.38);
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1),
    background-color 0.2s ease-in-out, box-shadow 0.3s ease-in-out,
    opacity 0.2s ease-in-out;
}

/* Play triangle. */
.vimeo-facade-play::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-40%, -50%);
  border-style: solid;
  border-width: 11px 0 11px 18px;
  border-color: transparent transparent transparent #fff;
}

/* Attention-drawing pulse ring behind the button. */
.vimeo-facade-play::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 14px;
  box-shadow: 0 0 0 0 rgba(0, 173, 239, 0.55);
  animation: vimeoPulse 2.6s cubic-bezier(0.66, 0, 0, 1) infinite;
  pointer-events: none;
}

@keyframes vimeoPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(0, 173, 239, 0.5);
  }
  70% {
    box-shadow: 0 0 0 22px rgba(0, 173, 239, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(0, 173, 239, 0);
  }
}

.vimeo-facade:hover .vimeo-facade-play,
.vimeo-facade:focus-within .vimeo-facade-play {
  transform: translate(-50%, -50%) scale(1.14);
  background-color: #00adef;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45), 0 0 28px rgba(0, 173, 239, 0.75);
}

/* Freeze the idle pulse while hovering (the glow takes over). */
.vimeo-facade:hover .vimeo-facade-play::after,
.vimeo-facade:focus-within .vimeo-facade-play::after {
  animation: none;
}

/* While the player loads: hide the play button and show a spinner. */
.vimeo-facade.is-loading {
  cursor: default;
}
.vimeo-facade.is-loading .vimeo-facade-play {
  opacity: 0;
}
.vimeo-facade.is-loading::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 2;
  width: 46px;
  height: 46px;
  margin: -23px 0 0 -23px;
  border: 4px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: vimeoSpin 0.8s linear infinite;
}

@keyframes vimeoSpin {
  to {
    transform: rotate(360deg);
  }
}

/* The real player crossfades in once loaded. */
.embed-container iframe.vimeo-frame {
  opacity: 0;
  transition: opacity 0.45s ease;
}
.embed-container iframe.vimeo-frame.is-ready {
  opacity: 1;
}

/* Respect users who prefer less motion: no pulse or zoom. */
@media (prefers-reduced-motion: reduce) {
  .vimeo-facade-play::after {
    animation: none;
  }
  .vimeo-facade.has-thumb:hover,
  .vimeo-facade.has-thumb:focus-within {
    transform: none;
  }
}

citat {
  border-left: 4px solid #ccc;
  margin-left: 20px;
  padding-left: 20px;
  display: block;
}

blockquote {
  border: 1px solid #ccc;
  background-color: #f3f4f6;
  padding: 10px;
  font-style: italic;
  margin: 0;
}

.content-body {
  font-size: 15px;
  line-height: 1.7;
}
/* Chapter title is rendered as an overlay on the feature image, so the
   in-content <h1> (the same title) is hidden to avoid duplication. */
.content-body h1 { display: none; }
.content-body h2 {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  margin: 1.5rem 0 0.5rem;
  scroll-margin-top: 90px;
}
.content-body h3 {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  margin: 1.25rem 0 0.25rem;
  scroll-margin-top: 90px;
}
.content-body h5 {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 700;
  margin: 0.75rem 0 0.25rem;
}
.content-body p { margin-bottom: 0.75rem; }
.content-body li { margin-bottom: 0.25rem; }
.content-body img {
  max-width: 100%;
  height: auto;
  margin: 1rem 0;
}
/* Legacy chapter HTML uses align="right" + width="100%" for full-width figures */
.content-body img[align="right"] {
  float: none;
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  margin: 1rem 0;
}
.content-body figure {
  margin: 1.5rem 0;
  clear: both;
}
.content-body .kg-card {
  margin: 1.5rem 0;
  clear: both;
}
.content-body .kg-image-card img,
.content-body .kg-image {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  margin: 0;
}
.content-body .kg-width-full .kg-image {
  width: 100%;
}
.content-body .w-50 {
  width: 50%;
}
.content-body .row {
  display: flex;
  flex-wrap: wrap;
  margin: 0 -0.75rem;
}
.content-body .col-6,
.content-body .col-12,
.content-body .col-md-4 {
  padding: 0 0.75rem;
  box-sizing: border-box;
}
.content-body .col-12,
.content-body .col-md-4 {
  width: 100%;
}
.content-body .col-6 {
  width: 50%;
}

@media (max-width: 768px) {
  .content-body .col-6,
  .content-body .w-50 {
    width: 100%;
  }
}

.content-body .card {
  border: 1px solid #dee2e6;
  margin-bottom: 1rem;
}
.content-body .card-body {
  padding: 1rem;
}
.content-body .text-center {
  text-align: center;
}
.content-body .mt-5 {
  margin-top: 3rem;
}
.content-body .mb-3 {
  margin-bottom: 1rem;
}
.content-body table { width: 100%; margin: 1rem 0; border-collapse: collapse; font-size: 12px; }
.content-body table th,
.content-body table td { padding: 0.5rem 0.75rem; border: 1px solid var(--border-color); text-align: left; }

@media (max-width: 768px) {
  .content-body table {
    display: block;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .content-body table thead,
  .content-body table tbody,
  .content-body table tr {
    display: table;
    width: 100%;
    table-layout: auto;
  }
}
.content-body table thead.table-dark th { background-color: var(--dark-bg); color: #fff; }

/* Chapter overview tables — section headings must read above chapter links (0.9rem) */
.content-body table thead.table-dark th h5,
.content-body table tr.table-dark th h7,
.content-body table tr.table-dark th > i {
  display: block;
  margin: 0;
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  font-style: italic;
  line-height: 1.35;
}
.content-body hr { margin: 1.5rem 0; border: 0; border-top: 1px solid var(--border-color); }
.content-body iframe { width: 100%; }

.content-body mjx-container {
  overflow-x: auto;
  max-width: 100%;
}
.content-body mjx-container[display="true"] {
  display: block;
  margin: 1rem 0;
  text-align: center;
}

/* R input code (chapters 20–22): black background, green text */
.content-body pre:has(> code) {
  margin: 0.4em 0 1.8em;
  padding: 20px 4.5rem 20px 20px;
  background: #000;
  color: #7fff00;
  border-radius: 0;
  font-family: var(--font-ibm-plex-mono), SFMono-Regular, Menlo, Monaco, Consolas,
    "Liberation Mono", "Courier New", monospace;
  font-size: 0.75rem;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
  position: relative;
  overflow: hidden;
}

.content-body pre:has(> code) code {
  display: block;
  background: transparent;
  color: inherit;
  padding: 0;
  border: none;
  font-size: inherit;
  font-family: inherit;
  white-space: inherit;
}

/* R output: gray frame */
.content-body code:has(> output) {
  display: block;
  width: 100%;
  margin: 0.4em 0 1.8em;
  padding: 20px;
  background: #f0f0f0;
  color: #000;
  border-radius: 0;
  font-family: var(--font-ibm-plex-mono), SFMono-Regular, Menlo, Monaco, Consolas,
    "Liberation Mono", "Courier New", monospace;
  font-size: 0.75rem;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

.content-body code:has(> output) output {
  display: block;
  background: transparent;
  color: inherit;
  font-family: inherit;
  font-size: inherit;
  white-space: inherit;
}

.r-code-copy-btn {
  position: absolute;
  top: 6px;
  right: 8px;
  z-index: 1;
  padding: 0.25rem 0.6rem;
  border: 1px solid #7fff00;
  border-radius: 0;
  background: transparent;
  color: #7fff00;
  font-family: var(--font-ibm-plex-mono), SFMono-Regular, Menlo, Monaco, Consolas,
    "Liberation Mono", "Courier New", monospace;
  font-size: 0.7rem;
  line-height: 1.3;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease,
    box-shadow 0.2s ease;
  animation: r-code-copy-pulse 2.4s ease-in-out infinite;
}

.r-code-copy-btn:hover,
.r-code-copy-btn:focus-visible {
  background: #7fff00;
  color: #000;
  border-color: #7fff00;
  transform: scale(1.05);
  box-shadow: 0 0 10px rgba(127, 255, 0, 0.45);
  animation: none;
}

.r-code-copy-btn.is-copied {
  background: #7fff00;
  color: #000;
  border: 1px solid #7fff00;
  border-radius: 0;
  animation: r-code-copy-success 0.45s ease;
}

@keyframes r-code-copy-pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.65;
  }
}

@keyframes r-code-copy-success {
  0% {
    transform: scale(1);
  }
  40% {
    transform: scale(1.12);
  }
  100% {
    transform: scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .r-code-copy-btn {
    animation: none;
  }
}

/* Animated tables via data-stat-viz="animated-table" */
.content-body table[data-stat-viz="animated-table"] tbody tr {
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.stat-viz-chart {
  max-width: 100%;
  margin: 1.5rem 0;
}

/* Table resource links — slide-reveal hover (materialer, eksamensopgaver, kapiteloversigt) */
.content-body table.table-hover tbody tr:has(> td > a.effectLinksTable) {
  cursor: pointer;
}

.content-body table td:has(> a.effectLinksTable) {
  padding: 0;
}

.content-body a.effectLinksTable {
  overflow: hidden;
  position: relative;
  display: block;
  text-decoration: none;
  color: #393838;
  background: none;
  padding: 0.5rem 0.75rem;
  width: 100%;
  font-family: var(--font-ui);
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.4;
  cursor: pointer;
}

.content-body a.effectLinksTable::after {
  content: attr(data-replace);
  position: absolute;
  left: 0.75rem;
  top: 0.5rem;
  right: 0.75rem;
  transform-origin: 100% 50%;
  transform: translate3d(200%, 0, 0);
  transition:
    transform 0.3s cubic-bezier(0.76, 0, 0.24, 1),
    opacity 0.3s ease,
    color 0.3s ease;
  color: inherit;
  background: none;
  opacity: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.content-body table.table-hover tbody tr:hover > td > a.effectLinksTable,
.content-body table.table-hover tbody tr:has(> td > a.effectLinksTable:focus-within) > td > a.effectLinksTable,
.content-body a.effectLinksTable:hover,
.content-body a.effectLinksTable:focus-visible {
  color: #fff;
  text-decoration: none;
  outline: none;
}

.content-body table.table-hover tbody tr:hover > td > a.effectLinksTable::after,
.content-body table.table-hover tbody tr:has(> td > a.effectLinksTable:focus-within) > td > a.effectLinksTable::after,
.content-body a.effectLinksTable:hover::after,
.content-body a.effectLinksTable:focus-visible::after {
  transform: translate3d(0, 0, 0);
  opacity: 1;
  color: #fff;
}

.content-body a.effectLinksTable span {
  display: inline-block;
  transition: transform 0.3s cubic-bezier(0.76, 0, 0.24, 1);
}

.content-body table.table-hover tbody tr:hover > td > a.effectLinksTable span,
.content-body table.table-hover tbody tr:has(> td > a.effectLinksTable:focus-within) > td > a.effectLinksTable span,
.content-body a.effectLinksTable:hover span,
.content-body a.effectLinksTable:focus-visible span {
  transform: translate3d(-200%, 0, 0);
}

.content-body table.table-hover tbody tr:hover td,
.content-body table.table-hover tbody tr:hover th {
  background: rgba(21, 23, 26, 0.5);
  color: #fff;
}

@media (prefers-reduced-motion: reduce) {
  .content-body a.effectLinksTable::after,
  .content-body a.effectLinksTable span {
    transition: none;
  }

  .content-body table.table-hover tbody tr:hover > td > a.effectLinksTable span,
  .content-body table.table-hover tbody tr:has(> td > a.effectLinksTable:focus-within) > td > a.effectLinksTable span,
  .content-body a.effectLinksTable:hover span,
  .content-body a.effectLinksTable:focus-visible span {
    transform: none;
    visibility: hidden;
  }

  .content-body table.table-hover tbody tr:hover > td > a.effectLinksTable::after,
  .content-body table.table-hover tbody tr:has(> td > a.effectLinksTable:focus-within) > td > a.effectLinksTable::after,
  .content-body a.effectLinksTable:hover::after,
  .content-body a.effectLinksTable:focus-visible::after {
    transform: none;
    opacity: 1;
    position: static;
    visibility: visible;
  }
}

/* Glossary tooltips (ordliste fra kapitel 25) */
@layer components {
  .content-body .tooltip2 {
    position: relative;
    display: inline;
    cursor: help;
    border-bottom: 1px dotted #a8afb8;
    border-radius: 2px;
    transition: background-color 0.15s ease;
  }

  .content-body .tooltip2:hover,
  .content-body .tooltip2:focus-within {
    background-color: #eef0f2;
  }

  .content-body .tooltip2 .tooltiptext {
    visibility: hidden;
    opacity: 0;
    position: absolute;
    z-index: 60;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    width: max-content;
    max-width: min(340px, 92vw);
    padding: 0.7rem 0.9rem;
    background-color: #fff;
    color: var(--foreground);
    font-size: 0.8125rem;
    font-weight: 400;
    line-height: 1.55;
    text-align: left;
    white-space: normal;
    border: 1px solid #e2e5e9;
    border-radius: 4px;
    box-shadow: 0 6px 20px rgba(21, 23, 26, 0.14);
    pointer-events: none;
    transition: opacity 0.15s ease, visibility 0.15s ease;
  }

  .content-body .tooltip2:hover .tooltiptext,
  .content-body .tooltip2:focus-within .tooltiptext {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
  }

  /* Accordion spørgsmål/svar: tooltip til højre så listetekst forbliver læsbar */
  .content-body .accordion-body .tooltip2 .tooltiptext {
    bottom: auto;
    top: 50%;
    left: calc(100% + 10px);
    right: auto;
    transform: translateY(-50%);
  }

  @media (max-width: 768px) {
    .content-body .tooltip2:not(:hover):not(:focus-within) .tooltiptext {
      left: 0;
      right: auto;
      width: 0;
      max-width: 0;
      overflow: hidden;
      padding: 0;
      border-width: 0;
      transform: none;
    }

    .content-body .tooltip2:hover .tooltiptext,
    .content-body .tooltip2:focus-within .tooltiptext {
      left: 50%;
      right: auto;
      width: min(340px, calc(100vw - 2rem));
      max-width: calc(100vw - 2rem);
      overflow: visible;
      padding: 0.7rem 0.9rem;
      border-width: 1px;
      transform: translateX(-50%);
    }
  }

  @media (max-width: 640px) {
    .content-body .accordion-body .tooltip2 .tooltiptext {
      top: calc(100% + 8px);
      left: 0;
      transform: none;
      width: min(340px, calc(100vw - 2rem));
      max-width: calc(100vw - 2rem);
    }
  }

  .content-body .tooltiptext em,
  .content-body .tooltiptext i {
    font-style: italic;
  }

  .content-body .tooltiptext a {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.2em;
    margin-top: 0.35rem;
    color: #fff !important;
    text-decoration: none !important;
    font-weight: 500;
    line-height: 1.3;
    padding: 0.2rem 0.6rem;
    border-radius: 2px;
    background-color: #7c848f;
    box-shadow: 0 1px 4px rgba(21, 23, 26, 0.14);
    transition:
      background-color 0.2s ease,
      transform 0.2s ease,
      box-shadow 0.2s ease;
    white-space: normal;
  }

  .content-body .tooltiptext a:hover,
  .content-body .tooltiptext a:focus-visible {
    color: #fff !important;
    background-color: #5c636d;
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(21, 23, 26, 0.2);
    outline: none;
  }
}

/* File download links — grey pill style inspired by jura.tepedu.dk */
@layer components {
  .content-body a[href*="storage.googleapis.com/tepedu/Files/"]:not(.chapter-resource-link):not(.effectLinksTable) {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.2em;
    color: #fff !important;
    text-decoration: none !important;
    font-weight: 500;
    line-height: 1.3;
    padding: 0.2rem 0.6rem;
    margin: 0 0.12rem;
    border-radius: 2px;
    background-color: #7c848f;
    box-shadow: 0 1px 4px rgba(21, 23, 26, 0.14);
    transition:
      color 0.35s cubic-bezier(0.4, 0, 0.2, 1),
      background-color 0.35s cubic-bezier(0.4, 0, 0.2, 1),
      transform 0.35s cubic-bezier(0.4, 0, 0.2, 1),
      box-shadow 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    vertical-align: baseline;
    white-space: normal;
  }

  .content-body a[href*="storage.googleapis.com/tepedu/Files/"]:not(.chapter-resource-link):not(.effectLinksTable)::after {
    content: "";
    display: inline-block;
    flex-shrink: 0;
    width: 0.85em;
    height: 0.85em;
    margin-left: 0.15em;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6'/%3E%3Cpolyline points='15 3 21 3 21 9'/%3E%3Cline x1='10' y1='14' x2='21' y2='3'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    opacity: 0.9;
    transform: translateX(-1px) scale(0.92);
    transition:
      transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1),
      opacity 0.3s ease;
  }

  .content-body a[href*="storage.googleapis.com/tepedu/Files/"]:not(.chapter-resource-link):not(.effectLinksTable):hover,
  .content-body a[href*="storage.googleapis.com/tepedu/Files/"]:not(.chapter-resource-link):not(.effectLinksTable):focus-visible {
    color: #fff !important;
    background-color: #5c636d;
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 4px 14px rgba(21, 23, 26, 0.22);
    outline: none;
  }

  .content-body a[href*="storage.googleapis.com/tepedu/Files/"]:not(.chapter-resource-link):not(.effectLinksTable):hover::after,
  .content-body a[href*="storage.googleapis.com/tepedu/Files/"]:not(.chapter-resource-link):not(.effectLinksTable):focus-visible::after {
    opacity: 1;
    transform: translateX(4px) scale(1.12) rotate(12deg);
  }

}

/* Quiz, selvtest & spørgsmål/svar */
@layer components {
  .chapter-resource-link {
    position: relative;
    display: flex;
    align-items: center;
    gap: 1rem;
    width: 100%;
    padding: 1rem 1.25rem;
    margin: 0 0 0.75rem;
    border: 1px solid #e2e5e9;
    border-radius: 2px;
    background-color: #f7f8f9;
    color: var(--dark-bg);
    font-family: var(--font-ui);
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.4;
    text-decoration: none;
    overflow: hidden;
    isolation: isolate;
    opacity: 0;
    transform: translateY(12px);
    transition:
      color 0.35s cubic-bezier(0.4, 0, 0.2, 1),
      border-color 0.35s cubic-bezier(0.4, 0, 0.2, 1),
      box-shadow 0.35s cubic-bezier(0.4, 0, 0.2, 1),
      transform 0.35s cubic-bezier(0.4, 0, 0.2, 1),
      opacity 0.45s ease;
  }

  .chapter-resource-link.is-visible {
    opacity: 1;
    transform: translateY(0);
  }

  /* Quiz/selvtest URLs — same mono label font as accordion spørgsmål */
  .content-body a.effectLinks[href*="stat.tepedu.dk"],
  .content-body a.effectLinks[href*="selvtest.tepedu.dk"],
  .content-body a.effectLinks[href*="tepedu.eu/moodle/mod/quiz"] {
    font-family: var(--font-ui);
    font-size: 0.9rem;
    font-weight: 600;
  }

  .chapter-resource-link--quiz {
    border-left: 3px solid var(--dark-bg);
  }

  .chapter-resource-link--selvtest {
    border-left: 3px solid #6b7280;
  }

  .chapter-resource-link::before {
    content: "";
    position: absolute;
    inset: 0;
    background-color: var(--dark-bg);
    opacity: 0;
    transform: scaleX(0);
    transform-origin: left center;
    transition:
      opacity 0.35s cubic-bezier(0.4, 0, 0.2, 1),
      transform 0.42s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
    z-index: -1;
  }

  .chapter-resource-link--selvtest::before {
    background-color: #374151;
  }

  .chapter-resource-link::after {
    content: "→";
    position: relative;
    z-index: 2;
    flex-shrink: 0;
    margin-left: auto;
    font-size: 1.15rem;
    line-height: 1;
    opacity: 0.35;
    transform: translateX(0);
    transition:
      transform 0.45s cubic-bezier(0.34, 1.35, 0.64, 1),
      opacity 0.3s ease;
  }

  .chapter-resource-link span {
    position: relative;
    z-index: 1;
    display: inline-block;
    font-family: inherit;
    transition:
      color 0.35s cubic-bezier(0.4, 0, 0.2, 1),
      transform 0.38s cubic-bezier(0.4, 0, 0.2, 1),
      letter-spacing 0.38s cubic-bezier(0.4, 0, 0.2, 1);
  }

  .chapter-resource-link:hover,
  .chapter-resource-link:focus-visible {
    color: #fff;
    border-color: var(--dark-bg);
    box-shadow: 0 8px 28px rgba(21, 23, 26, 0.2);
    transform: translateY(-2px);
    outline: none;
  }

  .chapter-resource-link--selvtest:hover,
  .chapter-resource-link--selvtest:focus-visible {
    border-color: #374151;
    box-shadow: 0 8px 28px rgba(55, 65, 81, 0.22);
  }

  .chapter-resource-link:hover::before,
  .chapter-resource-link:focus-visible::before {
    opacity: 1;
    transform: scaleX(1);
  }

  .chapter-resource-link:hover span,
  .chapter-resource-link:focus-visible span {
    color: #fff;
    transform: translateX(5px);
    letter-spacing: 0.015em;
  }

  .chapter-resource-link:hover::after,
  .chapter-resource-link:focus-visible::after {
    opacity: 1;
    transform: translateX(8px);
    animation: resource-arrow-nudge 0.55s cubic-bezier(0.34, 1.35, 0.64, 1);
  }

  @keyframes resource-arrow-nudge {
    0% {
      transform: translateX(0);
      opacity: 0.35;
    }
    55% {
      transform: translateX(12px);
      opacity: 1;
    }
    100% {
      transform: translateX(8px);
      opacity: 1;
    }
  }

  .content-body .accordion {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin: 1rem 0 2rem;
  }

  /*
   * Reveal is driven purely by CSS animation so the questions ("Spørgsmål")
   * are never left invisible when the client enhancer has not (yet) run,
   * e.g. during client-side navigation between chapters. `forwards` keeps the
   * final visible state after the animation completes.
   */
  .content-body .accordion-item {
    border: 1px solid #e2e5e9;
    border-radius: 2px;
    background: #fff;
    overflow: hidden;
    opacity: 0;
    transform: translateY(10px);
    animation: chapter-accordion-in 0.45s ease forwards;
    transition:
      border-color 0.3s ease,
      box-shadow 0.3s ease;
  }

  .content-body .accordion-item:nth-child(2) {
    animation-delay: 60ms;
  }
  .content-body .accordion-item:nth-child(3) {
    animation-delay: 120ms;
  }
  .content-body .accordion-item:nth-child(4) {
    animation-delay: 180ms;
  }
  .content-body .accordion-item:nth-child(n + 5) {
    animation-delay: 240ms;
  }

  /* Kept as a no-op safeguard: even if this class is added, item stays visible. */
  .content-body .accordion-item.is-visible {
    opacity: 1;
    transform: translateY(0);
  }

  @keyframes chapter-accordion-in {
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  @media (prefers-reduced-motion: reduce) {
    .content-body .accordion-item {
      animation: none;
      opacity: 1;
      transform: none;
    }
  }

  .content-body .accordion-item.is-open {
    border-color: #c4c9d0;
    box-shadow: 0 4px 20px rgba(21, 23, 26, 0.08);
    overflow: visible;
  }

  .content-body .accordion-item.is-answer {
    border-left: 3px solid #9ca3af;
  }

  .content-body .accordion-item:not(.is-answer) {
    border-left: 3px solid var(--dark-bg);
  }

  .content-body .accordion-header {
    display: block;
    margin: 0;
    font-weight: inherit;
  }

  .content-body .accordion-button {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.9rem 1.1rem;
    border: none;
    background: linear-gradient(180deg, #fafbfc 0%, #f5f6f8 100%);
    color: var(--dark-bg);
    font-family: var(--font-ui);
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.4;
    text-align: left;
    cursor: pointer;
    transition:
      background 0.3s ease,
      color 0.3s ease;
  }

  .content-body .accordion-button::after {
    content: "";
    flex-shrink: 0;
    width: 0.5rem;
    height: 0.5rem;
    margin-left: auto;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
    opacity: 0.45;
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
  }

  .content-body .accordion-button:hover {
    background: #eceef1;
  }

  .content-body .accordion-item.is-open .accordion-button {
    background: var(--dark-bg);
    color: #fff;
  }

  .content-body .accordion-item.is-open .accordion-button::after {
    transform: rotate(-135deg);
    opacity: 0.85;
  }

  .content-body .accordion-item.is-answer.is-open .accordion-button {
    background: #374151;
  }

  .content-body .accordion-collapse {
    display: grid;
    grid-template-rows: 0fr;
    visibility: visible;
    transition: grid-template-rows 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  }

  .content-body .accordion-collapse > .accordion-body {
    overflow: hidden;
    min-height: 0;
  }

  .content-body .accordion-collapse.is-open {
    grid-template-rows: 1fr;
    overflow: visible;
  }

  .content-body .accordion-collapse.is-open > .accordion-body {
    overflow: visible;
  }

  .content-body .accordion-body {
    padding: 0 1.1rem;
    color: #374151;
    font-size: 0.9rem;
    line-height: 1.65;
    transition: padding 0.35s ease;
  }

  .content-body .accordion-collapse.is-open > .accordion-body {
    padding: 0.75rem 1.1rem 1.1rem;
  }

  .content-body .accordion-body pre {
    margin: 0.75rem 0;
    padding: 0.85rem 1rem;
    border-radius: 2px;
    background: #f3f4f6;
    border: 1px solid #e2e5e9;
    font-size: 0.8rem;
    line-height: 1.5;
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-word;
  }

  .content-body .accordion-body code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  }

  .content-body h7 {
    display: block;
    margin: 0;
  }
}

.header {
  background-color: rgba(0, 0, 0, 0.5) !important;
  box-shadow: 0 3px 5px rgba(57, 63, 72, 0.3);
  color: #fff;
  position: fixed !important;
  top: 0;
  width: 100%;
  z-index: 99999;
}

.site-main {
  padding-top: 80px;
  padding-bottom: 72px;
}

/* Legal pages (terms, privacy) */
.legal-page {
  max-width: 48rem;
  margin-inline: auto;
  padding: 2rem 1rem 3rem;
  font-size: 15px;
  line-height: 1.7;
}

.legal-page h2 {
  font-family: var(--font-heading);
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.25;
  margin: 0 0 0.5rem;
}

.legal-page-meta {
  color: #6b7280;
  font-size: 0.875rem;
  margin: 0 0 2rem;
}

.legal-page h3 {
  font-family: var(--font-heading);
  font-size: 1.125rem;
  font-weight: 700;
  line-height: 1.35;
  margin: 2rem 0 0.75rem;
}

.legal-page p {
  margin: 0 0 1rem;
}

.legal-page p:last-child {
  margin-bottom: 0;
}

.legal-page ul {
  margin: 0 0 1rem;
  padding-left: 1.25rem;
  list-style: disc;
}

.legal-page li {
  margin-bottom: 0.5rem;
}

.legal-page li:last-child {
  margin-bottom: 0;
}

.legal-page a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
  word-break: break-word;
}

.legal-page a:hover,
.legal-page a:focus-visible {
  opacity: 0.75;
}

.legal-page strong {
  font-weight: 600;
}

.legal-page .legal-emphasis {
  font-weight: 500;
}

.legal-page .legal-muted {
  color: #6b7280;
  font-size: 0.875rem;
}

.legal-page .legal-company-registry {
  color: #9ca3af;
  font-size: 0.8125rem;
  line-height: 1.5;
  margin-top: -0.25rem;
}

.legal-page .legal-company-block p {
  margin: 0 0 0.35rem;
}

.legal-page .legal-company-block p:last-child {
  margin-bottom: 0;
}

.legal-page .legal-company-registry a {
  color: inherit;
  text-decoration: none;
}

.legal-page .legal-company-registry a:hover,
.legal-page .legal-company-registry a:focus-visible {
  text-decoration: underline;
  opacity: 1;
}

.help-page.legal-page {
  max-width: 56rem;
}

.help-page--bogen.legal-page {
  max-width: 44rem;
}

.help-bogen-lead {
  font-size: 1.05rem;
  line-height: 1.75;
  margin-bottom: 1.75rem;
}

.help-bogen-hero-link {
  color: inherit;
  display: block;
  margin: 0 0 2.25rem;
  text-decoration: none;
}

.help-bogen-hero {
  margin: 0;
  overflow: hidden;
  position: relative;
  transition: box-shadow 0.35s ease, transform 0.35s ease;
}

.help-bogen-hero img {
  display: block;
  height: auto;
  transition: transform 0.55s ease;
  width: 100%;
}

.help-bogen-hero figcaption {
  background: linear-gradient(to top, rgba(21, 23, 26, 0.88), rgba(21, 23, 26, 0.35));
  bottom: 0;
  color: #fff;
  font-size: 0.9rem;
  left: 0;
  line-height: 1.45;
  margin: 0;
  padding: 2.5rem 1.15rem 1rem;
  position: absolute;
  right: 0;
}

.help-bogen-hero-link:hover .help-bogen-hero,
.help-bogen-hero-link:focus-visible .help-bogen-hero {
  box-shadow: 0 16px 38px rgba(0, 0, 0, 0.28);
  transform: translateY(-3px);
}

.help-bogen-hero-link:hover .help-bogen-hero img,
.help-bogen-hero-link:focus-visible .help-bogen-hero img {
  transform: scale(1.04);
}

.help-bogen-hero-link:focus-visible {
  outline: 2px solid #15171a;
  outline-offset: 3px;
}

.help-bogen-section h3 {
  margin-top: 0;
}

.help-bogen-section {
  margin: 2.5rem 0 0;
}

.help-bogen-author-card {
  transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.help-bogen-author-card:hover {
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

.help-bogen-in-text {
  font-size: 0.875rem;
  margin: 0.75rem 0 0;
}

.help-bogen-table.content-body {
  line-height: inherit;
  margin: 0;
  max-width: none;
  padding: 0;
}

.legal-page .help-bogen-table.content-body a.effectLinksTable {
  opacity: 1;
  text-decoration: none;
}

.legal-page .help-bogen-table.content-body a.effectLinksTable:hover,
.legal-page .help-bogen-table.content-body a.effectLinksTable:focus-visible {
  opacity: 1;
}

.help-cite {
  background: #fff;
  border: 1px solid #e5e7eb;
  margin: 0 0 0.25rem;
  overflow: hidden;
  transition: border-color 0.2s ease;
}

.help-cite:hover {
  border-color: #cbd5e1;
}

.help-cite--copied {
  border-color: #86efac;
}

.help-cite-head {
  align-items: center;
  background: #f8f9fb;
  border-bottom: 1px solid #e5e7eb;
  display: flex;
  gap: 0.75rem;
  justify-content: space-between;
  padding: 0.55rem 0.85rem;
}

.help-cite--copied .help-cite-head {
  background: #ecfdf3;
  border-bottom-color: #bbf7d0;
}

.help-cite-label {
  color: #374151;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.help-cite-copy {
  align-items: center;
  background: transparent;
  border: 1px solid #cbd5e1;
  color: #4b5563;
  cursor: pointer;
  display: inline-flex;
  flex-shrink: 0;
  font: inherit;
  font-size: 0.75rem;
  font-weight: 500;
  gap: 0.3rem;
  line-height: 1;
  padding: 0.3rem 0.55rem;
  transition:
    background-color 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease;
}

.help-cite-copy:hover,
.help-cite-copy:focus-visible {
  background: #fff;
  border-color: #9ca3af;
  color: #15171a;
  outline: none;
}

.help-cite-copy--done {
  background: #f0fdf4;
  border-color: #86efac;
  color: #15803d;
}

.help-cite-copy--done:hover,
.help-cite-copy--done:focus-visible {
  background: #ecfdf3;
  border-color: #4ade80;
  color: #15803d;
}

.help-cite-copy-icon {
  flex-shrink: 0;
  height: 0.95rem;
  width: 0.95rem;
}

.help-cite-body {
  font-size: 0.98rem;
  line-height: 1.7;
  padding: 1rem 1.05rem 1.1rem;
}

.help-cite-body p {
  margin: 0;
}

.help-cite-body em {
  font-style: italic;
}

.help-steps {
  margin: 0 0 1.25rem;
  padding-left: 1.35rem;
  list-style: decimal;
}

.help-steps li {
  margin-bottom: 0.65rem;
}

.help-steps li:last-child {
  margin-bottom: 0;
}

.help-figure {
  margin: 1.25rem 0 1.75rem;
}

.help-figure img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 0;
}

.help-figure figcaption {
  margin-top: 0.5rem;
  padding: 0;
  font-size: 0.875rem;
  color: #374151;
  line-height: 1.45;
}

.help-step {
  margin: 2rem 0;
  padding-top: 0.25rem;
}

.help-step-title {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  font-family: var(--font-heading);
  font-size: 1.125rem;
  font-weight: 700;
  gap: 0.65rem;
  line-height: 1.35;
  margin: 0 0 0.85rem;
}

.help-step-badge {
  background: #15171a;
  border-radius: 0;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 0.2rem 0.65rem;
  white-space: nowrap;
}

.help-step-body p:last-child,
.help-step-body ul:last-child,
.help-step-body ol:last-child {
  margin-bottom: 0;
}

.help-author-card {
  align-items: flex-start;
  background: #f8f9fb;
  border: 1px solid #e5e7eb;
  display: grid;
  gap: 1.5rem;
  grid-template-columns: minmax(8.5rem, 11rem) minmax(0, 1fr);
  margin: 2rem 0;
  padding: 1.65rem;
}

.help-author-photo img {
  display: block;
  height: auto;
  width: 100%;
}

.help-author-info h3 {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.3;
  margin: 0 0 0.35rem;
}

.help-author-role {
  color: #6b7280;
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  margin: 0 0 0.85rem;
  text-transform: uppercase;
}

.help-author-info p:last-child {
  margin-bottom: 0;
}

@media (max-width: 640px) {
  .help-author-card {
    grid-template-columns: 1fr;
    max-width: 18rem;
  }
}

.navbar {
  width: 100%;
}

.navbar-inner {
  width: 100%;
  margin: 0;
  padding: 0.5rem clamp(1rem, 2.5vw, 1.5rem);
  display: flex;
  align-items: center;
  gap: 1rem;
}

.navbar-brand {
  text-decoration: none;
  flex-shrink: 0;
}

.logoImg {
  display: block;
  height: auto;
}

.navbar-toggler {
  display: none;
  margin-left: auto;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 0;
  padding: 0.35rem 0.6rem;
  cursor: pointer;
}

.navbar-toggler-icon {
  display: block;
  width: 1.25rem;
  height: 1.25rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3E%3Cpath stroke='rgba(255,255,255,0.85)' stroke-linecap='round' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
}

.navbar-collapse {
  display: flex;
  align-items: center;
}

.navbar-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
}

.chapterListBtn {
  position: relative;
}

.chapter-list-toggle {
  border-radius: 0;
}

.chapter-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 0.25rem;
  background: #15171a;
  min-width: 280px;
  max-height: 70vh;
  overflow-y: auto;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  z-index: 100000;
}

.chapter-dropdown-item {
  display: block;
  padding: 0.4rem 0.75rem;
  color: #fff;
  font-size: 12px;
  text-decoration: none;
}

.chapter-dropdown-item:hover {
  background: #fff;
  color: #15171a;
}

.account-dropdown {
  position: absolute;
  right: 0;
  top: 100%;
  margin-top: 0.25rem;
  background: #15171a;
  min-width: 160px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  z-index: 100000;
}

.account-dropdown-item {
  display: block;
  padding: 0.5rem 1rem;
  color: #fff;
  font-size: 12px;
  text-decoration: none;
}

.account-dropdown-item:hover {
  background: #fff;
  color: #15171a;
}

.account-dropdown-button {
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  cursor: pointer;
}

@media (max-width: 576px) {
  .navbar-toggler {
    display: block;
  }

  .navbar-collapse {
    display: none;
    width: 100%;
    order: 3;
  }

  .navbar-collapse.show {
    display: block;
  }

  .navbar-inner {
    flex-wrap: wrap;
  }
}

/* Chapter feature image (carried over from the chapter front-page image) */
.post-feature-image {
  position: relative;
  margin: 0 0 3vw;
}

.post-feature-image img {
  display: block;
  width: 100%;
  height: 500px;
  object-fit: cover;
}

/* Scrim so the overlaid title stays legible against any image */
.post-feature-image::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.15) 0%,
    rgba(0, 0, 0, 0) 35%,
    rgba(0, 0, 0, 0.55) 100%
  );
  pointer-events: none;
}

.post-feature-title {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1;
  margin: 0;
  padding: 0 max(1rem, calc((100% - 1140px) / 2 + 1rem)) 2.5rem;
  color: #fff;
  font-weight: 700;
  font-size: clamp(2rem, 5.5vw, 4.5rem);
  line-height: 1.05;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.55);
}

@media (max-width: 768px) and (min-width: 577px) {
  .post-feature-image img {
    height: 380px;
  }
}

@media (max-width: 576px) {
  .post-feature-image img {
    height: 300px;
  }

  .post-feature-title {
    padding: 0 1rem 1.5rem;
    font-size: clamp(1.75rem, 8vw, 2.5rem);
  }

  .post-card-image {
    height: 260px;
  }
}

/* Homepage */
.mainPage {
  padding: 0 0 3rem;
}

.container {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* Full-bleed 3-up grid, edge to edge with no gaps between images */
.chapter-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  width: 100%;
}

@media (max-width: 992px) {
  .chapter-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 576px) {
  .chapter-grid {
    grid-template-columns: 1fr;
  }
}

.chapterLink {
  text-decoration: none;
  color: inherit;
  display: block;
  height: 100%;
}

.chapterCard {
  border: none;
  height: 100%;
  transition: box-shadow 0.3s ease;
}

.chapter-grid-item {
  position: relative;
  transition: transform 0.3s ease, z-index 0s;
}

/* Hover: lift the card with a shadow and gently zoom the image */
.chapter-grid-item:hover {
  z-index: 2;
}

.chapter-grid-item:hover .post-card-image {
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.4);
}

.chapter-grid-item:hover .post-card-image img {
  transform: scale(1.06);
}

.post-card-image {
  position: relative;
  background-color: #5b7a81;
  height: 340px;
  margin: 0;
  overflow: hidden;
  transition: box-shadow 0.3s ease;
}

.post-card-image img {
  transition: transform 0.5s ease;
}

/* Scrim so overlaid text stays legible on any image */
.post-card-image::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.1) 0%,
    rgba(0, 0, 0, 0) 30%,
    rgba(0, 0, 0, 0.75) 100%
  );
  pointer-events: none;
}

/* Free/Pro badge, top-left on the image */
.post-card-tag-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 2;
  padding: 3px 10px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-family: var(--font-ui);
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* Title + excerpt overlaid at the bottom of the image */
.post-card-overlay {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  padding: 1.25rem 1.25rem 1.35rem;
}

.post-card-title {
  color: #fff;
  font-size: 1.5rem;
  margin: 0 0 6px;
  padding: 0;
  font-weight: 700;
  line-height: 1.1;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.6);
}

.post-card-excerpt {
  color: rgba(255, 255, 255, 0.9);
  line-height: 1.45;
  margin: 0;
  font-size: 13px;
  font-family: var(--font-ui);
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.7);
}

.btn-dark {
  background-color: #15171a;
  color: #fff;
  padding: 5px 10px;
  font-size: 12px;
  text-decoration: none;
  border-radius: 0;
  border: none;
  cursor: pointer;
}
.btn-dark:hover {
  opacity: 0.9;
}

.receipt-print-btn {
  position: relative;
  overflow: hidden;
  background-color: #15171a;
  color: #fff;
  padding: 8px 18px;
  font-size: 13px;
  font-family: var(--font-ui);
  border: 1px solid #15171a;
  border-radius: 0;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
  animation: receipt-print-pulse 2.6s ease-in-out infinite;
}

.receipt-print-btn::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    105deg,
    transparent 35%,
    rgba(255, 255, 255, 0.22) 50%,
    transparent 65%
  );
  transform: translateX(-120%);
  animation: receipt-print-shimmer 2.6s ease-in-out infinite;
}

.receipt-print-btn:hover,
.receipt-print-btn:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(21, 23, 26, 0.22);
  animation: none;
}

.receipt-print-btn:hover::after,
.receipt-print-btn:focus-visible::after {
  animation: none;
}

@keyframes receipt-print-pulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(21, 23, 26, 0.12);
  }
  50% {
    box-shadow: 0 0 0 6px rgba(21, 23, 26, 0);
  }
}

@keyframes receipt-print-shimmer {
  0%,
  35% {
    transform: translateX(-120%);
  }
  55%,
  100% {
    transform: translateX(120%);
  }
}

.receipt-print-only {
  display: none;
}

@media print {
  .header,
  .site-foot {
    display: none !important;
  }

  body {
    margin: 0;
    padding: 0;
  }

  .site-main {
    margin: 0;
    padding: 0;
  }

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

  .receipt-print-only {
    display: block;
  }

  .receipt-page {
    max-width: none;
    padding: 0;
  }

  .receipt-card {
    border: none !important;
    padding: 0 !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .receipt-print-btn,
  .receipt-print-btn::after {
    animation: none;
  }
}

/* Full-width stacked buttons with a guaranteed equal height (used on auth pages) */
.btn-block {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 44px;
  padding: 10px 16px;
  font-size: 14px;
  line-height: 1;
  box-sizing: border-box;
  border-radius: 0;
  border: 1px solid #15171a;
  text-decoration: none;
  cursor: pointer;
  transition:
    background-color 0.2s ease,
    color 0.2s ease,
    transform 0.18s ease,
    box-shadow 0.18s ease,
    border-color 0.2s ease;
}
.btn-block:disabled {
  cursor: not-allowed;
  opacity: 0.6;
  transform: none;
  box-shadow: none;
}
.btn-block-primary {
  background-color: #15171a;
  color: #fff;
}
.btn-block-primary:hover:not(:disabled) {
  background-color: #2a2d32;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(21, 23, 26, 0.22);
}
.btn-block-secondary {
  background-color: #fff;
  color: #15171a;
}
.btn-block-secondary:hover:not(:disabled) {
  background-color: #15171a;
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(21, 23, 26, 0.18);
}
.btn-block-accent {
  background-color: #16a34a;
  color: #fff;
  border-color: #16a34a;
}
.btn-block-accent:hover:not(:disabled) {
  background-color: #15803d;
  border-color: #15803d;
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(22, 163, 74, 0.35);
}
.btn-block-warning {
  background-color: #fef08a;
  color: #15171a;
  border: none;
}
.btn-block-warning:hover:not(:disabled) {
  background-color: #fde047;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(234, 179, 8, 0.28);
}
.btn-block-cta {
  min-height: 52px;
  padding: 14px 20px;
  font-size: 16px;
  font-weight: 600;
}
.btn-block-cta:hover:not(:disabled) {
  transform: translateY(-3px);
  box-shadow: 0 8px 22px rgba(22, 163, 74, 0.38);
}
.btn-block:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(21, 23, 26, 0.12);
}

/* Footer */
.site-foot {
  background-color: rgba(0, 0, 0, 0.5);
  bottom: 0;
  left: 0;
  right: 0;
  color: rgba(255, 255, 255, 0.7);
  font-size: 1.3rem;
  padding: 10px 0 5px;
  position: fixed;
  width: 100%;
  z-index: 9999;
}

.site-foot-nav {
  display: flex;
  align-items: center;
  justify-content: stretch;
  max-width: none;
  width: 100%;
  margin: 0;
  padding: 0;
}

.site-foot-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 0.75rem;
  width: 100%;
}

.site-foot-chapter-link-wrap {
  min-width: 0;
}

.site-foot-chapter-link-wrap--next {
  text-align: right;
}

.site-foot-chapter-link {
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: middle;
}

.site-foot-chapter-spacer {
  display: inline-block;
  min-width: 1px;
}

.site-foot-help-only {
  grid-column: 1 / -1;
  display: flex;
  justify-content: center;
}

.help-dropdown {
  position: relative;
  justify-self: center;
}

.chapter-pagination {
  display: flex;
  flex-direction: row;
  gap: 0.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.chapter-pagination li {
  list-style: none;
  margin: 0;
  padding: 0;
}

.chapter-pagination-btn {
  display: inline-block;
  font-size: 1rem;
  padding: 0.375rem 0.75rem;
}

.chapter-pagination-btn.disabled {
  opacity: 0.5;
  pointer-events: none;
}

.help-toggle {
  font-size: 12px;
}

.help-menu {
  position: absolute;
  left: 50%;
  right: auto;
  bottom: 100%;
  transform: translateX(-50%);
  margin-bottom: 0.25rem;
  background: #15171a;
  min-width: 200px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  z-index: 100000;
}

.help-menu-item {
  display: block;
  width: 100%;
  padding: 0.5rem 1rem;
  color: #fff;
  font-size: 12px;
  text-decoration: none;
  text-align: left;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.help-menu-item:hover {
  background: #fff;
  color: #15171a;
}

/* Chapter paywall */
.access-card {
  background-color: #15171a;
  color: #fff;
  margin: 0 auto;
  text-align: center;
  width: 50%;
  min-width: 280px;
  max-width: 640px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 8px 28px rgba(21, 23, 26, 0.18);
}

.access-card-body {
  padding: 3.5rem 1.5rem;
  font-family: var(--font-ui);
}

.access-card-title {
  font-family: var(--font-heading);
  color: #fff;
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0 0 0.75rem;
  line-height: 1.4;
}

.access-card-subtitle {
  font-size: 0.8125rem;
  letter-spacing: 0.02em;
  color: rgba(255, 255, 255, 0.72);
  margin: 0 0 1.75rem;
  line-height: 1.55;
}

.access-card-text {
  font-size: 0.8125rem;
  letter-spacing: 0.02em;
  color: rgba(255, 255, 255, 0.72);
  margin: 0 0 1.75rem;
  line-height: 1.55;
}

.access-card-action {
  margin: 0;
}

.access-card-login {
  margin: 1rem 0 0;
}

.access-card-login-link {
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.8125rem;
  letter-spacing: 0.02em;
  text-decoration: none;
  transition: color 0.2s ease;
}

.access-card-login-link:hover {
  color: #fff;
  text-decoration: underline;
}

.access-card-cta {
  display: inline-block;
  padding: 0.625rem 1.5rem;
  font-family: var(--font-ui);
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  background: #fff;
  color: #15171a;
  text-decoration: none;
  border: 1px solid #fff;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18);
  transition:
    transform 0.5s ease,
    box-shadow 0.3s ease;
}

.access-card-cta:hover {
  transform: scale(1.06);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.4);
}

.access-card-cta:hover .access-card-cta-arrow {
  transform: translateX(3px);
}

.access-card-cta:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.8);
  outline-offset: 3px;
}

.access-card-cta-arrow {
  display: inline-block;
  margin-left: 0.35rem;
  transition: transform 0.3s ease;
}

.access-card-notice {
  background: rgba(25, 135, 84, 0.2);
  border: 1px solid rgba(25, 135, 84, 0.5);
  color: #d1e7dd;
  font-size: 0.8125rem;
  margin: 0 0 1rem;
  padding: 0.5rem 0.75rem;
}

@media (prefers-reduced-motion: reduce) {
  .access-card-cta {
    transition: none;
  }

  .access-card-cta:hover {
    transform: none;
  }

  .access-card-cta:hover .access-card-cta-arrow {
    transform: none;
  }
}

@media (max-width: 768px) {
  .access-card {
    width: 100%;
  }
}

/* Chapter table of contents (in-page h2/h3 navigation) */
.chapter-toc-toggle {
  position: fixed;
  right: 1.25rem;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10003;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  border: none;
  border-radius: 999px;
  background: #15171a;
  color: #fff;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
  transition:
    transform 0.5s cubic-bezier(0.34, 1.45, 0.64, 1),
    box-shadow 0.45s cubic-bezier(0.22, 1, 0.36, 1),
    background 0.35s ease,
    color 0.35s ease,
    opacity 0.22s ease 0.08s;
  animation: toc-pulse 2.8s ease-in-out infinite;
}

.chapter-toc-toggle:active:not(.is-open) {
  transform: translateY(-50%) scale(0.92);
  transition-duration: 0.12s;
}

.chapter-toc-toggle:hover {
  transform: translateY(-50%) scale(1.05);
  box-shadow: 0 6px 28px rgba(0, 0, 0, 0.35);
  animation: none;
}

.chapter-toc-toggle.is-open {
  animation: none;
  background: #fff;
  color: #15171a;
  box-shadow: 0 0 0 0 rgba(48, 187, 252, 0);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-50%) scale(1.12);
  transition:
    transform 0.38s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.38s ease,
    background 0.2s ease,
    color 0.2s ease,
    opacity 0.18s ease 0.06s;
}

@keyframes toc-pulse {
  0%, 100% { box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25); }
  50% { box-shadow: 0 4px 28px rgba(48, 187, 252, 0.45); }
}

.chapter-toc-toggle-icon {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 1.25rem;
}

.chapter-toc-line {
  display: block;
  height: 2px;
  background: currentColor;
  border-radius: 1px;
  transition:
    transform 0.42s cubic-bezier(0.34, 1.2, 0.64, 1),
    opacity 0.28s ease,
    width 0.38s cubic-bezier(0.22, 1, 0.36, 1);
}

.chapter-toc-line:nth-child(1) { width: 100%; }
.chapter-toc-line:nth-child(2) { width: 75%; align-self: flex-end; }
.chapter-toc-line:nth-child(3) { width: 50%; align-self: flex-end; }

.chapter-toc-toggle.is-open .chapter-toc-line:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
  width: 100%;
  align-self: center;
}
.chapter-toc-toggle.is-open .chapter-toc-line:nth-child(2) {
  opacity: 0;
  width: 0;
}
.chapter-toc-toggle.is-open .chapter-toc-line:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
  width: 100%;
  align-self: center;
}

.chapter-toc-toggle-label {
  display: none;
}

.chapter-toc-ripple {
  position: fixed;
  left: var(--toc-origin-x, calc(100% - 2.625rem));
  top: var(--toc-origin-y, 50%);
  width: 2.75rem;
  height: 2.75rem;
  margin: 0;
  transform: translate(-50%, -50%) scale(0.6);
  border-radius: 50%;
  background: radial-gradient(
    circle,
    rgba(48, 187, 252, 0.35) 0%,
    rgba(48, 187, 252, 0.12) 45%,
    transparent 70%
  );
  pointer-events: none;
  z-index: 10001;
  opacity: 0;
  transition:
    transform 0.58s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.48s ease;
  will-change: transform, opacity;
}

.chapter-toc-ripple.is-open {
  transform: translate(-50%, -50%) scale(14);
  opacity: 1;
}

.chapter-toc-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(8, 10, 12, 0.42);
  backdrop-filter: blur(0px);
  -webkit-backdrop-filter: blur(0px);
  z-index: 10000;
  opacity: 0;
  transition:
    opacity 0.45s cubic-bezier(0.22, 1, 0.36, 1),
    backdrop-filter 0.5s cubic-bezier(0.22, 1, 0.36, 1),
    -webkit-backdrop-filter 0.5s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: opacity, backdrop-filter;
}

.chapter-toc-backdrop.is-open {
  opacity: 1;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.chapter-toc-panel {
  position: fixed;
  top: 80px;
  right: 0;
  bottom: 72px;
  width: min(320px, 90vw);
  z-index: 10002;
  background: linear-gradient(165deg, #1a1d22 0%, #15171a 55%, #121418 100%);
  color: #fff;
  display: flex;
  flex-direction: column;
  clip-path: circle(0px at var(--toc-origin-x, calc(100% - 2.625rem)) var(--toc-origin-y, 50%));
  opacity: 0;
  transition:
    clip-path 0.52s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.28s ease,
    box-shadow 0.52s cubic-bezier(0.22, 1, 0.36, 1);
  box-shadow:
    -8px 0 40px rgba(0, 0, 0, 0.35),
    inset 1px 0 0 rgba(48, 187, 252, 0.25);
  border-left: 1px solid rgba(48, 187, 252, 0.2);
  pointer-events: none;
  will-change: clip-path, opacity;
  overflow: hidden;
}

.chapter-toc-panel.is-open {
  clip-path: circle(150vmax at var(--toc-origin-x, calc(100% - 2.625rem)) var(--toc-origin-y, 50%));
  opacity: 1;
  pointer-events: auto;
  box-shadow:
    -12px 0 48px rgba(0, 0, 0, 0.4),
    inset 1px 0 0 rgba(48, 187, 252, 0.45);
}

.chapter-toc-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  flex-shrink: 0;
  opacity: 0;
  transform: translateY(-10px);
}

.chapter-toc-panel.is-open .chapter-toc-panel-header {
  animation: toc-header-in 0.42s cubic-bezier(0.22, 1, 0.36, 1) 0.14s forwards;
}

@keyframes toc-header-in {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.chapter-toc-panel-title {
  font-size: 1rem;
  font-weight: 700;
  margin: 0;
  color: #fff;
  letter-spacing: 0.01em;
}

.chapter-toc-close {
  background: rgba(255, 255, 255, 0.06);
  border: none;
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.75);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition:
    color 0.2s ease,
    background 0.2s ease,
    transform 0.25s cubic-bezier(0.34, 1.2, 0.64, 1);
}

.chapter-toc-close:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.14);
  transform: rotate(90deg);
}

.chapter-toc-nav {
  flex: 1;
  overflow-y: auto;
  padding: 0.75rem 0;
}

.chapter-toc-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.chapter-toc-item {
  opacity: 0;
  transform: translateY(8px);
}

.chapter-toc-panel.is-open .chapter-toc-item {
  animation: toc-item-in 0.48s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  animation-delay: calc(0.16s + var(--toc-delay, 0ms));
}

@keyframes toc-item-in {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.chapter-toc-link {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.85);
  font-size: 12px;
  line-height: 1.4;
  padding: 0.4rem 1.25rem;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, padding-left 0.15s ease;
}

.chapter-toc-level-3 .chapter-toc-link {
  padding-left: 2rem;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.65);
}

.chapter-toc-link:hover,
.chapter-toc-item.is-active .chapter-toc-link {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  padding-left: 1.5rem;
}

.chapter-toc-level-3 .chapter-toc-link:hover,
.chapter-toc-level-3.is-active .chapter-toc-link {
  padding-left: 2.25rem;
}

.chapter-toc-item.is-active .chapter-toc-link {
  border-left: 3px solid #30bbfc;
}

@media (max-width: 768px) {
  .site-foot-inner {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: auto auto;
  }

  .site-foot-chapter-link-wrap--next {
    grid-column: 1;
    grid-row: 2;
    text-align: left;
  }

  .help-dropdown {
    grid-column: 2;
    grid-row: 1 / span 2;
    align-self: end;
  }

  .site-foot-chapter-link {
    font-size: 11px;
    max-width: 42vw;
  }

  .chapter-toc-toggle {
    top: auto;
    bottom: var(--chapter-toc-mobile-bottom);
    right: 1rem;
    transform: none;
    width: 2.75rem;
    height: 2.75rem;
    padding: 0;
  }

  .chapter-toc-toggle:hover {
    transform: scale(1.05);
  }

  .chapter-toc-toggle.is-open {
    transform: scale(1.12);
  }

  .chapter-toc-panel {
    top: auto;
    bottom: 0;
    width: 100%;
    max-height: 70vh;
    border-radius: 16px 16px 0 0;
    clip-path: circle(0px at var(--toc-origin-x, 50%) var(--toc-origin-y, var(--chapter-toc-mobile-bottom)));
    border-left: none;
    border-top: 1px solid rgba(48, 187, 252, 0.25);
    box-shadow:
      0 -12px 48px rgba(0, 0, 0, 0.4),
      inset 0 1px 0 rgba(48, 187, 252, 0.3);
  }

  .chapter-toc-panel.is-open {
    clip-path: circle(150vmax at var(--toc-origin-x, 50%) var(--toc-origin-y, var(--chapter-toc-mobile-bottom)));
    box-shadow:
      0 -16px 56px rgba(0, 0, 0, 0.45),
      inset 0 1px 0 rgba(48, 187, 252, 0.45);
  }
}

@media (prefers-reduced-motion: reduce) {
  .chapter-toc-toggle,
  .chapter-toc-ripple,
  .chapter-toc-backdrop,
  .chapter-toc-panel,
  .chapter-toc-line,
  .chapter-toc-panel-header,
  .chapter-toc-item,
  .chapter-toc-close {
    animation: none !important;
    transition-duration: 0.01ms !important;
  }

  .chapter-toc-backdrop.is-open {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  .chapter-toc-panel.is-open {
    clip-path: none;
  }

  .chapter-toc-panel:not(.is-open) {
    display: none;
  }

  .chapter-toc-panel.is-open .chapter-toc-panel-header,
  .chapter-toc-panel.is-open .chapter-toc-item {
    opacity: 1;
    transform: none;
  }
}

/* Sign-up / purchase page */
.sign-up-page {
  padding: 0 1rem 2rem;
}

.sign-up-container {
  max-width: 540px;
  margin: 0 auto;
}

.sign-up-form {
  width: 100%;
}

.page-title {
  margin-bottom: 35px;
  text-align: center;
  font-size: 2rem;
  font-weight: 700;
}

.form-group {
  margin-top: 20px;
}

.form-group > label {
  display: block;
  margin-bottom: 0.25rem;
  font-size: 1rem;
}

.form-control {
  appearance: none;
  background-color: #fff;
  border: 1px solid #dee2e6;
  border-radius: 0;
  color: #212529;
  display: block;
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.5;
  padding: 0.375rem 0.75rem;
  width: 100%;
  box-sizing: border-box;
}

.form-control:focus {
  border-color: #86b7fe;
  outline: 0;
  box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

.sign-up-plan-options {
  margin-top: 0.25rem;
}

.sign-up-plan-label {
  display: inline-block;
  font-weight: 400;
  margin-bottom: 0.5rem;
  cursor: pointer;
}

.margin-right-20 {
  margin-right: 20px;
}

.btn-secondary {
  background-color: #6c757d;
  border: 1px solid #6c757d;
  color: #fff;
}

.btn-secondary:hover {
  background-color: #5c636a;
  border-color: #565e64;
}

.commonBtn {
  background-color: #15171a !important;
  border-radius: 0 !important;
  font-size: 12px !important;
  padding: 5px 10px !important;
  border: none;
  color: #fff;
  text-decoration: none;
  display: inline-block;
  cursor: pointer;
}

.commonBtn:hover {
  opacity: 0.9;
}

.commonBtn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.sign-up-submit {
  margin-top: 0;
}

.auth-actions {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1.25rem;
}

.terms-accept {
  align-items: flex-start;
  background: linear-gradient(135deg, #fafbfc 0%, #f4f6f8 100%);
  border: 1px solid #e5e7eb;
  border-radius: 0;
  cursor: pointer;
  display: flex;
  gap: 0.75rem;
  margin-top: 1.25rem;
  padding: 0.875rem 1rem;
  position: relative;
  transition:
    border-color 0.25s ease,
    box-shadow 0.25s ease,
    background 0.25s ease;
}

.terms-accept:hover:not(.terms-accept--disabled) {
  border-color: #c7d2dc;
  box-shadow: 0 2px 8px rgba(21, 23, 26, 0.06);
}

.terms-accept--checked {
  background: linear-gradient(135deg, #f8faf9 0%, #f0f7f4 100%);
  border-color: #9ec9b4;
  box-shadow: 0 2px 12px rgba(46, 125, 90, 0.1);
}

.terms-accept--disabled {
  cursor: not-allowed;
  opacity: 0.65;
}

.terms-accept-input {
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  height: 1px;
  overflow: hidden;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}

.terms-accept-input:focus-visible + .terms-accept-box {
  outline: 2px solid #15171a;
  outline-offset: 2px;
}

.terms-accept-box {
  align-items: center;
  background: #fff;
  border: 1.5px solid #cbd5e1;
  border-radius: 0;
  display: flex;
  flex-shrink: 0;
  height: 1.125rem;
  justify-content: center;
  margin-top: 0.1rem;
  transition:
    background 0.2s ease,
    border-color 0.2s ease,
    transform 0.2s ease;
  width: 1.125rem;
}

.terms-accept--checked .terms-accept-box {
  background: #15171a;
  border-color: #15171a;
  transform: scale(1.05);
}

.terms-accept-check {
  color: #fff;
  height: 0.55rem;
  opacity: 0;
  transform: scale(0.5);
  transition:
    opacity 0.2s ease,
    transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  width: 0.65rem;
}

.terms-accept--checked .terms-accept-check {
  opacity: 1;
  transform: scale(1);
}

.terms-accept-text {
  color: #4b5563;
  font-size: 0.8125rem;
  line-height: 1.5;
}

.terms-accept-text a {
  color: #15171a;
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: opacity 0.15s ease;
}

.terms-accept-text a:hover,
.terms-accept-text a:focus-visible {
  opacity: 0.7;
}

.terms-accept-hint {
  color: #6b7280;
  font-size: 0.75rem;
  margin: 0.5rem 0 0;
  text-align: center;
}

.tnc {
  font-size: 12px;
  margin-bottom: 10px;
  margin-top: 10px;
}

.tnc a {
  color: #0d6efd;
  text-decoration: underline;
}

.forgot-password {
  font-size: 12px;
  margin-top: 10px;
}

.text-right {
  text-align: right;
}

.message {
  font-size: 12px;
  font-weight: 600;
  margin-top: 10px;
  text-align: center;
}

.sign-up-logged-in {
  font-size: 0.875rem;
  color: #6c757d;
}

.sign-up-email-group {
  position: relative;
}

.email-tip-popup {
  position: relative;
  margin-bottom: 0.75rem;
  animation: email-tip-enter 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.email-tip-popup-glow {
  position: absolute;
  inset: -2px;
  background: linear-gradient(
    120deg,
    #fde047,
    #fbbf24,
    #fef08a,
    #f59e0b,
    #fde047
  );
  background-size: 300% 300%;
  animation: email-tip-shimmer 4s ease infinite;
  opacity: 0.85;
}

.email-tip-popup-inner {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.875rem 0.875rem 0.875rem 1rem;
  background: linear-gradient(135deg, #fffbeb 0%, #fef9c3 48%, #fef08a 100%);
  border-left: 4px solid #ca8a04;
  box-shadow:
    0 10px 28px rgba(202, 138, 4, 0.16),
    0 2px 8px rgba(21, 23, 26, 0.06);
}

.email-tip-popup-icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  color: #a16207;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(202, 138, 4, 0.28);
  animation: email-tip-icon-pulse 2.4s ease-in-out infinite;
}

.email-tip-popup-icon svg {
  width: 1.25rem;
  height: 1.25rem;
}

.email-tip-popup-body {
  flex: 1;
  min-width: 0;
}

.email-tip-popup-title {
  display: block;
  margin-bottom: 0.2rem;
  font-size: 0.9rem;
  font-weight: 700;
  color: #713f12;
  letter-spacing: 0.01em;
}

.email-tip-popup-text {
  margin: 0;
  font-size: 0.84rem;
  line-height: 1.45;
  color: #854d0e;
}

.email-tip-popup-close {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  padding: 0;
  border: 0;
  background: transparent;
  color: #92400e;
  cursor: pointer;
  opacity: 0.72;
  transition:
    opacity 0.18s ease,
    transform 0.18s ease,
    background-color 0.18s ease;
}

.email-tip-popup-close svg {
  width: 1rem;
  height: 1rem;
}

.email-tip-popup-close:hover {
  opacity: 1;
  transform: scale(1.08);
  background: rgba(255, 255, 255, 0.55);
}

.email-tip-popup-close:focus-visible {
  outline: 2px solid #ca8a04;
  outline-offset: 2px;
}

@keyframes email-tip-enter {
  0% {
    opacity: 0;
    transform: translateY(-10px) scale(0.97);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes email-tip-shimmer {
  0%,
  100% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
}

@keyframes email-tip-icon-pulse {
  0%,
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(202, 138, 4, 0.35);
  }
  50% {
    transform: scale(1.05);
    box-shadow: 0 0 0 8px rgba(202, 138, 4, 0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .email-tip-popup,
  .email-tip-popup-glow,
  .email-tip-popup-icon {
    animation: none;
  }
}

.confirm-dialog-backdrop {
  position: fixed;
  inset: 0;
  z-index: 200000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.45);
  padding: 1rem;
}

.confirm-dialog {
  width: 100%;
  max-width: 28rem;
  background: #fff;
  border: 1px solid #d1d5db;
  padding: 1.5rem;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.2);
}

.confirm-dialog-title {
  font-size: 1.125rem;
  font-weight: 700;
  margin: 0 0 0.75rem;
  color: #15171a;
}

.confirm-dialog-message {
  font-size: 0.9375rem;
  line-height: 1.5;
  margin: 0 0 1.25rem;
  color: #374151;
}

.confirm-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
}

.confirm-dialog-cancel,
.confirm-dialog-confirm {
  font-size: 0.875rem;
  padding: 0.5rem 1rem;
  cursor: pointer;
  border: 1px solid #d1d5db;
}

.confirm-dialog-cancel {
  background: #fff;
  color: #15171a;
}

.confirm-dialog-cancel:hover:not(:disabled) {
  background: #f3f4f6;
}

.confirm-dialog-confirm {
  background: #15171a;
  color: #fff;
  border-color: #15171a;
}

.confirm-dialog-confirm:hover:not(:disabled) {
  background: #2d3138;
}

.confirm-dialog-cancel:disabled,
.confirm-dialog-confirm:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}



.backup-banner {
  background: #b45309;
  color: #fff;
  text-align: center;
  padding: 0.6rem 1rem;
  font-size: 0.9rem;
}
.backup-home-link {
  color: #fff;
  text-decoration: none;
  font-size: 0.95rem;
  margin-left: auto;
}
.backup-home-link:hover {
  text-decoration: underline;
}
.post-card-image img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
