/*
Theme Name: South Rift Digital Hub
Theme URI: https://southriftdigihub.org
Author: South Rift Digital Hub
Description: A portal-style theme with a top bar, dropdown menus, image slider, notice board, news cards, statistics, gallery, partner logos, feedback form and a four-column footer. Everything is editable from Appearance > Customize.
Version: 2.0.0
Requires at least: 6.0
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: southriftdigihub
*/

:root {
  --ink: #2B1055;
  --ink-2: #41208A;
  --paper: #F7F5FB;
  --tint: #EFEBF8;
  --line: #D8CFEA;
  --accent: #7B4FD1;
  --sun: #E3A32B;
  --text: #221A33;
  --muted: #5A4F72;
  --white: #FFFFFF;
  --wrap: 1180px;
  --shadow: 0 8px 24px rgba(43, 16, 85, .14);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; scroll-padding-top: 5rem; }
body { margin: 0; font-family: "Public Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; font-size: 1.0625rem; line-height: 1.65; color: var(--text); background: var(--paper); }
img, svg, video { max-width: 100%; height: auto; }
a { color: var(--ink-2); text-underline-offset: .18em; }
a:hover { color: var(--accent); }
:focus-visible { outline: 3px solid var(--sun); outline-offset: 3px; }
h1, h2, h3, h4 { font-family: "Bricolage Grotesque", "Public Sans", system-ui, sans-serif; line-height: 1.15; letter-spacing: -.01em; color: var(--ink); margin: 0 0 .5em; }
h1 { font-size: clamp(2rem, 5vw, 3.25rem); }
h2 { font-size: clamp(1.6rem, 3.5vw, 2.4rem); }
h3 { font-size: clamp(1.15rem, 2.2vw, 1.4rem); }
p { margin: 0 0 1.1em; }
ul { padding-left: 1.2rem; }
.muted { color: var(--muted); }
.wrap { width: min(100% - 2.5rem, var(--wrap)); margin-inline: auto; }
.screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(1px, 1px, 1px, 1px); white-space: nowrap; }
.skip-link:focus { clip: auto; width: auto; height: auto; background: var(--sun); color: var(--ink); padding: .75rem 1rem; z-index: 100; left: 1rem; top: 1rem; font-weight: 600; }

/* Buttons */
.btn { display: inline-block; padding: .8rem 1.4rem; border-radius: 4px; font-weight: 600; text-decoration: none; border: 2px solid transparent; line-height: 1.2; cursor: pointer; font-family: inherit; font-size: 1rem; }
.btn--sun { background: var(--sun); color: var(--ink); }
.btn--sun:hover { background: #F0B845; color: var(--ink); }
.btn--ink { background: var(--ink); color: var(--white); }
.btn--ink:hover { background: var(--ink-2); color: var(--white); }

/* Search form */
.search-form { display: flex; gap: .4rem; max-width: 30rem; }
.search-field { flex: 1; min-width: 0; padding: .65rem .85rem; border: 2px solid var(--ink); border-radius: 4px; font: inherit; background: #fff; }
.search-submit { padding: .65rem 1.1rem; border: 2px solid var(--ink); background: var(--ink); color: #fff; border-radius: 4px; font: inherit; font-weight: 600; cursor: pointer; }

/* Top bar */
.topbar { display: none; background: var(--ink); color: #E4DBF6; font-size: .9rem; }
.topbar__inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 2.6rem; }
.topbar ul { list-style: none; margin: 0; padding: 0; }
.topbar__nav > ul { display: flex; flex-wrap: wrap; gap: 0 1.25rem; }
.topbar li { position: relative; }
.topbar a { color: #E4DBF6; text-decoration: none; display: inline-block; padding: .55rem 0; }
.topbar a:hover { color: var(--sun); }
.topbar .menu-item-has-children > a::after { content: " \25BE"; font-size: .75em; }
.topbar ul ul { display: none; position: absolute; left: 0; top: 100%; min-width: 14rem; background: var(--ink-2); border-top: 3px solid var(--sun); box-shadow: var(--shadow); z-index: 60; padding: .4rem 0; }
.topbar li:hover > ul, .topbar li:focus-within > ul { display: block; }
.topbar ul ul a { display: block; padding: .5rem 1rem; }
.topbar .search-form { max-width: 15rem; }
.topbar .search-field { padding: .25rem .6rem; border: 1px solid rgba(255,255,255,.35); background: rgba(255,255,255,.1); color: #fff; font-size: .875rem; }
.topbar .search-field::placeholder { color: #CDBFEA; }
.topbar .search-submit { padding: .25rem .7rem; border-color: var(--sun); background: var(--sun); color: var(--ink); font-size: .875rem; }
@media (min-width: 960px) { .topbar { display: block; } }

/* Header and main navigation */
.site-header { background: var(--white); position: sticky; top: 0; z-index: 50; border-bottom: 1px solid var(--line); box-shadow: 0 2px 10px rgba(43, 16, 85, .06); }
.site-header__inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .7rem 0; flex-wrap: wrap; }
.site-title { font-family: "Bricolage Grotesque", system-ui, sans-serif; font-weight: 700; font-size: 1.4rem; margin: 0; letter-spacing: -.01em; }
.site-title a { color: var(--ink); text-decoration: none; }
.custom-logo-link img { max-height: 56px; width: auto; display: block; }
.nav-toggle { display: none; background: none; border: 2px solid var(--ink); color: var(--ink); padding: .45rem .9rem; border-radius: 4px; font: inherit; font-weight: 600; cursor: pointer; }
.main-nav ul { list-style: none; margin: 0; padding: 0; }
.main-nav a { color: var(--ink); text-decoration: none; display: block; padding: .6rem .2rem; border-bottom: 3px solid transparent; font-weight: 500; }
.main-nav a:hover, .main-nav .current-menu-item > a, .main-nav .current_page_item > a, .main-nav .current-menu-ancestor > a { border-bottom-color: var(--sun); color: var(--ink); }
.submenu-toggle { display: none; }
.nav-extra { border-top: 1px solid var(--line); margin-top: .5rem; padding-top: .5rem; }

@media (max-width: 959px) {
  .js .nav-toggle { display: inline-block; }
  .js .main-nav { display: none; flex-basis: 100%; }
  .js .site-header.nav-open .main-nav { display: block; }
  .main-nav li { display: flex; flex-wrap: wrap; align-items: center; border-bottom: 1px solid var(--line); }
  .main-nav li > a { flex: 1; padding: .8rem .2rem; }
  .main-nav li > ul { flex-basis: 100%; padding-left: 1rem; }
  .js .main-nav li > ul { display: none; }
  .js .main-nav li.is-open > ul { display: block; }
  .main-nav li ul li:last-child { border-bottom: 0; }
  .js .submenu-toggle { display: block; width: 2.8rem; height: 2.4rem; background: none; border: 1px solid var(--line); border-radius: 4px; cursor: pointer; position: relative; }
  .submenu-toggle::before { content: "\25BE"; color: var(--ink); font-size: 1rem; }
  .is-open > .submenu-toggle::before { content: "\25B4"; }
}
@media (min-width: 960px) {
  .nav-extra { display: none; }
  .main-nav > ul { display: flex; gap: 0 1.4rem; align-items: center; }
  .main-nav li { position: relative; }
  .main-nav .menu-item-has-children > a::after, .main-nav .page_item_has_children > a::after { content: " \25BE"; font-size: .75em; }
  .main-nav ul ul { display: none; position: absolute; left: 0; top: 100%; min-width: 16rem; background: var(--white); border: 1px solid var(--line); border-top: 3px solid var(--accent); box-shadow: var(--shadow); padding: .4rem 0; z-index: 60; }
  .main-nav li:hover > ul, .main-nav li:focus-within > ul { display: block; }
  .main-nav ul ul a { padding: .55rem 1rem; border-bottom: 0; }
  .main-nav ul ul a:hover { background: var(--tint); }
}

/* Slider and headlines */
.front-top { background: var(--paper); padding: 1.25rem 0; }
.front-top__grid { display: grid; gap: 1.25rem; }
@media (min-width: 960px) { .front-top__grid { grid-template-columns: minmax(0, 2.6fr) minmax(0, 1fr); } }
.slider { position: relative; background: var(--ink); border-radius: 6px; overflow: hidden; }
.slides { position: relative; aspect-ratio: 2 / 1; min-height: 300px; }
.slide { position: absolute; inset: 0; opacity: 0; visibility: hidden; transition: opacity .6s ease; }
.slide.is-active { opacity: 1; visibility: visible; z-index: 1; }
.slide__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.slide:not(.slide--plain)::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(26, 8, 56, .88) 0%, rgba(26, 8, 56, .35) 45%, rgba(26, 8, 56, 0) 70%); }
.slide--plain { background: linear-gradient(160deg, var(--ink) 0%, #4A2A9A 100%); }
.slide--plain .hero__ridge { position: absolute; left: 0; right: 0; bottom: -1px; width: 100%; height: 42%; display: block; }
.ridge-sun { fill: var(--sun); }
.ridge-1 { fill: #3C1B78; }
.ridge-2 { fill: #53299A; }
.ridge-3 { fill: #7449BF; }
.ridge-4 { fill: var(--paper); }
.slide__caption { position: absolute; z-index: 2; left: 0; right: 0; bottom: 0; padding: 1.5rem clamp(1rem, 4vw, 2.5rem) 3.5rem; color: #fff; max-width: 46rem; }
.slide--plain .slide__caption { bottom: auto; top: 0; padding-top: clamp(1.25rem, 4vw, 2.5rem); }
.slide__caption h2 { color: #fff; font-size: clamp(1.5rem, 3.6vw, 2.6rem); margin-bottom: .35em; }
.slide__caption p { color: #E9E1F8; font-size: clamp(1rem, 1.6vw, 1.2rem); margin-bottom: 1rem; }
.slider__controls { position: absolute; z-index: 3; right: .75rem; bottom: .75rem; display: flex; align-items: center; gap: .4rem; }
.slider__btn { width: 2.4rem; height: 2.4rem; border: 0; border-radius: 50%; background: rgba(26, 8, 56, .65); color: #fff; font-size: 1.15rem; line-height: 1; cursor: pointer; }
.slider__btn:hover { background: var(--accent); }
.slider__pause { font-size: .7rem; }
.slider__dots { display: flex; gap: .4rem; padding: 0 .4rem; }
.slider__dot { width: .8rem; height: .8rem; border-radius: 50%; border: 2px solid #fff; background: transparent; padding: 0; cursor: pointer; }
.slider__dot.is-active { background: var(--sun); border-color: var(--sun); }

.headlines { background: var(--white); border: 1px solid var(--line); border-top: 4px solid var(--ink); border-radius: 6px; padding: 1rem 1.1rem; }
.headlines h2 { font-size: 1.25rem; margin-bottom: .6rem; }
.headlines ul { list-style: none; margin: 0; padding: 0; }
.headlines li { padding: .65rem 0; border-top: 1px solid var(--line); }
.headlines li a { display: block; font-weight: 600; text-decoration: none; line-height: 1.3; }
.headlines li a:hover { text-decoration: underline; }
.headlines time { font-size: .85rem; color: var(--muted); }

/* Sections */
.section { padding: clamp(2.5rem, 6vw, 4.5rem) 0; }
.section--tint { background: var(--tint); }
.section__head { max-width: 44rem; margin-bottom: 2rem; }
.section__head p { color: var(--muted); font-size: 1.1rem; margin: 0; }
.two-col { display: grid; gap: 2.5rem; }
@media (min-width: 860px) { .two-col { grid-template-columns: 1fr 1fr; align-items: start; } .two-col--wide { grid-template-columns: 5fr 7fr; } }

/* Programmes */
.prog-grid { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.prog { background: var(--white); border: 1px solid var(--line); border-top: 4px solid var(--accent); border-radius: 6px; padding: 1.4rem; }
.prog p { color: var(--muted); }
.prog__link { font-weight: 600; }

/* Leader message */
.message { display: grid; gap: 2rem; align-items: center; }
@media (min-width: 860px) { .message { grid-template-columns: 18rem 1fr; } }
.message__photo { margin: 0; text-align: center; }
.message__photo img { border-radius: 6px; width: 100%; max-width: 18rem; aspect-ratio: 4 / 5; object-fit: cover; box-shadow: var(--shadow); }
.message__photo figcaption { margin-top: .6rem; color: var(--muted); font-size: .95rem; }
.message blockquote { margin: 0 0 1.25rem; padding-left: 1.25rem; border-left: 4px solid var(--sun); font-size: 1.15rem; white-space: pre-line; max-width: 60ch; }

/* Notices and video */
.notice-list { list-style: none; margin: 0 0 1rem; padding: 0; border-top: 2px solid var(--ink); }
.notice-list li { padding: .8rem 0; border-bottom: 1px solid var(--line); display: flex; gap: .6rem; align-items: baseline; }
.notice-list a { font-weight: 600; text-decoration: none; }
.notice-list a:hover { text-decoration: underline; }
.badge { background: var(--sun); color: var(--ink); font-size: .75rem; font-weight: 700; padding: .1rem .5rem; border-radius: 3px; }
.empty { padding: 1.25rem 0; color: var(--muted); border-top: 2px solid var(--ink); border-bottom: 1px solid var(--line); margin: 0; }
.video-wrap { position: relative; aspect-ratio: 16 / 9; border-radius: 6px; overflow: hidden; background: #000; }
.video-wrap iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* News cards */
.card-grid { display: grid; gap: 1.5rem; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.card { background: var(--white); border: 1px solid var(--line); border-radius: 6px; overflow: hidden; display: flex; flex-direction: column; }
.card__img { display: block; aspect-ratio: 16 / 10; overflow: hidden; background: var(--tint); }
.card__img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card__body { padding: 1.1rem 1.2rem 1.3rem; }
.card__body time { font-size: .875rem; color: var(--muted); }
.card__body h3 { margin: .25rem 0 .5rem; }
.card__body h3 a { color: var(--ink); text-decoration: none; }
.card__body h3 a:hover { color: var(--accent); text-decoration: underline; }
.card__body p { margin: 0; color: var(--muted); font-size: .98rem; }
.more { margin: 2rem 0 0; }

/* Stats */
.stats { background: var(--ink); color: #fff; }
.stats h2 { color: #fff; }
.stats__grid { display: grid; gap: 1.5rem; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin: 1.5rem 0 0; }
.stats__grid div { border-top: 3px solid var(--sun); padding-top: .75rem; }
.stats dt { order: 2; color: #D9CFF0; margin: 0; }
.stats dd { margin: 0; font-family: "Bricolage Grotesque", system-ui, sans-serif; font-size: clamp(2.2rem, 5vw, 3.4rem); font-weight: 700; line-height: 1.1; color: var(--sun); }
.stats__grid div { display: flex; flex-direction: column; }
.stats dd { order: 1; }

/* Gallery */
.gallery { display: grid; gap: .6rem; grid-template-columns: repeat(2, 1fr); }
@media (min-width: 760px) { .gallery { grid-template-columns: repeat(4, 1fr); } }
.gallery img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 4px; display: block; }

/* Community and feedback */
.social-list { list-style: none; margin: 0; padding: 0; border-top: 2px solid var(--ink); }
.social-list li { border-bottom: 1px solid var(--line); }
.social-list a { display: block; padding: .8rem 0; font-weight: 600; text-decoration: none; }
.social-list a:hover { color: var(--accent); text-decoration: underline; }
.feedback-form p { margin-bottom: 1rem; }
.feedback-form label { display: block; font-weight: 600; margin-bottom: .25rem; }
.feedback-form input[type="text"], .feedback-form input[type="email"], .feedback-form select, .feedback-form textarea { width: 100%; padding: .7rem .85rem; border: 2px solid var(--ink); border-radius: 4px; font: inherit; background: #fff; }
.hp { position: absolute; left: -9999px; }
.notice { padding: .8rem 1rem; border-radius: 4px; border-left: 4px solid; }
.notice--ok { background: #E8F5EC; border-color: #2E8B57; color: #14432A; }
.notice--err { background: #FCEAEA; border-color: #C0392B; color: #6B1A12; }

/* Partners */
.partners { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 1.5rem 2.5rem; align-items: center; }
.partners img { height: 56px; width: auto; max-width: 160px; object-fit: contain; filter: grayscale(1); opacity: .8; transition: filter .2s, opacity .2s; }
.partners a:hover img, .partners a:focus-visible img { filter: none; opacity: 1; }

/* Announcement pop-up */
.announce { border: 0; padding: 0; border-radius: 8px; max-width: min(34rem, 92vw); width: 100%; box-shadow: var(--shadow); overflow: hidden; }
.announce::backdrop { background: rgba(26, 8, 56, .65); }
.announce img { display: block; width: 100%; max-height: 18rem; object-fit: cover; }
.announce__body { padding: 1.5rem; }
.announce__close { position: absolute; top: .5rem; right: .5rem; width: 2.4rem; height: 2.4rem; border: 0; border-radius: 50%; background: rgba(26, 8, 56, .75); color: #fff; font-size: 1.5rem; line-height: 1; cursor: pointer; z-index: 2; }

/* Inner pages */
.page-head { padding: clamp(2.5rem, 6vw, 4.5rem) 0 1.5rem; border-bottom: 1px solid var(--line); margin-bottom: 2.5rem; background: var(--tint); }
.page-head h1 { margin: 0; max-width: 22ch; }
.page-head .entry-meta { margin: .75rem 0 0; color: var(--muted); }
.entry-content { max-width: 70ch; padding-bottom: 4rem; font-size: 1.125rem; line-height: 1.75; }
.entry-content h2, .entry-content h3 { margin-top: 1.8em; }
.entry-content blockquote { margin: 1.5rem 0; padding: .25rem 0 .25rem 1.25rem; border-left: 4px solid var(--sun); color: var(--ink); }
.entry-content img { border-radius: 4px; }
.entry-content figure { margin: 1.5rem 0; }
.entry-content figcaption, .wp-caption-text { font-size: .9rem; color: var(--muted); }
.entry-content table { width: 100%; border-collapse: collapse; }
.entry-content th, .entry-content td { padding: .6rem .75rem; border: 1px solid var(--line); text-align: left; }
.entry-content pre { overflow-x: auto; background: var(--ink); color: #fff; padding: 1rem; border-radius: 4px; }
.alignleft { float: left; margin: .25rem 1.25rem 1rem 0; }
.alignright { float: right; margin: .25rem 0 1rem 1.25rem; }
.aligncenter { display: block; margin-inline: auto; }

.post-list { border-top: 2px solid var(--ink); }
.post-row { display: grid; gap: .5rem 2rem; padding: 1.5rem 0; border-bottom: 1px solid var(--line); }
.post-row__date { color: var(--muted); font-size: .95rem; }
.post-row h3 { margin-bottom: .35em; }
.post-row h3 a { color: var(--ink); text-decoration: none; }
.post-row h3 a:hover { color: var(--accent); text-decoration: underline; }
.post-row p { margin: 0; color: var(--muted); max-width: 60ch; }
.post-row__thumb img { display: block; border-radius: 4px; width: 100%; }
@media (min-width: 760px) {
  .post-row { grid-template-columns: 9rem minmax(0, 1fr); }
  .post-row--thumb { grid-template-columns: 9rem minmax(0, 1fr) 14rem; }
  .post-row__thumb { grid-column: 3; grid-row: 1; }
}
.navigation.pagination, .post-navigation { padding: 2rem 0 4rem; }
.nav-links { display: flex; flex-wrap: wrap; gap: .5rem 1rem; }
.page-numbers { padding: .4rem .8rem; border: 1px solid var(--line); border-radius: 4px; text-decoration: none; }
.page-numbers.current { background: var(--ink); color: #fff; border-color: var(--ink); }
.comments-area { max-width: 70ch; padding-bottom: 4rem; }
.comment-list { list-style: none; padding: 0; }
.comment-body { padding: 1rem 0; border-bottom: 1px solid var(--line); }
.comment-form input[type="text"], .comment-form input[type="email"], .comment-form input[type="url"], .comment-form textarea { width: 100%; padding: .7rem .9rem; border: 2px solid var(--ink); border-radius: 4px; font: inherit; background: #fff; }

/* Footer */
.site-footer { background: var(--ink); color: #D9CFF0; font-size: .97rem; }
.site-footer a { color: #fff; text-decoration: none; }
.site-footer a:hover { color: var(--sun); text-decoration: underline; }
.footer-grid { display: grid; gap: 2rem; padding: 3rem 0 2rem; }
@media (min-width: 760px) { .footer-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .footer-grid { grid-template-columns: 1.4fr 1fr 1fr 1fr; } }
.footer-brand { font-family: "Bricolage Grotesque", system-ui, sans-serif; font-size: 1.4rem; font-weight: 700; color: #fff; margin: 0 0 .5rem; }
.footer-title { font-size: 1.1rem; color: #fff; margin-bottom: .75rem; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: .45rem; }
.contact-list li { margin-bottom: .6rem; }
.muted-light { color: #B9A9DD; font-size: .9rem; }
.footer-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .75rem 2rem; padding: 1.25rem 0 1.75rem; border-top: 1px solid rgba(255, 255, 255, .18); }
.footer-bottom p { margin: 0; }
.legal-nav ul { display: flex; flex-wrap: wrap; gap: .25rem 1.25rem; }
.legal-nav li { margin: 0; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation: none !important; transition: none !important; }
}
