/*
Theme Name: TheCriners Site
Theme URI: https://www.thecriners.com
Author: TheCriners LLC
Author URI: https://www.thecriners.com
Description: Child theme for Astra, customised for TheCriners LLC with dark‑mode styling and a playful tech-forward aesthetic. Contains global styles for all pages.
Version: 1.0.0
Template: astra
Text Domain: thecriners-site
*/

/*
 * Global styles for TheCriners LLC website
 *
 * This stylesheet defines the colour palette, layout helpers and
 * component classes used throughout the site. The design aims to
 * balance professionalism with a playful tech‑forward aesthetic. Use
 * these variables and classes consistently to ensure a unified look
 * and feel across all pages.
 */

/* Colour palette */
:root {
  --primary-color: #0e4d92;    /* deep navy for headings and accents */
  --accent-color: #00bcd4;     /* teal for highlights and buttons */
  --highlight-color: #ff9800;  /* warm amber to add personality */
  --dark-bg: #0f2535;          /* dark slate background for header/footer */
  --light-bg: #f8f9fa;         /* light neutral background for content */
}

/* Base element resets */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
  background-color: var(--light-bg);
  color: #333;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Navigation bar */
header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background-color: var(--dark-bg);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 40px;
  z-index: 1000;
}

header .logo img {
  height: 50px;
}

header nav {
  display: flex;
  align-items: center;
}

header nav a {
  color: #fff;
  text-decoration: none;
  margin: 0 15px;
  font-weight: 500;
  transition: color 0.3s;
  white-space: nowrap;
}

header nav .cta {
  background-color: var(--accent-color);
  padding: 8px 16px;
  border-radius: 4px;
  color: #fff;
  margin-left: 20px;
}

header nav a:hover {
  color: var(--highlight-color);
}

/* Hero section */
.hero {
  background: linear-gradient(45deg, var(--primary-color) 0%, var(--accent-color) 100%);
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 80vh;
  padding-top: 80px;
  text-align: center;
}

.hero h1 {
  font-size: 3rem;
  margin-bottom: 10px;
  line-height: 1.2;
}

.hero p {
  font-size: 1.3rem;
  max-width: 700px;
  margin-bottom: 30px;
}

.btn-primary {
  background-color: var(--highlight-color);
  color: #fff;
  padding: 12px 28px;
  border: none;
  border-radius: 5px;
  font-size: 1rem;
  text-decoration: none;
  cursor: pointer;
  display: inline-block;
}

.btn-primary:hover {
  background-color: var(--accent-color);
}

/* Generic section styling */
.section {
  padding: 100px 40px;
  margin-top: 60px;
}

/* Alternate background colour for every second section */
.section:nth-child(even) {
  background-color: #f2f5f7;
}

.section h2 {
  color: var(--primary-color);
  margin-bottom: 20px;
  font-size: 2rem;
}

/* About section layout */
.about-container {
  display: flex;
  flex-wrap: wrap;
  gap: 40px;
  align-items: center;
}

.about-image img {
  width: 300px;
  height: 300px;
  object-fit: cover;
  border-radius: 50%;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.about-text {
  flex: 1;
  min-width: 250px;
}

/* Resume timeline */
.timeline {
  position: relative;
  margin: 0 auto;
  max-width: 900px;
  padding-top: 40px;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 100%;
  background-color: var(--accent-color);
}

.timeline-item {
  padding: 20px 40px;
  position: relative;
  width: 50%;
}

.timeline-item:nth-child(odd) {
  left: 0;
}

.timeline-item:nth-child(even) {
  left: 50%;
}

.timeline-item::before {
  content: '';
  position: absolute;
  top: 20px;
  border-style: solid;
}

.timeline-item:nth-child(odd)::before {
  border-width: 8px 8px 8px 0;
  border-color: transparent var(--accent-color) transparent transparent;
  right: -8px;
}

.timeline-item:nth-child(even)::before {
  border-width: 8px 0 8px 8px;
  border-color: transparent transparent transparent var(--accent-color);
  left: -8px;
}

.timeline-item h3 {
  margin-top: 0;
  color: var(--primary-color);
  font-size: 1.2rem;
}

.timeline-item span {
  font-weight: bold;
  color: var(--highlight-color);
  display: block;
  margin-bottom: 8px;
}

.timeline-item p {
  margin-bottom: 5px;
  font-size: 0.95rem;
  color: #444;
}

/* Skills list */
.skills-list {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  margin-top: 20px;
}

.skills-list .skill {
  background-color: var(--accent-color);
  color: #fff;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 0.9rem;
  white-space: nowrap;
}

/* Card grid for projects */
.card-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 30px;
}

.card {
  background-color: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
  flex: 1;
  min-width: 280px;
  max-width: 360px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.card img {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

.card-content {
  padding: 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.card-content h3 {
  margin-top: 0;
  color: var(--primary-color);
  font-size: 1.3rem;
}

.card-content p {
  color: #555;
  flex: 1;
  font-size: 0.95rem;
  margin-bottom: 15px;
}

.card-content a {
  align-self: flex-start;
  text-decoration: none;
  color: var(--accent-color);
  font-weight: 500;
}

.card-content a:hover {
  color: var(--highlight-color);
}

/* Services section */
.services-list {
  display: flex;
  flex-wrap: wrap;
  gap: 30px;
}

.service {
  background-color: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
  padding: 20px;
  flex: 1;
  min-width: 280px;
}

.service h3 {
  color: var(--primary-color);
  margin-top: 0;
  margin-bottom: 10px;
}

.service p {
  color: #555;
  font-size: 0.95rem;
}

/* Blog list */
.blog-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.blog-post {
  background-color: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
  padding: 20px;
}

.blog-post h3 {
  margin-top: 0;
  color: var(--primary-color);
  font-size: 1.3rem;
}

.blog-post p {
  color: #555;
  font-size: 0.95rem;
}

/* Contact form */
.contact-form {
  max-width: 600px;
  margin: 0 auto;
}

.contact-form label {
  display: block;
  margin-bottom: 5px;
  font-weight: 500;
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  padding: 10px;
  margin-bottom: 15px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 0.95rem;
}

.contact-form button {
  background-color: var(--accent-color);
  color: #fff;
  padding: 10px 20px;
  border: none;
  border-radius: 4px;
  font-size: 1rem;
  cursor: pointer;
}

.contact-form button:hover {
  background-color: var(--highlight-color);
}

/* Footer */
.footer {
  background-color: var(--dark-bg);
  color: #fff;
  padding: 40px;
}

.footer .footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin-bottom: 20px;
}

.footer .footer-links a {
  color: var(--accent-color);
  text-decoration: none;
  margin-right: 10px;
}

.footer .footer-links a:hover {
  color: var(--highlight-color);
}

.footer p {
  margin: 0;
  font-size: 0.9rem;
}

@media (max-width: 768px) {
  .timeline::before {
    left: 20px;
  }
  .timeline-item {
    width: 100%;
    padding-left: 60px;
    margin-bottom: 40px;
  }
  .timeline-item:nth-child(even) {
    left: 0;
  }
  .timeline-item::before {
    left: 20px;
    right: auto;
  }
}

/* Chat button and modal overlay */
.chat-button {
  position: fixed;
  bottom: 30px;
  right: 30px;
  background: linear-gradient(45deg, var(--primary-color), var(--accent-color));
  color: #fff;
  padding: 12px 20px;
  border: none;
  border-radius: 30px;
  cursor: pointer;
  font-size: 0.9rem;
  box-shadow: 0 4px 8px rgba(0,0,0,0.3);
  z-index: 9999;
  display: flex;
  align-items: center;
  gap: 8px;
}

.chat-button:hover {
  background: var(--highlight-color);
}

.chat-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9998;
}

.chat-modal {
  background: #fff;
  color: #333;
  border-radius: 8px;
  padding: 30px;
  max-width: 500px;
  width: 90%;
  position: relative;
}

.chat-modal.dark-mode {
  background: #1f2d3d;
  color: #eee;
}

.chat-close {
  position: absolute;
  top: 10px;
  right: 10px;
  background: transparent;
  border: none;
  font-size: 1.5rem;
  color: #888;
  cursor: pointer;
}

.chat-close:hover {
  color: var(--accent-color);
}

/* Theme toggle button */
.theme-toggle {
  position: fixed;
  bottom: 100px;
  right: 30px;
  background: var(--dark-bg);
  color: #fff;
  border: 2px solid var(--accent-color);
  border-radius: 50%;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 9999;
  font-size: 1rem;
}

.theme-toggle:hover {
  background: var(--accent-color);
}

/* -----------------------------------------------------------------
 * Accessibility and usability enhancements
 *
 * The following rules implement dark/light mode base styling,
 * skip‑link visibility, active menu highlighting and responsive
 * navigation. These styles are appended at the end of the stylesheet to
 * override earlier definitions where necessary.
 */

/* Dark and light mode backgrounds and text colours */
body.dark-mode {
  background-color: var(--dark-bg);
  color: #eee;
}

body.dark-mode header {
  background-color: #0a1c2b;
}

body.dark-mode .hero {
  /* Preserve the gradient colours but ensure text contrast */
  background: linear-gradient(45deg, var(--primary-color), var(--accent-color));
  color: #fff;
}

body.dark-mode .section {
  background-color: #132c44;
  color: #eee;
}

body.dark-mode .section:nth-child(even) {
  background-color: #0f2535;
}

body.dark-mode .btn-primary {
  background-color: var(--highlight-color);
  color: #fff;
}

body.light-mode {
  background-color: var(--light-bg);
  color: #333;
}

body.light-mode header {
  background-color: var(--dark-bg);
}

/* Skip to content link */
.skip-link {
  position: absolute;
  left: -999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
  background: transparent;
  color: #fff;
  padding: 0;
  z-index: 10000;
}

.skip-link:focus {
  left: 10px;
  top: 10px;
  width: auto;
  height: auto;
  background: var(--primary-color);
  color: #fff;
  padding: 8px 12px;
}

/* Highlight the current page in the menu */
header nav .current-menu-item a,
header nav .current_page_item a {
  border-bottom: 2px solid var(--highlight-color);
}

/* Responsive navigation */
.mobile-menu-toggle {
  display: none;
  background: transparent;
  border: none;
  color: #fff;
  font-size: 1.8rem;
  cursor: pointer;
  margin-left: auto;
}

@media (max-width: 768px) {
  header {
    flex-wrap: wrap;
  }
  header nav {
    display: none;
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
    background-color: var(--dark-bg);
    padding: 10px 40px;
  }
  header nav.open {
    display: flex;
  }
  header nav a {
    margin: 10px 0;
  }
  .mobile-menu-toggle {
    display: block;
  }
}

@media (min-width: 769px) {
  .mobile-menu-toggle {
    display: none;
  }
}