/* ============================================================
   EJOLTS — Redesigned main.css
   Tone: Academic / scholarly, neutral greys and slate
   Fonts: 'Lora' (serif body), 'Inter' (UI/nav)
   ============================================================ */

/* --- Tokens --- */
:root {
	--col-bg:        #f8f8f6;
	--col-surface:   #ffffff;
	--col-border:    #d4d4cc;
	--col-border-light: #e8e8e4;
	--col-text:      #1e1e1e;
	--col-text-mid:  #4a4a4a;
	--col-text-muted:#7a7a78;
	--col-accent:    #3d5a80;   /* slate-blue: links, highlights */
	--col-accent-lt: #eef2f7;   /* light tint of accent */
	--col-nav-bg:    #2c3e50;   /* dark slate nav */
	--col-nav-text:  #e8ecf0;
	--col-nav-hover: #3d5a80;
	--col-indent:    #cbd5e1;   /* left-border on nested comments */
	--col-thread-0:  #ffffff;
	--col-thread-1:  #f4f6f9;
	--col-thread-2:  #edf0f5;
	--col-thread-3:  #e6eaf1;
	--font-serif:    'Lora', Georgia, 'Times New Roman', serif;
	--font-ui:       'Inter', system-ui, sans-serif;
	--max-w:         780px;
	--radius:        6px;
	--radius-sm:     4px;
}

#page_1 {
	--max-w:         980px;
}

/* --- Reset baseline --- */
*, *::before, *::after { box-sizing: border-box; }

/* --- Base --- */
html {
	scroll-padding-top:200px;
}
body {
	font-family: var(--font-serif);
	font-weight: 400;
	font-size: 17px;
	line-height: 1.75;
	color: var(--col-text);
	background: var(--col-bg);
}

b, strong { font-weight: 700; }
i, em, emphasis { font-style: italic; }
dfn { cursor: help; border-bottom: 1px dotted var(--col-text-muted); }
th { text-align: left; }

p { margin: 0.6em 0; }

h1 { font-size: 1.75rem; font-weight: 700; margin: 0.5em 0 0.3em; line-height: 1.3; }
h2 { font-size: 1.35rem; font-weight: 400; margin: 0.5em 0 0.3em; line-height: 1.35; color: var(--col-text-mid); font-style: italic; }
h3 { font-size: 1.25rem; font-weight: 700; margin: 0.5em 0; }
h4 { font-size: 1.1rem;  font-weight: 700; margin: 0.5em 0; }
h5 { font-size: 1rem;    font-weight: 700; margin: 0.4em 0; }
h6 { font-size: 0.95rem; font-weight: 700; margin: 0.4em 0; }

a {
	color: var(--col-accent);
	text-decoration: underline;
	text-decoration-color: transparent;
	text-underline-offset: 3px;
	transition: text-decoration-color 0.15s;
}
a:hover { text-decoration-color: var(--col-accent); }

ol li {list-style-type:decimal;}
ul li {list-style-type:disc;}

/* --- Skip link --- */
#skip_link {
	position: absolute;
	top: 0;
	left: 50%;
	width: 200px;
	margin-left: -100px;
	background: var(--col-nav-bg);
	color: var(--col-nav-text);
	padding: 5px;
	text-align: center;
	font-family: var(--font-ui);
	font-size: 0.85rem;
	z-index: 5000;
	border-radius: 0 0 8px 8px;
	transform: rotateX(90deg);
	transform-origin: top;
	outline: 0;
}
#skip_link:focus { transform: rotateX(0); transition: all 0.3s ease-in-out; }
#skip_link:not(:focus) { transform: rotateX(90deg); transition: all 0.3s ease-in-out; }

/* --- Navigation --- */
header { position: fixed; top: 0; left: 0; right: 0; z-index: 100; }

nav {
	background: var(--col-nav-bg);
	padding: 0 24px;
	display: flex;
	align-items: center;
	min-height: 64px;
	font-family: var(--font-ui);
}

nav img#logo {
	height: 48px;
	display: block;
	margin: 8px 0;
}

nav menu {
	display: none;
	margin: 0;
	padding: 0;
	list-style: none;
}

nav menu li {
	display: inline-block;
}

nav menu li a {
	display: inline-block;
	color: var(--col-nav-text);
	text-decoration: none;
	font-size: 0.875rem;
	font-weight: 500;
	letter-spacing: 0.02em;
	padding: 8px 14px;
	border-radius: var(--radius-sm);
	transition: background 0.15s, color 0.15s;
}

nav menu li a:hover {
	background-color: var(--col-nav-hover);
	color: #fff;
}

#menu_opener {
	color: var(--col-nav-text);
	font-size: 26px;
	text-decoration: none;
	line-height: 1;
}

/* cloned nav set as fixed — handled by header now */
nav:last-child {
	position: static;
}

/* --- Main content --- */
main {
	max-width: var(--max-w);
	margin: 50px auto;
	padding: 32px 20px 60px;
	min-height: 60vh;
	font-size: 1rem;
}



/* --- Paper header section --- */
article.form_holder > section:first-child {
	border: none;
	border-bottom: 2px solid var(--col-border);
	border-radius: 0;
	padding: 24px 0 20px;
	margin: 0 0 8px;
	background: transparent;
}

article.form_holder > section:first-child h1 {
	font-size: 1.6rem;
	color: var(--col-text);
}

article.form_holder > section:first-child h2 {
	font-size: 1.05rem;
	color: var(--col-text-mid);
	font-style: normal;
	font-family: var(--font-ui);
	font-weight: 400;
	margin-top: 4px;
}

article.form_holder > section:first-child h2 a {
	color: var(--col-accent);
}

/* --- Generic section --- */
section {
	position: relative;
	border: 1px solid var(--col-border-light);
	border-radius: var(--radius);
	padding: 1.25em 1.25em 2.5em;
	margin: 1em 0;
	background: var(--col-surface);
}

/* --- Comment threading --- */
.comment {
	font-size: 0.97rem;
}

.comment_level_0 {
	margin-left: 0;
	background: var(--col-thread-0);
	border-left: 3px solid var(--col-accent);
}

.comment_level_1 {
	margin-left: 28px;
	background: var(--col-thread-1);
	border-left: 3px solid var(--col-indent);
}

.comment_level_2 {
	margin-left: 56px;
	background: var(--col-thread-2);
	border-left: 3px solid var(--col-border);
}

.comment_level_3,
.comment_level_4,
.comment_level_5,
.comment_level_6,
.comment_level_7,
.comment_level_8 {
	margin-left: 84px;
	background: var(--col-thread-3);
	border-left: 3px solid var(--col-border-light);
}

/* --- Comment meta line (author, date) --- */
.comment > p.comment_data {
	font-family: var(--font-ui);
	font-size: 0.8rem;
	color: var(--col-text-muted);
	margin-bottom: 0.8em;
	padding-bottom: 0.6em;
	border-bottom: 1px solid var(--col-border-light);
}

.comment > p.comment_data a {
	color: var(--col-text-mid);
	font-weight: 600;
}

/* --- Profile image (small, inline in comments) --- */
td.profile-small img,
img.profile-small {
	width: 26px;
	height: 26px;
	border-radius: 50%;
	aspect-ratio: 1 / 1;
	vertical-align: middle;
	margin: 0 4px 2px 0;
	border: 1px solid var(--col-border);
	object-fit: cover;
}

img.profile-medium {
	width: 80px;
	height: 80px;
	border-radius: 50%;
	aspect-ratio: 1 / 1;
	border: 2px solid var(--col-border);
	object-fit: cover;
}


.button_link,
.remove-btn {
	font-family: var(--font-ui);
	font-size: 0.78rem;
	font-weight: 600;
	color: var(--col-accent);
	text-decoration: none;
	letter-spacing: 0.03em;
	text-transform: uppercase;
	padding: 3px 10px;
	border: 1px solid var(--col-accent);
	border-radius: 3px;
	transition: background 0.15s, color 0.15s;
	cursor:pointer
}
	.button_link:hover,
	.remove-btn:hover {
		background: var(--col-accent);
		color: #fff;
		text-decoration: none;
	}

.remove-btn {
	margin:0 .5em;
}

.add_comment_link {
	position: absolute;
	bottom: 0.75em;
	right: 1em;
}

.edit_comment_link {
	position: absolute;
	bottom: 0.75em;
	right: 10em;
}



/* --- Footer --- */
footer { position: fixed; bottom: 0; left: 0; right: 0; z-index: 100; }
footer {
	padding: 16px 20px;
	font-family: var(--font-ui);
	font-size: 0.8rem;
	text-align: center;
	background: var(--col-nav-bg);
	color: var(--col-nav-text);
}

footer a { color: var(--col-nav-text); text-decoration: none; }
footer a:hover { text-decoration: underline; }

/* --- Messages / alerts --- */
div.msg {
	background: #f6c84a;
	color: #1a1a1a;
	text-align: center;
	padding: 8px 16px;
	font-family: var(--font-ui);
	font-size: 0.875rem;
	border-bottom: 1px solid #e0b53a;
	animation: fadeOutCollapse 2s ease forwards;
	animation-delay: 1.5s;
	overflow: hidden;
}

div.msg.errmsg { background: #c0392b; color: #fff; border-bottom-color: #962d22; }

@keyframes fadeOutCollapse {
	0%   { opacity: 1; }
	100% { opacity: 0; }
}

div.invitation {
	background: #e4f4f6;
	color: #1a1a1a;
	text-align: center;
	padding: 8px 16px;
	font-family: var(--font-ui);
	font-size: 0.875rem;
	border-top: 1px solid #1a7a8a;
	border-bottom: 1px solid #1a7a8a;
}

/* --- Details/summary accordion --- */
details summary { cursor: pointer; font-family: var(--font-ui); }
details summary::before { content: '\25B6'; display: inline-block; padding: 0 6px; font-size: 0.75em; }
details[open] summary { background: var(--col-nav-bg); color: var(--col-nav-text); outline: 0; }
details[open] summary::before { content: '\25BC'; }

/* --- Tables --- */
.data { width: 100%; margin-bottom: 10px; border-collapse: collapse; }
.data th, .data td { padding: 6px 10px; font-size: 0.825rem; font-family: var(--font-ui); }
.data thead > tr > th, .data thead > tr > td.fauxth {
	background: var(--col-nav-bg); color: var(--col-nav-text);
}
.data th a {color:white;}
.data thead tr td { background: #ddd; }
.data tbody tr { background: #f0f0ee; }
.data tbody>tr:nth-child(odd) { background: #fff; }
.data tbody tr:has(input[type=radio]:checked) { background-color: #fff8c4 !important; }
.data tbody tr.lead_question { background: #d4d4cc; }
.data tbody > tr > th, .data tbody > tr > td.fauxth {
	background: #b0bec5; font-weight: 500;
}
.data tbody > tr:nth-child(odd) > th { background: #78909c; color: #fff; }
.data tfoot tr { background: #e0e0dc; }
.data tfoot tr:nth-child(even) { background: #d8d8d4; }
.data tr.suspended { background: #fce4ec !important; }
.data tbody td, .data tbody th { position: relative; }
.data td.completed { background: #e8f5e9; }
.data td.indent { padding-left: 30px; }

.tableholder { overflow-x: auto; max-width: 87vw; }
.tableholder-review { overflow-x: auto; max-width: 92vw; }
@media only screen and (max-width: 768px) {
	.tableholder::before, .tableholder-review::before {
		content: 'You can scroll this table sideways if needed';
		display: block; max-width: 100vw;
		font-style: italic; font-size: 0.8rem;
		color: var(--col-text-muted);
	}
}

table#papers tr th:first-child {
	border-left:4px solid #78909c;
}
table#papers tr td:first-child {
	border-left:4px solid grey;
}
	table#papers tr.status10 td:first-child {
		border-left:4px solid #e6a817;
	}
	table#papers tr.status50 td:first-child {
		border-left:4px solid #2e7d4f;
	}

/* --- Grid layouts -- */
@media only screen and (min-width: 768px) {
	.grid {
		display:grid;
		gap:1em;
	}
	.grid_3 {
		grid-template-columns: 1fr 1fr 1fr;
	}
}

/* --- Utility --- */
.tal { text-align: left; }
.tac { text-align: center; }
.tar { text-align: right; }
.floatright { float: right; }
.info { cursor: help; }
.error_msg { color: #c0392b; font-family: var(--font-ui); font-size: 0.875rem; }


.sr_only, .screenreader-only {
	height: 1px; width: 1px; position: absolute; overflow: hidden; top: -10px;
}

.help_note {
	background: var(--col-accent-lt);
	border-left: 3px solid var(--col-accent);
	border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
	padding: 10px 14px;
	margin-bottom: 12px;
	font-family: var(--font-ui);
	font-size: 0.875rem;
	color: var(--col-text-mid);
}
.help_note:empty { display: none; }

.warning {
	background: #7b1d4a;
	color: #fff;
	font-weight: 700;
	font-family: var(--font-ui);
	padding: 8px 20px !important;
	margin-bottom: 20px;
	border-radius: var(--radius-sm);
}
.warning:empty { display: none; }

a.highlight_button {
	display: inline-block;
	background: var(--col-accent);
	color: #fff;
	border-radius: var(--radius);
	padding: 0.5rem 1.75rem;
	font-family: var(--font-ui);
	font-size: 0.875rem;
	font-weight: 600;
	text-decoration: none;
	transition: background 0.15s;
}
a.highlight_button:hover { background: #2c4a6e; }

#quick_search {
	float: right;
	padding: 4px 10px;
	background: var(--col-accent-lt);
	border: 1px solid var(--col-border);
	font-family: var(--font-ui);
	font-size: 0.8rem;
	border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}

#progress {
	background: var(--col-accent-lt);
	border-bottom: 1px solid var(--col-border);
	text-align: center;
	padding: 0.5rem;
	font-family: var(--font-ui);
	font-size: 0.875rem;
}

/* --- Responsive: mobile --- */
@media only screen and (max-width: 600px) {

	.invitation {
		margin-top:64px;
	}
	.msg {
		margin-top:64px;
	}
	.msg + .invitation {
		margin-top:0;
	}

	#menu_opener {
		position: absolute;
		top: 16px;
		right: 16px;
		text-decoration: none;
		font-weight: 700;
		font-size: 26px;
	}

	nav menu { padding-top: 8px; }
	nav menu li { padding: 5px; text-align: center; }

	article { overflow-x: auto; }
	.data tbody tr { border-top: 1px solid transparent; }
	
	section {
		padding: .5em .5em 1em;
	}

	.no_mobile { display: none; }

	.comment_level_1 { margin-left: 12px; }
	.comment_level_2 { margin-left: 24px; }
	.comment_level_3,
	.comment_level_4,
	.comment_level_5,
	.comment_level_6,
	.comment_level_7,
	.comment_level_8 {
	margin-left: 36px;
	background: var(--col-thread-3);
	border-left: 3px solid var(--col-border-light);
	}
}

/* --- Responsive: desktop --- */
@media only screen and (min-width: 601px) {

	body { margin-top: 64px; }

	nav img#logo { display: inline; margin: 0; }

	nav menu {
		display: flex;
		align-items: center;
		margin-left: auto;
		gap: 2px;
	}

	main { min-height: 78vh; }
	.mobile_only { display: none; }

	.cols_2 { column-count: 2; column-gap: 2rem; column-rule: 1px solid var(--col-border); }
	.cols_3 { column-count: 3; column-gap: 2rem; column-rule: 1px solid var(--col-border); }
	.cols_4 { column-count: 4; column-gap: 2rem; column-rule: 1px solid var(--col-border); }
}

@media only screen and (min-width: 1000px) {
	.grid-3-2 { display: grid; gap: 1rem; grid-template-columns: 3fr 2fr; }
	.pform.narrow input, .pform.narrow select { width: 200px; }
	.pform.blocks label { width: 100%; text-align: left; padding-bottom: 3px; }
	.pform.blocks input, .pform.blocks select, .pform.blocks textarea { width: 100%; }
}

/* --- Visible to staff only badge --- */
.visible_to_staff_only {
	color: #fff;
	background: #7b1d4a;
	padding: 0.3rem 0.3rem 1.5rem 0.3rem !important;
	position: relative;
	margin-bottom: 0.5rem;
	border-radius: var(--radius-sm);
}
.visible_to_staff_only::after {
	content: 'visible to staff only';
	font-style: italic;
	font-family: var(--font-ui);
	font-size: 0.75rem;
	position: absolute;
	right: 0.3rem;
	bottom: 0;
	color: rgba(255,255,255,0.7);
}

/* --- Post/reply/close --- */
.post, .reply, .close { position: relative; }
.post_delete, .reply_delete, .close_thread { position: absolute; top: 0; right: 10px; }
img.alert { width: 20px; margin-right: 10px; }

/* --- Accordion DL --- */
dl ul, dl ol { margin-left: 40px; }
dl ul li { list-style-type: disc; padding: 2px 0; }
dl ol li { list-style-type: decimal; padding: 2px 0; }

dl.accordion dt {
	position: relative;
	cursor: pointer;
	background: var(--col-nav-bg);
	color: var(--col-nav-text);
	padding: 0.4rem 0.75rem;
	margin-top: 1px;
	font-family: var(--font-ui);
	font-size: 0.875rem;
	border-left: 4px solid var(--col-accent);
}
dl.accordion dt.unread { border-left: 4px solid #c0392b; }
dl.accordion dt::after { content: '\25B6'; position: absolute; right: 10px; }
dl.accordion dt:hover, dl.accordion dt.open {
	background: var(--col-accent); color: #fff;
}
dl.accordion dt.open::after { content: '\25BC'; }
dl.accordion dd {
	border: 1px solid var(--col-border);
	border-top: 0;
	padding: 1rem;
	margin-bottom: 0.5rem;
	border-radius: 0 0 var(--radius) var(--radius);
	background: var(--col-surface);
}

/* --- faux_iframe --- */
.faux_iframe h1 { font-size: 1.4rem; font-weight: 400; padding: 0.3rem 0 0.2rem; }
.faux_iframe h2 { font-size: 1.2rem; font-weight: 400; padding: 0.3rem 0 0.2rem; }
.faux_iframe .pagebutton { display: none; }


/* --- Tooltips --- */
[data-tooltip]:not(a) {
    cursor: help;
}

[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--col-nav-bg);
    color: var(--col-nav-text);
    font-family: var(--font-ui);
    font-size: 0.65rem;
    font-style: normal;
    line-height: 1.4;
    white-space: normal;
    padding: 5px 10px;
    border-radius: 4px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s ease;
    z-index: 1000;
    min-width:150px;
    text-transform:uppercase;
}

[data-tooltip]:hover::after {
    opacity: 1;
}

[data-tooltip].tooltip-left::after {
    left: 0;
    transform: translateX(0);
}

[data-tooltip].tooltip-right::after {
    left: auto;
    right: 0;
    transform: translateX(0);
}