:root {
    --primary-font: 'CharisW', sans-serif;
    --header-font: 'CharisW', sans-serif;
    --subhead-font: 'CharisW', sans-serif;
    --primary-bg-color: #e0f7f4;
    --secondary-bg-color: #c3d7d4;
    --primary-color: #333333;
    --header-color: #2b788c;
    --subhead-color: #1a5561;
    --accent-color: #6ec1a4;
    --button-color: #6ec1a4;
    --border-color: #ccc;
    --border-thickness: 1px;
    --border-radius: 8px;
    --padding-standard: 15px;
    --max-width: 800px;
    --line-height: 1.6;
    --box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --gradient-bg: linear-gradient(135deg,  #e0f7f4, #f8f9fa);
    --text-bg: white;
    --text-col: black;
    --link-col: purple;
    --gloss-color: #444;
    --column-rule-color: lightblue;
    --status-ok-color: #2e7d32;
    --status-err-color: #b00020;
    --shadow-weak: 2px 2px 4px rgba(0,0,0,.25);
    --shadow-mid: 3px 3px 4px rgba(0,0,0,.35);
    --shadow-strong: 3px 3px 6px rgba(0,0,0,.45);
    --question-border: #0074d9;
    --mobile-toolbar-bg: #fffffff0;
    --mobile-toolbar-border: #ccc;
    --diff-add-fg: #0a0;
    --diff-add-bg: #eaffea;
    
    --diff-del-fg: #a00;
    --diff-del-bg: #ffecec;
}

/* dark mode overrides */
@media (prefers-color-scheme: dark) {
    :root {
        --primary-bg-color: #122527;
	--secondary-bg-color: #0e1f20;
        --primary-color: #e5f7f5;
        --header-color: #8dd7df;
        --subhead-color: #79b8bf;
        --accent-color: #5ab394;
        --button-color: #122527;

        --border-color: #2d3a3a;
        --box-shadow: 0 4px 6px rgba(0, 0, 0, 0.4);
        --gradient-bg: linear-gradient(135deg, #1a3537, #0f1a1b);
	--text-bg: black;
	--text-col: white;
	--link-col: pink;
	--gloss-color: #bbb;
	--column-rule-color: #366;
	--status-ok-color: #6fcf97;
	--status-err-color: #ff6b6b;
	--shadow-weak: 2px 2px 4px rgba(0,0,0,.6);
	--shadow-mid: 3px 3px 4px rgba(0,0,0,.65);
	--shadow-strong: 3px 3px 6px rgba(0,0,0,.75);
	--question-border: #3b82bf;
	--mobile-toolbar-bg: #000000d0;
	--mobile-toolbar-border: #444;
        --diff-add-fg: #7dff7d;
        --diff-add-bg: #113311;
	
        --diff-del-fg: #ff7d7d;
        --diff-del-bg: #331111;
    }
}

/* use Charis - Regular in .woff2 format */
@font-face {
    font-family: CharisW;
    font-weight: 400;
    src: url(fonts/Charis-Regular.woff2);
}
/* use Charis - Medium in .woff2 format */
@font-face {
    font-family: CharisW;
    font-weight: 500;
    src: url(fonts/Charis-Medium.woff2);
}
/* use Charis - SemiBold in .woff2 format */
@font-face {
    font-family: CharisW;
    font-weight: 600;
    src: url(fonts/Charis-SemiBold.woff2);
}
/* use Charis - Bold in .woff2 format */
@font-face {
    font-family: CharisW;
    font-weight: 700;
    src: url(fonts/Charis-Bold.woff2);
}
/* use Charis - Italic in .woff2 format */
@font-face {
    font-family: CharisW;
    font-weight: 400;
    font-style: italic;
    src: url(fonts/Charis-Italic.woff2);
}
/* use Charis - MediumItalic in .woff2 format */
@font-face {
    font-family: CharisW;
    font-weight: 500;
    font-style: italic;
    src: url(fonts/Charis-MediumItalic.woff2);
}
/* use Charis - SemiBoldItalic in .woff2 format */
@font-face {
    font-family: CharisW;
    font-weight: 600;
    font-style: italic;
    src: url(fonts/Charis-SemiBoldItalic.woff2);
}
/* use Charis - BoldItalic in .woff2 format */
@font-face {
    font-family: CharisW;
    font-weight: 700;
    font-style: italic;
    src: url(fonts/Charis-BoldItalic.woff2);
}

body {
    font-family: var(--primary-font);
    background: var(--gradient-bg);
    color: var(--primary-color);
    margin: 0;
    line-height: var(--line-height);
}

.layout {
    display: grid;
    grid-template-columns: 14rem minmax(0, 1fr);
    column-gap: 2rem;

    /* outer padding: small on left so identity feels "in the margin",
       more forgiving elsewhere */
    padding: 2rem 1.5rem 2rem 1rem;
}

.page {
    max-width: 60rem;   /* optional: keep content readable */
    margin: 0;          /* grid handles placement */
    padding: var(--padding-standard);
    background: var(--secondary-bg-color);
    box-shadow: var(--box-shadow);
    border-radius: var(--border-radius);
}

a {
    color: var(--link-col);
}

header {
    text-align: center;
    margin-bottom: 2em;
}

.logo {
    max-width: 80px;
    height: auto;
    vertical-align: middle;
    margin-right: 10px;
}


.site-header {
    align-self: start;
    position: sticky;   /* optional but delicious */
    top: 1.5rem;
}

.site-identity {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.6rem;
    text-decoration: none;
    color: inherit;
}

.site-identity .logo {
    width: 3.2rem;
    height: auto;
    align-self: center;
}

.site-identity:hover { text-decoration: none; }

.site-identity:focus-visible {
    outline: 2px solid var(--accent-color);
    outline-offset: 4px;
}

.site-title {
    font-family: var(--header-font);
    font-size: 1.4rem;
    white-space: nowrap;
    color: var(--header-color);
}

.site-tagline {
    font-size: 0.95rem;
    font-style: italic;
    line-height: 1.3;
    max-width: 14rem;   /* keeps it from sprawling */
    opacity: 0.85;
}

.page-title {
    font-family: var(--header-font);
    font-size: 2.6rem;
    line-height: 1.15;
    text-align: left;   /* now it makes sense */
    margin: 0 0 1rem 0;
}

.sidebar{
  padding: var(--padding-standard);
  background: rgba(0,0,0,0.65);
  box-shadow: var(--box-shadow);
  border-radius: var(--border-radius);
}

.sidebar ul{
  list-style: none;
  margin: 0;
  padding: 0;
}

.sidebar li{
  margin: 0.4rem 0;
}

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

.sidebar a:hover{
  text-decoration: underline;
}

.sidebar .current{
  font-weight: 700;
}
.sidebar{
  padding: var(--padding-standard);
  background: rgba(0,0,0,0.65);
  box-shadow: var(--box-shadow);
  border-radius: var(--border-radius);
}

.sidebar ul{
  list-style: none;
  margin: 0;
  padding: 0;
}

.sidebar li{
  margin: 0.4rem 0;
}

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

.sidebar a:hover{
  text-decoration: underline;
}

.sidebar .current{
  font-weight: 700;
}
.sidebar{
  padding: var(--padding-standard);
  background: rgba(0,0,0,0.65);
  box-shadow: var(--box-shadow);
  border-radius: var(--border-radius);
}

.sidebar ul{
  list-style: none;
  margin: 0;
  padding: 0;
}

.sidebar li{
  margin: 0.4rem 0;
}

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

.sidebar a:hover{
  text-decoration: underline;
}

.sidebar .current{
  font-weight: 700;
}

h1 {
    counter-reset: h2counter h3counter h4counter;
    font-family: var(--header-font);
    font-size: 2.6rem;
    line-height: 1.15;
    color: var(--header-color);
    text-align: center;
    margin-bottom: 0.3em;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5em; /* space between logo and text */
    flex-wrap: wrap;
}

.subtitle {
    font-family: var(--primary-font);
    font-size: 1.2rem;
    color: var(--primary-color);
    text-align: center;
    margin-top: -0.4em;
    margin-bottom: 1em;
    font-style: italic;
    line-height: 1.4;
    max-width: 38em;
    margin-left: auto;
    margin-right: auto;
}
h2 {
    font-family: var(--subhead-font);
    margin-top: 1.5em;
    margin-bottom: 0.5em;
    color: var(--primary-color);
    counter-increment: h2counter;
    counter-reset: h3counter h4counter;
}

h3 {
    font-family: var(--subhead-font);
    margin-top: 1.5em;
    margin-bottom: 0.5em;
    color: var(--primary-color);
    counter-increment: h3counter;
    counter-reset: h4counter;
}

h4 {
    font-family: var(--subhead-font);
    margin-top: 1.5em;
    margin-bottom: 0.5em;
    color: var(--primary-color);
    counter-increment: h4counter;
}

h2:before {
    content: counter(h2counter) ".\00a0\00a0";
    font-weight: normal;
    color: var(--accent-color);
}

h3:before {
    content: counter(h2counter) "." counter(h3counter) ".\00a0\00a0";
    font-weight: normal;
    color: var(--accent-color);
}

h4:before {
    content: counter(h2counter) "." counter(h3counter) "." counter(h4counter) ".\00a0\00a0";
    font-weight: normal;
    color: var(--accent-color);
}

.diff-add {
    color: var(--diff-add-fg);
    background: var(--diff-add-bg);
}

.diff-del {
    color: var(--diff-del-fg);
    background: var(--diff-del-bg);
}

option {
    background-color: var(--text-bg);
    color: var(--text-col);
    border: 1px solid var(--border-color);
}

select {
    background-color: var(--button-color);
    color: var(--text-col);
    border: 5px solid var(--border-color);
    padding: 0.4em;
    border-radius: 10px;
    border: 2px;
}

/* optional: hover / focus */
select:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 3px var(--accent-color);
}

button {
    background-color: var(--button-color);
    border: 1px solid var(--border-color);
    color: var(--text-col);
    background-color: var(--accent-color);
    color: #083c33; /* dark enough to read on accent */

    border: 0;
    padding: 10px;
    border-radius: 16px;

    font-size: 0.75rem;
    font-weight: 700;
    box-shadow: var(--shadow-mid);
}

input {
    background-color: var(--text-bg);
    color: var(--text-col);
}

div.pron {
    margin-top: 0;
    margin-bottom: .5em;
}
div.pron p {
    margin: 0;
}

div.ortho {
    margin-top: 0;
    margin-bottom: 0;
    font-weight: bold;
}

.interlinear {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8em;              /* horizontal spacing between pairs */
    align-items: flex-end;   /* keeps gloss rows aligned along baseline */
    margin-bottom: 0.4em;
}

.ilpair {
    display: inline-block;
    text-align: left;
    vertical-align: bottom;
    margin: 0 0.15em;
    line-height: 0.7;      /* tightens the gap */
    white-space: nowrap;
}

.ilpair .mor {
    display: block;
    line-height: 1.0;      /* keeps mor and gls snug */
}

.ilpair .gls {
    display: block;
    font-size: 0.85em;
    color: var(--gloss-color);
    line-height: 1.0;
    margin-top: -0.15em;   /* fine-tune this until it looks right */
}

table.numexample {
    width: calc(100% - 2em);
    margin-left: 1em;
    border-left: .5em solid var(--primary-bg-color);
    padding-left: .5em;
}

table.orthotable {
    width: calc(100% - 2em);
    margin-left: 1em;
    border-left: .5em solid var(--primary-bg-color);
    padding-left: .5em;
}

td.example {
    width: 90%;
}

td.example p {
    margin: 0;
}

td.number {
    vertical-align: top;
}

table.chart {
    width: 100%;
    border: var(--border-thickness) solid black;
    border-collapse: collapse;
    margin-top: 1em;
}

th.chart {
    background-color: var(--primary-bg-color);
    border: var(--border-thickness) solid var(--border-color);
    padding: 0.75rem 0;
}

td.chart {
    background-color: var(--secondary-bg-color);
    border: var(--border-thickness) solid var(--border-color);
    text-align: center;
    padding: 0.5rem;
}

div.dict {
    column-count: 3;
    column-gap: 20px;
    column-rule: var(--border-thickness) solid var(--column-rule-color);
    margin-top: 1em;
}

ul.dict {
    list-style-type: none;
    padding-left: 1em;
    text-indent: -1em;
    margin: 0;
}

ul.dict li {
    break-inside: avoid;
}

#applyStatus { margin-left:.5rem; font-size:.95em; }
#applyStatus.ok { color: var(--status-ok-color); }
#applyStatus.err{ color: var(--status-err-color); }
.ok { color: var(--status-ok-color); }
.err { color: var(--status-err-color); }
.flash { animation: fadeout 1.2s ease-in forwards; }
@keyframes fadeout { 0%{opacity:1} 80%{opacity:1} 100%{opacity:0} }

.mobile-toolbar {
  display: none;
}

/* -------------------------------------------------
   Floating navigation controls (calm edition)
   ------------------------------------------------- */

/* -------------------------------------------------
   Primary action: Submit
   ------------------------------------------------- */

.float {
    position: fixed;
    bottom: 15px;
    left: 15px;

    width: 60px;
    height: 60px;

    background-color: var(--accent-color);
    color: #083c33; /* dark enough to read on accent */

    border: none;
    border-radius: 16px;

    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;

    display: flex;
    align-items: center;
    justify-content: center;

    box-shadow: var(--shadow-mid);

    opacity: 0.95;
    transition:
        transform 0.15s ease,
        box-shadow 0.2s ease,
        background-color 0.2s ease;
}

.float:hover {
    background-color: #5da894; /* slightly darker accent */
    box-shadow: var(--shadow-strong);
    transform: translateY(-1px);
}

.float:active {
    transform: translateY(0);
    box-shadow: var(--shadow-mid);
}

/* shared style for arrow buttons */
.top-btn,
.bot-btn {
    position: fixed;
    bottom: 15px;

    width: 44px;
    height: 44px;

    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 10px;

    color: var(--accent-color);
    font-size: 1.6rem;
    font-weight: 600;

    display: flex;
    align-items: center;
    justify-content: center;

    box-shadow: var(--shadow-weak);
    opacity: 0.75;

    transition:
        opacity 0.2s ease,
        box-shadow 0.2s ease,
        background-color 0.2s ease,
        transform 0.15s ease;
}

/* horizontal grouping */
.top-btn { left: 92px; }
.bot-btn { left: 144px; }

.top-btn:hover,
.bot-btn:hover {
    opacity: 1;
    background-color: var(--secondary-bg-color);
    box-shadow: var(--shadow-mid);
    transform: translateY(-1px);
}

.top-btn:active,
.bot-btn:active {
    transform: translateY(0);
    box-shadow: var(--shadow-weak);
}

.questionbox {
    background-color: var(--secondary-bg-color);
    border: 1px solid #0074D9;
    padding: 1em;
    margin: 1em;
}

.tocbox {
    background-color: var(--secondary-bg-color);
    border: 1px solid #0074D9;
    padding: 1em;
    margin: 1em;
}

.tocbox a {
    text-decoration: none;
    color: var(--text-col);
}

.tocbox a:hover {
    text-decoration: underline;
}

.tocbox ol {
    counter-reset: item;
    list-style: none;   /* hide the default browser numbers */
    padding-left: 1.5rem;
}

.tocbox li {
    counter-increment: item;
    margin: .25rem 0;
}

.tocbox li::before {
    content: counters(item, ".") ". ";
}




table.showcase {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed; /* forces columns to share space sensibly */
}

table.showcase th,
table.showcase td {
    padding: 0.6rem 0.8rem;
    vertical-align: top;
    text-align: left;
}

table.showcase th {
    border-bottom: 2px solid #444;
    font-weight: 600;
}


/* Column proportions */
table.showcase th:nth-child(1),
table.showcase td:nth-child(1) {
    width: 30%;
}

table.showcase th:nth-child(2),
table.showcase td:nth-child(2) {
    width: 45%;
}

table.showcase th:nth-child(3),
table.showcase td:nth-child(3) {
    width: 25%;
    white-space: nowrap;
}

/* Subtle zebra striping */
table.showcase tr:nth-child(even) td {
    background: var(--secondary-bg-color);
}

/* Make the placeholder text look intentional */
table.showcase em {
    color: #666;
    font-style: italic;
}


@media print {
    :root {
	--primary-bg-color: #ffffff;
	--primary-color: #000000;
	--header-color: #000000;
	--subhead-color: #000000;
	--accent-color: #000000;
	--box-shadow: none;
	--gradient-bg: none;
    }
    body {
	background-color: white !important;
	padding: 0;
    }

    h1, h2, h3, h4, div.subhead {
	font-family: Palatino, serif;
    }

    table, table tr, table tr td, table tr th {
	page-break-inside: avoid;
    }

    th.chart {
	background-color: white;;
    }
    
    td.chart {
	background-color: white;
    }
    .questionbox {
	background-color: white;
    }
    a, a:visited {
	color: inherit !important;
	text-decoration: none !important;
    }
}

@media (max-width: 900px) {
    .layout {
        grid-template-columns: 1fr;
        row-gap: 1rem;
        padding: 1.25rem;
    }

    .site-header {
        position: static;
    }

    .page {
        max-width: none;
    }
}

@media (max-width: 600px) {
    body {
	margin: 0;
	padding: 1em;
	border-radius: 0;
	box-shadow: none;
	max-width: 100%;
	padding-bottom: 4.5rem; /* space so toolbar doesn’t cover content */
    }
    
    div.page {
	padding: 1em 0.5em;
	border-radius: 0;
	box-shadow: none;
    }
    
    .page-title, h1 {
        font-size: 2.1rem;
        line-height: 1.15;
    }

    .page-title {
        margin-bottom: 0.75rem;
    }

    div.dict {
	column-count: 1;
    }
    
    /* Hide the old floating buttons completely on mobile */
    .float,
    .top-btn,
    .bot-btn {
	display: none !important;
    }
    
    /* Show toolbar on mobile only */
    .mobile-toolbar {
	display: flex;
	position: fixed;
	bottom: 0;
	left: 0;
	right: 0;
	background: var(--mobile-toolbar-bg);
	border-top: 1px solid var(--mobile-toolbar-border);
	justify-content: space-around;
	padding: 0.6em 0.4em;
	z-index: 9999;
    }
    
    .mobile-toolbar button {
	background: var(--button-color);
	border: none;
	border-radius: 6px;
	padding: 0.6em 1em;
	font-size: 0.9rem;
	font-weight: 600;
	box-shadow: var(--shadow-weak);
    }
}

/* SVG stuff: */

svg.lcdiagram { color: var(--primary-color);}


svg.lcdiagram .stroke { stroke: var(--header-color); }
svg.lcdiagram .fill-soft { fill: var(--secondary-bg-color); }
svg.lcdiagram .fill-strong { fill: var(--primary-bg-color); }
svg.lcdiagram .fill-user { fill: var(--button-color); }

svg.lcdiagram .box {
  stroke-width: 2;
  rx: 16;
}

svg.lcdiagram .box-strong {
  stroke-width: 2;
  rx: 16;
}

svg.lcdiagram .box-internal {
  stroke-dasharray: 17 6;
}

svg.lcdiagram .user {
  stroke-width: 2.5;
}

svg.lcdiagram .title {
  font-family: CharisW, serif;
  font-size: 20px;
  font-weight: 600;
  fill: var(--primary-color);
}

svg.lcdiagram .label {
  font-family: CharisW, serif;
  font-size: 16px;
  font-weight: 500;
  fill: var(--primary-color);
}

svg.lcdiagram .small {
  font-family: CharisW, serif;
  font-size: 13px;
  fill: var(--primary-color);
}

svg.lcdiagram .mono {
  font-family: CharisW, serif;
  font-size: 15px;
  font-style: italic;
  fill: var(--primary-color);
}

svg.lcdiagram .arrow {
  fill: none;
  stroke-width: 2.5;
}

svg.lcdiagram .arrow-dash {
  fill: none;
  stroke-width: 2.5;
  stroke-dasharray: 7 6;
}

svg.lcdiagram .caption {
  font-family: CharisW, serif;
  font-size: 14px;
  fill: var(--primary-color);
}
