/*
Theme Name: StudentsCorner
Theme URI: https://example.com/
Author: StudentsCorner
Description: Custom multi-page WordPress theme converted from the StudentsCorner static website.
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 7.4
Text Domain: studentscorner
*/
/* =========================================================
   StudentsCorner — Core Design System
   "Your Corner for Every Opportunity"
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@500;600;700;800&family=Inter:wght@400;500;600;700&display=swap');

:root {
  /* ---- Color tokens ---- */
  --primary: #1E4B8C;
  --primary-dark: #163a6c;
  --primary-light: #e8f0fb;
  --secondary: #ffffff;
  --background: #f5f7fb;
  --surface: #ffffff;
  --text: #17203a;
  --muted: #64748b;
  --border: #e2e8f0;
  --success: #16a34a;
  --success-bg: #e9f9ef;
  --warning: #b45309;
  --warning-bg: #fef3e0;
  --danger: #dc2626;
  --danger-bg: #fdecec;
  --accent: #f5a623;

  /* ---- Layout tokens ---- */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --shadow-sm: 0 1px 2px rgba(23, 32, 58, 0.06);
  --shadow-md: 0 6px 20px rgba(23, 32, 58, 0.08);
  --shadow-lg: 0 16px 40px rgba(23, 32, 58, 0.12);
  --header-h: 68px;
  --ticker-h: 38px;
  --max-width: 1240px;

  --font-display: 'Poppins', 'Segoe UI', system-ui, sans-serif;
  --font-body: 'Inter', 'Segoe UI', system-ui, sans-serif;
}

[data-theme="dark"] {
  --primary: #4d84d6;
  --primary-dark: #3a6bb8;
  --primary-light: #14243d;
  --secondary: #0f1626;
  --background: #0b1120;
  --surface: #121a2e;
  --text: #e7ecf7;
  --muted: #94a3c0;
  --border: #223154;
  --success: #34d399;
  --success-bg: #0f2c22;
  --warning: #fbbf5f;
  --warning-bg: #2c2210;
  --danger: #f87171;
  --danger-bg: #2c1414;
  --accent: #f5b94a;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--background);
  color: var(--text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  transition: background .2s ease, color .2s ease;
}
h1, h2, h3, h4 { font-family: var(--font-display); color: var(--text); margin: 0 0 .5em; line-height: 1.25; }
h1 { font-size: clamp(1.7rem, 3.5vw, 2.5rem); font-weight: 800; }
h2 { font-size: clamp(1.3rem, 2.5vw, 1.7rem); font-weight: 700; }
h3 { font-size: 1.15rem; font-weight: 700; }
p { margin: 0 0 1em; color: var(--muted); }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
ul { padding-left: 1.2em; }
button { font-family: inherit; cursor: pointer; }

.container { max-width: var(--max-width); margin: 0 auto; padding: 0 20px; }

/* ---- Focus states (accessibility) ---- */
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

/* ================= HEADER ================= */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.sc-ticker {
  background: var(--primary);
  color: #fff;
  font-size: .82rem;
  height: var(--ticker-h);
  display: flex; align-items: center; overflow: hidden;
}
.sc-ticker .label { flex: none; background: var(--primary-dark); padding: 0 14px; height: 100%; display: flex; align-items: center; font-weight: 700; letter-spacing: .03em; }
.sc-ticker .track-wrap { flex: 1; overflow: hidden; white-space: nowrap; }
.sc-ticker .track { display: inline-block; padding-left: 100%; animation: ticker 28s linear infinite; }
.sc-ticker .track span { margin-right: 48px; }
@keyframes ticker { from { transform: translateX(0); } to { transform: translateX(-100%); } }
@media (prefers-reduced-motion: reduce) { .sc-ticker .track { animation: none; } }

.header-main { display: flex; align-items: center; justify-content: space-between; height: var(--header-h); gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 800; font-size: 1.25rem; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand-mark { width: 38px; height: 38px; border-radius: 11px; background: linear-gradient(135deg, var(--primary), var(--primary-dark)); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: .95rem; flex: none; }
.brand small { display: block; font-family: var(--font-body); font-weight: 500; font-size: .68rem; color: var(--muted); }

.main-nav { display: none; }
.main-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 4px; }
.main-nav a { color: var(--text); font-weight: 600; font-size: .9rem; padding: 8px 12px; border-radius: var(--radius-sm); display: block; }
.main-nav a:hover, .main-nav a.active { background: var(--primary-light); color: var(--primary); text-decoration: none; }

.header-actions { display: flex; align-items: center; gap: 6px; }
.icon-btn { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--border); background: var(--surface); color: var(--text); display: flex; align-items: center; justify-content: center; }
.icon-btn:hover { background: var(--primary-light); border-color: var(--primary); }
.hamburger { display: flex; }
@media (min-width: 960px) { .main-nav { display: block; } .hamburger { display: none; } }

.header-search { position: relative; display: none; }
.header-search input { width: 220px; padding: 8px 12px 8px 34px; border-radius: 999px; border: 1px solid var(--border); background: var(--background); color: var(--text); font-size: .85rem; }
@media (min-width: 1180px) { .header-search { display: block; } }

/* Mobile drawer */
.mobile-drawer { position: fixed; inset: 0; z-index: 200; display: none; }
.mobile-drawer.open { display: block; }
.mobile-drawer .backdrop { position: absolute; inset: 0; background: rgba(10,15,30,.5); }
.mobile-drawer .panel { position: absolute; top: 0; right: 0; width: min(320px, 85vw); height: 100%; background: var(--surface); padding: 18px; overflow-y: auto; box-shadow: var(--shadow-lg); }
.mobile-drawer .panel-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.mobile-drawer nav ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 2px; }
.mobile-drawer nav a { display: block; padding: 12px 10px; border-radius: var(--radius-sm); color: var(--text); font-weight: 600; }
.mobile-drawer nav a:hover, .mobile-drawer nav a.active { background: var(--primary-light); color: var(--primary); text-decoration: none; }
.mobile-drawer input[type="search"] { width: 100%; padding: 10px 12px; border-radius: var(--radius-sm); border: 1px solid var(--border); margin-bottom: 14px; background: var(--background); color: var(--text); }

/* ================= HERO ================= */
.hero { background: linear-gradient(180deg, var(--primary-light), var(--background) 70%); padding: 48px 0 40px; text-align: center; }
.hero p.lead { max-width: 620px; margin: 0 auto 22px; color: var(--muted); font-size: 1.02rem; }
.search-box { max-width: 640px; margin: 0 auto; display: flex; gap: 8px; background: var(--surface); padding: 8px; border-radius: 999px; box-shadow: var(--shadow-md); border: 1px solid var(--border); }
.search-box input { flex: 1; border: none; background: transparent; padding: 10px 14px; font-size: .95rem; color: var(--text); }
.search-box input:focus { outline: none; }
.search-box button { background: var(--primary); color: #fff; border: none; padding: 10px 22px; border-radius: 999px; font-weight: 700; font-size: .9rem; }
.search-box button:hover { background: var(--primary-dark); }
.hero-tags { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 16px; }
.hero-tags a { font-size: .8rem; padding: 5px 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); color: var(--muted); }
.hero-tags a:hover { color: var(--primary); border-color: var(--primary); text-decoration: none; }

/* ================= SECTIONS ================= */
.section { padding: 40px 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 18px; gap: 10px; flex-wrap: wrap; }
.section-head .eyebrow { display: block; font-size: .74rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--primary); margin-bottom: 4px; }
.view-all { font-size: .85rem; font-weight: 700; white-space: nowrap; }

/* ================= CARDS ================= */
.grid { display: grid; gap: 16px; }
.grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 960px) { .grid.cols-4 { grid-template-columns: repeat(2, 1fr); } .grid.cols-3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .grid.cols-4, .grid.cols-3, .grid.cols-2 { grid-template-columns: 1fr; } }

.cat-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 20px; text-align: left; box-shadow: var(--shadow-sm); transition: transform .15s ease, box-shadow .15s ease; }
.cat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); text-decoration: none; border-color: var(--primary); }
.cat-card .cat-icon { width: 44px; height: 44px; border-radius: var(--radius-sm); background: var(--primary-light); color: var(--primary); display: flex; align-items: center; justify-content: center; font-size: 1.3rem; margin-bottom: 12px; }
.cat-card h3 { margin-bottom: 4px; color: var(--text); }
.cat-card span.count { font-size: .8rem; color: var(--muted); }

.post-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 18px; box-shadow: var(--shadow-sm); display: flex; flex-direction: column; gap: 10px; }
.post-card:hover { box-shadow: var(--shadow-md); border-color: var(--primary); }
.post-card .row-top { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.post-card h3 a { color: var(--text); }
.post-card h3 a:hover { color: var(--primary); text-decoration: none; }
.badge { display: inline-block; font-size: .7rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.badge.status-active { background: var(--success-bg); color: var(--success); }
.badge.status-closed { background: var(--danger-bg); color: var(--danger); }
.badge.status-upcoming { background: var(--warning-bg); color: var(--warning); }
.badge.cat { background: var(--primary-light); color: var(--primary); }
.post-meta { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 6px 14px; font-size: .82rem; color: var(--muted); }
.post-meta li strong { color: var(--text); font-weight: 600; }
.post-card .cta-row { display: flex; justify-content: space-between; align-items: center; margin-top: 4px; padding-top: 10px; border-top: 1px dashed var(--border); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border-radius: var(--radius-sm); font-weight: 700; font-size: .85rem; padding: 9px 16px; border: 1px solid transparent; cursor: pointer; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); text-decoration: none; color: #fff; }
.btn-outline { background: transparent; color: var(--primary); border-color: var(--primary); }
.btn-outline:hover { background: var(--primary-light); text-decoration: none; }
.btn-sm { padding: 6px 12px; font-size: .78rem; }
.btn-block { width: 100%; }

/* ================= LAYOUT: content + sidebar ================= */
.layout { display: grid; grid-template-columns: 1fr; gap: 26px; }
@media (min-width: 960px) { .layout.with-sidebar { grid-template-columns: 2.4fr 1fr; } }
.sidebar { display: flex; flex-direction: column; gap: 18px; }
.widget { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 18px; box-shadow: var(--shadow-sm); }
.widget h3 { font-size: 1rem; margin-bottom: 12px; padding-bottom: 10px; border-bottom: 2px solid var(--primary-light); }
.widget ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.widget ul li a { color: var(--text); font-size: .85rem; font-weight: 600; }
.widget ul li a:hover { color: var(--primary); }
.ad-slot { background: var(--primary-light); border: 1px dashed var(--primary); border-radius: var(--radius-md); padding: 24px; text-align: center; color: var(--primary); font-size: .78rem; font-weight: 700; letter-spacing: .04em; }

/* ================= BREADCRUMBS ================= */
.breadcrumbs { font-size: .82rem; color: var(--muted); margin-bottom: 16px; display: flex; flex-wrap: wrap; gap: 4px; }
.breadcrumbs a { color: var(--muted); font-weight: 600; }
.breadcrumbs a:hover { color: var(--primary); }
.breadcrumbs .sep { opacity: .5; }
.breadcrumbs .current { color: var(--text); font-weight: 700; }

.job-subnav { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 4px; }
.job-subnav a { padding: 7px 16px; border-radius: 999px; border: 1px solid var(--border); font-size: .85rem; font-weight: 600; color: var(--text); }
.job-subnav a:hover { border-color: var(--primary); color: var(--primary); }
.job-subnav a.active { background: var(--primary); border-color: var(--primary); color: #fff; }

/* ================= FILTERS / TOOLBAR ================= */
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 14px; margin-bottom: 20px; }
.toolbar select, .toolbar input { padding: 8px 10px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--background); color: var(--text); font-size: .84rem; }
.toolbar .spacer { flex: 1; }
.toolbar .result-count { font-size: .82rem; color: var(--muted); font-weight: 600; }

/* ================= PAGINATION ================= */
.pagination { display: flex; justify-content: center; gap: 6px; margin-top: 26px; flex-wrap: wrap; }
.pagination button { min-width: 38px; height: 38px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface); color: var(--text); font-weight: 700; font-size: .85rem; }
.pagination button.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.pagination button:disabled { opacity: .4; cursor: not-allowed; }

/* ================= EMPTY / SKELETON ================= */
.empty-state { text-align: center; padding: 60px 20px; color: var(--muted); }
.empty-state h3 { color: var(--text); margin-bottom: 8px; }
.skeleton { background: linear-gradient(90deg, var(--border) 25%, var(--surface) 37%, var(--border) 63%); background-size: 400% 100%; animation: shimmer 1.4s ease infinite; border-radius: var(--radius-md); height: 160px; }
@keyframes shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

/* ================= TABLES ================= */
.sc-table { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; }
.sc-table th, .sc-table td { padding: 12px 14px; text-align: left; font-size: .85rem; border-bottom: 1px solid var(--border); }
.sc-table th { background: var(--primary-light); color: var(--primary); font-weight: 700; }
.sc-table tr:last-child td { border-bottom: none; }
.table-wrap { overflow-x: auto; }

/* ================= FORMS ================= */
.form-grid { display: grid; gap: 14px; grid-template-columns: 1fr 1fr; }
@media (max-width: 620px) { .form-grid { grid-template-columns: 1fr; } }
.form-field { display: flex; flex-direction: column; gap: 6px; }
.form-field.full { grid-column: 1 / -1; }
.form-field label { font-size: .84rem; font-weight: 700; }
.form-field input, .form-field select, .form-field textarea {
  padding: 10px 12px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--background); color: var(--text); font-size: .9rem; font-family: inherit;
}
.form-field textarea { resize: vertical; min-height: 100px; }
.form-error { font-size: .78rem; color: var(--danger); min-height: 1em; }
.form-success { background: var(--success-bg); color: var(--success); padding: 12px 14px; border-radius: var(--radius-sm); font-weight: 700; font-size: .88rem; }

/* ================= STATIC CONTENT PAGES ================= */
.static-page { max-width: 820px; margin: 0 auto; }
.static-page h2 { margin-top: 1.6em; }
.page-hero { background: var(--primary-light); padding: 34px 0; text-align: center; margin-bottom: 10px; }
.page-hero h1 { margin-bottom: 6px; }

/* ================= FOOTER ================= */
.site-footer { background: var(--primary-dark); color: #dbe6f7; margin-top: 40px; }
[data-theme="dark"] .site-footer { background: #060a15; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 26px; padding: 44px 0 24px; }
@media (max-width: 800px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .footer-grid { grid-template-columns: 1fr; } }
.footer-grid h4 { color: #fff; font-size: .92rem; margin-bottom: 14px; }
.footer-grid ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 9px; }
.footer-grid a { color: #b9c9e6; font-size: .85rem; }
.footer-grid a:hover { color: #fff; }
.footer-brand p { color: #b9c9e6; font-size: .85rem; max-width: 320px; }
.footer-social { display: flex; gap: 10px; margin-top: 14px; }
.footer-social a { width: 36px; height: 36px; border-radius: 50%; background: rgba(255,255,255,.08); display: flex; align-items: center; justify-content: center; color: #fff; font-size: .85rem; }
.footer-social a:hover { background: var(--accent); text-decoration: none; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.12); padding: 16px 0; text-align: center; font-size: .78rem; color: #97a9c9; }

/* ================= 404 ================= */
.error-page { text-align: center; padding: 80px 20px; }
.error-page .code { font-family: var(--font-display); font-weight: 800; font-size: clamp(4rem, 16vw, 8rem); color: var(--primary); line-height: 1; }
.error-actions { display: flex; gap: 10px; justify-content: center; margin-top: 22px; flex-wrap: wrap; }

/* ================= ADMIN ================= */
.admin-shell { display: grid; grid-template-columns: 230px 1fr; min-height: 100vh; }
@media (max-width: 800px) { .admin-shell { grid-template-columns: 1fr; } }
.admin-sidebar { background: var(--primary-dark); color: #dbe6f7; padding: 20px 14px; }
.admin-sidebar .brand { color: #fff; margin-bottom: 22px; }
.admin-sidebar nav ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 2px; }
.admin-sidebar nav a { display: block; padding: 10px 12px; border-radius: var(--radius-sm); color: #cddcf4; font-size: .87rem; font-weight: 600; }
.admin-sidebar nav a:hover, .admin-sidebar nav a.active { background: rgba(255,255,255,.1); color: #fff; text-decoration: none; }
.admin-sidebar .group-label { font-size: .68rem; text-transform: uppercase; letter-spacing: .06em; color: #90a6cc; margin: 16px 12px 6px; }
.admin-main { padding: 26px; }
.admin-topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 22px; flex-wrap: wrap; gap: 10px; }
.admin-banner { background: var(--warning-bg); color: var(--warning); border: 1px solid var(--warning); border-radius: var(--radius-sm); padding: 10px 14px; font-size: .82rem; font-weight: 600; margin-bottom: 20px; }
.stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 18px; box-shadow: var(--shadow-sm); }
.stat-card .num { font-family: var(--font-display); font-size: 1.7rem; font-weight: 800; color: var(--primary); }
.stat-card .lbl { font-size: .8rem; color: var(--muted); font-weight: 600; }

/* ================= TOOLS ================= */
.tool-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.tool-tabs button { padding: 9px 16px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font-weight: 700; font-size: .84rem; }
.tool-tabs button.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.tool-panel { display: none; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 24px; box-shadow: var(--shadow-sm); }
.tool-panel.active { display: block; }
.tool-result { margin-top: 16px; padding: 14px; border-radius: var(--radius-sm); background: var(--primary-light); color: var(--primary); font-weight: 700; display: none; }
.tool-result.show { display: block; }

.skip-link { position: absolute; left: -999px; top: 0; background: var(--primary); color: #fff; padding: 10px 16px; z-index: 999; border-radius: 0 0 8px 0; }
.skip-link:focus { left: 0; }

@media (max-width: 640px) { .header-main { padding: 0; } .footer-grid { text-align: left; } }
