/*
Theme Name: IMSC
Theme URI: https://www.imsc.edu.sg
Author: International Management and Sports College
Description: The IMSC website design. Use together with the "IMSC Site" plugin, which adds the pages, courses, events, forms and settings.
Version: 1.1.0
Requires at least: 6.2
Requires PHP: 7.4
Text Domain: imsc
*/

html { scroll-behavior: smooth; }
body { margin: 0; background: #FFFFFF; }
a { color: inherit; text-decoration: none; }
a:hover { opacity: .85; }
img { max-width: 100%; }
[hidden] { display: none !important; }
button, input, select, textarea { font-family: inherit; }
.screen-reader-text { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* Header */
.imsc-header nav a { padding: 12px 9px !important; }
.imsc-header nav { font-size: 13.5px !important; }
.imsc-header { column-gap: 20px !important; }

/* Text written in the editor (articles, events, ordinary pages, policies) */
.imsc-prose { font-size: 17px; line-height: 1.7; color: #1A0B33; }
.imsc-prose > * { margin-top: 0; margin-bottom: 1.1em; }
.imsc-prose h2, .imsc-prose h3, .imsc-prose h4 { font-family: 'Roboto Condensed', 'Noto Sans SC', sans-serif; color: #24015D; line-height: 1.15; margin-top: 1.6em; }
.imsc-prose h2 { font-size: 32px; } .imsc-prose h3 { font-size: 24px; } .imsc-prose h4 { font-size: 19px; }
.imsc-prose a { color: #CE0C13; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.imsc-prose img, .imsc-prose figure img { border-radius: 20px; height: auto; }
.imsc-prose figure { margin-left: 0; margin-right: 0; }
.imsc-prose figcaption { font-size: 14px; color: #4A3D63; margin-top: 8px; }
.imsc-prose blockquote { margin-left: 0; padding: 4px 0 4px 22px; border-left: 4px solid #CE0C13; color: #24015D; font-size: 20px; }
.imsc-prose table { width: 100%; border-collapse: collapse; font-size: 15px; display: block; overflow-x: auto; }
.imsc-prose th, .imsc-prose td { padding: 12px 16px; border-bottom: 1px solid #E4E0EC; text-align: left; vertical-align: top; }
.imsc-prose th { background: #F5F2FA; color: #24015D; }
.imsc-prose ul, .imsc-prose ol { padding-left: 1.3em; }
.imsc-prose li { margin-bottom: .4em; }
.imsc-prose .wp-block-button__link { background: #CE0C13; color: #FFFFFF; border-radius: 999px; padding: 14px 26px; text-decoration: none; display: inline-block; }
.imsc-prose .wp-block-file a:not(.wp-block-file__button) { color: #24015D; }
.imsc-prose .wp-block-file__button { background: #24015D; color: #FFF; border-radius: 999px; padding: 8px 16px; text-decoration: none; }

/* Hero slideshow on the home page */
.hero-slide { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; animation: heroFade 24s infinite; }
@keyframes heroFade { 0% { opacity: 0; transform: scale(1) } 5% { opacity: 1 } 25% { opacity: 1 } 31% { opacity: 0; transform: scale(1.08) } 100% { opacity: 0; transform: scale(1.08) } }
@media (prefers-reduced-motion: reduce) { .hero-slide { animation: none } .hero-slide:first-child { opacity: 1 } }

/* Logged-in staff: keep the admin bar from covering the header */
body.admin-bar .imsc-site { min-height: calc(100vh - 32px); }

@media (max-width: 1360px) {
  .imsc-header nav a { padding: 12px 7px !important; }
  .imsc-header [aria-label="Language"] a { padding: 0 10px !important; }
  .imsc-header { padding-left: 22px !important; }
}

@media (max-width: 1100px) {
  .imsc-header nav { flex-wrap: nowrap !important; overflow-x: auto; width: 100%; min-width: 0; flex: 1 1 100%; order: 3; scrollbar-width: none; }
  .imsc-header nav a { white-space: nowrap; }
  .imsc-header { border-radius: 28px !important; }
}

@media (max-width: 760px) {
  [style*="grid-template-columns"]:not([style*="repeat(7"]) { grid-template-columns: minmax(0, 1fr) !important; }
  [style*="repeat(4, minmax(0, 1fr))"][style*="height: 180px"], [style*="repeat(3, minmax(0, 1fr)); gap: 10px"] { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  [style*="grid-column"] { grid-column: auto !important; }
  [style*="grid-row: span"] { grid-row: auto !important; }
  h1 { font-size: 52px !important; letter-spacing: -1px !important; }
  h2 { font-size: 38px !important; }
  .imsc-prose h2 { font-size: 26px !important; }
  [style*="font-size: 240px"] { font-size: 110px !important; letter-spacing: -2px !important; }
  [style*="font-size: 80px"], [style*="font-size: 72px"], [style*="font-size: 96px"], [style*="font-size: 84px"], [style*="font-size: 88px"] { font-size: 44px !important; }
  [style*="padding: 112px 28px"], [style*="padding: 96px 28px"] { padding: 64px 20px !important; }
  [style*="padding: 80px 56px"], [style*="padding: 72px 56px"] { padding: 40px 24px !important; }
  [style*="padding: 36px"], [style*="padding: 40px"], [style*="padding: 48px"] { padding: 22px !important; }
  [style*="height: 600px"], [style*="height: 520px"] { height: auto !important; }
  [style*="height: 600px"] > *, [style*="height: 520px"] > * { min-height: 220px; }
  [style*="height: 340px"] { height: auto !important; }
  [style*="height: 340px"] > * { min-height: 200px; }
  [style*="width: 280px"], [style*="width: 300px"], [style*="width: 320px"] { width: 100% !important; }
  [style*="max-width: 280px"], [style*="max-width: 300px"], [style*="max-width: 340px"], [style*="max-width: 400px"] { max-width: none !important; }
  [style*="minmax(380px"], [style*="minmax(420px"] { grid-template-columns: minmax(0, 1fr) !important; }
  [style*="padding: 32px 32px"], [style*="padding: 40px 32px"], [style*="padding: 48px 32px"], [style*="padding: 56px 32px"], [style*="padding: 72px 32px"], [style*="padding: 0 32px"] { padding-left: 20px !important; padding-right: 20px !important; }
  .imsc-header { border-radius: 28px !important; padding: 14px !important; }
  .imsc-header > div { margin-left: auto; flex-wrap: wrap; justify-content: flex-end; }
  .imsc-header .imsc-apply { white-space: nowrap; padding: 0 16px !important; }
  .imsc-header [aria-label="Language"] a { padding: 0 9px !important; white-space: nowrap; }
  .imsc-header img.imsc-logo { height: 44px !important; }
  form[style*="border-radius: 999px"] { flex-wrap: wrap !important; border-radius: 24px !important; }
  form[style*="border-radius: 999px"] > a, form[style*="border-radius: 999px"] > button { width: 100%; justify-content: center; }
  table { font-size: 14px; }
}

/* Elementor pages: the IMSC design's spacing and type */
.elementor-widget-text-editor p { margin: 0; }
.elementor-widget-text-editor p + p { margin-top: .8em; }
.elementor-widget-heading .elementor-heading-title { margin: 0; }
.elementor-widget-button .elementor-button { line-height: 1.2; }
.elementor-widget-button .elementor-button-icon svg { width: 1em; height: 1em; }
.elementor-widget-shortcode .imsc-header, .elementor-widget-shortcode header { width: 100%; }
.e-con a.e-con, a.e-con { color: inherit; text-decoration: none; }
.elementor-widget-html form { margin: 0; }
.e-con > .elementor-widget-html { width: 100%; }

/* Long course names wrap instead of running off small screens */
.imsc-site h1, .imsc-site h2 { overflow-wrap: anywhere; hyphens: auto; }
