/* Ikigai School theme — bold editorial style in the logo colours.
 * Loaded last on every page (base.html and the testing layout), so it can
 * restyle the shell and shared components without rewriting each template.
 * Colours come from static/images/logo.png. */
:root {
  --ik-ink: #0b1d3f;          /* deep navy derived from the logo blue */
  --ik-ink-2: #132b59;
  --ik-blue: #23569b;         /* logo circle */
  --ik-cyan: #00afef;         /* logo petal, bottom */
  --ik-orange: #f58634;       /* logo petal, top — primary call to action */
  --ik-green: #00a859;        /* logo petal, left */
  --ik-red: #ed3237;          /* logo petal, right */
  --ik-paper: #eef3fa;
  --ik-line: #d6e0ee;
  --ik-text: #0b1d3f;
  --ik-muted: #5b6b84;
  --ik-font: 'Montserrat', 'Segoe UI', Arial, sans-serif;
  --ik-cut: 28px;             /* diagonal corner used on bands and tiles */
  --ik-grad-blue: linear-gradient(135deg, #2f6cc0 0%, #1a3f7a 100%);
  --ik-grad-orange: linear-gradient(135deg, #f8a057 0%, #d9621a 100%);
  --ik-grad-green: linear-gradient(135deg, #22c07a 0%, #007a41 100%);
  --ik-grad-red: linear-gradient(135deg, #f65a5e 0%, #b9161d 100%);
  --ik-grad-cyan: linear-gradient(135deg, #3cc6f5 0%, #0079b8 100%);
}

/* ---------- Typography ---------- */
html body { font-family: var(--ik-font); color: var(--ik-text); background: #fff; }
body h1, body h2, body h3, body h4, body h5, body h6,
body .h1, body .h2, body .h3, body .h4 { font-family: var(--ik-font); color: inherit; letter-spacing: -.01em; }
body h1, body .h1, body h2, body .h2 { font-weight: 900; text-transform: uppercase; line-height: 1.05; }
/* Long-form text keeps sentence case: question text, passages and blog articles. */
body .test-card h2, body .reading-body h2, body .reading-body h3, body article h2 { text-transform: none; font-weight: 700; line-height: 1.3; letter-spacing: 0; }
body h3, body .h3, body h4, body .h4 { font-weight: 800; }
body a { color: var(--ik-blue); }
body a:hover { color: var(--ik-orange); }
.ik-eyebrow, body .ik-section-label, body .ik-hero-eyebrow {
  font-family: var(--ik-font); font-weight: 800; text-transform: uppercase; letter-spacing: .16em; font-size: 12px; color: var(--ik-orange);
}

/* ---------- Shell: top bar, navigation, footer ---------- */
body .top-bar { background: var(--ik-ink) !important; padding: 8px 0; margin-bottom: 0 !important; border-bottom: 1px solid rgba(255,255,255,.08); }
body .top-bar a, body .top-bar span, body .top-bar strong { color: rgba(255,255,255,.86) !important; font-size: 13px; }
body .top-bar a:hover { color: var(--ik-orange) !important; }
body .top-bar-icon-btn { background: rgba(255,255,255,.08) !important; border-radius: 0 !important; }

body .sticky-nav, body .sticky-wrapper.is-sticky .sticky-nav, body #sticky-wrapper.is-sticky .sticky-nav {
  background: var(--ik-ink) !important; box-shadow: 0 6px 24px rgba(11,29,63,.35) !important; border: 0 !important;
}
body .sticky-nav .logo, body .nav-logo-text, body .sticky-nav.is-sticky .logo,
body #sticky-wrapper.is-sticky .sticky-nav .logo, body .js-sticky-header.is-sticky .logo {
  color: #fff !important; font-family: var(--ik-font); font-weight: 900; text-transform: uppercase; letter-spacing: .02em;
}
/* .sticky-nav raises specificity above base.html's dark #333 link colour. */
body .site-menu > li > a, body .site-menu-desktop > li > a, body .sticky-nav .site-menu > li > a {
  color: rgba(255,255,255,.9) !important; font-family: var(--ik-font); font-weight: 600 !important;
  text-transform: uppercase; font-size: 12.5px !important; letter-spacing: .04em;
}
body .site-menu > li > a:hover, body .site-menu > li.active > a,
body .sticky-nav .site-menu > li > a:hover, body .sticky-nav .site-menu > li.active > a { color: #fff !important; box-shadow: inset 0 -3px 0 var(--ik-orange); }
body .site-menu .dropdown, body .site-menu ul ul, body .site-menu .has-children .dropdown {
  background: var(--ik-ink-2) !important; border: 0 !important; border-radius: 0 !important; border-top: 3px solid var(--ik-orange) !important;
}
body .site-menu .dropdown a, body .site-menu ul ul a { color: rgba(255,255,255,.88) !important; }
body .site-menu .dropdown a:hover, body .site-menu ul ul a:hover { background: rgba(255,255,255,.06) !important; color: var(--ik-orange) !important; }
body .burger, body .js-menu-toggle, body .site-menu-toggle, body .mobile-menu-toggle { color: #fff !important; background: var(--ik-orange) !important; border-radius: 0 !important; }

body .site-footer { background: var(--ik-ink) !important; color: rgba(255,255,255,.75); position: relative; border-top: 4px solid var(--ik-orange); }
body .site-footer h2, body .site-footer h3, body .site-footer h4, body .site-footer .widget h3 { color: #fff !important; text-transform: uppercase; font-weight: 800; font-size: 14px; letter-spacing: .08em; }
body .site-footer a { color: rgba(255,255,255,.8) !important; }
body .site-footer a:hover { color: var(--ik-orange) !important; }

/* Footer "Мектепті табу": first four links, the rest behind a toggle (still in the HTML for search engines). */
body .footer-seo-links.is-collapsed li:nth-child(n+5) { display: none; }
body .footer-seo-toggle { background: none; border: 0; padding: 0; color: var(--ik-orange); font-weight: 700; text-transform: uppercase; font-size: 12px; letter-spacing: .08em; cursor: pointer; }
body .footer-seo-toggle::after { content: ' ↓'; }
body .footer-seo-toggle[aria-expanded="true"]::after { content: ' ↑'; }
body .footer-seo-toggle:hover, body .footer-seo-toggle:focus-visible { color: #fff; }

/* ---------- Buttons ---------- */
body .btn { font-family: var(--ik-font); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; border-radius: 0 !important; }
body .btn-primary, body .nav-enroll-btn, body .ik-btn-white, body .ik-btn-submit, body .btn-attendance, body .hw-button {
  background: var(--ik-orange) !important; border-color: var(--ik-orange) !important; color: #fff !important; border-radius: 0 !important;
  box-shadow: none !important;
}
body .btn-primary:hover, body .ik-btn-white:hover, body .ik-btn-submit:hover, body .btn-attendance:hover, body .hw-button:hover {
  background: #de6c1b !important; border-color: #de6c1b !important; color: #fff !important;
}
body .btn-secondary, body .btn-outline-primary, body .ik-btn-ghost {
  background: transparent !important; color: var(--ik-blue) !important; border: 2px solid currentColor !important; border-radius: 0 !important;
}
body .ik-hero .ik-btn-ghost { color: #fff !important; }
body .btn-success { background: var(--ik-green) !important; border-color: var(--ik-green) !important; }
body .btn-danger { background: var(--ik-red) !important; border-color: var(--ik-red) !important; }
body .btn-info { background: var(--ik-cyan) !important; border-color: var(--ik-cyan) !important; }

/* ---------- Bands, cards, tiles ---------- */
.ik-band, body .dashboard-header, body .page-header-ik {
  background: var(--ik-ink) !important; color: #fff !important; border-radius: 0 !important; position: relative;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - var(--ik-cut)), calc(100% - var(--ik-cut) * 3) 100%, 0 100%);
  padding: 36px 28px calc(28px + var(--ik-cut)) !important;
}
body .dashboard-header h1, .ik-band h1 { color: #fff !important; font-size: clamp(28px, 4vw, 48px) !important; }
body .dashboard-header p, .ik-band p { color: rgba(255,255,255,.8) !important; }

body .card { border-radius: 0 !important; border: 1px solid var(--ik-line) !important; box-shadow: 0 10px 30px rgba(11,29,63,.06) !important; }
body .card-header { background: var(--ik-ink) !important; color: #fff !important; border-radius: 0 !important; font-weight: 800; text-transform: uppercase; letter-spacing: .03em; }
body .card-header * { color: #fff; }

.ik-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.ik-tile {
  display: block; position: relative; padding: 24px 22px 28px; color: #fff !important; text-decoration: none !important;
  background: var(--ik-grad-blue); min-height: 150px; overflow: hidden; transition: transform .2s ease, filter .2s ease;
}
.ik-tile:hover { transform: translateY(-3px); filter: brightness(1.06); color: #fff !important; }
.ik-tile .ik-tile-num { font-size: 44px; font-weight: 900; line-height: 1; opacity: .55; display: block; margin-bottom: 10px; }
.ik-tile h3 { color: #fff; text-transform: uppercase; font-weight: 900; font-size: 17px; margin: 0 0 8px; }
.ik-tile p { color: rgba(255,255,255,.85); margin: 0; font-size: 14px; }
.ik-tile--orange { background: var(--ik-grad-orange); }
.ik-tile--green { background: var(--ik-grad-green); }
.ik-tile--red { background: var(--ik-grad-red); }
.ik-tile--cyan { background: var(--ik-grad-cyan); }

/* Home page sections (templates/accounts/home.html) */
body .ik-section-light { background: var(--ik-paper) !important; }
body .ik-section-title { font-weight: 900 !important; text-transform: uppercase; color: var(--ik-ink) !important; letter-spacing: -.01em; }
body .ik-hero { background-color: var(--ik-ink) !important; }
body .ik-hero-title { font-family: var(--ik-font) !important; font-weight: 900 !important; text-transform: uppercase; letter-spacing: -.02em; }
body .ik-hero-title em, body .ik-hero-title span { color: var(--ik-orange) !important; }

/* ---------- Tables and forms ---------- */
body .table thead th, body table.table th { background: var(--ik-ink); color: #fff; text-transform: uppercase; font-size: 12px; letter-spacing: .06em; border: 0; }
body .form-control, body select, body textarea, body input[type=text], body input[type=email], body input[type=password],
body input[type=number], body input[type=date], body input[type=datetime-local], body input[type=search] { border-radius: 0 !important; }
body .form-control:focus { border-color: var(--ik-orange) !important; box-shadow: 0 0 0 3px rgba(245,134,52,.2) !important; }
body .badge { border-radius: 0; font-weight: 700; }

/* ---------- Homework (templates/homework) ---------- */
body .hw-head h1 { color: var(--ik-ink); }
body .hw-card { border-radius: 0; border-left-color: var(--ik-blue); box-shadow: 0 10px 30px rgba(11,29,63,.06); }
body .hw-card h3 { color: var(--ik-ink); text-transform: uppercase; font-weight: 800; }
body .hw-subject { background: var(--ik-ink); color: #fff; border-radius: 0; text-transform: uppercase; font-size: 12px; letter-spacing: .05em; }
body .hw-deadline { color: var(--ik-red); }

/* ---------- AI helper button ---------- */
body .ikigai-ai-button { background: var(--ik-orange) !important; border-radius: 0 !important; font-family: var(--ik-font); text-transform: uppercase; font-weight: 700; }

/* ---------- Testing pages (templates/exams/layout.html) ---------- */
body .testing-header { background: var(--ik-ink); border: 0; color: rgba(255,255,255,.75); border-bottom: 4px solid var(--ik-orange); }
body .testing-header .brand { white-space: nowrap; color: #fff; font-weight: 900; text-transform: uppercase; letter-spacing: .02em; display: inline-flex; align-items: center; gap: 10px; }
body .testing-header .brand img { width: 34px; height: 34px; }
body .testing-header span { text-transform: uppercase; font-size: 12px; font-weight: 700; letter-spacing: .14em; }
body .testing { color: var(--ik-text); }
body .testing > .test-nav:first-child a { text-transform: uppercase; font-weight: 700; font-size: 12.5px; letter-spacing: .05em; color: var(--ik-ink); }
body .testing > .test-nav:first-child a:hover { color: var(--ik-orange); text-decoration: none; }
body .testing h1 { font-size: clamp(28px, 4vw, 46px); }
body .testing .eyebrow { color: var(--ik-orange); font-weight: 800; }
body .testing button, body .testing .button { background: var(--ik-orange); border-radius: 0; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; font-size: 13px; }
body .testing .secondary, body .testing .subject-tab { background: var(--ik-paper); color: var(--ik-ink); }
body .testing .subject-tab.current { background: var(--ik-ink); color: #fff; }
body .testing .danger { background: var(--ik-red); }
body .testing .test-card { border-radius: 0; border-color: var(--ik-line); box-shadow: 0 10px 30px rgba(11,29,63,.06); }
body .testing .badge { background: var(--ik-ink); color: #fff; text-transform: uppercase; font-size: 12px; letter-spacing: .05em; }
body .testing .notice { border-left-color: var(--ik-orange); background: var(--ik-paper); }
body .testing th { background: var(--ik-ink); color: #fff; text-transform: uppercase; font-size: 12px; letter-spacing: .05em; }
body .testing .option { border-radius: 0; }
body .testing .option:has(input:checked) { border-color: var(--ik-blue); background: #e9f1fc; box-shadow: inset 4px 0 0 var(--ik-blue); }
body .testing .question-nav button { border-radius: 0; text-transform: none; letter-spacing: 0; background: var(--ik-paper); color: var(--ik-ink); }
body .testing .question-nav button.current { border-color: var(--ik-orange); }
body .testing .timer { border-radius: 0; }
body .testing .score { font-weight: 900; color: var(--ik-ink); }
body .testing input:not([type=radio]):not([type=checkbox]), body .testing select, body .testing textarea { border-radius: 0; }

@media (max-width: 768px) {
  :root { --ik-cut: 18px; }
  body h1, body .h1 { font-size: 30px; }
  body h2, body .h2 { font-size: 24px; }
  .ik-band, body .dashboard-header { padding: 26px 16px calc(20px + var(--ik-cut)) !important; }
}
@media (prefers-reduced-motion: reduce) { .ik-tile { transition: none; } .ik-tile:hover { transform: none; } }
