@import url('theme.css');


/* ── CARDS ──────────────────────────────────────────────────────────── */
.card {
  border-left: 4px solid var(--accent);
  border-bottom: 1px solid var(--accent);
  background: var(--bg-fg);
  color: var(--fg);
  border-radius: 6px;
  margin: 1.5rem auto;
  max-width: 56ch;
  line-height: 1.2;
  box-shadow: var(--box-shadow);
  overflow: hidden;
}

/* header for static cards */
.card .card-header {
  display: flex;
  align-items: center;
  background: var(--accent);
  color: var(--fg-fg);
  padding: .6rem 1rem;
  font-weight: bold;
}
.card .card-header .card-icon {
  margin-right: .5rem;
}

/* content for static cards */
.card .card-content {
  display: flex;
  flex-direction: column; /* Default layout is vertical */
  overflow: auto; /* contain floats */
  padding: 1rem;
}

.card .card-content .row {
  display: flex; /* Create a horizontal row for avatar and first paragraph */
  align-items: flex-start; /* Align items at the top */
  margin-bottom: 0.5rem; /* Add spacing between the row and the second paragraph */
}

.card .card-content .row img {
  flex-shrink: 0; /* Prevent the avatar from shrinking */
  margin-right: 1rem; /* Add spacing between the avatar and the text */
}

.card .card-content .row p {
  flex-grow: 1; /* Allow the paragraph to take up remaining space */
  margin: 0; /* Remove default margin */
}

.card .card-content p:not(.row p) {
  clear: both; /* Ensure the second paragraph starts below the row */
}

.card .card-content p + p {
    margin-top: 0.5rem;
}

/* make the avatar float-left, with bottom margin */
.card-avatar {
  float: left;
  width: 80px;
  height: 90px;
  margin: 0 1rem 1rem 0;
  border-radius: 5%;
  object-fit: cover;
  box-shadow: var(--box-shadow);
}



.intro-pic {
  float: left;
  width: 170px;
  height: 120px;
  margin: 0 1rem 1rem 0rem;
  border-radius: 6%;
  object-fit: cover;
  box-shadow: var(--box-shadow);
}



.toggle-all {
  display: inline-block;
  /* margin: 1rem auto; */
  padding: 0rem 5rem;
  background: var(--bg);
  color: var(--accent);
  border: none;
  border-radius: 4px;
  cursor: pointer;
}
.toggle-all:hover {
  background: var(--border);
}


.footnote {
    font-size: 0.85em;
    color: var(--gray-0);
    /* padding-top: 0.5rem; */
}



/* ── COLLAPSIBLE (JS-driven) ───────────────────────────────────────── */
details.card summary {
  /* keep your marker-hiding & triangle here */
  list-style: none;
  display: flex;
  align-items: center;
  background: var(--accent);
  color: var(--fg-fg);
  font-weight: bold;
  padding: .6rem 1rem;
  cursor: pointer;
}
details.card summary::-webkit-details-marker { display: none; }
details.card summary::after {
  content: "▸";
  margin-left: auto;
  transition: transform .2s ease;
}
details.card[open] summary::after {
  transform: rotate(90deg);
}

/* all we need on the content box */
details.card > .card-content {
  overflow: hidden;
  /* JS will set max-height, opacity & padding inline */
  transition:
    max-height .2s ease,
    opacity    .2s ease,
    padding    .2s ease;
}





.card.flash {
  outline: 2px solid red;
  outline-offset: -2px;
  animation: flash-border 0.4s linear 5;
  animation-iteration-count: 5;
}

@keyframes flash-border {
  0%, 100%   { outline-color: var(--red-fg);}
  50%  { outline-color: transparent; }
}




/* ── HEADERS  ─────────────────────────────────────────────────── */

.page-content {
  width: 100%;
  max-width: 57ch;
  margin: 1.2rem auto;
  padding: 0 1rem;
  box-sizing: border-box;
}


.intro {
  width: 100%;
  max-width: 57ch;
  margin: 1.1rem auto;
  padding: 0 1rem;
  box-sizing: border-box;
  font-size: 1.2em;
  line-height: 1.3;
  color: #fabd2f;
  font-style: italic;
}

.intro-section {
    padding: 1em;
    background-image: url("../assets/bg2.png");
    /* background-image: url("../assets/bg.jpg"); */
    background-repeat: no-repeat;
    background-size: cover;
    /* background-color: var(--bg-fg); */
    background-color: rgba(100, 100, 100, 0.8);
    background-position: center center;
    background-blend-mode: multiply;
}



.intro-byline {
  width: 100%;
  max-width: 67ch;
  margin: 0.2rem auto 1.5rem;
  font-size: 0.8em;
  color: #504945;
  font-style: italic;
  text-align: right;
}

.intro-byline a {
  color: #076678;
  text-decoration: none;
}

.intro-content {
  width: 100%;
  max-width: 57ch;
  margin: 1.1rem auto;
  padding: 0 1rem;
  box-sizing: border-box;
  font-size: 1.05em;
  line-height: 1.25;
  color: var(--fg);
}


/* ── Diagram arrow  ─────────────────────────────────────────────────── */
.context-arrow {
  text-align: center;
  font-size: 1.6rem;
  color: var(-fg-fg);
  margin: -1.4rem 0 -1.5rem;
}


/* ── TOOLTIP PREVIEW ─────────────────────────────────────────── */
.tooltip-card {
  position: absolute;
  z-index: 2000;
  pointer-events: none;
  visibility: hidden;
  padding: 0;
  opacity: 0;
  margin: 0;
  transition: opacity .5s ease;  /* 0 .5 s fade-in/out */
  font-size: 0.8em;
}

.tooltip-card.show {
    opacity: 1;
    pointer-events: auto;
    visibility: visible;
}

/* keep the previewed card neat */
.tooltip-card .card {
  max-width: 56ch;
  margin: 0;         /* override the regular outer margin */
}


/* ── FAQ tooltip links ────────────────────────────────────────── */
/* give every link that spawns a FAQ-tooltip a distinct look */
a.faq-link {
  color: var(--orange-0);     /* pick any colour you like */
  text-decoration: none;
}

/* drop the disclosure triangle inside the preview */
.tooltip-card summary::after { display: none; }



/* ── UNIVERSAL TOOLTIP BOX ───────────────────────────────────── */
.tooltip-box {
  position: absolute;
  z-index: 1500;
  background: var(--bg);
  color: var(--fg-bg);
  font-size: 0.75em;
  padding: 0.6rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  box-shadow: var(--box-shadow);
  max-width: 42ch;     /* feel free to tweak */
  max-height: 70vh;
  overflow: auto;      /* scroll if huge */
  pointer-events: auto;
  opacity: 0;
  transition: opacity .3s ease;
}
.tooltip-box.show { opacity: 1; }


a.tooltip {
    text-decoration: none;
    color: var(--yellow-fg);
}


/* -- GENETIC CODE TABLE ────────────────────────────────────── */
.genetic-code {
  border-collapse: collapse;
  font-family: ui-monospace, monospace;
  font-size: 0.5em;
  background: var(--bg-fg);
}
.genetic-code th,
.genetic-code td { border: 1px solid var(--gray-0); padding: .25em .5em; color:var(--fg-bg); white-space: nowrap;}
/* .genetic-code#gc-general td { border: 1px solid var(--gray-bg); } */
.genetic-code thead th { background:var(--bg-fg); color:var(--fg); text-align:center; }
.genetic-code tbody th { background:var(--bg-fg); color:var(--fg);}
.genetic-code code { font-weight:600; color:var(--fg-fg); }
/* .split { background:var(--blue-bg); } */
.unsplit { background:var(--gray-bg); }


.two-tables-row{
  display: inline-flex;
  align-items: flex-start;
  gap: 0.6em;                 /* whatever looks good */
  min-width: max-content;
}

.two-tables-col{
  display: inline-flex;
  flex-direction: column;
  align-items: center;        /* centers label under its table */
  gap: 0.4em;
}

.two-tables-label{
  font-size: 0.9em;             /* uses intro-content font size */
  text-align: center;
  white-space: nowrap;
  padding-top: 0.3em;
}

.two-tables-arrow{
  align-self: center;         /* vertically centered between tables */
  font-size: 1.3em;
  /* padding: 0 0.3em; */
  white-space: nowrap;
}

.two-tables-scroll{
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
}


.gc-table {
    width: 100%;
    margin: 0.8em auto;
    border-collapse: collapse;
    /* font-family: ui-monospace, monospace; */
    font-size: 0.8em;
    /* background: var(--bg-fg); */
}

.reverse-table {
    border-collapse: collapse;
    /* font-family: ui-monospace, monospace; */
    font-size: 0.9em;
    margin: 0.8em auto;
}
.reverse-table th,
.reverse-table td {
    border: 1px solid var(--bg-fg-2);
    padding: .15em .5em;
    color: var(--fg-bg);
    text-align: left;
}

.gc-arrow {
    font-size: 0.9em;
    color: var(--purple-0);
    vertical-align: middle;
    padding: 0 0.4em;
}

.gc-nn {
    font-size: 0.6em;
    font-family: ui-monospace, monospace;
    color: var(--gray-0);
    vertical-align: super;
    white-space: pre-wrap;
    /* vertical-align: middle; */
}


.gc-block {
    /* display: inline-block; */
    /* width: 0.8em; */
    /* height: 0.8em; */
    /* margin-right: 0.2em; */
    /* border-radius: 3px; */
    padding: 0.5em 0.5em;
    /* padding-left: 1em; */
    border: 1px solid var(--bg-fg-2);
    font-size: 0.9em;
    text-align: left;
  padding-left: 2em;   /* adjust visually */
  padding-right: 0.4em;  /* optional symmetry */
}

.tooltip-box .genetic-code {
    float: right;          /* park the table on the right */
    margin: 0 0 1.2em 1.2em;/* space: top 0  right 0  bottom .75em  left 1rem */
    /* optional: limit width so it never overflows the tooltip */
    max-width: 18rem;
}



code {
  font-family: monospace;
  background-color: var(--bg-fg);
  padding: 0.2em 0.4em;
  border-radius: 4px;
  font-size: 0.95em;
}



/* Match your <code> palette */
.aa-pill {
  fill: var(--bg-fg);
  stroke: var(--bg-fg);
  stroke-width: 1;
}

.aa-label {
  font-family: var(--code-font, ui-monospace, SFMono-Regular, Menlo, monospace);
  font-size: 18px;
  fill: var(--fg);
}


.aa-name {
  font-family: var(--code-font, ui-monospace, SFMono-Regular, Menlo, monospace);
  font-size: 14px;
  fill: var(--fg-bg-3);
}


.base-name {
  font-family: var(--code-font, ui-monospace, SFMono-Regular, Menlo, monospace);
  font-size: 15px;
  fill: var(--fg-bg-3);
}

ul {
  margin-top: 1em;     /* vertical spacing above the list */
  padding-left: 2em;   /* indentation for bullets */
}

li {
  margin-bottom: 0.5em; /* spacing between bullet points (optional) */
}




/* ——— Genetic code and reverse tables: keep mappings on single lines ——— */
.gc-table .gc-block {
  white-space: nowrap;       /* no automatic wrapping within lines */
  line-height: 1.35;
  padding-left: 2em;   /* adjust visually */
  padding-right: 1em;   /* adjust visually */
}


.reverse-table td {
  white-space: nowrap;       /* no automatic wrapping within lines */
  line-height: 1.35;
  padding-left: 1em;   /* adjust visually */
  padding-right: 1em;   /* adjust visually */
}

/* ensure all inline parts respect nowrap */
.gc-table .gc-block .gc-arrow,
.gc-table .gc-block code,
.gc-table .gc-block stp,
.gc-table .gc-block .cdn-wrap,
.reverse-table td * {
  display: inline-block;
  white-space: inherit;
}

/* allow both tables to grow horizontally and scroll on small screens */
/* .intro-content, */
.table-container {
  overflow-x: auto;
}

.intro-content .gc-table,
.table-container .reverse-table {
  width: max-content;        /* expand to fit full contents */
  min-width: 100%;
}

/* small screens: slightly smaller text */
@media (max-width: 560px) {
  .gc-table,
  .reverse-table {
    font-size: 0.95em;
  }
}

/* ——— restore preserved spacing for nucleotide notation elements ——— */
.gc-nn {
  white-space: pre-wrap !important;  /* respect original spacing and line breaks */
  display: inline;                   /* keep natural flow */
}


/* .gcblock .gcframe{ */
/*   display:inline-block; */
/*   border:2px solid red; */
/*   padding:2px 6px; */
/*   border-radius:4px; */
/* } */
/* .gcblock .gcline{ display:block; } */


/* .gcline{display:block;padding:0px 0px} */
/* .gcline.sel{border-left:1px solid red;border-right:1px solid red} */
/* .gcline.sel.start{border-top:1px solid red;border-top-left-radius:1px;border-top-right-radius:1px} */
/* .gcline.sel.end{border-bottom:1px solid red;border-bottom-left-radius:1px;border-bottom-right-radius:1px} */

td table {
  width: 100%;
  border-collapse: collapse;
  border: none !important;
}
td table td {
  border: none !important;
  padding: 0px 2px !important;
}



:root { --hl-phrase: "dark"; }
:root { --hl-phrase-opposite: "light"; }
html[data-theme="dark"] { --hl-phrase: "light"; --hl-phrase-opposite: "dark"; }
.theme-text::after { content: var(--hl-phrase); }
.theme-text-opposite::after { content: var(--hl-phrase-opposite); }




/* ── ADMONITION-LIKE CARDS ─────────────────────────────────────────── */

:root { --admon-scale: .95; }

.admon {
  border-left: 4px solid var(--accent);
  border-bottom: 1px solid var(--accent);
  background: var(--bg-bg);
  /* color: var(--fg-bg-4); */
  color: var(--gray-0);
  border-radius: 6px;
  margin: 1.2rem auto;
  max-width: 56ch;
  line-height: 1.3;
  box-shadow: var(--box-shadow);
  overflow: hidden;
  /* font-size: 0.95em; */
  font-size: calc(1rem * var(--admon-scale));
  -webkit-text-size-adjust: 100%; /* reduce mobile font boosting */
  text-size-adjust: 100%;

}

/* header bar similar to .card-header but thinner */
.admon .admon-title {
  background: var(--accent);
  color: var(--fg-fg);
  font-weight: bold;
  padding: 0.4rem 0.9rem;
  font-size: 0.8em;
  display: flex;
  align-items: center;
}

/* body area with smaller, compact text */
.admon .admon-content {
  padding: 0.7rem 1rem 0.8rem;
  font-size: 0.9em;
  line-height: 1.35;
}

/* optional icon styling (if needed) */
.admon .admon-icon {
  margin-right: 0.5rem;
  font-size: 1.1em;
}


.float-right{
  float: right;
  margin: 0 0 0.6em 0.8em; /* top right bottom left */
  max-width: 10%;         /* optional */
  height: auto;
}


.nowrap {
  white-space: nowrap;
}



.site-footer {
  margin-top: 3rem;
  padding: 1.5rem 0;
  text-align: center;
  font-size: 0.9rem;
  color: var(--gray-0);
  border-top: 1px solid var(--bg-fg-4);
}

.site-footer a {
  color: inherit;
  text-decoration: none;
}

.site-footer a:hover {
  text-decoration: underline;
}

cmnt {
  font-size: 0.85em;
  color: var(--gray-0);
  font-style: italic;
}


.gamow-table {
    border-collapse: collapse;
    font-size: 0.8em;
    margin: 0.8em auto;
    border: 1px solid var(--bg-fg-2);
}
.gamow-table th,
.gamow-table td {
    border: 1px solid var(--bg-fg-2);
    padding: .3em .5em;
    color: var(--fg-bg);
    text-align: left;
}
