/**
 * TAL site-specific styles for Helix Ultimate (shaper_helixultimate)
 *
 * Update-safe: templates/shaper_helixultimate/css/custom.css
 * Loaded by Helix Ultimate via $theme->add_css('custom.css').
 *
 * Visual baseline: live jb_dynamic4 chrome on https://www.tallinnaarstid.ee/
 * Compared against Helix page https://www.tallinnaarstid.ee/organisatsioonist/pohikiri
 *
 * Sources:
 * - jb_dynamic4/css/custom.css
 * - Selected rules from jb_dynamic4/scss/joomlabuff.scss (TAL-used only)
 * - Live computed styles from old preset8 / template.css (#sp-footer padding, etc.)
 */

:root {
	--tal-brand: #f50101;
	--tal-brand-hover: #99e501;
	--tal-muted: #70719a;
	--tal-heading-navy: #252767;
	--tal-panel-bg: #f7f7f7;
	--tal-panel-border: #f3f3f3;
	--tal-footer-bg: #f5f5f5;
	--tal-header-height: 63px;
	--tal-search-width: 230px;
}


.sppb-btn {
	padding: 12px 16px;
}

.article-details .article-ratings-social-share {
	border-bottom: unset;
}

#sp-top-bar .sp-module {
	margin: 0;
}

.centerme {
	margin: auto !important;
	display: block !important;
}

.sp-megamenu-parent > li > a,
.sp-megamenu-parent > li > span {
	font-size: 18px;
}

.sp-megamenu-parent .sp-dropdown li.sp-menu-item > a,
.sp-megamenu-parent .sp-dropdown li.sp-menu-item span:not(.sp-menu-badge) {
	font-size: 16px;
}

#events .item .eg-content:hover .data {
	background-color: rosybrown;
}

.breadcrumb {
	margin: revert;
}

.kasti_varv {
	background-color: mistyrose;
}

/*
 * Search module class "otsing" (from old site).
 * Vertical centering only — horizontal width comes from .tal-header-search.
 */
.otsing {
	position: absolute;
	top: 50%;
	-ms-transform: translateY(-50%);
	transform: translateY(-50%);
}

#searchForm > div.mb-3.searchintro > p > strong > span.badge {
	color: unset;
	font-size: unset;
}

.edocmanxtdlink:before {
	content: "\f019";
	font-family: "Font Awesome 6 Free";
	font-weight: 900;
	display: inline-block;
	padding-right: 6px;
	vertical-align: middle;
}

/* System messages: keep in content flow (not floating corner)
#system-message-container {
	position: relative !important;
	top: auto !important;
	right: auto !important;
	bottom: auto !important;
	left: auto !important;
	width: 100% !important;
	z-index: 1 !important;
}*/

.registration-complete #system-message-container joomla-alert {
	position: relative !important;
	display: block !important;
	font-size: 16px !important;
	line-height: 1.6 !important;
	padding: 20px !important;
	border-radius: 6px !important;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1) !important;
}

/* -------------------------------------------------------------------------
 * Header (tll_top)
 *
 * Based on Helix Ultimate 2.2.9 official Top Bar header geometry.
 * Do not reconstruct the header grid here: let Helix/Bootstrap do the layout.
 * ---------------------------------------------------------------------- */

#sp-header.tal-header-tll-top {
	height: var(--tal-header-height);
}

#sp-header.tal-header-tll-top > .container,
#sp-header.tal-header-tll-top > .container > .container-inner,
#sp-header.tal-header-tll-top > .container > .container-inner > .row,
#sp-header.tal-header-tll-top #sp-menu,
#sp-header.tal-header-tll-top #sp-menu > .sp-column {
	height: 100%;
}

/* With the logo column intentionally removed, #sp-menu owns the whole row. */
#sp-header.tal-header-tll-top #sp-menu {
	min-width: 0;
}

/*
 * This wrapper is the only TAL addition to the official Top Bar geometry.
 * It keeps navigation at the LEFT side while header modules/search stay right.
 */
#sp-header.tal-header-tll-top .tal-menu-wrap {
	min-width: 0;
	flex: 1 1 auto !important;
	justify-content: flex-start !important;
	overflow: visible;
}

#sp-header.tal-header-tll-top .header-modules {
	flex-shrink: 0 !important;
}

/* renderFeature() returns nav.sp-megamenu-wrapper.d-flex */
#sp-header.tal-header-tll-top .tal-menu-wrap > .sp-megamenu-wrapper {
	display: flex !important;
	align-items: center !important;
	justify-content: flex-start !important;
	flex: 0 0 auto !important;
	width: max-content !important;
	max-width: none !important;
	min-width: 0;
	margin: 0 !important;
	padding: 0 !important;
}

/*
 * In the official header the menu is a flex child, so stock float:right is
 * irrelevant. Reset it explicitly for clarity and old-site parity.
 */
#sp-header.tal-header-tll-top .tal-menu-wrap .sp-megamenu-parent {
	/*
	 * renderFeature() adds Bootstrap's d-lg-block, which is
	 * display:block !important. We must override it with !important,
	 * otherwise the desktop UL is not actually a flex row.
	 */
	float: none !important;
	display: flex !important;
	flex-direction: row !important;
	align-items: center !important;
	justify-content: flex-start !important;
	flex-wrap: nowrap !important;
	width: max-content !important;
	max-width: none !important;
	margin: 0 !important;
	padding: 0 !important;
	white-space: nowrap !important;
}

#sp-header.tal-header-tll-top .tal-menu-wrap .sp-megamenu-parent > li {
	display: block !important;
	flex: 0 0 auto !important;
	width: auto !important;
	white-space: nowrap !important;
}

#sp-header.tal-header-tll-top .tal-menu-wrap .sp-megamenu-parent > li > a,
#sp-header.tal-header-tll-top .tal-menu-wrap .sp-megamenu-parent > li > span {
	font-family: inherit !important;
	font-size: 1.1rem !important;
	text-transform: uppercase;
	font-style: normal !important;
	font-weight: 500 !important;
	line-height: var(--tal-header-height) !important;
	letter-spacing: normal !important;
	text-decoration: none !important;
	padding-left: 0px;
	padding-right: 1.2rem;
	color: #252525 !important;
	white-space: nowrap !important;
}

#sp-header.tal-header-tll-top .tal-menu-wrap .sp-megamenu-parent > li:hover > a,
#sp-header.tal-header-tll-top .tal-menu-wrap .sp-megamenu-parent > li:hover > span,
#sp-header.tal-header-tll-top .tal-menu-wrap .sp-megamenu-parent > li.active > a,
#sp-header.tal-header-tll-top .tal-menu-wrap .sp-megamenu-parent > li.active > span,
#sp-header.tal-header-tll-top .tal-menu-wrap .sp-megamenu-parent > li.active:hover > a,
#sp-header.tal-header-tll-top .tal-menu-wrap .sp-megamenu-parent > li.active:hover > span {
	color: var(--tal-brand) !important;
}

/* Search: normal flex-flow item. Do not use the old absolute-position trick here. */
#sp-header.tal-header-tll-top .header-modules {
	flex: 0 0 auto;
	margin-left: 18px;
	height: var(--tal-header-height);
}

#sp-header.tal-header-tll-top .header-modules .sp-module {
	margin: 0;
}

#sp-header.tal-header-tll-top .header-modules .otsing {
	position: static !important;
	top: auto !important;
	right: auto !important;
	left: auto !important;
	transform: none !important;
	width: var(--tal-search-width);
	max-width: var(--tal-search-width);
}

#sp-header.tal-header-tll-top .header-modules .search .form-control,
#sp-header.tal-header-tll-top .header-modules .mod-finder__search .form-control,
#sp-header.tal-header-tll-top .header-modules input[type="search"].form-control {
	width: var(--tal-search-width);
	max-width: var(--tal-search-width);
	height: 32px;
	font-size: 15px;
}

/* Dropdown caret: no custom positioning; let current Helix align it. */
#sp-header.tal-header-tll-top .sp-megamenu-parent > li.sp-has-child > a::after,
#sp-header.tal-header-tll-top .sp-megamenu-parent > li.sp-has-child > span::after {
	position: static !important;
	margin-left: 5px;
}

/* If space gets tight, tighten spacing before changing font size or wrapping. */
@media (min-width: 992px) and (max-width: 1199.98px) {
	#sp-header.tal-header-tll-top .tal-menu-wrap .sp-megamenu-parent > li > a,
	#sp-header.tal-header-tll-top .tal-menu-wrap .sp-megamenu-parent > li > span {
		padding-left: 7px;
		padding-right: 7px;
	}
}

/* -------------------------------------------------------------------------
 * Top bar
 * ---------------------------------------------------------------------- */

#sp-top-bar {
	background: var(--tal-brand);
	padding: 8px 0;
	font-size: 1rem;
}

#sp-top-bar,
#sp-top-bar a {
	color: #ffffff;
}

#sp-top-bar a:hover,
#sp-top-bar a:focus {
	color: #ffffff;
	opacity: 0.9;
}


/* Helix built-in login, intentionally moved to top bar right. */
#sp-top-bar #sp-top2 .tal-top-login {
	display: flex;
	align-items: center;
	margin: 0;
	padding: 0;
}

#sp-top-bar #sp-top2 .tal-top-login .sp-sign-in,
#sp-top-bar #sp-top2 .tal-top-login a {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	margin: 0;
	padding: 0;
}

#sp-top-bar #sp-top2 .tal-top-login .sp-sign-in:hover,
#sp-top-bar #sp-top2 .tal-top-login a:hover,
#sp-top-bar #sp-top2 .tal-top-login .sp-sign-in:focus,
#sp-top-bar #sp-top2 .tal-top-login a:focus {
	color: #ffffff !important;
	opacity: 0.9;
}

#sp-top-bar #sp-top2 .tal-top-login i,
#sp-top-bar #sp-top2 .tal-top-login .fa,
#sp-top-bar #sp-top2 .tal-top-login .fas,
#sp-top-bar #sp-top2 .tal-top-login .far,
#sp-top-bar #sp-top2 .tal-top-login .fa-solid,
#sp-top-bar #sp-top2 .tal-top-login .fa-regular {
	font-size: 12px !important;
	line-height: 1 !important;
}


.sp-megamenu-parent .sp-dropdown-main .sp-dropdown-inner {
	border-top: 3px solid var(--tal-brand);
}

.sp-megamenu-parent .sp-dropdown-main .sp-dropdown-inner .item-header .sp-group-title {
	padding: 0 10px;
	color: var(--tal-brand);
}

.sp-megamenu-parent .sp-dropdown-main .sp-dropdown-inner .sp-dropdown-items li a {
	font-weight: 400;
	color: var(--tal-heading-navy);
	display: block;
	padding: 15px 10px;
}

.sp-megamenu-parent .sp-dropdown li.sp-menu-item > a:hover,
.sp-megamenu-parent .sp-dropdown li.sp-menu-item.active > a {
	color: var(--tal-brand);
}

/* -------------------------------------------------------------------------
 * Buttons
 * ---------------------------------------------------------------------- */

.sppb-btn,
.btn {
	font-size: 16px;
	line-height: 1.5;
	font-weight: 500;
}

.sppb-btn-primary,
.btn-primary {
	border-color: var(--tal-brand);
	background-color: var(--tal-brand);
}

.sppb-btn-link {
	box-shadow: none;
	color: var(--tal-brand);
}

.sppb-btn-link:hover {
	color: var(--tal-brand-hover);
}

/* -------------------------------------------------------------------------
 * Footer — match live old preset (#f5f5f5) + muted text (not pure white)
 * ---------------------------------------------------------------------- */

#sp-footer,
#sp-bottom {
	background: var(--tal-footer-bg) !important;
	color: var(--tal-muted) !important;
	font-size: 14px;
}

#sp-footer .container-inner {
	padding: 30px 0;
}

#sp-footer a,
#sp-bottom a {
	color: var(--tal-muted) !important;
}

#sp-footer a:hover,
#sp-footer a:focus,
#sp-bottom a:hover,
#sp-bottom a:focus {
	color: var(--tal-brand) !important;
}

#sp-footer #sp-footer2 {
	text-align: right;
}

#sp-bottom {
	padding: 60px 0 0;
	font-size: 18px;
	line-height: 1.9;
}

@media (max-width: 991.98px) {
	#sp-footer #sp-footer2 {
		text-align: left;
		margin-top: 0.5rem;
	}
}

/*Sidemenu*/
#sp-right .sp-module, #sp-left .sp-module {border: unset;padding: unset;box-shadow: unset;}
#sp-left .sp-module ul>li, #sp-right .sp-module ul>li {border-bottom: unset;}
#sp-left .sp-module ul>li>a, #sp-right .sp-module ul>li>a {line-height: unset;}
#sp-left > div > div > div > ul > li > a  {
    background: #f7f7f7 none repeat scroll 0 0;
    color: #222222;
    display: block;
    font-size: 16px;
    border-radius: 5px;
    border-left: 5px solid #f7f7f7;
    border-bottom: 0px;
    font-weight: 600;
    padding: 17px 20px 15px !important;
    width: 100%;
    position: relative;
    z-index: 1;
    transition: all 500ms ease;
    transition-delay: 0.15s;
}

#sp-left > div > div > div > ul > li > a::before {
    position: absolute;
    top: 0;
    right: 0;
    width: 37px;
    height: 56px;
    content: "";
    font-family: "Font Awesome 6 Free";
    color: #ffffff;
    line-height: 58px;
    font-size: 18px;
    transform: translate3d(-30px, 0px, 0px);
    transition-delay: 0.5s;
    transition: all 500ms ease;
    opacity: 0;
}
#sp-left > div > div > div > ul > li > a:hover {color: #fff;border-color: #252767;background: var(--tal-brand);;}
#sp-left > div > div > div > ul > li > a:hover::before, #sp-left > div > div > div > ul > li > a.active::before {transform: translate3d(0px, 0px, 0px);opacity: 1;}
#sp-left .sp-module ul > li {margin-top: 5px;}
#sp-left > div > div > div > ul > li.current a {color: #fff;border-color: #1f1f1f;background: var(--tal-brand);;}
#sp-left > div > div > div > ul > li.current a::before {transform: translate3d(0px, 0px, 0px);opacity: 1;}

.sidebar-menu .sppb-addon-content .menu li a {
    border-bottom: 2px solid #fff;
    background: #f7f7f7 none repeat scroll 0 0;
    color: #222;
    display: block;
    font-size: 16px;
    border-radius: 5px;
    border-left: 5px solid #f7f7f7;
    border-bottom: 0px;
    font-weight: 600;
    padding: 17px 20px 15px;
    width: 100%;
    position: relative;
    z-index: 1;
    transition: all 500ms ease;
    transition-delay: .15s;
}

.sidebar-menu .sppb-addon-content .menu li a:before {
    position: absolute;
    top: 0;
    right: 0;
    width: 37px;
    height: 56px;
    content: "";
    font-family: "Font Awesome 6 Free";
    color: #fff;
    line-height: 58px;
    font-size: 18px;
    transform: translate3d(-30px, 0px, 0px);
    transition-delay: .5s;
    transition: all 500ms ease;
    opacity: 0;
}

.sidebar-menu .sppb-addon-content .menu li a:hover:before, .sidebar-menu .sppb-addon-content .menu li a.active:before {
    transform: translate3d(0px, 0px, 0px);
    opacity: 1;
}

.sidebar-menu .sppb-addon-content .menu li  {
    margin-top: 5px;
}

.sidebar-menu .sppb-addon-content .menu li a:hover {
    border-color: #252767;
    background: var(--tal-brand);;
    color: #fff;
}

.sidebar-menu .sppb-addon-content .menu
 {
    overflow: hidden;
    margin-bottom: 50px;
    padding: 0px;
}

/*Sidemenu lõpp*/

/* -------------------------------------------------------------------------
 * Blog / article
 * ---------------------------------------------------------------------- */

.blog .article-list .article {
	box-shadow: 0 10px 30px 0 rgba(205, 205, 205, 0.33);
	border-radius: 10px;
	transition: all 0.3s ease;
}

.blog .article-list .article:hover {
	box-shadow: 0 2px 4px 0 rgba(205, 205, 205, 0.33);
}

.blog .article-list .article .article-header h2 a {
	font-weight: 400;
	color: var(--tal-brand) !important;
	line-height: 30px;
	text-transform: capitalize;
}

.article-details .article-header h1 {
	font-size: 36px;
	color: var(--tal-brand);
	font-weight: normal;
}

.article-details .article-info span a,
.blog .article-list .article .article-info span a {
	color: var(--tal-muted) !important;
}

.article-details h1,
.article-details h2,
.article-details h3,
.article-details h4,
.article-details h5,
.article-details h6 {
	margin: 20px 0;
	color: var(--tal-brand);
}

.article-details .article-author-information {
	padding: 2rem 0;
	border: 4px solid #f7f8f9;
}

.page-item:not(.active) .page-link {
	color: var(--tal-heading-navy);
}

.page-item.active .page-link {
	background-color: var(--tal-brand);
	border-color: var(--tal-brand);
}

/* Global link accent (when Helix preset drifts to orange) */
a {
	color: var(--tal-brand);
}

a:hover,
a:focus,
a:active {
	color: var(--tal-brand);
}

/* -------------------------------------------------------------------------
 * Login / registration
 * ---------------------------------------------------------------------- */

.com-users-login.login {
	margin: 50px 0;
}

.tal-id-auth-assets {
	display: none;
}

.sp-profile-wrapper .sp-profile-dropdown {
    z-index: 100;
    background: var(--tal-brand);
    color: #fff;
}

.sp-profile-wrapper .sp-profile-dropdown a:hover,
.sp-profile-wrapper .sp-profile-dropdown a:focus {
    color: #fff !important;
    opacity: 0.85;
}

/* Näita loginiteksti ja kasutajanime ka mobiilis */
#sp-top-bar .tal-top-login .signin-text,
#sp-top-bar .tal-top-login .user-text {
    display: inline-block !important;
}

/* Juhatuse liikmete kaardid */
.tal-board-cards {
	margin-top: 10px;
}

.tal-board-card {
	border-left: 4px solid transparent;
	border: 1px solid #e9ecef;
	border-radius: 10px;
	background: #ffffff;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
	transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
	overflow: hidden;
}

.tal-board-card .card-body {
	padding: 22px 20px;
}

.tal-board-card h3 {
	margin-bottom: 14px;
	color: #222;
}

.tal-board-card .text-muted {
	font-size: 13px;
	text-transform: uppercase;
	letter-spacing: 0.04em;
}

.tal-board-card:hover {
	transform: translateY(-4px);
	box-shadow: 0 10px 24px rgba(0, 0, 0, 0.12);
	border-color: #f50101;
	background: #fffdfd;
	border-left-color: #f50101;
}

.tal-board-card:hover h3 {
	color: #f50101;
}



/* -------------------------------------------------------------------------
 * TAL mobile header / offcanvas fix
 *
 * Helix renders the desktop menu UL with Bootstrap classes:
 *   d-none d-lg-block
 *
 * The TAL desktop menu uses display:flex !important, so below 992px we must
 * explicitly hide the desktop navigation wrapper and leave only the Helix
 * offcanvas toggler visible/clickable.
 * ---------------------------------------------------------------------- */
@media (max-width: 991.98px) {
	#sp-header.tal-header-tll-top {
		height: var(--tal-header-height);
	}

	/* Hide desktop navigation and desktop search/header modules. */
	#sp-header.tal-header-tll-top .tal-menu-wrap {
		display: none !important;
	}

	#sp-header.tal-header-tll-top .header-modules {
		display: none !important;
	}

	/* Let the Helix menu column occupy the row and place toggler at right. */
	#sp-header.tal-header-tll-top #sp-menu {
		width: 100%;
		max-width: 100%;
		flex: 1 1 100%;
	}

	#sp-header.tal-header-tll-top #sp-menu > .sp-column {
		width: 100%;
		height: var(--tal-header-height);
		display: flex !important;
		align-items: center !important;
		justify-content: flex-end !important;
		overflow: visible !important;
	}

	/* Large, unobstructed click target for hamburger. */
	#sp-header.tal-header-tll-top #offcanvas-toggler {
		display: flex !important;
		align-items: center !important;
		justify-content: center !important;
		flex: 0 0 auto !important;
		position: relative !important;
		z-index: 1000 !important;
		margin: 0 !important;
		padding: 12px !important;
		min-width: 48px;
		min-height: 48px;
		cursor: pointer;
		pointer-events: auto !important;
	}

	#sp-header.tal-header-tll-top #offcanvas-toggler .burger-icon {
		position: relative;
		z-index: 1001;
		pointer-events: none;
	}
}

