/*
Theme Name: Local SEO Savvy
Theme URI: https://localseosavvy.com
Author: Local SEO Savvy Team
Author URI: https://localseosavvy.com
Description: A professional, fully responsive WordPress theme built for local businesses. Compatible with Elementor page builder, supports full customization of text, headings, fonts, colors, backgrounds, and images. Cross-browser and cross-platform compatible.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: local-seo-savvy
Tags: blog, e-commerce, education, portfolio, one-column, two-columns, three-columns, left-sidebar, right-sidebar, custom-background, custom-colors, custom-header, custom-logo, custom-menu, editor-style, featured-images, footer-widgets, full-width-template, microformats, post-formats, rtl-language-support, sticky-post, theme-options, threaded-comments, translation-ready, accessibility-ready, block-patterns, block-styles, wide-blocks, elementor
*/

/* ============================================================
   CSS Custom Properties (Design Tokens)
   ============================================================ */
:root {
  /* Primary Palette */
  --color-primary:       #1A56DB;
  --color-primary-dark:  #1341B0;
  --color-primary-light: #EFF6FF;
  --color-secondary:     #0EA5E9;
  --color-accent:        #F59E0B;
  --color-success:       #059669;
  --color-danger:        #DC2626;

  /* Neutral Palette */
  --color-dark:          #0F172A;
  --color-text:          #1E293B;
  --color-muted:         #64748B;
  --color-border:        #E2E8F0;
  --color-bg:            #FFFFFF;
  --color-bg-alt:        #F8FAFC;
  --color-bg-dark:       #0F172A;

  /* Typography — v1.1 (fixed stretched headings) */
  --font-heading:        'Sora', 'Segoe UI', system-ui, sans-serif;
  --font-body:           'Inter', 'Segoe UI', system-ui, sans-serif;
  --font-mono:           'JetBrains Mono', 'Fira Code', monospace;

  /* Font Sizes — fixed (no aggressive vw scaling causing stretching) */
  --text-xs:   0.75rem;
  --text-sm:   0.875rem;
  --text-base: 1rem;
  --text-lg:   1.125rem;
  --text-xl:   1.25rem;
  --text-2xl:  1.5rem;
  --text-3xl:  clamp(1.75rem,  3vw,  2.25rem);
  --text-4xl:  clamp(2rem,     4vw,  2.75rem);
  --text-5xl:  clamp(2.25rem,  5vw,  3.5rem);

  /* Spacing */
  --space-1:  0.25rem;
  --space-2:  0.5rem;
  --space-3:  0.75rem;
  --space-4:  1rem;
  --space-5:  1.25rem;
  --space-6:  1.5rem;
  --space-8:  2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;

  /* Layout */
  --container-sm:  640px;
  --container-md:  768px;
  --container-lg:  1024px;
  --container-xl:  1280px;
  --container-2xl: 1400px;

  /* Borders & Radius */
  --radius-sm:  4px;
  --radius-md:  8px;
  --radius-lg:  16px;
  --radius-xl:  24px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm:  0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.04);
  --shadow-md:  0 4px 16px rgba(0,0,0,.10), 0 2px 6px rgba(0,0,0,.06);
  --shadow-lg:  0 12px 40px rgba(0,0,0,.14), 0 4px 12px rgba(0,0,0,.08);
  --shadow-xl:  0 24px 64px rgba(0,0,0,.16), 0 8px 24px rgba(0,0,0,.10);
  --shadow-blue: 0 8px 32px rgba(26,86,219,.25);

  /* Transitions */
  --transition-fast:   150ms ease;
  --transition-base:   250ms ease;
  --transition-slow:   400ms ease;

  /* Z-index Scale */
  --z-dropdown: 100;
  --z-sticky:   200;
  --z-overlay:  300;
  --z-modal:    400;
  --z-tooltip:  500;
}

/* ============================================================
   Reset & Base
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

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

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--color-text);
  background-color: var(--color-bg);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img, video, svg { max-width: 100%; height: auto; display: block; }
a { color: var(--color-primary); text-decoration: none; transition: color var(--transition-fast); }
a:hover { color: var(--color-primary-dark); }
a:focus-visible { outline: 3px solid var(--color-primary); outline-offset: 2px; border-radius: 2px; }
button { cursor: pointer; font-family: inherit; }
input, textarea, select { font-family: inherit; }
ul, ol { list-style: none; }
table { border-collapse: collapse; }

/* ============================================================
   Typography
   ============================================================ */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  line-height: 1.25;
  color: var(--color-dark);
  font-weight: 700;
  font-stretch: normal;       /* prevent horizontal stretching */
  font-style: normal;
  word-break: break-word;
  overflow-wrap: break-word;
  max-width: 100%;            /* never wider than container */
  letter-spacing: -0.01em;
}

h1 { font-size: var(--text-5xl); letter-spacing: -0.02em; line-height: 1.15; }
h2 { font-size: var(--text-4xl); letter-spacing: -0.015em; line-height: 1.2; }
h3 { font-size: var(--text-3xl); letter-spacing: -0.01em; }
h4 { font-size: var(--text-2xl); }
h5 { font-size: var(--text-xl);  font-weight: 600; }
h6 { font-size: var(--text-lg);  font-weight: 600; }

p { margin-bottom: var(--space-4); }
p:last-child { margin-bottom: 0; }

blockquote {
  border-left: 4px solid var(--color-primary);
  padding: var(--space-4) var(--space-6);
  background: var(--color-primary-light);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  font-style: italic;
  color: var(--color-muted);
  margin: var(--space-6) 0;
}

code {
  font-family: var(--font-mono);
  font-size: 0.875em;
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  padding: 0.125em 0.4em;
  border-radius: var(--radius-sm);
}

/* ============================================================
   Layout Utilities
   ============================================================ */
.container {
  width: 100%;
  max-width: var(--container-2xl);
  margin-inline: auto;
  padding-inline: var(--space-6);
}
.container-lg { max-width: var(--container-xl); }
.container-sm { max-width: var(--container-lg); }

.section { padding-block: var(--space-20); }
.section-sm { padding-block: var(--space-12); }
.section-lg { padding-block: clamp(4rem, 8vw, 8rem); }

/* ============================================================
   Buttons
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 0.75em 1.75em;
  font-size: var(--text-sm);
  font-weight: 600;
  font-family: var(--font-body);
  border-radius: var(--radius-full);
  border: 2px solid transparent;
  transition: all var(--transition-base);
  text-decoration: none;
  white-space: nowrap;
  letter-spacing: 0.02em;
}
.btn-primary {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
  box-shadow: var(--shadow-blue);
}
.btn-primary:hover {
  background: var(--color-primary-dark);
  border-color: var(--color-primary-dark);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 12px 40px rgba(26,86,219,.35);
}
.btn-outline {
  background: transparent;
  color: var(--color-primary);
  border-color: var(--color-primary);
}
.btn-outline:hover {
  background: var(--color-primary);
  color: #fff;
  transform: translateY(-2px);
}
.btn-white {
  background: #fff;
  color: var(--color-primary);
  border-color: #fff;
}
.btn-white:hover { background: var(--color-primary-light); color: var(--color-primary-dark); }
.btn-lg { padding: 1em 2.25em; font-size: var(--text-base); }
.btn-sm { padding: 0.5em 1.25em; font-size: var(--text-xs); }

/* ============================================================
   Cards
   ============================================================ */
.card {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  overflow: hidden;
  transition: all var(--transition-base);
  box-shadow: var(--shadow-sm);
}
.card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
  border-color: var(--color-primary);
}
.card-body { padding: var(--space-8); }
.card-img img { width: 100%; height: 220px; object-fit: cover; }

/* ============================================================
   Forms
   ============================================================ */
.form-group { margin-bottom: var(--space-5); }
.form-label {
  display: block;
  font-weight: 600;
  font-size: var(--text-sm);
  color: var(--color-text);
  margin-bottom: var(--space-2);
}
.form-control {
  width: 100%;
  padding: 0.75em 1em;
  font-size: var(--text-base);
  font-family: var(--font-body);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-md);
  background: #fff;
  color: var(--color-text);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}
.form-control:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 4px rgba(26,86,219,.12);
}

/* ============================================================
   Accessibility
   ============================================================ */
.screen-reader-text {
  clip: rect(1px,1px,1px,1px);
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  word-wrap: normal;
}
.skip-link {
  position: absolute;
  top: -100%;
  left: 0;
  background: var(--color-primary);
  color: #fff;
  padding: var(--space-3) var(--space-6);
  font-weight: 600;
  z-index: var(--z-tooltip);
  transition: top var(--transition-fast);
}
.skip-link:focus { top: 0; }

/* ============================================================
   WordPress Core Classes
   ============================================================ */
.alignleft   { float: left;  margin-right: var(--space-6); margin-bottom: var(--space-4); }
.alignright  { float: right; margin-left:  var(--space-6); margin-bottom: var(--space-4); }
.aligncenter { display: block; margin-inline: auto; margin-bottom: var(--space-4); }
.alignwide   { margin-inline: calc(-1 * var(--space-8)); }
.alignfull   { margin-inline: calc(50% - 50vw); width: 100vw; }

.wp-caption { max-width: 100%; }
.wp-caption-text { font-size: var(--text-sm); color: var(--color-muted); text-align: center; margin-top: var(--space-2); }

.gallery { display: grid; gap: var(--space-3); }
.gallery-columns-2 { grid-template-columns: repeat(2, 1fr); }
.gallery-columns-3 { grid-template-columns: repeat(3, 1fr); }
.gallery-columns-4 { grid-template-columns: repeat(4, 1fr); }
.gallery-item img { width: 100%; height: 200px; object-fit: cover; border-radius: var(--radius-md); }

/* ============================================================
   Elementor Compatibility
   ============================================================ */
.elementor-page .site-main,
.elementor-section { position: relative; }

.elementor-widget-heading .elementor-heading-title { line-height: 1.2; }

/* Elementor Global Kit overrides */
body.elementor-page { --e-global-color-primary: var(--color-primary); }

/* ============================================================
   Responsive Media Queries
   ============================================================ */
@media (max-width: 1280px) { .container { padding-inline: var(--space-8); } }
@media (max-width: 1024px) { .section { padding-block: var(--space-16); } }
@media (max-width: 768px)  {
  .container { padding-inline: var(--space-5); }
  .section { padding-block: var(--space-12); }
  h1 { font-size: clamp(2rem, 8vw, 3rem); }
  h2 { font-size: clamp(1.75rem, 6vw, 2.5rem); }
  .gallery-columns-3, .gallery-columns-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
  .container { padding-inline: var(--space-4); }
  .gallery-columns-2, .gallery-columns-3, .gallery-columns-4 { grid-template-columns: 1fr; }
  .btn { width: 100%; justify-content: center; }
}

/* ============================================================
   Print Styles
   ============================================================ */
@media print {
  *            { box-shadow: none !important; text-shadow: none !important; }
  a[href]::after { content: " (" attr(href) ")"; }
  .no-print, .site-header nav, .site-footer { display: none; }
  body         { font-size: 12pt; color: #000; background: #fff; }
}
