/* Institute Manager theme
 * Colours: ink, bottle green, emerald, paper, ruled-line blue, register gold.
 * Type: Familjen Grotesk (headings), Atkinson Hyperlegible (text).
 */
:root {
  --ink: #13211B;
  --ink-soft: #46574F;
  --bottle: #0E3B2C;
  --emerald: #0B6E4F;
  --emerald-dark: #085A40;
  --paper: #F4F7F2;
  --white: #FFFFFF;
  --rule: #CBDCEA;
  --rule-strong: #9FBBD3;
  --gold: #E2A72E;
  --gold-soft: #FBEFD2;
  --line: #DCE4DE;
  --head: "Familjen Grotesk", "Segoe UI", system-ui, sans-serif;
  --text: "Atkinson Hyperlegible", "Segoe UI", system-ui, sans-serif;
  --wrap: 1180px;
  --gutter: clamp(16px, 4vw, 40px);
  --radius: 10px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { transition: none !important; animation: none !important; } }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1.0625rem/1.6 var(--text);
}
img, svg { max-width: 100%; height: auto; }
a { color: var(--emerald); text-underline-offset: 3px; }
a:hover { color: var(--emerald-dark); }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3 { font-family: var(--head); line-height: 1.12; letter-spacing: -0.015em; margin: 0 0 .5em; color: var(--ink); }
h1 { font-size: clamp(2.1rem, 4.6vw, 3.6rem); font-weight: 700; }
h2 { font-size: clamp(1.7rem, 3vw, 2.4rem); font-weight: 700; }
h3 { font-size: 1.25rem; font-weight: 600; }
p { margin: 0 0 1em; }

.imt-wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.imt-wrap-text { max-width: 820px; }
.imt-wrap-app { max-width: var(--wrap); }
.imt-ico { width: 1.25em; height: 1.25em; fill: currentColor; flex: none; }

.imt-skip { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--white); color: var(--ink); padding: 10px 16px; border-radius: 6px; }
.imt-skip:focus { left: 8px; }

/* ---------- buttons ---------- */
.imt-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 18px; border-radius: 8px; border: 2px solid transparent;
  font: 600 1rem/1.2 var(--head); text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background-color .15s, color .15s, border-color .15s;
}
.imt-btn-primary { background: var(--gold); color: var(--ink); }
.imt-btn-primary:hover { background: #D19520; color: var(--ink); }
.imt-btn-quiet { color: inherit; }
.imt-btn-quiet:hover { background: rgba(255,255,255,.1); color: inherit; }
.imt-btn-line { border-color: var(--ink); color: var(--ink); }
.imt-btn-line:hover { background: var(--ink); color: var(--white); }
.imt-btn-big { min-height: 52px; padding: 12px 24px; font-size: 1.0625rem; }

/* ---------- header ---------- */
.imt-header { background: var(--bottle); color: var(--white); position: sticky; top: 0; z-index: 50; }
.admin-bar .imt-header { top: 32px; }
@media (max-width: 782px) { .admin-bar .imt-header { top: 0; position: relative; } }
.imt-header-row { display: flex; align-items: center; gap: 24px; min-height: 68px; }
.imt-brand { display: flex; align-items: center; gap: 10px; color: var(--white); text-decoration: none; margin-right: auto; min-width: 0; }
.imt-brand:hover { color: var(--white); }
.imt-brand-name { font: 700 1.125rem/1.15 var(--head); overflow: hidden; text-overflow: ellipsis; }
.imt-logo-img { max-height: 44px; width: auto; }
.imt-mark { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 9px; background: var(--gold); color: var(--bottle); flex: none; }
.imt-mark .imt-ico { width: 26px; height: 26px; }
.imt-mark-small { width: 34px; height: 34px; }
.imt-mark-small .imt-ico { width: 22px; height: 22px; }
.imt-nav { display: flex; align-items: center; gap: 12px; }
.imt-menu { list-style: none; display: flex; gap: 4px; margin: 0; padding: 0; }
.imt-menu a { display: block; white-space: nowrap; padding: 10px 12px; color: rgba(255,255,255,.88); text-decoration: none; font-weight: 700; border-radius: 6px; }
.imt-menu a:hover, .imt-menu .current-menu-item > a { color: var(--white); background: rgba(255,255,255,.08); }
.imt-account { display: flex; gap: 8px; }
.imt-menu-toggle { display: none; align-items: center; gap: 6px; min-height: 44px; padding: 8px 12px; border: 1px solid rgba(255,255,255,.35); border-radius: 8px; background: transparent; color: var(--white); font: 600 1rem var(--head); cursor: pointer; }

@media (max-width: 1080px) {
  .imt-menu-toggle { display: inline-flex; }
  .imt-nav { display: none; position: absolute; left: 0; right: 0; top: 100%; background: var(--bottle); flex-direction: column; align-items: stretch; gap: 8px; padding: 8px var(--gutter) 20px; border-top: 1px solid rgba(255,255,255,.12); }
  .imt-nav-open .imt-nav { display: flex; }
  .imt-menu { flex-direction: column; }
  .imt-menu a { padding: 14px 4px; border-bottom: 1px solid rgba(255,255,255,.1); border-radius: 0; }
  .imt-account { flex-direction: column; }
  .imt-account .imt-btn-quiet { border-color: rgba(255,255,255,.35); }
}

/* ---------- hero ---------- */
.imt-hero { padding: clamp(40px, 7vw, 88px) 0 clamp(48px, 7vw, 96px); }
.imt-hero-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(32px, 5vw, 64px); align-items: center; }
.imt-hero h1 { max-width: 15ch; }
.imt-lead { font-size: 1.1875rem; color: var(--ink-soft); max-width: 36em; }
.imt-actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 28px 0 18px; }
.imt-note { font-size: .9375rem; color: var(--ink-soft); }
@media (max-width: 900px) { .imt-hero-grid { grid-template-columns: minmax(0, 1fr); } }

/* the printed timetable sheet */
.imt-sheet {
  margin: 0; background: var(--white); border: 1px solid var(--rule-strong); border-radius: 4px;
  box-shadow: 0 1px 0 var(--rule), 0 18px 40px -24px rgba(14,59,44,.45);
  padding: 18px 18px 20px; transform: rotate(.6deg);
  background-image: linear-gradient(90deg, transparent 38px, #F2C9C9 38px, #F2C9C9 39px, transparent 39px);
}
.imt-sheet-title { font: 700 1.15rem/1 var(--head); text-align: center; letter-spacing: .02em; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 5px; margin: 0 0 14px; color: var(--ink); }
.imt-sheet-scroll { overflow-x: auto; }
.imt-sheet table { width: 100%; min-width: 500px; border-collapse: collapse; font-size: .8125rem; line-height: 1.25; }
.imt-sheet th, .imt-sheet td { border: 1px solid var(--ink); padding: 7px 6px; text-align: center; vertical-align: middle; }
.imt-sheet thead th { background: #EEF4F9; font: 700 .9375rem/1.1 var(--head); }
.imt-sheet thead small { display: block; font: 400 .6875rem var(--text); color: var(--ink-soft); margin-top: 2px; }
.imt-sheet tbody th { text-align: left; font-weight: 700; white-space: nowrap; background: #FAFCFA; }
.imt-sheet td small, .imt-sheet tbody th small { display: block; color: var(--ink-soft); font-size: .75rem; font-weight: 400; margin-top: 2px; }
.imt-sheet .imt-recess { width: 30px; padding: 0; background: repeating-linear-gradient(45deg, #F7F9F7 0 6px, #EDF2EE 6px 7px); }
.imt-sheet td.imt-recess span { writing-mode: vertical-rl; transform: rotate(180deg); font: 700 .75rem var(--head); letter-spacing: .3em; color: var(--ink-soft); }
.imt-cover-cell { position: relative; }
.imt-slip {
  position: absolute; left: 50%; bottom: -13px; z-index: 1; transform: translateX(-50%) rotate(-3deg);
  background: var(--gold); color: var(--ink); font: 700 .6875rem/1.2 var(--head); white-space: nowrap;
  padding: 4px 8px; border-radius: 2px; box-shadow: 0 3px 8px -2px rgba(0,0,0,.25);
}
@media (prefers-reduced-motion: no-preference) {
  .imt-slip { animation: imt-slip .5s .6s both cubic-bezier(.2,.8,.3,1.3); }
  @keyframes imt-slip { from { opacity: 0; transform: translate(-50%, -10px) rotate(-12deg); } }
}
@media (max-width: 900px) { .imt-sheet { transform: none; } }

/* ---------- sections ---------- */
.imt-section { padding: clamp(56px, 8vw, 104px) 0; }
.imt-roles { background: var(--white); border-top: 1px solid var(--line); }
.imt-role-cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 28px; }
.imt-role { padding: 0 clamp(20px, 3vw, 40px); border-left: 1px solid var(--line); }
.imt-role:first-child { padding-left: 0; border-left: 0; }
.imt-role h3 { font-size: 1.5rem; padding-bottom: 10px; border-bottom: 3px solid var(--emerald); display: inline-block; }
.imt-role ul { list-style: none; margin: 8px 0 0; padding: 0; }
.imt-role li { padding: 12px 0; border-bottom: 1px solid var(--line); color: var(--ink-soft); }
.imt-role li:last-child { border-bottom: 0; }
@media (max-width: 860px) {
  .imt-role-cols { grid-template-columns: 1fr; gap: 32px; }
  .imt-role { padding: 0; border-left: 0; }
}

.imt-how { background: var(--paper); }
.imt-steps { list-style: none; margin: 32px 0 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 28px; counter-reset: step; }
.imt-steps li { counter-increment: step; position: relative; padding-top: 64px; }
.imt-steps li::before {
  content: counter(step); position: absolute; top: 0; left: 0;
  width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center;
  background: var(--bottle); color: var(--white); font: 700 1.25rem var(--head);
}
.imt-steps li:not(:last-child)::after { content: ""; position: absolute; top: 23px; left: 58px; right: -16px; border-top: 2px dashed var(--rule-strong); }
.imt-steps p { color: var(--ink-soft); }
@media (max-width: 900px) {
  .imt-steps { grid-template-columns: 1fr; gap: 0; }
  .imt-steps li { padding: 0 0 28px 66px; min-height: 46px; }
  .imt-steps li:not(:last-child)::after { top: 52px; bottom: 4px; left: 22px; right: auto; border-top: 0; border-left: 2px dashed var(--rule-strong); }
}

.imt-app { background: var(--bottle); color: var(--white); }
.imt-app h2 { color: var(--white); }
.imt-app .imt-lead, .imt-app .imt-note { color: rgba(255,255,255,.8); }
.imt-app-grid { display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); gap: 48px; align-items: center; }
.imt-stores { display: flex; flex-wrap: wrap; gap: 12px; margin: 26px 0 14px; }
.imt-store { display: inline-flex; align-items: center; gap: 12px; min-height: 58px; padding: 10px 20px 10px 16px; border-radius: 10px; background: var(--white); color: var(--ink); text-decoration: none; font: 700 1.125rem/1.1 var(--head); }
.imt-store:hover { background: var(--gold-soft); color: var(--ink); }
.imt-store .imt-ico { width: 28px; height: 28px; color: var(--emerald); }
.imt-store small { display: block; font: 400 .75rem var(--text); color: var(--ink-soft); }
.imt-store-soon { background: transparent; color: var(--white); border: 1px dashed rgba(255,255,255,.45); }
.imt-store-soon .imt-ico { color: var(--gold); }
.imt-store-soon small { color: rgba(255,255,255,.7); }

.imt-phone { justify-self: center; width: min(300px, 100%); padding: 12px; border-radius: 38px; background: #0A2a1F; box-shadow: inset 0 0 0 2px rgba(255,255,255,.12), 0 30px 60px -30px rgba(0,0,0,.6); }
.imt-phone-screen { border-radius: 28px; overflow: hidden; background: var(--white); color: var(--ink); min-height: 470px; display: flex; flex-direction: column; }
.imt-phone-bar { background: var(--emerald); color: var(--white); padding: 34px 18px 14px; font: 700 1.125rem var(--head); }
.imt-phone-bar small { display: block; font: 400 .8125rem var(--text); opacity: .85; }
.imt-diary {
  flex: 1; padding: 6px 18px 12px 30px; font-size: .875rem; line-height: 28px;
  background: repeating-linear-gradient(var(--white) 0 27px, var(--rule) 27px 28px);
  background-position: 0 6px; position: relative;
}
.imt-diary::before { content: ""; position: absolute; top: 0; bottom: 0; left: 20px; border-left: 1px solid #F2C9C9; }
.imt-diary p { margin: 0 0 28px; }
.imt-diary b { color: var(--emerald); font-family: var(--head); }
.imt-phone-alert { margin: 0 12px 14px; padding: 10px 12px; background: var(--gold-soft); border-left: 4px solid var(--gold); border-radius: 6px; font-size: .8125rem; line-height: 1.4; }
@media (max-width: 860px) { .imt-app-grid { grid-template-columns: minmax(0, 1fr); } }

.imt-contact { background: var(--white); }
.imt-contact-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 40px; align-items: start; }
.imt-contact-grid p { color: var(--ink-soft); max-width: 32em; }
.imt-contact-list { list-style: none; margin: 0; padding: 0; }
.imt-contact-list li { display: flex; align-items: flex-start; gap: 14px; padding: 16px 0; border-bottom: 1px solid var(--line); font-size: 1.125rem; }
.imt-contact-list li:first-child { border-top: 1px solid var(--line); }
.imt-contact-list .imt-ico { color: var(--emerald); width: 24px; height: 24px; margin-top: 2px; }
.imt-contact-list a { color: var(--ink); font-weight: 700; text-decoration: none; }
.imt-contact-list a:hover { color: var(--emerald); text-decoration: underline; }
.imt-admin-hint { color: var(--ink-soft); font-size: .9375rem !important; background: var(--gold-soft); padding: 14px 16px !important; border-radius: 8px; border: 0 !important; }
@media (max-width: 760px) { .imt-contact-grid { grid-template-columns: 1fr; gap: 20px; } }

/* ---------- footer ---------- */
.imt-footer { background: var(--ink); color: rgba(255,255,255,.75); padding: 36px 0; font-size: .9375rem; }
.imt-footer-row { display: flex; flex-wrap: wrap; align-items: center; gap: 20px 40px; }
.imt-footer-brand { display: flex; gap: 12px; align-items: center; margin-right: auto; }
.imt-footer-brand strong { color: var(--white); font-family: var(--head); font-size: 1.0625rem; }
.imt-footer-brand p { margin: 0; }
.imt-footer-menu { list-style: none; display: flex; flex-wrap: wrap; gap: 4px 18px; margin: 0; padding: 0; }
.imt-footer a { color: rgba(255,255,255,.88); }
.imt-copy { margin: 0; }

/* ---------- normal pages, posts ---------- */
.imt-page { padding: clamp(36px, 6vw, 72px) 0; }
.imt-page-title { font-size: clamp(1.9rem, 3.6vw, 2.75rem); margin-bottom: .6em; }
.imt-meta { color: var(--ink-soft); font-size: .9375rem; }
.imt-content > * { max-width: 100%; }
.imt-content img { border-radius: 6px; }
.imt-content blockquote { margin: 1.5em 0; padding: .2em 0 .2em 1.2em; border-left: 4px solid var(--gold); color: var(--ink-soft); }
.imt-posts { display: grid; gap: 0; }
.imt-post { padding: 24px 0; border-bottom: 1px solid var(--line); }
.imt-post h2 { font-size: 1.5rem; margin-bottom: .2em; }
.imt-post h2 a { color: var(--ink); text-decoration: none; }
.imt-post h2 a:hover { color: var(--emerald); text-decoration: underline; }
.nav-links { display: flex; gap: 8px; margin-top: 24px; }
.nav-links .page-numbers { padding: 8px 14px; border: 1px solid var(--line); border-radius: 6px; text-decoration: none; background: var(--white); }
.nav-links .current { background: var(--bottle); color: var(--white); border-color: var(--bottle); }
.imt-404 { min-height: 50vh; }

/* Pages with a School Manager screen: the plugin draws its own boxes, so the page stays plain.
   */
.imt-app-page .imt-page { padding-top: 28px; }
.imt-app-page .imt-page-title { font-size: 1.75rem; }

/* WordPress core classes */
.alignwide { max-width: var(--wrap); }
.alignfull { width: 100vw; max-width: 100vw; margin-left: calc(50% - 50vw); }
.aligncenter { margin-left: auto; margin-right: auto; display: block; }
.screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(1px,1px,1px,1px); white-space: nowrap; }
.wp-caption-text, .wp-element-caption { font-size: .875rem; color: var(--ink-soft); }
