/* Essay contest pages: /essay-contest/ (inside the site theme) and the stand-alone
   /essay-contest/judge/ and /essay-contest/results/ pages. */

/* ---- student page (/essay-contest/) ---- */
.milca-essay-facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 28px 0 20px; }
.milca-essay-facts > div { background: #07203C; color: #fff; padding: 18px 20px; }
.milca-essay-facts b { display: block; font-family: "Barlow Condensed", sans-serif; text-transform: uppercase; letter-spacing: 1px; color: #d4a94f; font-size: 15px; margin-bottom: 4px; }
.milca-essay-prompt { border-left: 4px solid #d4a94f; background: #fbf7ee; padding: 18px 22px; margin: 0 0 28px; }
.milca-essay-prompt b { font-family: "Barlow Condensed", sans-serif; text-transform: uppercase; letter-spacing: 1px; color: #07203C; }
.milca-essay-prompt p { margin: 6px 0 0; font-size: 19px; line-height: 1.5; color: #07203C; }
.milca-essay-rules ul { margin: 8px 0 0; padding-left: 1.2em; }
.milca-essay-rules li { margin-bottom: 6px; }
.milca-essay-status { padding: 14px 18px; border: 2px solid #dc3232; background: #fff5f5; color: #07203C; margin: 20px 0 0; font-weight: 600; }
.milca-wordcount { font-size: 14px; margin-top: 6px; color: #5D5D5D; }
.milca-wordcount.ok [data-words] { color: #2e7d32; font-weight: 700; }
.milca-wordcount.bad [data-words] { color: #c62828; font-weight: 700; }
.milca-essay-done { border: 2px solid #46b450; padding: 20px 24px; background: #fff; }
.milca-essay-done strong { font-size: 1.2em; color: #07203C; }
@media (max-width: 767px) { .milca-essay-facts { grid-template-columns: 1fr; } }

/* ---- stand-alone judge + results pages ---- */
.ep { --navy: #07203C; --gold: #d4a94f; --ink: #2b2b2b; --muted: #6b6b6b; --line: #e1e1e1; --bg: #f4f4f4; --card: #fff; --good: #2e7d32; --bad: #c62828;
  margin: 0; background: var(--bg); color: var(--ink); font-family: "Titillium Web", system-ui, sans-serif; font-size: 16px; line-height: 1.55; }
.ep * { box-sizing: border-box; }
.ep h1, .ep h2, .ep h3 { font-family: "Barlow Condensed", sans-serif; text-transform: uppercase; letter-spacing: .5px; color: var(--navy); margin: 0 0 .4em; line-height: 1.15; }
.ep-top { background: var(--navy); color: #fff; padding: 14px 16px; }
.ep-top .in { max-width: 1200px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.ep-top strong { font-family: "Barlow Condensed", sans-serif; text-transform: uppercase; letter-spacing: 1px; font-size: 20px; }
.ep-top span { color: #cfd7e3; font-size: 14px; }
.ep-main { max-width: 1200px; margin: 0 auto; padding: 24px 16px 60px; }
.ep-card { background: var(--card); border: 1px solid var(--line); padding: 22px; margin-bottom: 20px; }
.ep-muted { color: var(--muted); font-size: 14px; }
.ep-btn { display: inline-block; font-family: "Barlow Condensed", sans-serif; font-weight: 600; text-transform: uppercase; letter-spacing: 1px; font-size: 15px; background: var(--navy); color: #fff; padding: 10px 20px; border: 0; cursor: pointer; text-decoration: none; }
.ep-btn:hover { background: #0e3a6b; }
.ep-btn.ghost { background: transparent; color: var(--navy); border: 1px solid var(--navy); }
.ep-btn.small { padding: 6px 12px; font-size: 13px; }
.ep-btn.danger { background: transparent; color: var(--bad); border: 1px solid var(--bad); }
.ep-btn:disabled { opacity: .5; cursor: default; }
.ep input[type=text], .ep input[type=email], .ep input[type=password], .ep textarea, .ep select { width: 100%; padding: 10px 12px; border: 1px solid #cfcfcf; font: inherit; background: #fff; color: var(--ink); }
.ep label { font-weight: 600; color: var(--navy); font-size: 14px; display: block; margin-bottom: 4px; }
.ep-msg { padding: 10px 14px; margin: 12px 0; border: 2px solid var(--good); background: #f3faf3; }
.ep-msg.err { border-color: var(--bad); background: #fff5f5; }
.ep-row { display: flex; gap: 12px; flex-wrap: wrap; align-items: end; }
.ep-row > * { flex: 1 1 200px; }
.ep-row > .ep-btn { flex: 0 0 auto; }

/* judge layout */
.ep-judge { display: grid; grid-template-columns: 260px 1fr; gap: 20px; align-items: start; }
.ep-list { background: var(--card); border: 1px solid var(--line); position: sticky; top: 12px; max-height: calc(100vh - 24px); overflow: auto; }
.ep-list button { display: flex; width: 100%; justify-content: space-between; align-items: center; gap: 8px; padding: 12px 14px; border: 0; border-bottom: 1px solid var(--line); background: #fff; font: inherit; cursor: pointer; text-align: left; color: var(--ink); }
.ep-list button:hover { background: #f7f7f7; }
.ep-list button[aria-current="true"] { background: #eef2f8; box-shadow: inset 4px 0 0 var(--navy); }
.ep-list .id { font-weight: 700; color: var(--navy); }
.ep-tag { font-size: 12px; padding: 2px 8px; border-radius: 10px; background: #eee; color: #555; white-space: nowrap; }
.ep-tag.done { background: #e3f3e4; color: var(--good); }
.ep-tag.skip { background: #fdf0d9; color: #8a5a00; }
.ep-tag.off { background: #fde7e7; color: var(--bad); }
.ep-info { margin: 4px 0 12px; font-size: 13.5px; }
.ep-info summary { cursor: pointer; color: #985221; font-weight: 600; list-style: none; display: inline-flex; align-items: center; gap: 6px; }
.ep-info summary::-webkit-details-marker { display: none; }
.ep-info .i, .i-inline { display: inline-flex; align-items: center; justify-content: center; width: 17px; height: 17px; border-radius: 50%; background: #985221; color: #fff; font: italic 700 12px Georgia, serif; }
.ep-info[open] summary { margin-bottom: 6px; }
.ep-info > div { background: #fbf5ee; border-left: 4px solid #CE9F5B; padding: 10px 14px; color: #333; line-height: 1.5; }
.ep-info > div p { margin: 0 0 6px; } .ep-info > div p:last-child { margin: 0; }
.ep-info > div ul { margin: 4px 0 8px; padding-left: 0; list-style: none; } .ep-info > div li { margin: 4px 0; }
.ep-list-head { padding: 12px 14px 0; }
.ep-tag.new { background: #CE9F5B; color: #2C1908; font-weight: 700; }
.ep-news { border-left: 5px solid #CE9F5B; background: #fbf5ee; display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.ep-news button { cursor: pointer; } .ep-news[hidden] { display: none; }
.ep-progress { padding: 12px 14px; border-bottom: 1px solid var(--line); font-size: 14px; }
.ep-bar { height: 6px; background: #eee; margin-top: 6px; }
.ep-bar i { display: block; height: 100%; background: var(--good); }
.ep-essay-text { white-space: pre-wrap; font-size: 17px; line-height: 1.7; max-width: 72ch; }
.ep-split { display: grid; grid-template-columns: 1fr 380px; gap: 20px; align-items: start; }
.ep-rubric { position: sticky; top: 12px; }
.ep-crit { border-top: 1px solid var(--line); padding: 12px 0; }
.ep-crit:first-of-type { border-top: 0; }
.ep-crit .head { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.ep-crit .help { font-size: 13px; color: var(--muted); margin: 2px 0 8px; }
.ep-crit input[type=number] { width: 84px; padding: 8px; border: 1px solid #cfcfcf; font: inherit; font-size: 18px; text-align: center; }
.ep-crit input[type=range] { width: 100%; accent-color: var(--navy); }
.ep-crit .inputs { display: flex; gap: 12px; align-items: center; }
.ep-total { display: flex; justify-content: space-between; align-items: baseline; border-top: 2px solid var(--navy); padding-top: 12px; margin-top: 4px; font-family: "Barlow Condensed", sans-serif; font-size: 22px; color: var(--navy); text-transform: uppercase; }
.ep-check { display: flex; gap: 8px; align-items: flex-start; font-weight: 400 !important; color: var(--ink) !important; margin: 12px 0 !important; }
.ep-check input { margin-top: 4px; }
.ep-nav { display: flex; justify-content: space-between; gap: 10px; margin-top: 14px; }

/* results tables */
.ep-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 20px; }
.ep-stats div { background: var(--card); border: 1px solid var(--line); border-top: 4px solid var(--navy); padding: 14px 16px; }
.ep-stats b { display: block; font-size: 28px; color: var(--navy); font-family: "Barlow Condensed", sans-serif; }
.ep-table-wrap { overflow-x: auto; }
.ep table { border-collapse: collapse; width: 100%; font-size: 14px; }
.ep th, .ep td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.ep th { font-family: "Barlow Condensed", sans-serif; text-transform: uppercase; letter-spacing: .5px; color: var(--navy); font-size: 14px; white-space: nowrap; }
.ep td.num, .ep th.num { text-align: right; font-variant-numeric: tabular-nums; }
.ep tr.ineligible td { color: #999; }
.ep tr.top td { background: #fbf7ee; }
.ep code.link { display: block; font-size: 12px; word-break: break-all; background: #f6f6f6; padding: 6px 8px; margin-top: 4px; }
.ep details { border-top: 1px solid var(--line); padding: 10px 0; }
.ep details summary { cursor: pointer; font-weight: 600; color: var(--navy); }

@media (max-width: 1150px) {
  .ep-split { grid-template-columns: 1fr; }
  .ep-rubric { position: static; }
}
@media (max-width: 900px) {
  .ep-judge, .ep-split { grid-template-columns: 1fr; }
  .ep-list, .ep-rubric { position: static; max-height: none; }
  .ep-stats { grid-template-columns: 1fr 1fr; }
}
.milca-essay-prompt blockquote.milca-essay-quote { margin: 12px 0 6px !important; padding: 0 !important; background: none !important; border: 0 !important; box-shadow: none !important; font-family: inherit !important; font-size: 18px !important; line-height: 1.5 !important; font-style: italic !important; text-transform: none !important; color: #2b2b2b !important; }
.milca-essay-prompt blockquote.milca-essay-quote::before, .milca-essay-prompt blockquote.milca-essay-quote::after { content: none !important; display: none !important; }
.milca-essay-prompt blockquote.milca-essay-quote cite { display: block; margin-top: 6px; font-size: 14px !important; font-style: normal !important; color: #6b6b6b !important; }
.ep-crit ul.levels { list-style: none; margin: 4px 0 10px; padding: 0; font-size: 13.5px; line-height: 1.45; color: #555; }
.ep-crit ul.levels li { margin: 2px 0; }
.ep-crit ul.levels b { display: inline-block; min-width: 46px; color: #07203C; }
