/*
Theme Name: Turf Medic
Theme URI: https://turfmedicontario.ca
Author: Turf Medic Ontario
Author URI: https://turfmedicontario.ca
Description: A modern WordPress theme for Turf Medic Ontario, featuring commercial lawn landscaping, snow removal, and property maintenance services. Built with Tailwind CSS and optimized for performance.
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: turfmedic
Requires at least: 5.0
Tested up to: 6.4
Requires PHP: 7.4
*/

/* Tailwind utility overrides & custom enhancements for Turf Medic */
:root {
  color-scheme: light;
}

body {
  font-family: 'Poppins', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background-color: #f8fafc;
}

main {
  position: relative;
  z-index: 0;
}

.animate-fade-in-down {
  animation: fade-in-down 0.35s ease-out;
}

@keyframes fade-in-down {
  0% {
    opacity: 0;
    transform: translateY(-10px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

iframe,
img {
  max-width: 100%;
}

@media (max-width: 1023px) {
  header.sticky {
    backdrop-filter: blur(18px);
    background-color: rgba(255, 255, 255, 0.92);
  }
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.shadow-soft-xl {
  box-shadow: 0 30px 60px -30px rgba(9, 45, 24, 0.35);
}

/* WordPress Content Styling */
.article-content {
  color: #1f2937;
  font-size: 1rem;
  line-height: 1.7;
/*
  display: grid;
  gap: 1.5rem;
*/
}

/* Paragraphs */
.article-content p {
  margin: 0 0 1.5rem 0;
}

.article-content p:last-child {
  margin-bottom: 0;
}

/* Headings */
.article-content h1,
.article-content h2,
.article-content h3,
.article-content h4,
.article-content h5,
.article-content h6 {
  font-family: 'Playfair Display', 'Georgia', serif;
  color: #0b6b37;
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  line-height: 1.3;
  font-weight: 600;
}

.article-content h1:first-child,
.article-content h2:first-child,
.article-content h3:first-child,
.article-content h4:first-child,
.article-content h5:first-child,
.article-content h6:first-child {
  margin-top: 0;
}

.article-content h1 {
  font-size: 2.25rem;
}

.article-content h2 {
  font-size: 1.75rem;
}

.article-content h3 {
  font-size: 1.375rem;
}

.article-content h4 {
  font-size: 1.125rem;
}

.article-content h5 {
  font-size: 1rem;
}

.article-content h6 {
  font-size: 0.875rem;
}

@media (min-width: 640px) {
  .article-content h1 {
    font-size: 2.5rem;
  }
  
  .article-content h2 {
    font-size: 2rem;
  }
  
  .article-content h3 {
    font-size: 1.5rem;
  }
  
  .article-content h4 {
    font-size: 1.25rem;
  }
}

/* Links */
.article-content a {
  color: #0b6b37;
  text-decoration: underline;
  text-decoration-color: rgba(11, 107, 55, 0.4);
  transition: color 0.2s ease, text-decoration-color 0.2s ease;
}

.article-content a:hover {
  color: #034b28;
  text-decoration-color: rgba(11, 107, 55, 0.6);
}

/* Lists */
.article-content ul,
.article-content ol {
  margin: 0 0 1.5rem 1.5rem;
  padding-left: 1.5rem;
  display: grid;
  gap: 0.75rem;
}

.article-content ul {
  list-style-type: disc;
}

.article-content ol {
  list-style-type: decimal;
}

.article-content ul ul,
.article-content ol ol,
.article-content ul ol,
.article-content ol ul {
  margin-top: 0.75rem;
  margin-bottom: 0.75rem;
}

.article-content ul ul {
  list-style-type: circle;
}

.article-content ul ul ul {
  list-style-type: square;
}

.article-content li {
  margin: 0;
  padding-left: 0.5rem;
}

.article-content li p {
  margin-bottom: 0.5rem;
}

.article-content li:last-child p {
  margin-bottom: 0;
}

/* Blockquotes */
.article-content blockquote {
  border-left: 4px solid rgba(11, 107, 55, 0.2);
  padding: 1.25rem 1.5rem;
  margin: 2rem 0;
  font-style: italic;
  color: #1f2937;
  background-color: rgba(107, 142, 35, 0.05);
  border-radius: 0.5rem;
}

.article-content blockquote p {
  margin-bottom: 0.75rem;
}

.article-content blockquote p:last-child {
  margin-bottom: 0;
}

.article-content blockquote cite {
  display: block;
  margin-top: 0.75rem;
  font-size: 0.875rem;
  font-style: normal;
  color: #64748b;
}

/* Images and Figures */
.article-content figure {
  margin: 2rem 0;
}

.article-content img {
  border-radius: 1.25rem;
  height: auto;
  display: block;
}

/* Default image (no alignment class) - full width */
/*
.article-content img:not(.alignleft):not(.alignright):not(.aligncenter):not(.alignnone) {
  width: 100%;
  margin: 1.5rem 0;
}
*/

/*
.article-content figure img {
  margin: 0;
}
*/

/*
.article-content figcaption {
  margin-top: 0.75rem;
  font-size: 0.875rem;
  color: #64748b;
  text-align: center;
  font-style: italic;
}
*/

/* Image Alignment - alignleft */
.article-content img.alignleft,
.article-content figure.alignleft,
.article-content .alignleft img {
  float: left;
  margin: 0 1.5rem 1.5rem 0;
/*   max-width: 50%; */
  width: auto;
}

.article-content figure.alignleft {
  float: left;
  margin: 0 1.5rem 1.5rem 0;
  max-width: 50%;
}

/* Image Alignment - alignright */
.article-content img.alignright,
.article-content figure.alignright,
.article-content .alignright img {
  float: right !important;
  margin: 0 0 1.5rem 1.5rem;
  width: auto;
}

.article-content figure.alignright {
  float: right;
  margin: 0 0 1.5rem 1.5rem;
/*   max-width: 50%; */
}

/* Image Alignment - aligncenter */
.article-content img.aligncenter,
.article-content figure.aligncenter,
.article-content .aligncenter img {
  display: block;
  margin: 1.5rem auto;
  width: auto;
  max-width: 100%;
}

.article-content figure.aligncenter {
  display: block;
  margin: 1.5rem auto;
  max-width: 100%;
}

/* Image Alignment - alignnone (no float, full width) */
.article-content img.alignnone,
.article-content figure.alignnone,
.article-content .alignnone img {
  float: none;
  display: block;
  margin: 1.5rem 0;
  width: 100%;
  max-width: 100%;
}

.article-content figure.alignnone {
  float: none;
  margin: 2rem 0;
  max-width: 100%;
}

/* Responsive: Remove floats on mobile */
@media (max-width: 640px) {
  .article-content img.alignleft,
  .article-content img.alignright,
  .article-content figure.alignleft,
  .article-content figure.alignright,
  .article-content .alignleft,
  .article-content .alignright {
    float: none;
    margin-left: 0;
    margin-right: 0;
    max-width: 100%;
    width: 100%;
  }
  
  .article-content .alignleft img,
  .article-content .alignright img {
    float: none;
    margin: 1.5rem 0;
    max-width: 100%;
    width: 100%;
  }
}

/* Horizontal Rule */
.article-content hr {
  border: 0;
  border-top: 1px solid rgba(15, 23, 42, 0.08);
  margin: 2.5rem 0;
}

/* Text Formatting */
.article-content strong,
.article-content b {
  font-weight: 600;
  color: #0b6b37;
}

.article-content em,
.article-content i {
  font-style: italic;
}

.article-content code {
  background-color: rgba(15, 23, 42, 0.05);
  padding: 0.125rem 0.375rem;
  border-radius: 0.25rem;
  font-size: 0.875em;
  font-family: 'Courier New', monospace;
  color: #0b6b37;
}

.article-content pre {
  background-color: rgba(15, 23, 42, 0.05);
  padding: 1.25rem;
  border-radius: 0.5rem;
  overflow-x: auto;
  margin: 1.5rem 0;
  border-left: 4px solid rgba(11, 107, 55, 0.2);
}

.article-content pre code {
  background: none;
  padding: 0;
  border-radius: 0;
  font-size: 0.875rem;
}

/* Tables */
.article-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  border-radius: 0.5rem;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.article-content thead {
  background-color: rgba(11, 107, 55, 0.1);
}

.article-content th {
  padding: 0.75rem 1rem;
  text-align: left;
  font-weight: 600;
  color: #0b6b37;
  border-bottom: 2px solid rgba(11, 107, 55, 0.2);
}

.article-content td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

.article-content tbody tr:hover {
  background-color: rgba(11, 107, 55, 0.03);
}

.article-content tbody tr:last-child td {
  border-bottom: none;
}

/* WordPress Alignment Classes (for divs/wrappers) */
.article-content .alignleft {
  float: left;
  margin: 0 1.5rem 1.5rem 0;
  max-width: 50%;
}

.article-content .alignright {
  float: right;
  margin: 0 0 1.5rem 1.5rem;
  max-width: 50%;
}

.article-content .aligncenter {
  display: block;
  margin: 1.5rem auto;
  clear: both;
}

.article-content .alignnone {
  float: none;
  display: block;
  margin: 1.5rem 0;
  max-width: 100%;
  clear: both;
}

.article-content .alignwide {
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
}

.article-content .alignfull {
  width: 100vw;
  max-width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
}

/* WordPress Captions */
.article-content .wp-caption {
  max-width: 100%;
  margin: 1.5rem 0;
}

.article-content .wp-caption-text {
  margin-top: 0.5rem;
  font-size: 0.875rem;
  color: #64748b;
  text-align: center;
  font-style: italic;
}

/* WordPress Galleries */
.article-content .gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}

.article-content .gallery-item {
  margin: 0;
}

.article-content .gallery-item img {
  border-radius: 0.75rem;
  margin: 0;
}

/* WordPress Embeds */
.article-content iframe,
.article-content embed,
.article-content object {
  max-width: 100%;
  border-radius: 0.75rem;
  margin: 1.5rem 0;
}

.article-content .wp-block-embed {
  margin: 1.5rem 0;
}

/* Clear floats */
.article-content::after {
  content: "";
  display: table;
  clear: both;
}

/* Floating Book Estimate Button */
.floating-book-estimate {
  animation: gentle-pulse 2.5s ease-in-out infinite;
}

@keyframes gentle-pulse {
  0%, 100% {
    box-shadow: 0 10px 25px -5px rgba(11, 107, 55, 0.4), 0 4px 6px -2px rgba(11, 107, 55, 0.2);
  }
  50% {
    box-shadow: 0 15px 35px -5px rgba(11, 107, 55, 0.5), 0 6px 8px -2px rgba(11, 107, 55, 0.3);
  }
}

.floating-book-estimate:hover {
  animation: none;
}

/* Mobile-specific responsive enhancements */
@media (max-width: 640px) {
  /* Ensure forms and inputs are touch-friendly */
  input[type="text"],
  input[type="email"],
  input[type="tel"],
  textarea,
  select {
    font-size: 16px; /* Prevents iOS zoom on focus */
  }
  
  /* Better spacing on mobile */
  section {
    padding-left: 1rem;
    padding-right: 1rem;
  }
  
  /* Improve button touch targets */
  button,
  a[role="button"],
  input[type="submit"] {
    min-height: 44px;
    min-width: 44px;
  }
}

/* Tablet adjustments */
@media (min-width: 641px) and (max-width: 1024px) {
  /* Optimize spacing for tablets */
  .container {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }
}

/* Prevent horizontal scrolling */
html,
body {
  overflow-x: hidden;
  width: 100%;
}

/* Ensure images are always responsive */
img {
  height: auto;
  max-width: 100%;
}

/* Gallery Content Styles */
.gallery-content {
  width: 100%;
}

/* NextGEN Gallery Integration */
.gallery-content .ngg-galleryoverview,
.gallery-content .ngg-gallerythumbnail {
  margin: 0;
  padding: 0;
}

.gallery-content .ngg-galleryoverview {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.gallery-content .ngg-gallerythumbnail {
  position: relative;
  overflow: hidden;
  border-radius: 1.5rem;
  box-shadow: 0 30px 60px -30px rgba(9, 45, 24, 0.35);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.gallery-content .ngg-gallerythumbnail:hover {
  transform: translateY(-8px);
  box-shadow: 0 40px 80px -30px rgba(9, 45, 24, 0.45);
}

.gallery-content .ngg-gallerythumbnail img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 1.5rem;
  transition: transform 0.5s ease;
}

.gallery-content .ngg-gallerythumbnail:hover img {
  transform: scale(1.05);
}

/* Ensure NextGEN Gallery images are responsive */
.gallery-content .ngg-gallerythumbnail img,
.gallery-content .ngg-galleryoverview img {
  max-width: 100%;
  height: auto;
}

/* NextGEN Gallery pagination */
.gallery-content .ngg-navigation {
  margin-top: 2rem;
  text-align: center;
}

.gallery-content .ngg-navigation a {
  display: inline-block;
  padding: 0.5rem 1rem;
  margin: 0 0.25rem;
  border-radius: 0.5rem;
  background-color: #0b6b37;
  color: white;
  text-decoration: none;
  transition: background-color 0.3s ease;
}

.gallery-content .ngg-navigation a:hover {
  background-color: #034b28;
}

/* Responsive adjustments for gallery */
@media (max-width: 640px) {
  .gallery-content .ngg-galleryoverview {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
  }
}

@media (min-width: 1024px) {
  .gallery-content .ngg-galleryoverview {
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
  }
}

/* Visual Form Builder (VFB) Styles */
.visual-form-builder-container {
  width: 100%;
  max-width: 100%;
}

.visual-form-builder {
  width: 100%;
}

/* Fieldset Styling */
.visual-form-builder .vfb-fieldset {
  margin: 0 0 2rem 0;
  padding: 0;
  border: none;
  background: transparent;
}

.visual-form-builder .vfb-legend {
  margin: 0 0 1.5rem 0;
  padding: 0;
  border: none;
  width: 100%;
}

.visual-form-builder .vfb-legend h3 {
  font-family: 'Playfair Display', 'Georgia', serif;
  font-size: 1.5rem;
  font-weight: 600;
  color: #0b6b37;
  margin: 0;
  padding: 0;
}

/* Section and List Styling */
.visual-form-builder .vfb-section {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1.5rem;
}

.visual-form-builder .vfb-item {
  margin: 0;
  padding: 0;
  list-style: none;
}

/* Label Styling */
.visual-form-builder .vfb-desc {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: #334155;
  margin-bottom: 0.5rem;
  line-height: 1.5;
}

.visual-form-builder .vfb-required-asterisk {
  color: #dc2626;
  margin-left: 0.25rem;
}

/* Input Fields - Text, Email, etc. */
.visual-form-builder input[type="text"],
.visual-form-builder input[type="email"],
.visual-form-builder input[type="tel"],
.visual-form-builder input[type="number"],
.visual-form-builder input[type="url"],
.visual-form-builder input[type="date"],
.visual-form-builder input[type="time"],
.visual-form-builder input[type="datetime-local"] {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  line-height: 1.5;
  color: #1e293b;
  background-color: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 1rem;
  transition: all 0.2s ease;
  font-family: 'Poppins', system-ui, -apple-system, sans-serif;
}

.visual-form-builder input[type="text"]:focus,
.visual-form-builder input[type="email"]:focus,
.visual-form-builder input[type="tel"]:focus,
.visual-form-builder input[type="number"]:focus,
.visual-form-builder input[type="url"]:focus,
.visual-form-builder input[type="date"]:focus,
.visual-form-builder input[type="time"]:focus,
.visual-form-builder input[type="datetime-local"]:focus {
  outline: none;
  border-color: #0b6b37;
  box-shadow: 0 0 0 2px rgba(11, 107, 55, 0.2);
  background-color: #ffffff;
}

.visual-form-builder input[type="text"]:hover,
.visual-form-builder input[type="email"]:hover,
.visual-form-builder input[type="tel"]:hover {
  border-color: #cbd5e1;
}

/* Select Dropdown */
.visual-form-builder select.vfb-select {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  line-height: 1.5;
  color: #1e293b;
  background-color: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 1rem;
  transition: all 0.2s ease;
  font-family: 'Poppins', system-ui, -apple-system, sans-serif;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3E%3Cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 1.5em 1.5em;
  padding-right: 2.5rem;
}

.visual-form-builder select.vfb-select:focus {
  outline: none;
  border-color: #0b6b37;
  box-shadow: 0 0 0 2px rgba(11, 107, 55, 0.2);
  background-color: #ffffff;
}

.visual-form-builder select.vfb-select:hover {
  border-color: #cbd5e1;
}

/* Textarea */
.visual-form-builder textarea.vfb-textarea {
  width: 100%;
  min-height: 120px;
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  line-height: 1.5;
  color: #1e293b;
  background-color: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 1rem;
  transition: all 0.2s ease;
  font-family: 'Poppins', system-ui, -apple-system, sans-serif;
  resize: vertical;
}

.visual-form-builder textarea.vfb-textarea:focus {
  outline: none;
  border-color: #0b6b37;
  box-shadow: 0 0 0 2px rgba(11, 107, 55, 0.2);
  background-color: #ffffff;
}

.visual-form-builder textarea.vfb-textarea:hover {
  border-color: #cbd5e1;
}

/* Submit Button */
.visual-form-builder .vfb-item-submit {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid #e2e8f0;
}

.visual-form-builder input[type="submit"].vfb-submit,
.visual-form-builder button.vfb-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.875rem 2rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: #ffffff;
  background-color: #0b6b37;
  border: none;
  border-radius: 9999px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: 'Poppins', system-ui, -apple-system, sans-serif;
  box-shadow: 0 4px 6px -1px rgba(11, 107, 55, 0.3);
}

.visual-form-builder input[type="submit"].vfb-submit:hover,
.visual-form-builder button.vfb-submit:hover {
  background-color: #034b28;
  box-shadow: 0 6px 12px -2px rgba(11, 107, 55, 0.4);
  transform: translateY(-1px);
}

.visual-form-builder input[type="submit"].vfb-submit:active,
.visual-form-builder button.vfb-submit:active {
  transform: translateY(0);
  box-shadow: 0 2px 4px -1px rgba(11, 107, 55, 0.3);
}

/* Verification Section */
.visual-form-builder .vfb-fieldset.verification {
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 2px solid #e2e8f0;
}

.visual-form-builder .vfb-fieldset.verification .vfb-legend h3 {
  font-size: 1.25rem;
  color: #64748b;
}

/* Logged in user message styling */
.visual-form-builder .vfb-item {
  color: #64748b;
  font-size: 0.875rem;
}

.visual-form-builder .vfb-item a {
  color: #0b6b37;
  text-decoration: underline;
  text-decoration-color: rgba(11, 107, 55, 0.4);
  transition: text-decoration-color 0.2s ease;
}

.visual-form-builder .vfb-item a:hover {
  text-decoration-color: rgba(11, 107, 55, 0.6);
}

/* Verification Input Span */
.visual-form-builder .vfb-span {
  display: block;
  margin-top: 0.5rem;
}

.visual-form-builder .vfb-span label {
  display: block;
  font-size: 0.75rem;
  color: #64748b;
  margin-top: 0.5rem;
  font-style: italic;
}

/* Hidden Spam Protection */
.visual-form-builder .vfb-item[style*="display:none"] {
  display: none !important;
}

/* Error States */
.visual-form-builder input.error,
.visual-form-builder select.error,
.visual-form-builder textarea.error {
  border-color: #dc2626;
  background-color: #fef2f2;
}

.visual-form-builder input.error:focus,
.visual-form-builder select.error:focus,
.visual-form-builder textarea.error:focus {
  border-color: #dc2626;
  box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.2);
}

/* Responsive Grid for Two-Column Layout */
@media (min-width: 640px) {
  .visual-form-builder .vfb-section {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
  }
  
  /* Full-width items on mobile, but allow grid on larger screens */
  .visual-form-builder .vfb-item-textarea,
  .visual-form-builder .vfb-item-submit {
    grid-column: 1 / -1;
  }
}

/* Medium and Large Input Sizes */
.visual-form-builder .vfb-medium {
  max-width: 100%;
}

/* Input Inverse Override (remove any inverse styling) */
.visual-form-builder .input-inverse {
  background-color: #f8fafc;
  color: #1e293b;
}

/* Form Control Override */
.visual-form-builder .form-control {
  display: block;
  width: 100%;
}

/* Remove Bootstrap-like input-sm if present */
.visual-form-builder .input-sm {
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
}

/* Required Field Indicator */
.visual-form-builder .required {
  border-left: 2px solid transparent;
}

.visual-form-builder .required:focus {
  border-left-color: #0b6b37;
}

/* Spacing Adjustments */
.visual-form-builder .vfb-item + .vfb-item {
  margin-top: 0;
}

/* Ensure proper spacing between fieldsets */
.visual-form-builder .vfb-fieldset + .vfb-fieldset {
  margin-top: 2.5rem;
  padding-top: 2.5rem;
  border-top: 2px solid #e2e8f0;
}

