/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --navy: #1a3557;
  --navy-light: #243f6b;
  --gold: #c8972b;
  --gold-light: #d4a83e;
  --gold-dark: #b08620;
  --bg: #fdf8f2;
  --bg-light: #f5f0e8;
  --text: #2c2c2c;
  --text-light: #5a5a5a;
  --text-muted: #8a8a8a;
  --white: #ffffff;
  --shadow: 0 2px 12px rgba(26, 53, 87, 0.08);
  --shadow-hover: 0 6px 24px rgba(26, 53, 87, 0.14);
  --radius: 10px;
  --radius-sm: 6px;
  --transition: 0.25s ease;
  --max-width: 1200px;
}

html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: 'Source Sans 3', sans-serif;
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Cormorant Garamond', serif;
  color: var(--navy);
  line-height: 1.25;
}

a { color: var(--navy); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--gold); }

img { max-width: 100%; height: auto; }

/* ===== UTILITY ===== */
.container { max-width: var(--max-width); margin: 0 auto; padding: 0 1.5rem; }

.gold-divider {
  width: 60px; height: 3px;
  background: linear-gradient(90deg, var(--gold), var(--gold-light));
  border: none; border-radius: 2px;
  margin: 1.5rem 0;
}

.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.75rem 1.75rem;
  font-family: 'Source Sans 3', sans-serif; font-size: 1rem; font-weight: 600;
  border: none; border-radius: var(--radius-sm);
  cursor: pointer; transition: all var(--transition);
  text-decoration: none;
}

.btn-primary {
  background: var(--navy);
  color: var(--white);
}
.btn-primary:hover { background: var(--navy-light); color: var(--white); }

.btn-gold {
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dark) 100%);
  color: var(--white);
}
.btn-gold:hover { background: linear-gradient(135deg, var(--gold-light) 0%, var(--gold-dark) 100%); color: var(--white); transform: translateY(-1px); }

.btn-outline {
  background: transparent;
  color: var(--navy);
  border: 2px solid var(--navy);
}
.btn-outline:hover { background: var(--navy); color: var(--white); }

.btn-large { padding: 1rem 2.5rem; font-size: 1.1rem; }

/* ===== HEADER ===== */
.site-header {
  background: var(--white);
  border-bottom: 1px solid var(--bg-light);
  padding: 1rem 0;
  position: sticky; top: 0; z-index: 100;
}
.header-inner { display: flex; align-items: center; justify-content: center; }
.header-logo { display: flex; align-items: center; gap: 1rem; }
.header-logo img { max-height: 52px; }
.header-logo a { font-family: 'Cormorant Garamond', serif; font-size: 1.4rem; font-weight: 700; color: var(--navy); }

/* ===== HERO ===== */
.hero {
  text-align: center;
  padding: 4rem 1rem 3rem;
  background: linear-gradient(180deg, var(--white) 0%, var(--bg) 100%);
}
.hero h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  color: var(--navy);
  margin-bottom: 0.5rem;
}
.hero .subtitle {
  font-size: clamp(1.1rem, 2.5vw, 1.35rem);
  color: var(--text-light);
  max-width: 750px;
  margin: 0 auto 1.5rem;
  font-style: italic;
}
.hero .intro-text {
  font-size: 1.05rem;
  color: var(--text-light);
  max-width: 700px;
  margin: 0 auto;
  line-height: 1.7;
}
.hero .gold-divider { margin: 1.5rem auto; }

/* ===== IMPACT STRIP ===== */
.impact-strip {
  background: var(--navy);
  color: var(--gold);
  text-align: center;
  padding: 1.5rem 1rem;
  font-size: clamp(0.95rem, 2vw, 1.15rem);
  font-weight: 600;
  letter-spacing: 0.02em;
}
.impact-strip .separator { color: rgba(200, 151, 43, 0.5); margin: 0 1rem; }

/* ===== FILTER BAR ===== */
.filter-bar {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 0.5rem;
  padding: 2rem 1rem 1.5rem;
}
.filter-btn {
  padding: 0.5rem 1.25rem;
  font-family: 'Source Sans 3', sans-serif; font-size: 0.9rem; font-weight: 500;
  background: var(--white); color: var(--text);
  border: 1.5px solid var(--bg-light); border-radius: 50px;
  cursor: pointer; transition: all var(--transition);
}
.filter-btn:hover { border-color: var(--gold); color: var(--gold); }
.filter-btn.active {
  background: var(--gold); color: var(--white); border-color: var(--gold);
}

/* ===== POSITIONS GRID ===== */
.positions-section { padding: 1rem 0 3rem; }
.positions-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}
.position-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 1.75rem;
  box-shadow: var(--shadow);
  transition: all var(--transition);
  display: flex; flex-direction: column;
  border: 1px solid transparent;
}
.position-card:hover {
  box-shadow: var(--shadow-hover);
  border-color: var(--bg-light);
  transform: translateY(-2px);
}
.position-card .dept-tag {
  display: inline-block;
  font-size: 0.78rem; font-weight: 600;
  color: var(--gold-dark);
  text-transform: uppercase; letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}
.position-card h3 {
  font-size: 1.2rem;
  margin-bottom: 0.75rem;
  line-height: 1.35;
}
.position-card .meta {
  display: flex; flex-wrap: wrap; gap: 0.75rem;
  font-size: 0.9rem; color: var(--text-light);
  margin-bottom: 0.75rem;
}
.position-card .meta span { display: flex; align-items: center; gap: 0.3rem; }
.position-card .overview {
  font-size: 0.95rem; color: var(--text-light); line-height: 1.55;
  margin-bottom: 1.25rem;
  flex: 1;
}
.position-card .card-footer { margin-top: auto; }

/* ===== NO RESULTS ===== */
.no-results {
  grid-column: 1 / -1;
  text-align: center; padding: 3rem 1rem;
  color: var(--text-muted);
}
.no-results h3 { font-size: 1.3rem; margin-bottom: 0.5rem; }

/* ===== POSITION DETAIL ===== */
.position-detail { padding: 2rem 0 4rem; }
.breadcrumb { margin-bottom: 2rem; }
.breadcrumb a { color: var(--gold); font-weight: 600; }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb span { color: var(--text-muted); }

.position-detail h2 { font-size: 2.2rem; margin-bottom: 1rem; }
.position-detail .meta-row { display: flex; flex-wrap: wrap; gap: 1rem; margin-bottom: 1.5rem; }
.position-detail .meta-item {
  display: inline-flex; align-items: center; gap: 0.4rem;
  font-size: 0.95rem; color: var(--text-light); background: var(--bg-light);
  padding: 0.4rem 0.85rem; border-radius: 50px;
}
.position-detail .detail-overview {
  font-size: 1.1rem; color: var(--text); line-height: 1.7;
  margin-bottom: 2rem; padding: 1.5rem;
  background: linear-gradient(135deg, var(--bg-light) 0%, var(--white) 100%);
  border-radius: var(--radius); border-left: 4px solid var(--gold);
}

.jd-container {
  background: var(--white); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden;
  margin-bottom: 2rem;
}
.jd-container iframe { width: 100%; height: 800px; border: none; display: block; }
.jd-fallback { display: none; padding: 2rem; text-align: center; color: var(--text-light); }
.jd-fallback p { margin-bottom: 1rem; }

.pdf-mobile-fallback { display: none; }

.cta-section {
  text-align: center; padding: 3rem 1.5rem;
  background: var(--white); border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.cta-section h3 { font-size: 1.6rem; margin-bottom: 0.5rem; }
.cta-section p { color: var(--text-light); margin-bottom: 1.5rem; }
.cta-section .secondary-line {
  margin-top: 1.25rem; font-size: 0.9rem; color: var(--text-muted);
}
.cta-section .secondary-line a { color: var(--gold); }

/* ===== APPLICATION FORM ===== */
.apply-section { padding: 2rem 0 4rem; }
.apply-section h2 { font-size: 2rem; margin-bottom: 0.25rem; }
.apply-section .apply-subtitle { color: var(--text-light); margin-bottom: 2rem; }

.form-container { max-width: 700px; margin: 0 auto; }
.form-card {
  background: var(--white); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 2.5rem;
}
.form-group { margin-bottom: 1.5rem; }
.form-group label {
  display: block; font-weight: 600; color: var(--text);
  margin-bottom: 0.4rem; font-size: 0.95rem;
}
.form-group .required::after { content: " *"; color: var(--gold); }
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%; padding: 0.75rem 1rem;
  font-family: 'Source Sans 3', sans-serif; font-size: 1rem;
  border: 1.5px solid var(--bg-light); border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  transition: border-color var(--transition);
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none; border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(200, 151, 43, 0.12);
}
.form-group input.error,
.form-group select.error,
.form-group textarea.error {
  border-color: #d9534f;
}
.form-group .error-message {
  color: #d9534f; font-size: 0.85rem; margin-top: 0.3rem; display: none;
}
.form-group .error-message.visible { display: block; }
.form-group .helper-text {
  font-size: 0.85rem; color: var(--text-muted); margin-top: 0.3rem;
}
.form-group .char-count {
  text-align: right; font-size: 0.8rem; color: var(--text-muted); margin-top: 0.2rem;
}

.radio-group { display: flex; gap: 2rem; margin-top: 0.3rem; }
.radio-group label {
  display: flex; align-items: center; gap: 0.5rem;
  font-weight: 400; cursor: pointer;
}
.radio-group input[type="radio"] { width: auto; accent-color: var(--gold); }

.conditional-field { display: none; }
.conditional-field.visible { display: block; }

.file-upload-area {
  border: 2px dashed var(--bg-light); border-radius: var(--radius-sm);
  padding: 1.5rem; text-align: center;
  background: var(--bg);
  transition: border-color var(--transition);
  cursor: pointer;
}
.file-upload-area:hover,
.file-upload-area.dragover { border-color: var(--gold); }
.file-upload-area .upload-icon { font-size: 2rem; margin-bottom: 0.5rem; }
.file-upload-area .upload-text { font-size: 0.9rem; color: var(--text-light); }
.file-upload-area .upload-hint { font-size: 0.8rem; color: var(--text-muted); }
.file-upload-area input[type="file"] { display: none; }
.file-upload-area .file-selected {
  display: none; font-weight: 600; color: var(--navy); margin-top: 0.5rem;
}
.file-upload-area .file-selected.visible { display: block; }

.already-applied-note {
  font-size: 0.85rem; color: var(--text-muted);
  text-align: center; margin: 1.5rem 0 1rem;
  font-style: italic;
}

.submit-error {
  background: #fdf0ef; color: #d9534f;
  padding: 1rem; border-radius: var(--radius-sm);
  margin-bottom: 1.5rem; display: none;
  font-size: 0.95rem; line-height: 1.5;
}
.submit-error.visible { display: block; }

.btn-full { width: 100%; justify-content: center; }
.btn-disabled { opacity: 0.6; pointer-events: none; }

/* ===== THANK YOU STATE ===== */
.thank-you-state {
  text-align: center; padding: 4rem 1.5rem;
  display: none;
}
.thank-you-state.visible { display: block; }
.thank-you-state .thank-you-icon {
  font-size: 3rem; margin-bottom: 1.5rem;
}
.thank-you-state h2 {
  font-size: 2rem; margin-bottom: 1rem;
}
.thank-you-state .thank-you-message {
  font-size: 1.1rem; color: var(--text-light);
  max-width: 600px; margin: 0 auto 1.5rem;
  line-height: 1.7;
}
.thank-you-state .thank-you-signature {
  margin-top: 2rem; color: var(--text-muted);
  font-style: italic;
}

/* ===== FOOTER ===== */
.site-footer {
  background: var(--navy); color: var(--bg-light);
  text-align: center; padding: 2.5rem 1.5rem;
  font-size: 0.95rem; line-height: 1.8;
}
.site-footer a { color: var(--gold); }
.site-footer a:hover { text-decoration: underline; }
.site-footer p { margin-bottom: 0.3rem; }

/* ===== ADMIN LOGIN ===== */
.admin-login {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: var(--bg);
}
.login-card {
  background: var(--white); border-radius: var(--radius);
  box-shadow: var(--shadow-hover); padding: 3rem;
  width: 100%; max-width: 420px; text-align: center;
}
.login-card h1 { font-size: 1.8rem; margin-bottom: 0.5rem; }
.login-card p { color: var(--text-light); margin-bottom: 2rem; }
.login-card .login-error {
  background: #fdf0ef; color: #d9534f;
  padding: 0.75rem; border-radius: var(--radius-sm);
  margin-bottom: 1rem; display: none;
}

/* ===== ADMIN DASHBOARD ===== */
.admin-dashboard { padding: 2rem 0 4rem; }
.admin-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 2rem; flex-wrap: wrap; gap: 1rem;
}
.admin-header h2 { font-size: 1.8rem; }
.admin-header .admin-actions { display: flex; gap: 0.75rem; flex-wrap: wrap; }

.stats-bar {
  background: var(--white); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 1.25rem 1.5rem;
  margin-bottom: 1.5rem;
  font-size: 1.05rem;
}
.stats-bar strong { color: var(--navy); }
.stats-bar .new-count { color: var(--gold); }

.admin-filters {
  display: flex; gap: 0.75rem; margin-bottom: 1.25rem; flex-wrap: wrap;
}
.admin-filters select,
.admin-filters input {
  padding: 0.55rem 1rem;
  font-family: 'Source Sans 3', sans-serif; font-size: 0.9rem;
  border: 1.5px solid var(--bg-light); border-radius: var(--radius-sm);
  background: var(--white); color: var(--text);
}
.admin-filters select:focus,
.admin-filters input:focus {
  outline: none; border-color: var(--gold);
}
.admin-filters .search-input { flex: 1; min-width: 200px; }

.table-wrapper {
  background: var(--white); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow-x: auto;
}
table {
  width: 100%; border-collapse: collapse;
  font-size: 0.9rem;
}
th {
  background: var(--navy); color: var(--white);
  padding: 0.85rem 1rem; text-align: left;
  font-weight: 600; font-size: 0.85rem;
  white-space: nowrap; cursor: pointer;
  user-select: none;
}
th:hover { background: var(--navy-light); }
th .sort-arrow { font-size: 0.7rem; margin-left: 0.25rem; opacity: 0.5; }
th .sort-arrow.active { opacity: 1; }
td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--bg-light);
  vertical-align: top;
}
tr:nth-child(even) td { background: var(--bg); }
tr:hover td { background: var(--bg-light); }
td .truncate {
  max-width: 250px; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap;
}
td .expand-btn {
  color: var(--gold); cursor: pointer; font-size: 0.85rem;
  margin-left: 0.25rem;
}
td .expand-btn:hover { text-decoration: underline; }
td .full-text { display: none; }

.status-badge {
  display: inline-block; padding: 0.2rem 0.75rem; border-radius: 50px;
  font-size: 0.8rem; font-weight: 600; cursor: pointer;
  transition: all var(--transition);
}
.status-badge.new { background: var(--gold); color: var(--white); }
.status-badge.reviewed { background: var(--bg-light); color: var(--text-light); }

.no-data { text-align: center; padding: 3rem; color: var(--text-muted); }

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
  .positions-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .positions-grid { grid-template-columns: 1fr; }
  .jd-container iframe { display: none; }
  .pdf-mobile-fallback { display: block; padding: 2rem; text-align: center; color: var(--text-light); background: var(--bg-light); border-radius: var(--radius); margin-bottom: 2rem; }
  .pdf-mobile-fallback p { margin-bottom: 1rem; }
  .form-card { padding: 1.5rem; }
  .hero { padding: 3rem 1rem 2rem; }
  .admin-header { flex-direction: column; align-items: flex-start; }
  .admin-filters { flex-direction: column; }
}

@media (max-width: 480px) {
  .impact-strip { font-size: 0.9rem; }
  .impact-strip .separator { margin: 0 0.5rem; }
  .filter-btn { padding: 0.4rem 0.9rem; font-size: 0.82rem; }
  .position-detail h2 { font-size: 1.7rem; }
  .login-card { padding: 2rem 1.5rem; }
}

/* ===== ACCESSIBILITY ===== */
:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
