/*
Theme Name: ThriveConnect v2a
Theme URI: https://thriveandconnect.com/
Author: Thrive and Connect
Description: A modernized, mobile-ready refresh of the Thrive and Connect custom theme. Keeps the original header artwork, navy/steel-blue palette and Lato typography with cleaner spacing and full block editor support.
Version: 2.0.0
Requires at least: 5.8
Tested up to: 6.6
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: tccustom
Tags: blog, podcast, three-columns, left-sidebar, right-sidebar, custom-menu, block-styles, wide-blocks
*/

/* ==========================================================
   1. Tokens
   ========================================================== */
:root {
	--tc-navy: #1c4470;
	--tc-navy-deep: #133255;
	--tc-blue: #28456c;
	--tc-steel: #8dadc9;
	--tc-steel-soft: #dbe5ef;
	--tc-panel: #f3f6f9;
	--tc-banner: #c8d1dc;
	--tc-link: #2b5aa8;
	--tc-link-hover: #133255;
	--tc-text: #333a42;
	--tc-muted: #6b7682;
	--tc-border: #d9e1e9;
	--tc-white: #ffffff;

	--tc-font: "Lato", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

	--tc-space-1: 0.25rem;
	--tc-space-2: 0.5rem;
	--tc-space-3: 0.75rem;
	--tc-space-4: 1rem;
	--tc-space-5: 1.5rem;
	--tc-space-6: 2rem;
	--tc-space-7: 3rem;
	--tc-space-8: 4rem;

	--tc-radius: 6px;
	--tc-shadow: 0 1px 2px rgba(19, 50, 85, .06), 0 4px 16px rgba(19, 50, 85, .06);
	--tc-container: 1180px;
}

/* ==========================================================
   2. Base / reset
   ========================================================== */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
	margin: 0;
	background: var(--tc-white);
	color: var(--tc-text);
	font-family: var(--tc-font);
	font-size: 1.0625rem;
	line-height: 1.7;
	-webkit-font-smoothing: antialiased;
}

img, svg, video, iframe, embed, object { max-width: 100%; }
img { height: auto; border: 0; }

h1, h2, h3, h4, h5, h6 {
	color: var(--tc-navy-deep);
	font-weight: 700;
	line-height: 1.25;
	margin: var(--tc-space-6) 0 var(--tc-space-4);
}
h1 { font-size: clamp(1.6rem, 1.2rem + 1.4vw, 2.1rem); }
h2 { font-size: clamp(1.35rem, 1.1rem + .8vw, 1.65rem); }
h3 { font-size: 1.3rem; }
h4 { font-size: 1.1rem; }

p, ul, ol, dl, blockquote, pre, table, figure { margin: 0 0 var(--tc-space-5); }
ul, ol { padding-left: var(--tc-space-5); }
li > ul, li > ol { margin-bottom: 0; }

a { color: var(--tc-link); text-decoration-thickness: 1px; text-underline-offset: 3px; transition: color .15s ease; }
a:hover, a:focus { color: var(--tc-link-hover); }
a:focus-visible, button:focus-visible, input:focus-visible { outline: 2px solid var(--tc-steel); outline-offset: 2px; }

blockquote {
	border-left: 4px solid var(--tc-steel);
	background: var(--tc-panel);
	padding: var(--tc-space-4) var(--tc-space-5);
	border-radius: 0 var(--tc-radius) var(--tc-radius) 0;
	font-style: italic;
}
blockquote p:last-child { margin-bottom: 0; }

hr { border: 0; border-top: 1px solid var(--tc-border); margin: var(--tc-space-6) 0; }

pre { background: var(--tc-panel); padding: var(--tc-space-4); overflow: auto; border-radius: var(--tc-radius); font-size: .9rem; }
code, kbd { font-family: Menlo, Consolas, monospace; font-size: .9em; }

table { width: 100%; border-collapse: collapse; }
th, td { padding: var(--tc-space-2) var(--tc-space-3); border-bottom: 1px solid var(--tc-border); text-align: left; }

.screen-reader-text {
	clip: rect(1px, 1px, 1px, 1px); position: absolute !important;
	height: 1px; width: 1px; overflow: hidden; word-wrap: normal !important;
}
.screen-reader-text:focus {
	clip: auto !important; display: block; height: auto; width: auto;
	left: 8px; top: 8px; z-index: 100000; padding: 12px 20px;
	background: var(--tc-white); color: var(--tc-navy); box-shadow: var(--tc-shadow);
	border-radius: var(--tc-radius); font-weight: 700; text-decoration: none;
}

/* ==========================================================
   3. Forms & buttons
   ========================================================== */
input[type="text"], input[type="email"], input[type="url"], input[type="password"],
input[type="search"], input[type="tel"], input[type="number"], select, textarea {
	width: 100%;
	max-width: 100%;
	padding: .65rem .8rem;
	border: 1px solid var(--tc-border);
	border-radius: var(--tc-radius);
	background: var(--tc-white);
	color: var(--tc-text);
	font: inherit;
	font-size: 1rem;
	transition: border-color .15s ease, box-shadow .15s ease;
}
input:focus, select:focus, textarea:focus {
	outline: none;
	border-color: var(--tc-steel);
	box-shadow: 0 0 0 3px rgba(141, 173, 201, .35);
}
textarea { min-height: 8rem; }

button, input[type="submit"], input[type="button"], input[type="reset"],
.wp-block-button__link, .tc-button {
	display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
	padding: .7rem 1.4rem;
	border: 0;
	border-radius: var(--tc-radius);
	background: var(--tc-blue);
	color: var(--tc-white);
	font: inherit; font-size: .95rem; font-weight: 700; letter-spacing: .02em;
	line-height: 1.2;
	cursor: pointer;
	text-decoration: none;
	transition: background-color .15s ease, transform .15s ease;
}
button:hover, input[type="submit"]:hover, input[type="button"]:hover,
.wp-block-button__link:hover, .tc-button:hover {
	background: var(--tc-navy-deep); color: var(--tc-white);
}
button:active, input[type="submit"]:active { transform: translateY(1px); }

label { font-weight: 700; color: var(--tc-navy-deep); font-size: .95rem; }

/* WordPress login form ([tc_login_form] / wp_login_form) */
#loginform { max-width: 420px; margin: 0 auto var(--tc-space-5); }
#loginform p { margin-bottom: var(--tc-space-4); }
#loginform label { display: block; margin-bottom: var(--tc-space-1); width: auto; padding: 0; }
#loginform input[type="text"], #loginform input[type="password"] { display: block; width: 100%; }
#loginform .login-remember label { display: inline-flex !important; align-items: center; gap: .5rem; font-weight: 400; padding: 0 !important; }
#loginform .login-remember input { width: auto !important; padding: 0 !important; }
#loginform .login-submit { padding: 0; }
#loginform .login-submit input { width: 100%; }

/* Search form */
.search-form { display: flex; gap: var(--tc-space-2); }
.search-form label { flex: 1; margin: 0; }
.search-form .search-field { width: 100%; box-sizing: border-box; -webkit-appearance: none; }
.search-form .search-submit { padding: .65rem 1rem; }
.widget_search .search-submit { display: none; }

.form-error { background: #fde8e8; color: #9b1c1c; border-radius: var(--tc-radius); }
div.form-error { padding: var(--tc-space-4) var(--tc-space-5); margin: 0 0 var(--tc-space-5); font-weight: 700; }

/* Legacy webinar button */
button.css3button { width: 100%; text-transform: uppercase; font-size: 1.05rem; padding: .9rem 1rem; white-space: normal; }

/* ==========================================================
   4. Layout
   ========================================================== */
.tc-container {
	width: 100%;
	max-width: var(--tc-container);
	margin: 0 auto;
	padding: 0 var(--tc-space-5);
}

.site { display: flex; flex-direction: column; min-height: 100vh; }
.site-content { flex: 1; padding: var(--tc-space-6) 0 var(--tc-space-8); }

.tc-layout {
	display: grid;
	gap: var(--tc-space-6);
	grid-template-columns: minmax(0, 1fr);
	grid-template-areas: "main" "right" "left";
}
.tc-layout > .content-area { grid-area: main; min-width: 0; }
.tc-layout > #secondary { grid-area: left; }
.tc-layout > #secondary-right { grid-area: right; }

@media (min-width: 800px) {
	.tc-layout {
		grid-template-columns: 230px minmax(0, 1fr);
		grid-template-areas: "left main" "left right";
		align-items: start;
	}
}
@media (min-width: 1140px) {
	.tc-layout {
		grid-template-columns: 230px minmax(0, 1fr) 230px;
		grid-template-areas: "left main right";
	}
}
/* Layout without sidebars (e.g. 404) */
.tc-layout.tc-layout--full { grid-template-columns: minmax(0, 1fr); grid-template-areas: "main"; max-width: 820px; margin: 0 auto; }

/* ==========================================================
   5. Header
   ========================================================== */
.site-header { background: var(--tc-white); }

.tc-topbar {
	background: var(--tc-navy-deep);
	color: #dbe5ef;
	font-size: .875rem;
}
.tc-topbar .tc-container {
	display: flex; justify-content: flex-end; align-items: center; gap: var(--tc-space-4);
	min-height: 40px;
}
.tc-topbar a { color: var(--tc-white); text-decoration: none; font-weight: 700; }
.tc-topbar a:hover { color: var(--tc-steel); }
.tc-topbar .tc-user-links { display: flex; align-items: center; gap: var(--tc-space-4); flex-wrap: wrap; justify-content: flex-end; }
.tc-topbar .tc-signup {
	padding: .25rem .8rem; border: 1px solid rgba(255,255,255,.45); border-radius: 999px;
}
.tc-topbar .tc-signup:hover { background: rgba(255,255,255,.1); color: var(--tc-white); }

/* Header artwork band – the image itself is untouched, only its placement */
.tc-brand-band {
	background:
		linear-gradient(180deg, #e9eff5 0%, #cfdbe7 100%);
	border-bottom: 5px solid var(--tc-navy);
}
.tc-brand-band .tc-container {
	display: flex; align-items: center; justify-content: space-between; gap: var(--tc-space-5);
	padding-top: var(--tc-space-5); padding-bottom: var(--tc-space-5);
}
.site-branding { margin: 0; line-height: 0; flex: 0 1 690px; }
.site-branding a { display: block; }
.site-branding img {
	display: block; width: 100%; max-width: 690px; height: auto;
	border-radius: var(--tc-radius);
	box-shadow: 0 6px 24px rgba(19, 50, 85, .18);
}
.site-title, .site-description { margin: 0; }

/* Primary navigation */
.main-navigation { flex: 0 0 auto; }
.main-navigation ul { list-style: none; margin: 0; padding: 0; }
.main-navigation > div > ul, .main-navigation > ul { display: flex; gap: var(--tc-space-2); flex-wrap: wrap; justify-content: flex-end; }
.main-navigation li { position: relative; }
.main-navigation a {
	display: block; padding: .55rem 1rem; border-radius: var(--tc-radius);
	color: var(--tc-navy-deep); font-weight: 700; text-decoration: none;
}
.main-navigation a:hover, .main-navigation a:focus { background: rgba(255,255,255,.7); color: var(--tc-navy); }
.main-navigation .current-menu-item > a, .main-navigation .current_page_item > a, .main-navigation .current_page_ancestor > a {
	background: var(--tc-navy); color: var(--tc-white);
}
.main-navigation ul ul {
	position: absolute; top: 100%; right: 0; z-index: 999; min-width: 220px;
	background: var(--tc-white); border-radius: var(--tc-radius); box-shadow: var(--tc-shadow);
	padding: var(--tc-space-2); display: none;
}
.main-navigation li:hover > ul, .main-navigation li:focus-within > ul { display: block; }
.main-navigation ul ul a { font-weight: 400; }

.menu-toggle { display: none; }

@media (max-width: 799px) {
	.tc-brand-band .tc-container { flex-direction: column; align-items: stretch; padding-top: var(--tc-space-4); padding-bottom: var(--tc-space-4); gap: var(--tc-space-3); }
	.site-branding { flex-basis: auto; align-self: center; width: 100%; }
	.menu-toggle {
		display: inline-flex; width: 100%; justify-content: space-between;
		background: var(--tc-navy); padding: .75rem 1rem;
	}
	.menu-toggle .tc-bars { display: inline-block; width: 18px; height: 2px; background: currentColor; position: relative; }
	.menu-toggle .tc-bars::before, .menu-toggle .tc-bars::after { content: ""; position: absolute; left: 0; width: 18px; height: 2px; background: currentColor; }
	.menu-toggle .tc-bars::before { top: -6px; }
	.menu-toggle .tc-bars::after { top: 6px; }
	.main-navigation > div > ul, .main-navigation > ul { display: none; flex-direction: column; gap: 0; margin-top: var(--tc-space-2); background: var(--tc-white); border-radius: var(--tc-radius); box-shadow: var(--tc-shadow); padding: var(--tc-space-2); }
	.main-navigation.toggled > div > ul, .main-navigation.toggled > ul { display: flex; }
	.main-navigation ul ul { position: static; display: block; box-shadow: none; padding: 0 0 0 var(--tc-space-4); }
	.tc-topbar .tc-container { justify-content: center; }
}

/* ==========================================================
   6. Topbar widget (intro banner)
   ========================================================== */
#primary-top {
	background: var(--tc-banner);
	background: linear-gradient(135deg, #d4dce6 0%, #c3cedb 100%);
	border-left: 5px solid var(--tc-navy);
	border-radius: var(--tc-radius);
	padding: var(--tc-space-5) var(--tc-space-6);
	margin: 0 0 var(--tc-space-6);
	text-align: center;
	color: var(--tc-navy-deep);
	font-size: 1.05rem;
	line-height: 1.65;
}
#primary-top .widget { margin: 0; }
#primary-top p:last-child { margin-bottom: 0; }
#primary-top .widget-title { font-weight: 700; margin-bottom: var(--tc-space-2); }
@media (max-width: 599px) { #primary-top { padding: var(--tc-space-4); font-size: 1rem; } }

/* ==========================================================
   7. Sidebars & widgets
   ========================================================== */
.widget-area .widget {
	background: var(--tc-white);
	border: 1px solid var(--tc-border);
	border-top: 3px solid var(--tc-steel);
	border-radius: var(--tc-radius);
	padding: var(--tc-space-5);
	margin: 0 0 var(--tc-space-5);
	font-size: .92rem;
	line-height: 1.5;
}
.widget-area .widget:last-child { margin-bottom: 0; }
.widget-area .widget-title, .widget-area .wp-block-heading {
	font-size: 1.05rem; margin: 0 0 var(--tc-space-4);
	color: var(--tc-navy-deep); letter-spacing: .01em;
}
.widget-area ul { list-style: none; margin: 0; padding: 0; }
.widget-area li { padding: .4rem 0; border-bottom: 1px solid var(--tc-panel); }
.widget-area li:last-child { border-bottom: 0; padding-bottom: 0; }
.widget-area li:first-child { padding-top: 0; }
.widget-area li a { text-decoration: none; }
.widget-area li a:hover { text-decoration: underline; }
.widget-area select { width: 100%; }
.widget-area img { display: block; }

/* Long category / archive lists become compact tags on narrow screens */
@media (max-width: 799px) {
	#secondary .widget_categories ul, #secondary .widget_archive ul,
	#secondary .wp-block-categories, #secondary .wp-block-archives {
		display: flex; flex-wrap: wrap; gap: .4rem;
	}
	#secondary .widget_categories li, #secondary .widget_archive li,
	#secondary .wp-block-categories li, #secondary .wp-block-archives li {
		border: 1px solid var(--tc-border); border-radius: 999px; padding: .25rem .7rem;
	}
}

/* Subscribe widget from the podcast plugin – tame the oversized heading */
.widget-area h1, .widget-area h2 { font-size: 1.15rem; }

/* ==========================================================
   8. Posts & pages
   ========================================================== */
.hentry { margin: 0; }

.blog .hentry, .archive .hentry, .search .hentry {
	background: var(--tc-white);
	border: 1px solid var(--tc-border);
	border-radius: var(--tc-radius);
	box-shadow: var(--tc-shadow);
	padding: var(--tc-space-6);
	margin-bottom: var(--tc-space-6);
}
@media (max-width: 599px) {
	.blog .hentry, .archive .hentry, .search .hentry { padding: var(--tc-space-5); }
}

.entry-header { margin-bottom: var(--tc-space-5); }
.entry-title { margin: 0 0 var(--tc-space-2); font-size: clamp(1.45rem, 1.15rem + 1vw, 1.9rem); }
.entry-title a { color: var(--tc-navy-deep); text-decoration: none; }
.entry-title a:hover { color: var(--tc-link); }
.page .entry-title { text-align: center; }

.entry-meta, .entry-footer {
	color: var(--tc-muted);
	font-size: .85rem;
}
.entry-meta a, .entry-footer a { color: var(--tc-muted); }
.entry-meta .byline::before { content: "\00b7"; margin: 0 .4rem; }
.updated:not(.published) { display: none; }

.entry-footer {
	display: flex; flex-wrap: wrap; gap: var(--tc-space-2) var(--tc-space-4);
	margin-top: var(--tc-space-5); padding-top: var(--tc-space-4);
	border-top: 1px solid var(--tc-border);
}
.entry-footer:empty { display: none; }

.entry-content, .entry-summary, .page-content { text-align: left; }
.entry-content > *:first-child { margin-top: 0; }
.entry-content > *:last-child { margin-bottom: 0; }
.entry-content .more-link { display: inline-block; margin-top: var(--tc-space-2); font-weight: 700; }

.ap-home-content { min-height: 0; }
#ap-featured-image, #ap-featured-image-home { float: none; margin: 0 0 var(--tc-space-5); text-align: center; }
#ap-featured-image img, #ap-featured-image-home img { border-radius: var(--tc-radius); }

.page-header { margin-bottom: var(--tc-space-6); }
.page-title { margin: 0; }
.archive-description { color: var(--tc-muted); margin-top: var(--tc-space-2); }

.sticky .entry-title::before { content: "\2605  "; color: var(--tc-steel); }

/* Post / posts navigation */
.navigation .nav-links { display: flex; justify-content: space-between; gap: var(--tc-space-4); flex-wrap: wrap; }
.navigation .nav-previous, .navigation .nav-next { flex: 1 1 240px; }
.navigation .nav-next { text-align: right; }
.navigation a {
	display: block; padding: var(--tc-space-4); border: 1px solid var(--tc-border);
	border-radius: var(--tc-radius); text-decoration: none; font-weight: 700; background: var(--tc-panel);
}
.navigation a:hover { border-color: var(--tc-steel); background: var(--tc-white); }
.post-navigation { margin-top: var(--tc-space-6); }
.pagination .nav-links { justify-content: center; }
.pagination .page-numbers { display: inline-block; padding: .4rem .8rem; border-radius: var(--tc-radius); }
.pagination .current { background: var(--tc-navy); color: var(--tc-white); }

/* ==========================================================
   9. Block editor content
   ========================================================== */
.alignleft { float: left; margin: .3rem var(--tc-space-5) var(--tc-space-4) 0; }
.alignright { float: right; margin: .3rem 0 var(--tc-space-4) var(--tc-space-5); }
.aligncenter { display: block; margin-left: auto; margin-right: auto; }
@media (max-width: 599px) { .alignleft, .alignright { float: none; margin: 0 auto var(--tc-space-4); display: block; } }
.entry-content::after { content: ""; display: table; clear: both; }

.wp-block-image img, .wp-caption img { border-radius: var(--tc-radius); }
.wp-caption, .wp-block-image figcaption, .wp-caption-text { font-size: .85rem; color: var(--tc-muted); text-align: center; }
.wp-block-pullquote { border-top: 3px solid var(--tc-navy); border-bottom: 3px solid var(--tc-navy); }
.wp-block-separator { border: 0; border-top: 1px solid var(--tc-border); }
.wp-block-embed, .wp-block-video { margin-bottom: var(--tc-space-5); }
.wp-block-embed__wrapper iframe { width: 100%; }
.wp-block-button { margin-bottom: var(--tc-space-4); }
.wp-block-group.has-background, .wp-block-columns.has-background { padding: var(--tc-space-5); border-radius: var(--tc-radius); }

/* Palette classes */
.has-tc-navy-color { color: var(--tc-navy) !important; }
.has-tc-navy-background-color { background-color: var(--tc-navy) !important; }
.has-tc-blue-color { color: var(--tc-blue) !important; }
.has-tc-blue-background-color { background-color: var(--tc-blue) !important; }
.has-tc-steel-color { color: var(--tc-steel) !important; }
.has-tc-steel-background-color { background-color: var(--tc-steel) !important; }
.has-tc-panel-color { color: var(--tc-panel) !important; }
.has-tc-panel-background-color { background-color: var(--tc-panel) !important; }
.has-tc-banner-background-color { background-color: var(--tc-banner) !important; }
.has-tc-text-color { color: var(--tc-text) !important; }
.has-tc-white-background-color { background-color: #fff !important; }

.gallery { display: grid; gap: var(--tc-space-3); grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }

/* Podcast player (PowerPress / MediaElement) */
.powerpress_player, .wp-audio-shortcode, .mejs-container { margin-bottom: var(--tc-space-4); border-radius: var(--tc-radius); overflow: hidden; }
.mejs-container, .mejs-embed, .mejs-embed body, .mejs-container .mejs-controls { background: #6f8ca8 !important; }
.mejs-controls .mejs-time-rail .mejs-time-current { background: var(--tc-navy-deep) !important; }
.powerpress_links { font-size: .85rem; color: var(--tc-muted); margin-bottom: var(--tc-space-5); }

/* ==========================================================
   10. Comments
   ========================================================== */
.comments-area { margin-top: var(--tc-space-7); padding-top: var(--tc-space-6); border-top: 1px solid var(--tc-border); }
.comment-list { list-style: none; padding: 0; }
.comment-list .children { list-style: none; padding-left: var(--tc-space-5); }
.comment-body { padding: var(--tc-space-4) 0; border-bottom: 1px solid var(--tc-panel); }
.comment-meta { font-size: .85rem; color: var(--tc-muted); }
.comment-author .avatar { border-radius: 50%; vertical-align: middle; margin-right: .5rem; }
.comment-form p { margin-bottom: var(--tc-space-4); }
.comment-form label { display: block; margin-bottom: var(--tc-space-1); }
.comment-form-cookies-consent label { display: inline; font-weight: 400; }
.bypostauthor > .comment-body { border-left: 3px solid var(--tc-steel); padding-left: var(--tc-space-4); }

/* ==========================================================
   11. Footer
   ========================================================== */
.site-footer {
	background: var(--tc-navy);
	color: #dbe5ef;
	font-size: .9rem;
	border-top: 5px solid var(--tc-navy-deep);
}
.site-footer .tc-container {
	display: flex; justify-content: space-between; align-items: center; gap: var(--tc-space-4);
	flex-wrap: wrap; padding-top: var(--tc-space-6); padding-bottom: var(--tc-space-6);
}
.site-footer p { margin: 0; }
.site-footer a { color: var(--tc-white); text-decoration: none; }
.site-footer a:hover { text-decoration: underline; color: var(--tc-white); }
.footer-menu { display: flex; flex-wrap: wrap; gap: var(--tc-space-2) var(--tc-space-5); list-style: none; margin: 0; padding: 0; }
@media (max-width: 599px) {
	.site-footer .tc-container { flex-direction: column; text-align: center; }
	.footer-menu { justify-content: center; }
}

/* ==========================================================
   12. Misc
   ========================================================== */
#devbanner { position: fixed; top: 0; left: 0; width: 100%; background: #ffb; color: #b00; font-size: .75rem; text-align: center; z-index: 10000; }
.wj-hide { overflow-x: hidden !important; }
.wj-hide body { overflow: hidden !important; }
.error-404 .search-form { max-width: 480px; margin-bottom: var(--tc-space-6); }
