/*
Theme Name: Campus Hub
Description: Intranet-style theme for the Campus Activity Hub (pairs with the Campus Activity Hub plugin). Site header with logo and navigation, page banners and a centred content canvas.
Version: 1.0.0
Requires at least: 6.3
Requires PHP: 7.4
Author: Campus Activity Hub team
Text Domain: campus-hub
*/

:root {
  --hub-primary: #1267b5;
  --hub-primary-dark: #0e4e8a;
  --hub-primary-darker: #0a3965;
  --hub-text: #323130;
  --hub-text-2: #605e5c;
  --hub-border: #edebe9;
  --hub-bg: #ffffff;
  --hub-bg-soft: #faf9f8;
  --hub-canvas: 1204px;
  --hub-gutter: 32px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: "Segoe UI", "Segoe UI Web (West European)", -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  color: var(--hub-text);
  background: var(--hub-bg);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; }
a { color: var(--hub-primary); }
a:hover { color: var(--hub-primary-dark); }
:focus-visible { outline: 2px solid var(--hub-text); outline-offset: 2px; }
h1, h2, h3, h4 { line-height: 1.3; color: var(--hub-text); }
h2 { font-size: 22px; font-weight: 600; }
h3 { font-size: 18px; font-weight: 600; margin: 1.4em 0 .5em; }
.screen-reader-text { border: 0; clip: rect(1px,1px,1px,1px); clip-path: inset(50%); height: 1px; margin: -1px; overflow: hidden; padding: 0; position: absolute !important; width: 1px; word-wrap: normal !important; }
.skip-link:focus { clip: auto; clip-path: none; height: auto; width: auto; left: 8px; top: 8px; padding: 10px 14px; background: #fff; z-index: 1000; }

/* top bar */
.hub-topbar { background: #1b1a19; color: #fff; }
.hub-topbar-inner { max-width: 1440px; margin: 0 auto; height: 48px; padding: 0 16px; display: flex; align-items: center; justify-content: center; position: relative; }
.hub-search { position: relative; width: min(560px, 100% - 120px); display: flex; align-items: center; }
.hub-search svg { position: absolute; left: 10px; color: var(--hub-primary); pointer-events: none; }
.hub-search input { width: 100%; height: 32px; border: 0; border-radius: 4px; padding: 0 12px 0 34px; font: inherit; font-size: 14px; background: #fff; color: var(--hub-text); }
.hub-search input:focus { outline: 2px solid var(--hub-primary); }
.hub-account { position: absolute; right: 16px; top: 0; height: 48px; display: flex; align-items: center; }
.hub-signin { color: #fff; font-size: 14px; font-weight: 600; text-decoration: none; padding: 6px 10px; border-radius: 2px; }
.hub-signin:hover { background: #3b3a39; color: #fff; }
.hub-me { position: relative; }
.hub-me > summary { list-style: none; cursor: pointer; }
.hub-me > summary::-webkit-details-marker { display: none; }
.hub-avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--hub-primary); color: #fff; display: grid; place-items: center; font-size: 12px; font-weight: 600; border: 1px solid #fff; }
.hub-me-menu { position: absolute; right: 0; top: 42px; width: 240px; background: #fff; color: var(--hub-text); border-radius: 4px; box-shadow: 0 6.4px 14.4px rgba(0,0,0,.13), 0 1.2px 3.6px rgba(0,0,0,.11); padding: 8px 0; z-index: 50; }
.hub-me-name { margin: 0; padding: 8px 16px 10px; font-weight: 600; border-bottom: 1px solid var(--hub-border); font-size: 14px; }
.hub-me-name span { font-weight: 400; color: var(--hub-text-2); font-size: 12px; }
.hub-me-menu a { display: block; padding: 8px 16px; color: var(--hub-text); text-decoration: none; font-size: 14px; }
.hub-me-menu a:hover { background: #f3f2f1; }

/* site header */
.hub-header { background: #fff; border-bottom: 1px solid var(--hub-border); }
.hub-header-inner { max-width: 1440px; margin: 0 auto; padding: 18px var(--hub-gutter) 0; display: grid; grid-template-columns: auto 1fr; grid-template-areas: "brand toggle" "nav nav"; align-items: center; column-gap: 16px; }
.hub-brand { grid-area: brand; display: flex; align-items: center; gap: 16px; text-decoration: none; color: var(--hub-text); }
.hub-logo { width: 64px; height: 64px; border-radius: 12px; display: block; }
.hub-sitename { font-size: 24px; font-weight: 600; line-height: 1.2; }
.hub-brand:hover { color: var(--hub-text); }
.hub-nav-toggle { grid-area: toggle; justify-self: end; display: none; border: 1px solid #8a8886; background: #fff; border-radius: 2px; padding: 6px 12px; font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
.hub-nav { grid-area: nav; display: flex; align-items: center; flex-wrap: wrap; gap: 0 4px; margin-top: 10px; padding-left: 80px; }
.hub-menu { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; }
.hub-menu > li { position: relative; display: flex; align-items: center; }
.hub-menu a, .hub-nav-extra { display: block; padding: 10px 10px 12px; color: var(--hub-text); text-decoration: none; font-size: 14px; border-bottom: 2px solid transparent; }
.hub-menu > li > a:hover, .hub-nav-extra:hover { color: var(--hub-text); border-bottom-color: #c8c6c4; }
.hub-menu > li.current-menu-item > a, .hub-menu > li.current_page_item > a { font-weight: 600; border-bottom-color: var(--hub-primary); }
.hub-nav-extra { color: var(--hub-primary); }
.hub-sub-toggle { border: 0; background: none; padding: 4px 6px 8px 0; margin-left: -6px; cursor: pointer; color: var(--hub-text-2); font-size: 14px; line-height: 1; }
.hub-menu .sub-menu { list-style: none; margin: 0; padding: 6px 0; position: absolute; top: 100%; left: 0; min-width: 220px; background: #fff; border-radius: 4px; box-shadow: 0 6.4px 14.4px rgba(0,0,0,.13), 0 1.2px 3.6px rgba(0,0,0,.11); display: none; z-index: 40; }
.hub-menu > li:hover > .sub-menu, .hub-menu > li:focus-within > .sub-menu, .hub-menu > li.is-open > .sub-menu { display: block; }
.hub-menu .sub-menu a { padding: 8px 16px; border: 0; }
.hub-menu .sub-menu a:hover { background: #f3f2f1; }
.hub-menu .sub-menu .current-menu-item > a { font-weight: 600; color: var(--hub-primary); }

/* page title banner */
.hub-banner { position: relative; max-width: 1440px; margin: 0 auto; height: 230px; overflow: hidden; background: #333; }
.hub-banner-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hub-banner::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(0,0,0,.6), rgba(0,0,0,.2) 70%, rgba(0,0,0,.1)); }
.hub-banner-inner { position: absolute; inset: auto 0 0 0; z-index: 1; max-width: var(--hub-canvas); margin: 0 auto; padding: 0 var(--hub-gutter) 26px; }
.hub-banner-title { color: #fff; font-size: 32px; font-weight: 600; margin: 0; text-shadow: 0 1px 4px rgba(0,0,0,.4); }
.hub-titlebar-inner { max-width: var(--hub-canvas); margin: 0 auto; padding: 28px var(--hub-gutter) 4px; }
.hub-page-title { font-size: 32px; font-weight: 600; margin: 0; }

/* content canvas */
.hub-canvas { max-width: var(--hub-canvas); margin: 0 auto; padding: 28px var(--hub-gutter) 48px; }
.hub-content > *:first-child { margin-top: 0; }
.hub-content p, .hub-content li { max-width: 80ch; }
.hub-content .wp-block-columns { gap: 32px; margin-bottom: 8px; }
.hub-content .wp-block-column > *:first-child { margin-top: 0; }
.hub-content .wp-block-buttons { gap: 12px; margin: 16px 0 28px; }
.hub-content .wp-block-buttons.is-vertical { align-items: flex-start; margin-top: 0; }
.hub-content .wp-block-button__link { background: var(--hub-primary); color: #fff; border-radius: 2px; padding: 8px 20px; font-size: 14px; font-weight: 600; line-height: 20px; text-decoration: none; }
.hub-content .wp-block-button__link:hover { background: var(--hub-primary-dark); color: #fff; }
.hub-content .wp-block-separator { border: 0; border-top: 1px solid var(--hub-border); margin: 28px 0; }
.hub-content .wp-block-details { border-bottom: 1px solid var(--hub-border); padding: 4px 0; margin: 0; }
.hub-content .wp-block-details > summary { cursor: pointer; font-size: 22px; font-weight: 600; padding: 14px 0; list-style: none; display: flex; gap: 12px; align-items: center; }
.hub-content .wp-block-details > summary::-webkit-details-marker { display: none; }
.hub-content .wp-block-details > summary::before { content: "⌄"; font-size: 18px; transform: rotate(-90deg); transition: transform .15s; display: inline-block; width: 18px; line-height: 1; color: var(--hub-text-2); }
.hub-content .wp-block-details[open] > summary::before { transform: none; }
.hub-content .wp-block-details > :not(summary) { margin: 0 0 16px 30px; }
.hub-content .wp-block-shortcode { margin: 0; }

/* comments */
.hub-comments { max-width: 720px; margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--hub-border); }
.hub-comments-title { font-size: 18px; }
.hub-comment-list { list-style: none; padding: 0; }
.hub-comment-list .comment-body { padding: 10px 0; border-bottom: 1px solid var(--hub-border); font-size: 14px; }
.hub-comments textarea { width: 100%; border: 1px solid #8a8886; border-radius: 2px; padding: 8px 10px; font: inherit; font-size: 14px; }
.hub-comments .submit { background: var(--hub-primary); color: #fff; border: 0; border-radius: 2px; padding: 8px 20px; font: inherit; font-weight: 600; cursor: pointer; }

/* search results */
.hub-results { list-style: none; padding: 0; margin: 0; }
.hub-results li { padding: 14px 0; border-bottom: 1px solid var(--hub-border); }
.hub-result-title { font-size: 18px; font-weight: 600; text-decoration: none; }
.hub-result-type { margin-left: 8px; font-size: 12px; background: #f3f2f1; padding: 2px 8px; border-radius: 10px; color: var(--hub-text-2); }
.hub-results p { margin: 4px 0 0; color: var(--hub-text-2); font-size: 14px; }

/* footer */
.hub-footer { border-top: 1px solid var(--hub-border); background: var(--hub-bg-soft); }
.hub-footer-inner { max-width: var(--hub-canvas); margin: 0 auto; padding: 20px var(--hub-gutter); font-size: 13px; color: var(--hub-text-2); }
.hub-footer a { color: var(--hub-text-2); }

@media (max-width: 860px) {
  :root { --hub-gutter: 16px; }
  .hub-topbar-inner { justify-content: flex-start; }
  .hub-search { width: calc(100% - 64px); }
  .hub-header-inner { padding-top: 12px; padding-bottom: 12px; }
  .hub-logo { width: 44px; height: 44px; border-radius: 8px; }
  .hub-sitename { font-size: 18px; }
  .hub-nav-toggle { display: inline-block; }
  .hub-nav { display: none; padding-left: 0; flex-direction: column; align-items: stretch; margin-top: 8px; }
  .hub-nav.is-open { display: flex; }
  .hub-menu { flex-direction: column; }
  .hub-menu > li { flex-wrap: wrap; }
  .hub-menu > li > a { flex: 1; }
  .hub-menu a, .hub-nav-extra { border-bottom: 0; border-left: 3px solid transparent; padding: 10px 12px; }
  .hub-menu > li.current-menu-item > a { border-left-color: var(--hub-primary); }
  .hub-sub-toggle { padding: 10px 12px; margin: 0; }
  .hub-menu .sub-menu { position: static; box-shadow: none; width: 100%; padding: 0 0 0 16px; }
  .hub-menu > li:hover > .sub-menu { display: none; }
  .hub-menu > li.is-open > .sub-menu, .hub-menu > li:focus-within > .sub-menu { display: block; }
  .hub-banner { height: 150px; }
  .hub-banner-title, .hub-page-title { font-size: 24px; }
  .hub-banner-inner { padding-bottom: 16px; }
  .hub-canvas { padding-top: 20px; }
}
