/* Small additions to Pico CSS (FastHTML's default styling) for the KaryoKE page. */
p.lead { color: var(--pico-muted-color); }

/* File drop area around the file button */
#drop { border: 2px dashed var(--pico-muted-border-color); border-radius: var(--pico-border-radius);
        padding: 1rem; text-align: center; color: var(--pico-muted-color); margin-bottom: 1rem; }
#drop.over { border-color: var(--pico-primary); background: var(--pico-primary-focus); }
#drop input[type=file] { width: auto; margin: 0; }

textarea { font-family: var(--pico-font-family-monospace); font-size: 0.8rem; }

/* "Drawing karyograms..." next to the button, shown by htmx while a run is going */
#busy { margin-left: 1rem; }

/* Result box buttons side by side */
.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.error strong { color: var(--pico-del-color); }
pre { max-height: 50vh; overflow: auto; font-size: 0.8rem; padding: 0.75rem; }

/* Title and byline on the left, logo on the right, the same height and centred together as one group.
   Stacked on narrow screens (phones). */
.site-header { display: flex; align-items: center; justify-content: center; gap: 2.5rem; margin: 1.5rem 0 2rem; }
.site-header h1 { margin-bottom: 1.25rem; font-size: 6rem; line-height: 1; }
.site-header h1 small { display: block; font-size: 2.2rem; font-weight: 500; line-height: 1.2;
                        color: var(--pico-muted-color); margin-top: 0.6rem; }
.site-header .byline { color: var(--pico-muted-color); margin: 0; font-size: 1.25rem; }
.site-header img { height: 228px; width: auto; max-width: 45%; object-fit: contain; }
@media (max-width: 1023px) {
  .site-header { flex-direction: column-reverse; gap: 1rem; text-align: center; }
  .site-header h1 { font-size: 3rem; }
  .site-header h1 small { font-size: 1.3rem; }
  .site-header img { height: auto; width: 360px; max-width: 100%; }
}

/* Contact links at the bottom of the page */
.site-footer { display: flex; justify-content: center; gap: 1.5rem; margin-top: 3rem; padding: 1.5rem 0;
               border-top: 1px solid var(--pico-muted-border-color); }

/* Everything under the header centred, to match the title and logo. The form is kept to a readable width. */
p.lead { text-align: center; max-width: 52rem; margin-left: auto; margin-right: auto; }
main form, #result { max-width: 52rem; margin-left: auto; margin-right: auto; }
main form fieldset { text-align: center; }
main form legend { width: 100%; text-align: center; font-weight: 600; }
main form fieldset > label { display: inline-flex; align-items: center; margin: 0 0.75rem 0.5rem; }
main form .grid fieldset > label { display: flex; justify-content: center; }
main form small { display: block; text-align: center; }
main form textarea { text-align: left; }
#result article { text-align: center; }
#result .actions { justify-content: center; }
#result pre { text-align: left; }

/* The two sections of the page: "How to use" and "Input SDD or SDR files". Headings centred like the rest;
   the guide's own text stays left-aligned for reading, in a centred column as wide as the form. */
main > section { margin-top: 2.5rem; }
main > section > h2 { text-align: center; font-size: 2rem; padding-bottom: 0.5rem;
                      border-bottom: 1px solid var(--pico-muted-border-color); }
.guide { max-width: 52rem; margin: 0 auto; }
.guide h3 { font-size: 1.25rem; margin-top: 1.75rem; }
.guide img { max-width: 100%; border: 1px solid var(--pico-muted-border-color); border-radius: var(--pico-border-radius); }

/* Collapsible "How to use": the heading looks like the other section headings, with a
   "Show instructions" / "Hide instructions" hint under it instead of Pico's arrow at the far right */
#how-to-use details { border-bottom: 1px solid var(--pico-muted-border-color); padding-bottom: 0.5rem; margin: 0; }
#how-to-use summary { text-align: center; }
#how-to-use summary::after { display: none; }
#how-to-use summary h2 { display: inline; font-size: 2rem; margin: 0; }
#how-to-use summary .hint { display: block; font-size: 0.9rem; color: var(--pico-primary); }
#how-to-use summary .hint::before { content: "Show instructions \25BE"; }
#how-to-use details[open] summary .hint::before { content: "Hide instructions \25B4"; }
#how-to-use summary:hover .hint { text-decoration: underline; }
#how-to-use .guide { padding-top: 1rem; }
