/* Articles: a quiet, single reading column on white. Uses the colour tokens from site.css. */

.hub { padding: 40px 0 72px; background: var(--surface); }
@media (min-width: 768px) { .hub { padding: 56px 0 96px; } }

.hub-wrap { max-width: 680px; margin: 0 auto; padding: 0 20px; }
.hub-wrap-wide { max-width: 880px; }

.hub-messages p {
  margin-bottom: 20px; padding: 12px 16px;
  background: var(--accent-wash); border-radius: var(--radius);
  color: var(--ink-2); font-weight: 500;
}

.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* --- List of articles ------------------------------------------------------ */

.hub-intro { padding-bottom: 28px; border-bottom: 1px solid var(--line); }
.hub-tagline {
  font-family: var(--serif); font-weight: 700; color: var(--ink);
  font-size: clamp(1.625rem, 1.25rem + 1.6vw, 2.375rem); line-height: 1.18; letter-spacing: -0.02em;
  text-wrap: balance;
}
.hub-lead { margin-top: 14px; color: var(--muted); font-size: 1.0625rem; line-height: 1.6; }

/* Sections and topic cards (photos you upload for each topic). */

.hub-section { margin-top: 36px; }
.hub-section-title { color: var(--ink-2); font-size: 0.8125rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; }

.topic-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 16px; margin-top: 16px; }
@media (min-width: 640px) { .topic-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.topic-card { display: block; color: inherit; text-decoration: none; }
.topic-card-image { display: block; aspect-ratio: 3 / 2; overflow: hidden; background: var(--bg-alt); border-radius: 8px; }
.topic-card-image img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s ease; }
.topic-card:hover .topic-card-image img { transform: scale(1.04); }
.topic-card-image.is-empty { background: linear-gradient(135deg, var(--accent-wash), var(--bg-alt)); }
.topic-card-name { display: block; margin-top: 10px; color: var(--ink); font-family: var(--serif); font-size: 1.125rem; font-weight: 700; line-height: 1.25; }
.topic-card:hover .topic-card-name { text-decoration: underline; text-underline-offset: 3px; }
.topic-card-count { display: block; margin-top: 2px; color: var(--muted-2); font-size: 0.8125rem; }

/* A topic page: the photo as a banner, the name, sub-topics as chips. */

.topic-banner { margin-top: 14px; aspect-ratio: 16 / 9; overflow: hidden; background: var(--bg-alt); border-radius: 12px; }
@media (min-width: 640px) { .topic-banner { aspect-ratio: 21 / 9; } }
.topic-banner img { display: block; width: 100%; height: 100%; object-fit: cover; }
.topic-title { margin-top: 20px; font-family: var(--serif); font-weight: 700; color: var(--ink); font-size: clamp(2rem, 1.6rem + 1.8vw, 2.75rem); line-height: 1.12; letter-spacing: -0.02em; }

.chip-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.chip {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 36px; padding: 6px 16px;
  background: var(--bg-alt); border-radius: 999px;
  color: var(--ink-2); font-size: 0.875rem; font-weight: 500; text-decoration: none;
  transition: background-color 0.15s ease;
}
.chip:hover { background: var(--line); }
.chip img { width: 24px; height: 24px; margin-left: -8px; border-radius: 50%; object-fit: cover; }
.chip[aria-current="page"] { background: var(--ink); color: #fff; }

/* Article rows: text on the left, the sub-topic's photo as a thumbnail on the right (as on Medium). */

.hub-item { display: flex; align-items: flex-start; gap: 16px; }
@media (min-width: 640px) { .hub-item { gap: 32px; } }
.hub-item-text { flex: 1; min-width: 0; }
.hub-thumb { flex: none; width: 96px; aspect-ratio: 3 / 2; margin-top: 24px; overflow: hidden; background: var(--bg-alt); border-radius: 6px; }
@media (min-width: 640px) { .hub-thumb { width: 160px; } }
.hub-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }

.hub-item { padding: 26px 0; border-bottom: 1px solid var(--line); }
.hub-meta { color: var(--accent); font-size: 0.8125rem; font-weight: 600; }
.hub-meta a { text-decoration: none; }
.hub-meta a:hover { text-decoration: underline; text-underline-offset: 3px; }
.hub-item-title { margin-top: 6px; font-family: var(--serif); font-size: 1.375rem; line-height: 1.25; color: var(--ink); }
.hub-item-title a { text-decoration: none; }
.hub-item-title a:hover { text-decoration: underline; text-underline-offset: 4px; }
.hub-excerpt { margin-top: 8px; color: var(--muted); font-size: 0.9375rem; line-height: 1.6; }
.hub-byline { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 10px; color: var(--muted-2); font-size: 0.8125rem; }
.hub-byline a { color: var(--ink-2); font-weight: 600; text-decoration: none; }

.hub-empty { margin-top: 28px; color: var(--muted); }
.hub-pager { display: flex; justify-content: space-between; margin-top: 28px; font-weight: 600; }
.hub-pager a { color: var(--accent); text-decoration: none; }
.hub-foot { margin-top: 36px; color: var(--muted-2); font-size: 0.875rem; }
.hub-foot a { color: var(--accent); text-underline-offset: 3px; }
.hub-back { margin: 0 0 16px; }

/* --- One article ----------------------------------------------------------- */

.post-private { margin-bottom: 20px; padding: 10px 14px; background: #fff7e6; border-radius: var(--radius); color: #7a4b00; font-size: 0.9375rem; }
.post-title {
  margin-top: 10px; font-family: var(--serif); font-weight: 700; color: var(--ink);
  font-size: clamp(1.875rem, 1.35rem + 2vw, 2.625rem); line-height: 1.15; letter-spacing: -0.02em;
}
.post-author { display: flex; align-items: center; gap: 12px; margin-top: 22px; padding-bottom: 22px; border-bottom: 1px solid var(--line); }
.post-author-name { color: var(--ink); font-weight: 600; text-decoration: none; }
.post-author-name:hover { text-decoration: underline; text-underline-offset: 3px; }
.post-author-meta { color: var(--muted-2); font-size: 0.875rem; }

.post-body { margin-top: 28px; font-family: var(--serif); font-size: 1.125rem; line-height: 1.7; color: var(--ink-2); overflow-wrap: break-word; }
.post-body p + p { margin-top: 1.1em; }
.post-body a { color: var(--accent); text-underline-offset: 3px; }
@media (min-width: 640px) { .post-body { font-size: 1.1875rem; } }

.relate { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; margin-top: 40px; padding: 18px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.relate-button {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 18px;
  background: #fff; border: 1.5px solid var(--ink); border-radius: 999px;
  color: var(--ink); font-size: 0.9375rem; font-weight: 600; text-decoration: none;
  cursor: pointer; transition: background-color 0.15s ease;
}
.relate-button:hover { background: var(--accent-wash); }
.relate-button[aria-pressed="true"] { background: var(--cta); }
.relate-button[aria-pressed="true"]::before { content: "✓"; }
.relate-count { color: var(--muted); font-size: 0.9375rem; }

.comments { margin-top: 36px; }
.comments-title { font-family: var(--serif); font-size: 1.375rem; color: var(--ink); }
.comment { padding: 18px 0; border-bottom: 1px solid var(--line); }
.comment-meta { color: var(--muted-2); font-size: 0.875rem; }
.comment-meta strong { color: var(--ink); }
.comment-tag { margin-left: 4px; padding: 1px 8px; background: var(--accent-wash); border-radius: 999px; color: var(--accent); font-size: 0.75rem; font-weight: 600; }
.comment-body { margin-top: 6px; color: var(--ink-2); line-height: 1.6; overflow-wrap: break-word; }
.comment-body p + p { margin-top: 0.6em; }
.comment-form { margin-top: 24px; }
.comment-form-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; }
.comment-as { color: var(--muted); font-size: 0.875rem; }
.comment-gate { margin-top: 24px; padding: 16px 18px; background: var(--surface-soft); border: 1px solid var(--line); border-radius: var(--radius); color: var(--ink-3); line-height: 1.6; }
.comment-gate a { color: var(--accent); font-weight: 600; text-underline-offset: 3px; }

.post-coach { display: flex; align-items: flex-start; gap: 16px; margin-top: 44px; padding: 22px; background: var(--surface-soft); border-radius: var(--radius-lg); }
.post-coach-label { color: var(--muted-2); font-size: 0.75rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.post-coach-name { display: inline-block; margin-top: 2px; font-family: var(--serif); font-size: 1.25rem; font-weight: 700; color: var(--ink); text-decoration: none; }
.post-coach-bio { margin-top: 6px; color: var(--muted); font-size: 0.9375rem; line-height: 1.6; }
.post-coach-link { display: inline-block; margin-top: 10px; color: var(--accent); font-weight: 600; text-underline-offset: 3px; }

/* --- Avatars --------------------------------------------------------------- */

.avatar {
  display: grid; place-items: center; flex: none;
  width: 40px; height: 40px; overflow: hidden;
  background: var(--ink); border-radius: 50%;
  color: var(--cta); font-family: var(--serif); font-size: 0.9375rem; font-weight: 700;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-md { width: 56px; height: 56px; font-size: 1.125rem; }
.avatar-lg { width: 96px; height: 96px; font-size: 1.75rem; }

/* --- Coach profile --------------------------------------------------------- */

.profile-name { margin-top: 16px; font-family: var(--serif); font-size: clamp(1.875rem, 1.5rem + 1.6vw, 2.5rem); line-height: 1.15; color: var(--ink); }
.profile-bio { margin-top: 12px; color: var(--ink-3); font-size: 1.0625rem; line-height: 1.65; }
.profile-bio p + p, .profile-text p + p { margin-top: 0.8em; }
.profile-block { margin-top: 36px; padding-top: 24px; border-top: 1px solid var(--line); }
.profile-label { color: var(--accent); font-size: 0.75rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; }
.profile-text { margin-top: 10px; color: var(--ink-2); line-height: 1.65; }
.route { margin-top: 14px; padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); }
.route-title { font-family: var(--serif); font-size: 1.1875rem; color: var(--ink); }
.route p { margin-top: 6px; color: var(--muted); line-height: 1.6; }
.route .btn { margin-top: 14px; }
.route-link { display: inline-block; margin-top: 12px; color: var(--accent); font-weight: 600; text-underline-offset: 3px; }

/* --- Forms: student check and coach panel ---------------------------------- */

.hub-title { font-family: var(--serif); font-size: clamp(1.625rem, 1.3rem + 1.4vw, 2.125rem); line-height: 1.2; color: var(--ink); }
.hub-note { margin-top: 10px; color: var(--muted); line-height: 1.6; }
.hub-form { margin-top: 24px; }
.hub-form .field + .field { margin-top: 18px; }
.hub-form > .btn { margin-top: 22px; }
.hub-form .form-alert { margin: 0 0 18px; }
.field-help { margin-top: 6px; color: var(--muted-2); font-size: 0.8125rem; }
.field input[type="file"] { padding: 9px; }
.check { display: inline-flex; align-items: center; gap: 8px; margin-top: 10px; color: var(--ink-2); font-size: 0.9375rem; }

.hub-universities { margin-top: 36px; padding-top: 20px; border-top: 1px solid var(--line); }
.hub-universities-title { color: var(--ink-2); font-size: 0.875rem; font-weight: 600; }
.hub-universities ul { margin-top: 8px; color: var(--muted); font-size: 0.9375rem; line-height: 1.8; }

.photo-row { display: flex; align-items: center; gap: 20px; margin-bottom: 18px; }
.photo-fields { flex: 1; min-width: 0; }

/* --- Coach panel ----------------------------------------------------------- */

.panel-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; }
.panel-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.panel-numbers { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 28px; }
.panel-number { padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--radius); }
.panel-number strong { display: block; font-family: var(--serif); font-size: 1.75rem; line-height: 1.1; color: var(--ink); }
.panel-number span { color: var(--muted); font-size: 0.875rem; }
.panel-subtitle { margin-top: 40px; font-family: var(--serif); font-size: 1.375rem; color: var(--ink); }

.table-scroll { margin-top: 12px; overflow-x: auto; }
.panel-table { width: 100%; min-width: 560px; border-collapse: collapse; font-size: 0.9375rem; }
.panel-table th { color: var(--muted-2); font-size: 0.75rem; font-weight: 700; letter-spacing: 0.06em; text-align: left; text-transform: uppercase; }
.panel-table th, .panel-table td { padding: 12px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.panel-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.panel-table a { color: var(--ink); font-weight: 600; text-underline-offset: 3px; }
.panel-sub { display: block; margin-top: 2px; color: var(--muted-2); font-size: 0.8125rem; }

.pill { display: inline-block; padding: 2px 10px; background: var(--bg-alt); border-radius: 999px; color: var(--ink-3); font-size: 0.8125rem; font-weight: 600; white-space: nowrap; }
.pill-live { background: var(--accent-wash); color: var(--accent); }
.pill-warn { background: #fff7e6; color: #7a4b00; }

/* --- Article text: what the editor writes (shared by the article page and the writing page) --- */

.post-body h2, .writer-body h2 { margin: 1.5em 0 0.35em; font-family: var(--serif); font-size: 1.625rem; font-weight: 700; line-height: 1.25; color: var(--ink); }
.post-body h3, .writer-body h3 { margin: 1.3em 0 0.3em; font-family: var(--serif); font-size: 1.3125rem; font-weight: 700; line-height: 1.3; color: var(--ink); }
.post-body > :first-child, .writer-body > :first-child { margin-top: 0; }
.post-body p + p, .writer-body p + p { margin-top: 1.1em; }
.post-body h2 + p, .post-body h3 + p, .writer-body h2 + p, .writer-body h3 + p { margin-top: 0; }
.post-body blockquote, .writer-body blockquote { margin: 1.4em 0; padding-left: 22px; border-left: 3px solid var(--ink); color: var(--ink-3); font-style: italic; }
.post-body ul, .post-body ol, .writer-body ul, .writer-body ol { margin: 1em 0; padding-left: 1.6em; }
.post-body ul, .writer-body ul { list-style: disc; }
.post-body ol, .writer-body ol { list-style: decimal; }
.post-body li + li, .writer-body li + li { margin-top: 0.35em; }
.post-body hr, .writer-body hr { height: auto; margin: 2.2em 0; border: 0; text-align: center; }
.post-body hr::before, .writer-body hr::before { content: "· · ·"; color: var(--muted); font-size: 1.5rem; letter-spacing: 0.6em; }
.post-body figure { margin: 2em 0; }
.post-body img { width: 100%; height: auto; border-radius: 4px; }
.post-body figcaption { margin-top: 8px; color: var(--muted); font-family: var(--sans); font-size: 0.875rem; text-align: center; }
.post-body pre { margin: 1.4em 0; padding: 16px; overflow-x: auto; background: var(--bg-alt); border-radius: 6px; font-size: 0.9rem; }
.post-origin { margin-top: 28px; color: var(--muted); font-size: 0.9375rem; font-style: italic; }
.post-origin a { color: var(--accent); }

/* --- The writing page (Medium-style) ---------------------------------------- */

.hub-wrap-writer { max-width: 760px; }
.writer-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-bottom: 28px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.writer-back { color: var(--muted); font-size: 0.875rem; text-decoration: none; }
.writer-back:hover { color: var(--ink); }
.writer-status { color: var(--muted-2); font-size: 0.875rem; }
.writer-actions { display: flex; align-items: center; gap: 16px; margin-left: auto; }
.writer-actions .link-button { margin: 0; color: var(--muted); font-weight: 500; text-decoration: none; }
.writer-actions .link-button:hover { color: var(--ink); }
.writer-actions .writer-delete:hover { color: var(--danger); }
.writer-publish { padding: 8px 18px; background: var(--accent); border: 0; border-radius: 999px; color: #fff; font-size: 0.875rem; font-weight: 600; cursor: pointer; }
.writer-publish:hover { background: var(--ink); }

.writer-title {
  display: block; width: 100%; padding: 0; overflow: hidden; resize: none;
  background: transparent; border: 0; outline: none;
  color: var(--ink); font-family: var(--serif); font-size: clamp(2rem, 1.5rem + 2.2vw, 2.75rem); font-weight: 700; line-height: 1.2;
}
.writer-title::placeholder { color: var(--faint); }
.writer-source { display: block; width: 100%; min-height: 50vh; margin-top: 16px; padding: 12px; border: 1px solid var(--line-2); border-radius: 8px; font: inherit; }
.writer-body { min-height: 50vh; margin-top: 18px; outline: none; color: var(--ink-2); font-family: var(--serif); font-size: 1.25rem; line-height: 1.65; }
.writer-body.is-empty::before { content: attr(data-placeholder); float: left; height: 0; color: var(--faint); pointer-events: none; }
.writer-body a { color: var(--accent); }
.writer-body figure { margin: 1.5em 0; }
.writer-body img { max-width: 100%; height: auto; }

.editor-toolbar {
  position: absolute; z-index: 60; display: flex; align-items: center; gap: 2px;
  padding: 4px; background: #1a1a1a; border-radius: 6px; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  transform: translate(-50%, -100%);
}
.editor-toolbar::after { content: ""; position: absolute; left: 50%; bottom: -6px; border: 6px solid transparent; border-bottom: 0; border-top-color: #1a1a1a; transform: translateX(-50%); }
.editor-tool { min-width: 36px; height: 34px; padding: 0 8px; background: none; border: 0; border-radius: 4px; color: #fff; font-family: var(--serif); font-size: 1.0625rem; cursor: pointer; }
.editor-tool:hover { background: rgba(255, 255, 255, 0.12); }
.editor-tool[aria-pressed="true"] { color: var(--cta); }
.editor-tool-bold { font-weight: 700; }
.editor-tool-italic { font-style: italic; }
.editor-tool-h2 { font-size: 1.25rem; font-weight: 700; }
.editor-tool-h3 { font-size: 0.875rem; font-weight: 700; }
.editor-toolbar input { width: min(300px, 70vw); height: 34px; padding: 0 10px; background: transparent; border: 0; outline: none; color: #fff; font: inherit; font-size: 0.9375rem; }

.editor-plus, .editor-plus-menu button {
  display: grid; place-items: center; width: 32px; height: 32px; padding: 0;
  background: #fff; border: 1px solid var(--muted-2); border-radius: 50%;
  color: var(--muted); font-size: 1.125rem; line-height: 1; cursor: pointer;
}
.editor-plus { position: absolute; z-index: 55; transition: transform 0.15s ease; }
.editor-plus[aria-expanded="true"] { transform: rotate(45deg); }
.editor-plus-menu { position: absolute; z-index: 55; display: flex; gap: 8px; }
.editor-plus-menu button { border-color: var(--accent); color: var(--accent); font-size: 0.9375rem; font-weight: 700; }
.editor-plus-menu button:hover { background: var(--accent-wash); }

.publish-dialog { width: calc(100% - 32px); max-width: 460px; padding: 28px; border: 0; border-radius: 14px; box-shadow: var(--shadow-lg); color: var(--ink-2); }
.publish-dialog::backdrop { background: rgba(18, 48, 15, 0.35); }
.publish-title { font-family: var(--serif); font-size: 1.5rem; color: var(--ink); }
.publish-dialog .field { margin-top: 18px; }
.publish-actions { display: flex; align-items: center; gap: 16px; margin-top: 22px; }

.panel-medium { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-top: 24px; padding: 16px 18px; background: var(--surface-soft); border: 1px solid var(--line); border-radius: var(--radius); }
.panel-medium p { min-width: 0; overflow-wrap: anywhere; color: var(--ink-2); font-size: 0.9375rem; }
