/* =======================================
-- GLOBAL & THEME VARIABLES -- 
=======================================
*/
:root {
  --primary-color: #0a1931; /* Deep Navy Blue */
  --accent-color: #ffd700; /* Vibrant Gold */
  --text-color-light: #f0f0f0;
  --text-color-dark: #333;
  --text-color-muted: #b0b0b0;
  --hover-bg: #1a345b;
  --transition-speed: 0.3s;
  --max-width: 1400px;
}

/* Base style reset for a clean canvas */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: "Inter", sans-serif;
  color: var(--text-color-dark);
  line-height: 1.6;
}

.header-spacer {
  /* Height matches the fixed header height (80px in desktop navbar) */
  height: 80px;
}

/* Reusable Section Styles */
.section-container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 60px 20px;
}

.section-heading {
  text-align: center;
  font-size: 2.2rem;
  font-weight: 800;
  margin-bottom: 40px;
  color: var(--primary-color);
  position: relative;
  display: inline-block;
}

.section-heading::after {
  content: "";
  display: block;
  width: 60px;
  height: 4px;
  background-color: var(--accent-color);
  margin: 10px auto 0;
  border-radius: 2px;
}

.cta-button {
  display: inline-block;
  background-color: var(--accent-color);
  color: var(--primary-color);
  padding: 12px 30px;
  border: none;
  border-radius: 50px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  text-decoration: none;
  box-shadow: 0 4px 10px rgba(255, 215, 0, 0.5);
  transition: background-color var(--transition-speed),
    transform var(--transition-speed);
}

.cta-button:hover {
  background-color: #fff;
  color: var(--primary-color);
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(255, 215, 0, 0.8);
}

/* =======================================
-- 1. NAVBAR STYLES --
=======================================
*/
#main-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background-color: var(--primary-color);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  z-index: 1000;
  transition: all var(--transition-speed) ease;
}

.navbar-container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
  height: 80px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo-area {
  display: flex;
  align-items: center;
  text-decoration: none;
  color: var(--accent-color);
  font-size: 1.8rem;
  font-weight: 700;
}

.logo-img {
  height: 100px;
  width: auto;
  border-radius: 8px;
  margin-right: 10px;
}

.nav-links ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  gap: 30px;
}

.nav-links a {
  text-decoration: none;
  color: var(--text-color-light);
  font-weight: 500;
  padding: 10px 0;
  display: block;
  position: relative;
  transition: color var(--transition-speed) ease;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.nav-links a::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 3px;
  background-color: var(--accent-color);
  transition: width var(--transition-speed) ease,
    left var(--transition-speed) ease;
}

.nav-links a:hover {
  color: var(--accent-color);
}

.nav-links a:hover::after {
  width: 100%;
  left: 0;
}

.dropdown {
  position: relative;
  padding: 0 0 5px 0;
}

.dropdown-content {
  display: none;
  position: absolute;
  min-width: 200px;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  background-color: #fff;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.25);
  border-radius: 8px;
  overflow: hidden;
  border-top: 5px solid var(--accent-color);
  z-index: 10;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, transform 0.2s ease;
  transform: translate(-50%, 5px);
}

.dropdown:hover .dropdown-content {
  display: block;
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
}

.dropdown-content a {
  color: var(--primary-color);
  padding: 12px 16px;
  text-decoration: none;
  display: block;
  font-weight: 400;
  transition: background-color 0.2s ease, color 0.2s ease;
  text-transform: none;
  letter-spacing: normal;
}

.dropdown-content a:hover {
  background-color: var(--accent-color);
  color: var(--primary-color);
  font-weight: 600;
}

.login-btn {
  background-color: var(--accent-color);
  color: var(--primary-color);
  padding: 10px 25px;
  border: none;
  border-radius: 50px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  box-shadow: 0 4px 10px rgba(255, 215, 0, 0.5);
  transition: background-color var(--transition-speed),
    transform var(--transition-speed), box-shadow var(--transition-speed);
  text-decoration: none;
}

.login-btn:hover {
  background-color: #fff;
  color: var(--primary-color);
  transform: scale(1.05);
  box-shadow: 0 6px 15px rgba(255, 215, 0, 0.8);
}

.mobile-toggle {
  display: none;
  width: 30px;
  height: 25px;
  background: transparent;
  border: none;
  cursor: pointer;
  position: relative;
  z-index: 10;
  padding: 0;
  margin: 0;
}

.bar {
  display: block;
  width: 100%;
  height: 3px;
  background-color: var(--accent-color);
  border-radius: 2px;
  margin: 5px 0;
  transition: all 0.3s ease-in-out;
}

.mobile-toggle.is-active .bar:nth-child(2) {
  opacity: 0;
}
.mobile-toggle.is-active .bar:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}
.mobile-toggle.is-active .bar:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

.mobile-menu-content {
  max-height: 0;
  overflow: hidden;
  background-color: var(--hover-bg);
  transition: max-height 0.4s ease-in-out;
}

.mobile-menu-content.open {
  max-height: 500px;
  padding: 10px 0;
}

.mobile-link {
  display: block;
  color: var(--text-color-light);
  padding: 12px 30px;
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  font-weight: 500;
  text-transform: uppercase;
  transition: background-color var(--transition-speed),
    color var(--transition-speed);
}

.mobile-link:hover {
  background-color: var(--primary-color);
  color: var(--accent-color);
}

.mobile-login-btn {
  background-color: var(--accent-color);
  color: var(--primary-color);
  text-align: center;
  margin: 15px 30px;
  border-radius: 4px;
  padding: 10px 30px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

.mobile-login-btn:hover {
  background-color: #fff;
}

.sub-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.mobile-sub-menu {
  max-height: 0;
  overflow: hidden;
  background-color: rgba(0, 0, 0, 0.1);
  transition: max-height 0.3s ease-in-out;
}

.mobile-sub-menu a {
  color: var(--text-color-light);
  display: block;
  padding: 8px 30px 8px 45px;
  text-transform: none;
  font-size: 0.95rem;
  font-weight: 300;
  transition: background-color 0.2s;
}

.mobile-sub-menu a:hover {
  background-color: var(--primary-color);
  color: var(--accent-color);
}

/* =======================================
-- 2. FOOTER STYLES --
=======================================
*/
#main-footer {
  width: 100%;
  background-color: var(--primary-color);
  box-shadow: 0 -8px 15px rgba(0, 0, 0, 0.4);
  font-family: "Inter", sans-serif;
  color: var(--text-color-light);
  padding-top: 30px;
  padding-bottom: 0;
  margin-top: 80px;
}

.footer-content-wrap {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px 30px 20px;
  display: grid;
  gap: 30px;
  grid-template-columns: 2fr 1fr 1fr 2fr 2fr;
}

.footer-section .section-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--accent-color);
  margin-bottom: 20px;
  text-transform: uppercase;
  letter-spacing: 1px;
  position: relative;
}

.footer-section .section-title::after {
  content: "";
  display: block;
  width: 40px;
  height: 3px;
  background-color: var(--accent-color);
  margin-top: 5px;
  border-radius: 2px;
}

.footer-section .logo-img {
  height: 150px;
  width: 100px;
  border-radius: 4px;
  margin-right: 10px;
  /* box-shadow: 0 0 8px rgba(255, 215, 0, 0.3); */
}

.links-col ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.links-col li {
  margin-bottom: 8px;
}

.links-col a {
  color: var(--text-color-muted);
  text-decoration: none;
  font-size: 0.95rem;
  transition: color var(--transition-speed);
}

.links-col a:hover {
  color: var(--accent-color);
  text-shadow: 0 0 5px rgba(255, 215, 0, 0.5);
}

.contact-info p,
.contact-info address {
  margin-bottom: 8px;
  line-height: 1.4;
  color: var(--text-color-muted);
}
.contact-info a {
  color: var(--text-color-muted);
  text-decoration: none;
  transition: color 0.2s;
}
.contact-info a:hover {
  color: var(--accent-color);
}

.social-links {
  display: flex;
  gap: 15px;
  margin-bottom: 30px;
}

.social-icon {
  width: 30px;
  height: 30px;
  fill: var(--text-color-light);
  transition: fill var(--transition-speed), transform var(--transition-speed);
}

.social-links a:hover .social-icon {
  fill: var(--accent-color);
  transform: scale(1.1);
}

#newsletter-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

#email-field {
  padding: 12px;
  border: 2px solid var(--hover-bg);
  border-radius: 6px;
  background-color: var(--hover-bg);
  color: var(--text-color-light);
  font-size: 1rem;
  transition: border-color 0.2s;
}

#email-field:focus {
  outline: none;
  border-color: var(--accent-color);
  box-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

.subscribe-btn {
  background-color: var(--accent-color);
  color: var(--primary-color);
  border: none;
  padding: 12px;
  border-radius: 6px;
  font-weight: 700;
  cursor: pointer;
  text-transform: uppercase;
  transition: background-color 0.3s, transform 0.2s;
}

.subscribe-btn:hover {
  background-color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(255, 215, 0, 0.8);
}

.footer-bottom {
  border-top: 1px solid var(--hover-bg);
  padding: 15px 20px;
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-color-muted);
}

/* =======================================
-- 3. HOME PAGE SPECIFIC STYLES (Example) --
=======================================
*/
/* Note: Include your Home page styles here if you used them in the index.html file */

/* =======================================
-- 4. ABOUT PAGE SPECIFIC STYLES (Example) --
=======================================
*/
.hero-intro {
  background-color: var(--hover-bg);
  color: var(--text-color-light);
  padding: 80px 20px;
  text-align: center;
}
/* ... (Other About page styles here if you merged them) ... */

/* =======================================
-- 5. CONTACT PAGE SPECIFIC STYLES (Example) --
=======================================
*/
.contact-hero {
  background-color: var(--hover-bg);
  color: var(--text-color-light);
  padding: 80px 20px;
  text-align: center;
}

.contact-hero .page-title {
  font-size: 3rem;
  font-weight: 900;
  margin-bottom: 15px;
}

.contact-hero .page-subtitle {
  font-size: 1.2rem;
  max-width: 800px;
  margin: 0 auto;
  color: var(--text-color-muted);
}

.contact-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 40px;
  padding-top: 80px;
  padding-bottom: 80px;
  background-color: #ffffff;
  max-width: var(--max-width);
  margin: 0 auto;
}

.form-container {
  padding: 30px;
  background-color: #f7f7f7;
  border-radius: 8px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

.form-row {
  display: flex;
  gap: 20px;
  margin-bottom: 20px;
}
/* ... (Remaining Contact styles here if you merged them) ... */

/* =======================================
-- 6. SERVICE PAGE COMMON STYLES (All 6 Pages) --
=======================================
*/

/* --- Unique Split Hero Section --- */
.law-hero {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 80px 20px;
  background-color: var(--primary-color);
  color: var(--text-color-light);
}

.hero-text-content {
  flex: 1;
  padding-right: 40px;
}

.hero-text-content .tagline {
  color: var(--accent-color);
  font-size: 1rem;
  font-weight: 600;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.hero-text-content h1 {
  font-size: 3.2rem;
  font-weight: 900;
  margin-bottom: 20px;
}

.hero-text-content .description {
  font-size: 1.1rem;
  color: var(--text-color-muted);
  margin-bottom: 30px;
}

.hero-image-placeholder {
  flex: 1;
  max-width: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
}

.hero-image-placeholder .image-box img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

/* --- Services Grid Section (Icon Cards) --- */
.services-grid-section {
  padding: 80px 20px;
  background-color: #f0f0f0;
  text-align: center;
}

.services-grid-section .section-heading {
  margin-bottom: 10px;
}

.services-grid-section .sub-heading {
  font-size: 1.1rem;
  color: var(--text-color-dark);
  margin-bottom: 40px;
}

/* =======================================
-- 4. SERVICE PAGE COMMON STYLES (All 6 Pages) --
=======================================
*/
/* ... (Existing styles for .law-hero, .hero-text-content, etc. remain unchanged) ... */

/* --- Services Grid Section (Icon Cards) --- */
.services-grid-section {
  padding: 80px 20px;
  background-color: #f0f0f0;
  text-align: center;
}

.services-grid-section .section-heading {
  margin-bottom: 10px;
}

.services-grid-section .sub-heading {
  font-size: 1.1rem;
  color: var(--text-color-dark);
  margin-bottom: 40px;
}

/* --- KEY CHANGE: Ensures 3 grids per row on large screens --- */
.services-grid {
  display: grid;
  /* This line ensures 3 columns are displayed when width allows */
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
}

@media (min-width: 1200px) {
  /* Explicitly lock to 3 columns on desktop for perfect alignment */
  .services-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}
/* ----------------------------------------------------------- */

.service-icon-card {
  padding: 30px;
  background-color: #ffffff;
  border-radius: 8px;
  text-align: center;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  transition: transform 0.3s, box-shadow 0.3s;
}

.service-icon-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.15);
}
/* ... (Remaining Service page common styles and responsiveness remain unchanged) ... */

/* =======================================
-- 5. RESPONSIVENESS (Combined) --
=======================================
*/

/* ... (Existing media queries remain unchanged) ... */

@media (max-width: 900px) {
  /* SERVICE PAGE ADJUSTMENTS */
  /* This ensures 2 columns on tablets */
  .services-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  /* ... (rest of 900px media query) ... */
}

@media (max-width: 600px) {
  /* SERVICE PAGE ADJUSTMENTS */
  /* This ensures 1 column on small mobile devices */
  .services-grid {
    grid-template-columns: 1fr;
  }
  /* ... (rest of 600px media query) ... */
}

/* --- Why Stackly Section (Unique Block) --- */
.why-stackly-section {
  background-color: var(--hover-bg);
  color: var(--text-color-light);
  padding: 80px 20px;
  text-align: center;
}

.why-stackly-section .why-content {
  max-width: 900px;
  margin: 0 auto;
}

.why-stackly-section h2 {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--accent-color);
  margin-bottom: 40px;
}

.why-stackly-section .feature-list {
  display: flex;
  justify-content: space-between;
  gap: 30px;
  margin-bottom: 30px;
}

.why-stackly-section .feature-list p {
  flex: 1;
  border-left: 3px solid var(--accent-color);
  padding-left: 15px;
  text-align: left;
  color: var(--text-color-muted);
}

.why-stackly-section .feature-list strong {
  color: var(--text-color-light);
  font-weight: 700;
}

.learn-more-link {
  color: var(--accent-color);
  text-decoration: none;
  font-weight: 600;
  text-transform: uppercase;
  transition: color 0.2s;
}
.learn-more-link:hover {
  color: #fff;
}

/* =======================================
-- 7. RESPONSIVENESS (Combined) --
=======================================
*/

@media (max-width: 1024px) {
  /* NAVBAR RESPONSIVENESS */
  .nav-links,
  .desktop-only {
    display: none;
  }
  .mobile-toggle {
    display: block;
  }
  .navbar-container {
    height: 70px;
  }
  .header-spacer {
    height: 70px;
  }

  /* FOOTER RESPONSIVENESS */
  .footer-content-wrap {
    grid-template-columns: repeat(3, 1fr);
  }

  /* HERO HEADERS */
  .contact-hero .page-title,
  .careers-hero .hero-title {
    font-size: 2.5rem;
  }

  /* SERVICE PAGE RESPONSIVENESS */
  .law-hero {
    flex-direction: column;
    text-align: center;
    padding-top: 60px;
    padding-bottom: 60px;
  }
  .hero-text-content {
    padding-right: 0;
    margin-bottom: 30px;
  }
  .hero-image-placeholder {
    max-width: 100%;
  }
}

@media (max-width: 900px) {
  /* SERVICE PAGE ADJUSTMENTS */
  .services-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .law-hero .hero-text-content h1 {
    font-size: 2.5rem;
  }
  .why-stackly-section .feature-list {
    flex-direction: column;
  }
  .why-stackly-section .feature-list p {
    text-align: center;
    border-left: none;
    border-bottom: 1px dashed var(--text-color-muted);
    padding-left: 0;
    padding-bottom: 15px;
  }

  /* CONTACT: Stack form and map vertically */
  .contact-grid {
    grid-template-columns: 1fr;
    gap: 30px;
  }
  #google-map-placeholder {
    height: 350px;
  }

  /* CAREER: Tablet adjustments */
  .culture-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  /* FOOTER RESPONSIVENESS */
  .footer-content-wrap {
    grid-template-columns: repeat(2, 1fr);
  }
  .brand-info {
    grid-column: span 2;
    text-align: center;
  }

  /* HERO HEADERS */
  .contact-hero .page-title,
  .careers-hero .hero-title {
    font-size: 2.2rem;
  }
}

@media (max-width: 600px) {
  /* SERVICE PAGE ADJUSTMENTS */
  .law-hero .hero-text-content h1 {
    font-size: 2rem;
  }
  .services-grid {
    grid-template-columns: 1fr;
  }
  .why-stackly-section h2 {
    font-size: 2rem;
  }

  /* CONTACT: Mobile form stack */
  .form-row {
    flex-direction: column;
    gap: 0;
  }
  .form-row .form-group {
    margin-bottom: 20px;
  }
  .address-box {
    text-align: center;
  }
  .map-link {
    display: inline;
    margin: 0 10px;
  }

  /* CAREER: Mobile stack */
  .job-card {
    flex-direction: column;
    align-items: flex-start;
    padding: 20px;
    gap: 15px;
  }
  .job-card .job-info,
  .job-card .apply-btn {
    width: 100%;
  }
  .culture-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 500px) {
  /* FOOTER RESPONSIVENESS (Full Stack) */
  .footer-content-wrap {
    grid-template-columns: 1fr;
  }
  .brand-info {
    grid-column: span 1;
  }
  .links-col,
  .contact-info,
  .social-newsletter {
    text-align: center;
  }
  #newsletter-form {
    flex-direction: column;
    max-width: 300px;
    margin: 0 auto;
  }
  #email-field,
  .subscribe-btn {
    width: 100%;
  }
}
