/*
 * Queen's Bootstrap - theme styles for Bootstrap 5.3.
 *
 * This file loads AFTER Bootstrap and only holds the site's own look (colours, sizes, layout tweaks).
 * It replaces the old custom.css, which was a complete customised copy of Bootstrap 3.
 */

/* ---------- Colours & base type (same values as the old theme) ---------- */
:root {
	--bs-body-font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
	--bs-body-font-size: 14px;
	--bs-body-line-height: 1.428571429;
	--bs-body-color: #332c2f;
	--bs-body-color-rgb: 51, 44, 47;
	--bs-body-bg: #9d79d5;
	--bs-body-bg-rgb: 157, 121, 213;
	--bs-link-color: #5d00bf;
	--bs-link-color-rgb: 93, 0, 191;
	--bs-link-hover-color: #000;
	--bs-link-hover-color-rgb: 0, 0, 0;
	--bs-gutter-x: 30px; /* Bootstrap 3 used a 30px gutter; Bootstrap 5 defaults to 24px */
}

a { text-decoration: none; }
a:hover, a:focus { text-decoration: underline; }

/* Accessibility: links inside text are underlined so they don't rely on colour alone */
main a:not(.btn):not(.carousel-control-prev):not(.carousel-control-next) { text-decoration: underline; }

p { margin-bottom: 10px; }

h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 {
	font-weight: 500;
	line-height: 1.1;
	margin-bottom: 10px;
}
h1, h2, h3, .h1, .h2, .h3 { margin-top: 20px; }
h4, h5, h6, .h4, .h5, .h6 { margin-top: 10px; }
h1, .h1 { font-size: 36px; }
h2, .h2 { font-size: 30px; }
h3, .h3 { font-size: 24px; }
h4, .h4 { font-size: 18px; }
h5, .h5 { font-size: 14px; }
h6, .h6 { font-size: 12px; }

ul, ol { margin-bottom: 10px; }

/* ---------- Page frame ---------- */
.container {
	--bs-gutter-x: 30px;
	margin-top: 10px;
	margin-bottom: 10px;
	box-shadow: 0 0 5px grey;
	padding: 0 15px;
	border-right: 1px solid #fff;
	border-left: 1px solid #fff;
}
/* Same widths as the old theme: 750px tablets, 970px desktops (Bootstrap 5 would use 720 / 960 / 1140 / 1320) */
@media (min-width: 768px) { .container { max-width: 750px; } }
@media (min-width: 992px) { .container { max-width: 970px; } }
@media (max-width: 767.98px) { .container { margin-top: -1px; } }

.row { --bs-gutter-x: 30px; }

#header {
	background-color: #b7acca;
	padding: 35px 20px;
	border-top: 1px solid #fff;
}
@media (max-width: 767.98px) { #header { padding: 10px; } }

/* ---------- Navigation ---------- */
.navbar-queens {
	--bs-navbar-padding-y: 0;
	--bs-navbar-padding-x: 15px;
	--bs-navbar-color: #fff;
	--bs-navbar-hover-color: #fff;
	--bs-navbar-active-color: #fff;
	--bs-navbar-brand-color: #fff;
	--bs-navbar-brand-hover-color: #fff;
	--bs-navbar-nav-link-padding-x: 15px;
	--bs-navbar-toggler-border-color: #333;
	--bs-navbar-toggler-focus-width: 3px;
	background-color: #5a497d;
	border-bottom: 1px solid #33284b;
	min-height: 50px;
	margin-left: -15px;  /* span the full width of the white page frame */
	margin-right: -15px;
	margin-bottom: 20px; /* Bootstrap 3's navbar had this built in; the page content is laid out to expect it */
}
.navbar-queens .navbar-nav .nav-link {
	padding-top: 15px;
	padding-bottom: 15px;
	line-height: 20px;
	color: #fff;
}
.navbar-queens .navbar-nav .nav-link:hover,
.navbar-queens .navbar-nav .nav-link:focus { color: #fff; text-decoration: none; }
.navbar-queens .navbar-nav .nav-link.active,
.navbar-queens .navbar-nav .show > .nav-link { color: #fff; background-color: #4a306f; }
.navbar-queens .dropdown-menu { --bs-dropdown-link-active-bg: #4a306f; }
.navbar-queens .navbar-brand { padding: 0; margin-right: 10px; }
.navbar-queens .navbar-toggler { border-color: #333; }
.navbar-queens .navbar-toggler:hover { background-color: #333; }
.navbar-queens .navbar-menu-label { color: #fff; margin: 0 10px 0 auto; font-size: 18px; }
@media (max-width: 767.98px) {
	.navbar-queens { padding-top: 6px; padding-bottom: 6px; }
	.navbar-queens .navbar-nav .nav-link { padding-top: 10px; padding-bottom: 10px; }
}

/* ---------- Buttons (Bootstrap 5 colours set per button, so use its variables) ---------- */
.btn-primary {
	--bs-btn-color: #fff;
	--bs-btn-bg: #4a2f75;
	--bs-btn-border-color: #002701;
	--bs-btn-hover-color: #fff;
	--bs-btn-hover-bg: #230e45;
	--bs-btn-hover-border-color: #000;
	--bs-btn-focus-shadow-rgb: 74, 47, 117;
	--bs-btn-active-color: #fff;
	--bs-btn-active-bg: #230e45;
	--bs-btn-active-border-color: #000;
	--bs-btn-disabled-bg: #4a2f75;
	--bs-btn-disabled-border-color: #002701;
}
.btn { --bs-btn-font-size: 14px; --bs-btn-line-height: 1.428571429; --bs-btn-padding-y: 6px; --bs-btn-padding-x: 12px; --bs-btn-border-radius: 4px; }
.btn-lg { --bs-btn-font-size: 18px; --bs-btn-line-height: 1.33; --bs-btn-padding-y: 10px; --bs-btn-padding-x: 16px; --bs-btn-border-radius: 6px; }

/* ---------- Home page ---------- */
.home-hero .btn { white-space: normal; max-width: 100%; margin: 4px 2px; }
#myCarousel2 { margin-left: -15px; margin-right: -15px; }
.carousel-item > picture { display: block; }
.carousel-item img { display: block; width: 100%; max-width: 100%; height: auto; }
.slide-caption {
	position: absolute;
	bottom: 0;
	left: 0;
	width: 100%;
	background-color: rgba(0, 0, 0, 0.7);
	color: #fff;
	padding: 8px 8px 0 8px;
	text-align: center;
}
/* Lift the slide dots above the caption bar so they don't sit on top of the caption text */
#myCarousel2 .carousel-indicators { margin-bottom: 40px; }
/* The captions sit above the pictures but must not cover the Previous / Next buttons */
.carousel-control-prev, .carousel-control-next { z-index: 3; }

/* ---------- Footer ---------- */
.footer-row { background-color: #4a2f75; }
.footer-row h2, .footer-row h4 { color: #bba6e3; }
.footer-row p, .footer-row a { color: #fff; }

/* ---------- Admin tab (top right, wide screens only) ---------- */
@media (min-width: 1170px) {
	#hover-admin { border-bottom-left-radius: 100px; position: fixed; width: 125px; height: 125px; top: 0; right: 0; }
	#hover-admin:hover + #admin-link-top { opacity: 1; transition: 0.3s ease-out; -webkit-transition: 0.3s; }
	#admin-link-top:hover { opacity: 1; transition: 0.3s ease-out; -webkit-transition: 0.3s; }
	#admin-link-top {
		transition: 0.3s ease-out;
		-webkit-transition: 0.3s;
		opacity: 0.9;
		position: fixed;
		width: 50px;
		top: -1px;
		right: 21px;
		font-size: 10px;
		background-color: #eec5ff;
		border-bottom-left-radius: 3px;
		border-bottom-right-radius: 3px;
		border: 1px solid #e4b9ff;
	}
}
@media (max-width: 1169.98px) { #admin-link-top { display: none; } }

/* ---------- Icons ----------
   Bootstrap 5 has no icon font (Glyphicons were removed in Bootstrap 4), so the few icons the site uses
   are small inline SVG masks. Use as <span class="qh-icon qh-icon-phone" aria-hidden="true"></span> */
.qh-icon { position: relative; top: 1px; display: inline-block; width: 1em; height: 1em; line-height: 1; vertical-align: baseline; }
.qh-icon:before { content: ""; display: block; width: 1em; height: 1em; background-color: currentColor; -webkit-mask: var(--icon) center / contain no-repeat; mask: var(--icon) center / contain no-repeat; }
.qh-icon-envelope { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M2 5h20v14H2zm2 2v.5l8 5 8-5V7zm16 3l-8 5-8-5v7h16z'/%3E%3C/svg%3E"); }
.qh-icon-phone { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6.62 10.79c1.44 2.83 3.76 5.14 6.59 6.59l2.2-2.2c.27-.27.67-.36 1.02-.24 1.12.37 2.33.57 3.57.57.55 0 1 .45 1 1V20c0 .55-.45 1-1 1-9.39 0-17-7.61-17-17 0-.55.45-1 1-1h3.5c.55 0 1 .45 1 1 0 1.25.2 2.45.57 3.57.11.35.03.74-.25 1.02z'/%3E%3C/svg%3E"); }
.qh-icon-road { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M9 2L4 22h3.5l.7-3H15.8l.7 3H20L15 2zm1.5 2h3l.9 4h-4.8zm-1.9 8h6.8l.9 4H8.7z'/%3E%3C/svg%3E"); }
.qh-icon-calendar { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7 2v2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2h-2V2h-2v2H9V2zM5 9h14v11H5z'/%3E%3C/svg%3E"); }

/* ---------- Print ---------- */
@media print {
	.navbar { display: none; }
}

/* =====================================================================================================
   DARK MODE
   -----------------------------------------------------------------------------------------------------
   How it works: header.php sets data-bs-theme="dark" or "light" on <html> (saved choice, otherwise the
   visitor's device setting). Everything below only applies when it is "dark", and only on screen (printing
   always stays light). Light mode is unchanged: the two small variables below just hold the old colours.

   To change the dark colours, edit the values in the ":root[data-bs-theme="dark"]" block and the
   "Dark mode: page pieces" block. The site's own colours that are written directly inside page content
   (#f3ecfe, #f1f9f1, #d4befe, #332c2f) are overridden further down, so no page needs editing.
   ===================================================================================================== */

/* Light-mode values for the pieces that used to have the colour written inline in the templates */
:root {
	--qh-frame-bg: #ffffff;   /* the white page frame  */
	--qh-panel-bg: #f3ecfe;   /* the pale purple sidebar */
}
.page-frame   { background-color: var(--qh-frame-bg); }
.sidebar-panel { background-color: var(--qh-panel-bg); }
.header-mail  { color: #332c2f; }   /* e-mail address in the header (was an inline style) */
.admin-link   { color: #000000; }   /* "ADMIN" tab (was an inline style) */

/* ---------- The Light / Dark / Auto switch (bottom of the page, in the footer) ----------
   Hidden until the small script in header.php has run, so it never shows on a browser with JavaScript off. */
.theme-switch { display: none; align-items: center; flex-wrap: wrap; gap: 6px; }
:root[data-theme-mode] .theme-switch { display: flex; }
.theme-switch-label { color: #d4befe; font-size: 12px; margin-right: 2px; }
.theme-btn {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	padding: 4px 10px;
	font-size: 12px;
	line-height: 1.4;
	color: #fff;
	background: transparent;
	border: 1px solid rgba(255, 255, 255, 0.5);
	border-radius: 4px;
	cursor: pointer;
}
.theme-btn:hover { background-color: rgba(255, 255, 255, 0.15); }
.theme-btn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.theme-btn[aria-pressed="true"] { color: #2b1f45; background-color: #d4befe; border-color: #d4befe; font-weight: 600; }
.theme-btn .qh-icon { top: 0; }
.footer-bottom { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 20px; padding: 10px 20px 6px 30px; }
.footer-copy { margin: 0; }
@media (max-width: 575.98px) { .footer-bottom { padding-left: 20px; justify-content: center; } }
.qh-icon-sun  { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='4.5'/%3E%3Cpath d='M11 1h2v3h-2zM11 20h2v3h-2zM1 11h3v2H1zM20 11h3v2h-3zM4.2 5.6l1.4-1.4 2.1 2.1-1.4 1.4zM16.3 17.7l1.4-1.4 2.1 2.1-1.4 1.4zM4.2 18.4l2.1-2.1 1.4 1.4-2.1 2.1zM16.3 6.3l2.1-2.1 1.4 1.4-2.1 2.1z'/%3E%3C/svg%3E"); }
.qh-icon-moon { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M21 12.8A9 9 0 1 1 11.2 3a7 7 0 0 0 9.8 9.8z'/%3E%3C/svg%3E"); }
.qh-icon-auto { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill-rule='evenodd' d='M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zm0 2a8 8 0 0 1 0 16z'/%3E%3C/svg%3E"); }
@media print { .theme-switch { display: none !important; } }

@media screen {

/* ---------- Dark mode: base colours ----------
   White text throughout, and the SAME light/dark order as the light theme, just darker:
     light theme:  header LIGHT > nav DARK > panels LIGHT > accent block slightly darker > footer DARK
     dark theme:   header mid-dark > nav near-black > panels mid-dark > accent block slightly darker > footer near-black
   Same hue as the old purples, same order, everything one big step darker.
   To tweak, change the --qh-d-* values below: they feed everything else. */
:root[data-bs-theme="dark"] {
	color-scheme: dark;   /* dark scrollbars and form controls */
	--qh-d-page:   #2a2040;   /* page behind the frame   (light mode: #9d79d5) */
	--qh-d-frame:  #4f4373;   /* the page frame          (light mode: white)   */
	--qh-d-panel:  #453a66;   /* pale panels             (light mode: #f3ecfe) */
	--qh-d-green:  #3c4a4a;   /* home picture column     (light mode: #f1f9f1) */
	--qh-d-accent: #3a2f5c;   /* purple accent blocks    (light mode: #d4befe) */
	--qh-d-band:   #31294a;   /* header band             (light mode: #b7acca) */
	--qh-d-nav:    #181026;   /* navigation bar          (light mode: #5a497d) */
	--qh-d-footer: #120b1f;   /* footer                  (light mode: #4a2f75) */
	--qh-d-line:   #6b5d94;   /* thin borders */

	--bs-body-color: #ffffff;
	--bs-body-color-rgb: 255, 255, 255;
	--bs-body-bg: #4f4373;          /* components (forms, dropdowns) match the frame; the page behind the frame is set on <body> below */
	--bs-body-bg-rgb: 79, 67, 115;
	--bs-emphasis-color: #ffffff;
	--bs-emphasis-color-rgb: 255, 255, 255;
	--bs-heading-color: #ffffff;
	--bs-secondary-color: rgba(255, 255, 255, 0.75);
	--bs-secondary-bg: #31294a;
	--bs-tertiary-color: rgba(255, 255, 255, 0.55);
	--bs-tertiary-bg: #453a66;
	--bs-border-color: var(--qh-d-line);
	--bs-border-color-translucent: rgba(255, 255, 255, 0.2);
	--bs-link-color: #ffffff;
	--bs-link-color-rgb: 255, 255, 255;
	--bs-link-hover-color: #d4befe;
	--bs-link-hover-color-rgb: 212, 190, 254;
	--bs-highlight-bg: #4a3d1e;
	--bs-highlight-color: #fff;
	--bs-code-color: #f0a8d0;
	--qh-frame-bg: var(--qh-d-frame);
	--qh-panel-bg: var(--qh-d-panel);
}
:root[data-bs-theme="dark"] body { background-color: var(--qh-d-page); }

/* ---------- Dark mode: page pieces ---------- */
:root[data-bs-theme="dark"] .container { box-shadow: 0 0 10px #000; border-right-color: var(--qh-d-frame); border-left-color: var(--qh-d-frame); }
:root[data-bs-theme="dark"] #header { background-color: var(--qh-d-band); border-top-color: var(--qh-d-frame); }
:root[data-bs-theme="dark"] .header-mail { color: #ffffff; }
:root[data-bs-theme="dark"] .header-mail:hover { color: #d4befe; }

/* Navigation: the old dark purple, one step darker (near-black), so it still reads as the dark strip between the header and the content */
:root[data-bs-theme="dark"] .navbar-queens { background-color: var(--qh-d-nav); border-bottom-color: #0a0612; }
:root[data-bs-theme="dark"] .navbar-queens .navbar-nav .nav-link.active,
:root[data-bs-theme="dark"] .navbar-queens .navbar-nav .show > .nav-link { background-color: #0c0716; }
:root[data-bs-theme="dark"] .navbar-queens .navbar-nav .nav-link:hover,
:root[data-bs-theme="dark"] .navbar-queens .navbar-nav .nav-link:focus { background-color: rgba(255, 255, 255, 0.1); }
:root[data-bs-theme="dark"] .navbar-queens .navbar-toggler { border-color: rgba(255, 255, 255, 0.45); }
:root[data-bs-theme="dark"] .navbar-queens .navbar-toggler:hover { background-color: rgba(255, 255, 255, 0.15); }
:root[data-bs-theme="dark"] .navbar-queens .dropdown-menu {
	--bs-dropdown-bg: #181026;
	--bs-dropdown-border-color: var(--qh-d-line);
	--bs-dropdown-link-color: #ffffff;
	--bs-dropdown-link-hover-color: #ffffff;
	--bs-dropdown-link-hover-bg: #2a2040;
	--bs-dropdown-link-active-bg: #4a306f;
}

/* Buttons: dark on the mid-dark panels, like the old dark buttons on the pale panels, with a light edge so they stand out */
:root[data-bs-theme="dark"] .btn-primary {
	--bs-btn-bg: #170e2a;
	--bs-btn-border-color: #9a7bd0;
	--bs-btn-hover-bg: #2a1a4a;
	--bs-btn-hover-border-color: #b99ee6;
	--bs-btn-focus-shadow-rgb: 154, 123, 208;
	--bs-btn-active-bg: #2a1a4a;
	--bs-btn-active-border-color: #b99ee6;
	--bs-btn-disabled-bg: #170e2a;
	--bs-btn-disabled-border-color: #9a7bd0;
}

/* Footer: white text on a near-black band, the dark end of the page like the old dark-purple footer (the light-purple text colours are written inline in footer.php) */
:root[data-bs-theme="dark"] .footer-row { background-color: var(--qh-d-footer); }
:root[data-bs-theme="dark"] .footer-row [style*="color:#"] { color: #ffffff !important; }
:root[data-bs-theme="dark"] .footer-row h2,
:root[data-bs-theme="dark"] .footer-row h4 { color: #ffffff; }
:root[data-bs-theme="dark"] .footer-row a:hover { color: #d4befe !important; }
:root[data-bs-theme="dark"] .theme-switch-label { color: #ffffff; }
:root[data-bs-theme="dark"] .theme-btn { border-color: rgba(255, 255, 255, 0.6); }
:root[data-bs-theme="dark"] .theme-btn[aria-pressed="true"] { color: #000000; background-color: #ffffff; border-color: #ffffff; }

:root[data-bs-theme="dark"] #admin-link-top { background-color: var(--qh-d-band); border-color: var(--qh-d-line); }
:root[data-bs-theme="dark"] .admin-link { color: #ffffff; }

/* Pictures: a touch softer so they don't glare against the dark page */
:root[data-bs-theme="dark"] main img { filter: brightness(0.92); }

/* ---------- Dark mode: colours written directly inside page content (no page editing needed) ---------- */
:root[data-bs-theme="dark"] [style*="background-color:#f3ecfe"] { background-color: var(--qh-d-panel) !important; }    /* pale purple text panels */
:root[data-bs-theme="dark"] [style*="background-color:#f1f9f1"] { background-color: var(--qh-d-green) !important; }    /* home page picture column */
:root[data-bs-theme="dark"] [style*="background-color:#d4befe"] { background-color: var(--qh-d-accent) !important; }   /* purple accent blocks */
:root[data-bs-theme="dark"] main [style*="color:#332c2f"]       { color: #ffffff !important; }                          /* dark-brown text/links */

/* ---------- Dark mode: The Events Calendar plugin ----------
   The plugin colours itself from these variables, so setting them is enough for most of the calendar. */
:root[data-bs-theme="dark"],
:root[data-bs-theme="dark"] .tribe-common,
:root[data-bs-theme="dark"] .tribe-events {
	--tec-color-text-primary: #ffffff;
	--tec-color-text-primary-light: rgba(255, 255, 255, 0.75);
	--tec-color-text-secondary: #e6e6e6;
	--tec-color-text-disabled: #6f6280;
	--tec-color-text-events-title: #ffffff;
	--tec-color-text-event-title: #ffffff;
	--tec-color-text-event-date: #ffffff;
	--tec-color-link-primary: #ffffff;
	--tec-color-link-accent: #c9adff;
	--tec-color-link-accent-hover: #d4befe;
	--tec-color-accent-primary: #c9adff;
	--tec-color-accent-primary-hover: rgba(201, 173, 255, 0.85);
	--tec-color-accent-primary-active: rgba(201, 173, 255, 0.95);
	--tec-color-accent-primary-background: rgba(201, 173, 255, 0.12);
	--tec-color-accent-secondary: #c9adff;
	--tec-color-icon-primary: #c9bfd6;
	--tec-color-icon-primary-alt: #b3a7c4;
	--tec-color-icon-secondary: #6f6280;
	--tec-color-icon-active: #ffffff;
	--tec-color-icon-disabled: #5a4d6c;
	--tec-color-background: #4f4373;
	--tec-color-background-events: #4f4373;
	--tec-color-background-transparent: rgba(79, 67, 115, 0.9);
	--tec-color-background-primary: #453a66;
	--tec-color-background-secondary: #453a66;
	--tec-color-background-tertiary: #453a66;
	--tec-color-background-secondary-hover: #3a2f5c;
	--tec-color-border-default: #6b5d94;
	--tec-color-border-secondary: #5a4d80;
	--tec-color-border-tertiary: #6f6280;
	--tec-color-border-hover: #8a7da0;
	--tec-color-border-active: #c9adff;
}
:root[data-bs-theme="dark"] .tribe-events .datepicker,
:root[data-bs-theme="dark"] .datepicker,
:root[data-bs-theme="dark"] .tribe-events .tribe-events-c-view-selector__content {
	background-color: #453a66;
	color: #ffffff;
	border-color: #6b5d94;
}
:root[data-bs-theme="dark"] .tribe-events input,
:root[data-bs-theme="dark"] .tribe-events select,
:root[data-bs-theme="dark"] .tribe-events textarea {
	background-color: #181026;
	color: #ffffff;
	border-color: #6b5d94;
}

}   /* end @media screen (dark mode) */
