﻿/*
Theme Name:   The Green Traffic Light
Theme URI:    https://www.thegreentrafficlight.com/
Description:  Standalone WordPress theme for The Green Traffic Light with LearnDash-focused pages.
Author:       The Green Traffic Light
Author URI:   https://www.thegreentrafficlight.com/
Version:      1.1.2
License:      GNU General Public License v2 or later
License URI:  http://www.gnu.org/licenses/gpl-2.0.html
Text Domain:  tgtl-theme
Tags:         learndash, driving-school, education
*/

:root {
  --tgtl-green: #28a745;
  --tgtl-green-dark: #1e8035;
  --tgtl-dark: #1a1a2e;
  --tgtl-charcoal: #2d3748;
  --tgtl-gray-100: #f7f8fa;
  --tgtl-gray-600: #4a5568;
  --tgtl-border: #e2e8f0;
  --tgtl-white: #ffffff;
  --tgtl-container: 1200px;
  --tgtl-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.06);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  overflow-x: clip;
}

body {
  background: var(--tgtl-gray-100);
  color: var(--tgtl-charcoal);
  font-family: "Open Sans", sans-serif;
  line-height: 1.6;
}

a {
  color: var(--tgtl-green-dark);
  text-decoration: none;
}

a:hover {
  color: var(--tgtl-green);
}

.tgtl-container {
  max-width: var(--tgtl-container);
  margin-inline: auto;
  padding-inline: clamp(1rem, 4vw, 2rem);
}

.tgtl-skip-link {
  position: absolute;
  left: -9999px;
  top: auto;
}

.tgtl-skip-link:focus {
  left: 1rem;
  top: 1rem;
  background: var(--tgtl-white);
  border: 2px solid var(--tgtl-green);
  border-radius: 8px;
  color: var(--tgtl-dark);
  padding: 0.5rem 0.75rem;
  z-index: 999;
}

.preview-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #fff;
  box-shadow: 0 1px 0 #e2e8f0;
  height: 104px;
  display: flex;
  align-items: center;
}

body.admin-bar .preview-header {
  top: 32px;
}

@media (max-width: 782px) {
  body.admin-bar .preview-header {
    top: 46px;
  }
}

.preview-header__inner {
  max-width: 1200px;
  margin-inline: auto;
  padding-inline: clamp(1rem, 4vw, 2rem);
  width: 100%;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.preview-header__logo {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  font-family: "Poppins", sans-serif;
  font-weight: 800;
  font-size: 1.32rem;
  color: #1a1a2e;
  text-decoration: none;
}

.preview-header__logo-image {
  display: block;
  height: 90px;
  width: auto;
  object-fit: contain;
  object-position: center;
}

.preview-header__brand .custom-logo-link {
  display: inline-flex;
  align-items: center;
  height: 92px;
}

.preview-header__logo-light {
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: #1a1a2e;
  padding: 6px;
  border-radius: 8px;
}

.preview-header__logo-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.preview-header__logo-dot--r {
  background: #e74c3c;
}

.preview-header__logo-dot--a {
  background: #f39c12;
}

.preview-header__logo-dot--g {
  background: #28a745;
  box-shadow: 0 0 6px #28a745;
}

.preview-header__brand .custom-logo-link img,
.preview-header__brand .custom-logo {
  height: 90px !important;
  width: auto !important;
  max-height: none !important;
  max-width: none !important;
}

.preview-header__nav {
  display: flex;
  gap: 3.1rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.preview-header__nav li {
  position: relative;
}

.preview-header__nav a {
  position: relative;
  display: inline-block;
  font-family: "Poppins", sans-serif;
  font-size: 1.12rem;
  font-weight: 700;
  color: #4a5568;
  text-decoration: none;
  transition: color 0.2s;
  padding-bottom: 0.4rem;
}

.preview-header__nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0.05rem;
  width: 100%;
  height: 5px;
  border-radius: 999px;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.24s ease;
}

.preview-header__nav a:hover::after,
.preview-header__nav a:focus-visible::after {
  transform: scaleX(1);
}

.preview-header__nav a:focus-visible {
  outline: none;
}

.preview-header__nav-item--courses a::after {
  background: #e74c3c;
  box-shadow: 0 0 10px rgba(231, 76, 60, 0.55);
}

.preview-header__nav-item--home a::after {
  background: #28a745;
  box-shadow: 0 0 10px rgba(40, 167, 69, 0.55);
}

.preview-header__nav-item--paths a::after {
  background: #ffd400;
  box-shadow: 0 0 10px rgba(255, 212, 0, 0.6);
}

.preview-header__nav-item--contact a::after {
  background: #28a745;
  box-shadow: 0 0 10px rgba(40, 167, 69, 0.6);
}

.preview-header__nav li.is-active a::after {
  transform: scaleX(1);
}

.preview-header__cta {
  font-family: "Poppins", sans-serif;
  font-size: 0.875rem;
  font-weight: 700;
  background: #28a745;
  color: #fff;
  padding: 0.5rem 1.25rem;
  border-radius: 8px;
  text-decoration: none;
  transition: background 0.2s;
}

.preview-header__cta:hover {
  background: #1e8035;
  color: #fff;
}

.preview-header__user {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.preview-header__user-name {
  font-family: "Poppins", sans-serif;
  font-size: 0.875rem;
  font-weight: 500;
  color: #2d4159;
  white-space: nowrap;
  cursor: default;
}

.preview-header__user-name:hover {
  text-decoration: none;
}

.preview-header__user-sep {
  color: #cbd5e0;
  font-size: 0.875rem;
}

.preview-header__actions {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
}

.preview-header__cart {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border: 1px solid #d6e3f2;
  border-radius: 10px;
  background: #f5f9ff;
  color: #133457;
  padding: 0.45rem 0.62rem;
  text-decoration: none;
  line-height: 1;
}

.preview-header__cart:hover {
  background: #ebf4ff;
  color: #0f2d4d;
}

.preview-header__cart-icon {
  display: inline-flex;
  width: 20px;
  height: 20px;
}

.preview-header__cart-icon svg {
  width: 100%;
  height: 100%;
}

.preview-header__cart-count {
  min-width: 20px;
  height: 20px;
  border-radius: 999px;
  background: #28a745;
  color: #fff;
  font-family: "Poppins", sans-serif;
  font-size: 0.74rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
}

.preview-header__cart-empty {
  font-family: "Poppins", sans-serif;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: #587088;
}

.preview-header__cart.is-empty {
  background: #f8fafc;
}

.preview-header__mobile-menu {
  display: none;
  position: relative;
}

.preview-header__mobile-summary {
  list-style: none;
  cursor: pointer;
  font-family: "Poppins", sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  color: #1a1a2e;
  background: #eef4fb;
  border: 1px solid #d6e3f2;
  border-radius: 10px;
  padding: 0.45rem 0.75rem;
  user-select: none;
}

.preview-header__mobile-summary::-webkit-details-marker {
  display: none;
}

.preview-header__mobile-list {
  position: absolute;
  right: 0;
  left: auto;
  top: calc(100% + 0.5rem);
  z-index: 120;
  width: 210px;
  max-width: calc(100vw - 1rem);
  margin: 0;
  padding: 0.45rem;
  list-style: none;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.14);
}

.preview-header__mobile-list li + li {
  margin-top: 0.25rem;
}

.preview-header__mobile-list a {
  display: block;
  padding: 0.55rem 0.65rem;
  border-radius: 8px;
  font-family: "Poppins", sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  color: #2d3748;
}

.preview-header__mobile-list a:hover {
  background: #f7f8fa;
  color: #1e8035;
}

.tgtl-site-content {
  min-height: calc(100vh - 180px);
}

.tgtl-default-main {
  padding: clamp(2rem, 5vw, 3rem) 0;
}

.tgtl-default-content {
  background: var(--tgtl-white);
  border: 1px solid var(--tgtl-border);
  border-radius: 16px;
  box-shadow: var(--tgtl-shadow-sm);
  padding: clamp(1.25rem, 3vw, 2rem);
}

.tgtl-default-content .post {
  margin-bottom: 2rem;
}

.tgtl-default-content .post:last-child {
  margin-bottom: 0;
}

.tgtl-default-title {
  margin: 0 0 0.75rem;
  font-family: "Poppins", sans-serif;
  font-size: clamp(1.5rem, 3.2vw, 2rem);
  line-height: 1.2;
  color: var(--tgtl-dark);
}

.tgtl-default-title a {
  color: inherit;
}

.tgtl-default-meta {
  color: var(--tgtl-gray-600);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.tgtl-default-entry > :first-child {
  margin-top: 0;
}

.tgtl-default-entry > :last-child {
  margin-bottom: 0;
}

.tgtl-site-footer {
  background: var(--tgtl-dark);
  color: rgba(255, 255, 255, 0.9);
}

.tgtl-site-footer__inner {
  min-height: 88px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 1rem;
  padding-bottom: 1rem;
}

.tgtl-site-footer__menu {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 1rem;
}

.tgtl-site-footer__menu a {
  color: rgba(255, 255, 255, 0.9);
}

.tgtl-site-footer__copy {
  margin: 0;
  font-size: 0.9rem;
}

@media (max-width: 800px) {
  .preview-header {
    height: auto;
    min-height: 80px;
    padding: 0.5rem 0;
  }

  .preview-header__inner {
    gap: 0.75rem;
  }

  .tgtl-site-footer__inner {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 700px) {
  .preview-header__nav {
    display: none;
  }

  .preview-header__mobile-menu {
    display: block;
    margin-left: auto;
  }

  .preview-header__cta {
    display: none;
  }

  .preview-header__actions {
    display: none;
  }

  .preview-header__logo-image {
    height: 56px;
  }

  .preview-header__brand .custom-logo-link {
    height: 58px;
  }

  .preview-header__brand .custom-logo-link img,
  .preview-header__brand .custom-logo {
    height: 56px !important;
  }

  .preview-header__logo {
    font-size: 1.12rem;
  }
}


/* My Courses dashboard (Woo account custom view) */
body.tgtl-my-courses-view .woocommerce-MyAccount-content > p:first-of-type {
	display: none;
}

.tgtl-my-courses {
	background: #fff;
	border: 1px solid #dde6f0;
	border-radius: 16px;
	padding: clamp(16px, 2vw, 24px);
	box-shadow: 0 10px 24px rgba(9, 30, 66, 0.06);
}

.tgtl-my-courses__hero {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 16px;
	margin-bottom: 18px;
}

.tgtl-my-courses__hero h2 {
	margin: 0;
	font-size: clamp(1.5rem, 2.5vw, 2rem);
}

.tgtl-my-courses__hero p {
	margin: 6px 0 0;
	color: #566273;
}

.tgtl-my-courses__stats {
	min-width: 130px;
	text-align: center;
	border: 1px solid #cce7d8;
	background: #f2fbf5;
	border-radius: 14px;
	padding: 10px 12px;
}

.tgtl-my-courses__stat-value {
	display: block;
	font-family: "Poppins", sans-serif;
	font-size: 1.5rem;
	font-weight: 700;
	color: #137a3a;
	line-height: 1.1;
}

.tgtl-my-courses__stat-label {
	display: block;
	margin-top: 4px;
	font-size: 0.82rem;
	color: #35516d;
}

.tgtl-my-courses__list {
	list-style: none;
	padding: 0;
	margin: 0;
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
	gap: 14px;
}

.tgtl-my-courses__item {
	border: 1px solid #d8e3ee;
	border-radius: 14px;
	background: #fbfdff;
	padding: 14px;
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.tgtl-my-courses__card-top {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	gap: 10px;
}

.tgtl-my-courses__card-top strong {
	font-family: "Poppins", sans-serif;
	font-size: 1rem;
	line-height: 1.25;
	color: #0f3760;
}

.tgtl-my-courses__badge {
	display: inline-flex;
	align-items: center;
	border-radius: 999px;
	padding: 4px 9px;
	font-size: 0.72rem;
	font-weight: 700;
	letter-spacing: .01em;
	white-space: nowrap;
}

.tgtl-my-courses__badge::before {
	content: "";
	width: 7px;
	height: 7px;
	border-radius: 50%;
	margin-right: 6px;
	flex: 0 0 auto;
}

.tgtl-my-courses__badge.is-active {
	background: #e8f8ef;
	color: #127238;
	border: 1px solid #bce8cb;
}

.tgtl-my-courses__badge.is-active::before {
	background: #22a447;
}

.tgtl-my-courses__badge.is-locked {
	background: #f2f5f9;
	color: #42586f;
	border: 1px solid #d4deea;
}

.tgtl-my-courses__badge.is-locked::before {
	background: #7c8ea3;
}

.tgtl-my-courses__desc {
	margin: 0;
	color: #5b6877;
	font-size: 0.92rem;
	line-height: 1.45;
}

.tgtl-my-courses__actions {
	margin-top: auto;
}

.tgtl-my-courses__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 40px;
	padding: 0.6rem 0.95rem;
	border-radius: 10px;
	border: 2px solid transparent;
	font-family: "Poppins", sans-serif;
	font-size: 0.86rem;
	font-weight: 700;
	line-height: 1;
	text-decoration: none;
}

.tgtl-my-courses__btn.is-primary {
	background: #28a745;
	color: #fff;
	border-color: #28a745;
	box-shadow: 0 8px 18px rgba(40, 167, 69, 0.24);
	opacity: 1;
}

.woocommerce-account .tgtl-my-courses__btn.is-primary,
.woocommerce-account .tgtl-my-courses__btn.is-primary:visited,
.woocommerce-account .woocommerce-MyAccount-content a.tgtl-my-courses__btn.is-primary {
	background: #28a745 !important;
	color: #ffffff !important;
	border-color: #28a745 !important;
	opacity: 1 !important;
}

.tgtl-my-courses__btn.is-primary:hover {
	background: #1e8035;
	border-color: #1e8035;
	color: #fff;
	box-shadow: 0 10px 22px rgba(30, 128, 53, 0.3);
}

.woocommerce-account .tgtl-my-courses__btn.is-primary:hover,
.woocommerce-account .woocommerce-MyAccount-content a.tgtl-my-courses__btn.is-primary:hover {
	background: #1e8035 !important;
	color: #ffffff !important;
	border-color: #1e8035 !important;
}

.tgtl-my-courses__btn.is-secondary {
	background: #0f2d4c;
	color: #ffffff;
	border-color: #0f2d4c;
	box-shadow: 0 8px 18px rgba(15, 45, 76, 0.24);
}

.woocommerce-account .tgtl-my-courses__btn.is-secondary,
.woocommerce-account .tgtl-my-courses__btn.is-secondary:visited,
.woocommerce-account .woocommerce-MyAccount-content a.tgtl-my-courses__btn.is-secondary {
	background: #0f2d4c !important;
	color: #ffffff !important;
	border-color: #0f2d4c !important;
}

.tgtl-my-courses__btn.is-secondary:hover {
	background: #0b223a;
	color: #ffffff;
	border-color: #0b223a;
	box-shadow: 0 10px 22px rgba(15, 45, 76, 0.3);
}

/* LearnDash course pages: hide status/price/get-started strip */
.single-sfwd-courses.tgtl-learndash-content .learndash-wrapper .ld-course-status {
	display: none !important;
}
