/* ===================
   PHY Law - Estate Law Firm
   Elegant Professional Design
   =================== */

/* CSS Variables */
:root {
    --primary-color: #1a2a4a;      /* Deep navy blue */
    --secondary-color: #2c3e5c;    /* Lighter navy */
    --accent-color: #c9a961;       /* Warm gold */
    --accent-light: #d4bc7e;       /* Light gold */
    --text-color: #2d2d2d;         /* Dark gray text */
    --text-light: #6b6b6b;         /* Light gray text */
    --bg-light: #f8f6f3;           /* Warm off-white */
    --bg-cream: #fdfcfa;           /* Cream */
    --white: #ffffff;
    --font-heading: 'Playfair Display', Georgia, serif;
    --font-body: 'Open Sans', sans-serif;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.7;
    color: var(--text-color);
    background-color: var(--white);
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.3s ease;
}

ul {
    list-style: none;
}

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

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ===================
   Typography
   =================== */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 600;
    line-height: 1.3;
    color: var(--primary-color);
}

h1 { font-size: 56px; }
h2 { font-size: 42px; }
h3 { font-size: 28px; }
h4 { font-size: 22px; }

/* ===================
   Buttons
   =================== */
.btn {
    display: inline-block;
    padding: 16px 32px;
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    border-radius: 0;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
}

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

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

.btn-outline {
    background-color: transparent;
    color: var(--white);
    border: 2px solid var(--white);
}

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

.btn-outline-dark {
    background-color: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn-outline-dark:hover {
    background-color: var(--primary-color);
    color: var(--white);
}

.btn-large {
    padding: 18px 40px;
    font-size: 15px;
}

/* ===================
   Top Bar
   =================== */
.top-bar {
    background-color: var(--primary-color);
    padding: 10px 0;
    font-size: 13px;
    color: var(--white);
}

.top-bar .container {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 30px;
}

.top-bar a {
    color: var(--white);
    opacity: 0.9;
}

.top-bar a:hover {
    opacity: 1;
    color: var(--accent-color);
}

.top-bar-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ===================
   Header
   =================== */
.main-header {
    background-color: var(--white);
    padding: 20px 0;
    border-bottom: 1px solid rgba(0,0,0,0.08);
}

.main-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
}

.logo-text {
    font-family: var(--font-heading);
    font-size: 28px;
    font-weight: 700;
    color: var(--primary-color);
    letter-spacing: 1px;
}

.logo-text span {
    color: var(--accent-color);
}

.logo-tagline {
    font-size: 11px;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-top: 2px;
}

.main-nav ul {
    display: flex;
    gap: 40px;
}

.main-nav a {
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 600;
    color: var(--text-color);
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 5px 0;
    position: relative;
}

.main-nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--accent-color);
    transition: width 0.3s ease;
}

.main-nav a:hover::after,
.main-nav a.active::after {
    width: 100%;
}

.main-nav a:hover,
.main-nav a.active {
    color: var(--primary-color);
}

.header-cta .btn {
    padding: 14px 28px;
}

/* ===================
   Hero Section
   =================== */
.hero {
    position: relative;
    min-height: 85vh;
    display: flex;
    align-items: center;
    background-color: var(--primary-color);
    overflow: hidden;
}

.hero-background {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url('../images/hero-bg.jpg');
    background-size: cover;
    background-position: center;
    opacity: 0.15;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
}

.hero .container {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
}

.hero-content {
    color: var(--white);
}

.hero-subtitle {
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 3px;
    color: var(--accent-color);
    margin-bottom: 20px;
}

.hero h1 {
    color: var(--white);
    font-size: 52px;
    line-height: 1.2;
    margin-bottom: 25px;
}

.hero p {
    font-size: 18px;
    line-height: 1.8;
    opacity: 0.9;
    margin-bottom: 35px;
    max-width: 500px;
}

.hero-buttons {
    display: flex;
    gap: 15px;
}

.hero-image {
    display: flex;
    justify-content: center;
    align-items: center;
}

.hero-image img {
    max-width: 400px;
    max-height: 500px;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.3);
}

.hero-image-placeholder {
    width: 400px;
    height: 500px;
    background: linear-gradient(180deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0.05) 100%);
    border: 2px solid rgba(255,255,255,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 14px;
    opacity: 0.7;
}

/* ===================
   Intro Section
   =================== */
.intro-section {
    padding: 100px 20px;
    background-color: var(--white);
}

.intro-content {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.intro-content h2 {
    margin-bottom: 25px;
}

.intro-content p {
    font-size: 18px;
    line-height: 1.9;
    color: var(--text-light);
}

.gold-line {
    width: 60px;
    height: 3px;
    background-color: var(--accent-color);
    margin: 30px auto;
}

/* ===================
   Services Section
   =================== */
.services-section {
    padding: 100px 20px;
    background-color: var(--bg-light);
}

.section-header {
    text-align: center;
    margin-bottom: 60px;
}

.section-header h2 {
    margin-bottom: 15px;
}

.section-header p {
    font-size: 18px;
    color: var(--text-light);
    max-width: 600px;
    margin: 0 auto;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

.service-card {
    background-color: var(--white);
    padding: 45px 35px;
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.service-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.1);
}

.service-icon {
    width: 70px;
    height: 70px;
    margin: 0 auto 25px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--bg-light);
    border-radius: 50%;
}

.service-icon span {
    font-size: 28px;
}

.service-card h3 {
    font-size: 22px;
    margin-bottom: 15px;
}

.service-card p {
    font-size: 15px;
    color: var(--text-light);
    line-height: 1.7;
}

/* ===================
   Why Choose Section
   =================== */
.why-choose {
    padding: 100px 20px;
    background-color: var(--white);
}

.why-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 80px;
    align-items: center;
}

.why-image {
    position: relative;
}

.why-image img {
    width: 100%;
    height: 500px;
    object-fit: cover;
    object-position: top;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
}

.why-image-placeholder {
    width: 100%;
    height: 500px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 14px;
    opacity: 0.8;
}

.why-content h2 {
    margin-bottom: 25px;
}

.why-content > p {
    font-size: 17px;
    color: var(--text-light);
    margin-bottom: 35px;
    line-height: 1.8;
}

.why-features {
    list-style: none;
}

.why-features li {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    margin-bottom: 20px;
}

.why-features .check {
    width: 24px;
    height: 24px;
    background-color: var(--accent-color);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
    margin-top: 2px;
}

.why-features span {
    font-size: 16px;
    color: var(--text-color);
}

/* ===================
   Dual Practice Banner
   =================== */
.dual-practice {
    padding: 80px 20px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: var(--white);
    text-align: center;
}

.dual-practice h2 {
    font-size: 36px;
    color: var(--white);
    margin-bottom: 20px;
}

.dual-practice p {
    font-size: 18px;
    opacity: 0.95;
    max-width: 700px;
    margin: 0 auto 30px;
    line-height: 1.8;
}

.dual-practice .btn-outline {
    border-color: var(--white);
    color: var(--white);
}

.dual-practice .btn-outline:hover {
    background-color: var(--white);
    color: var(--primary-color);
}

/* ===================
   CTA Section
   =================== */
.cta-section {
    padding: 100px 20px;
    background-color: var(--primary-color);
    text-align: center;
}

.cta-section h2 {
    color: var(--white);
    margin-bottom: 20px;
}

.cta-section p {
    color: var(--white);
    opacity: 0.9;
    font-size: 18px;
    max-width: 600px;
    margin: 0 auto 35px;
}

/* ===================
   Footer
   =================== */
.main-footer {
    background-color: var(--primary-color);
    color: var(--white);
    padding: 80px 20px 30px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 50px;
    margin-bottom: 50px;
}

.footer-col h4 {
    font-family: var(--font-heading);
    font-size: 18px;
    color: var(--white);
    margin-bottom: 25px;
    font-weight: 600;
}

.footer-about p {
    font-size: 15px;
    line-height: 1.8;
    opacity: 0.8;
    margin-bottom: 20px;
}

.footer-col ul li {
    margin-bottom: 12px;
}

.footer-col ul a {
    font-size: 15px;
    opacity: 0.8;
    transition: opacity 0.3s ease, color 0.3s ease;
}

.footer-col ul a:hover {
    opacity: 1;
    color: var(--accent-color);
}

.footer-contact p {
    font-size: 15px;
    opacity: 0.8;
    margin-bottom: 10px;
    line-height: 1.6;
}

.footer-contact a:hover {
    color: var(--accent-color);
}

.footer-bottom {
    padding-top: 30px;
    border-top: 1px solid rgba(255,255,255,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-bottom p {
    font-size: 14px;
    opacity: 0.7;
}

.footer-legal {
    display: flex;
    gap: 25px;
}

.footer-legal a {
    font-size: 14px;
    opacity: 0.7;
}

.footer-legal a:hover {
    opacity: 1;
    color: var(--accent-color);
}

.site-credit {
    display: block;
    margin-top: 20px;
    font-size: 12px;
    opacity: 0.5;
    transition: opacity 0.3s ease;
}

.site-credit:hover {
    opacity: 0.8;
    color: var(--accent-color);
}

/* ===================
   Page Hero (Inner Pages)
   =================== */
.page-hero {
    position: relative;
    padding: 120px 20px 80px;
    background-color: var(--primary-color);
    text-align: center;
}

.page-hero h1 {
    color: var(--white);
    font-size: 48px;
    margin-bottom: 15px;
}

.page-hero p {
    color: var(--white);
    opacity: 0.9;
    font-size: 18px;
}

/* ===================
   About Page - Attorney Section
   =================== */
.attorney-section {
    padding: 100px 20px;
    background-color: var(--white);
}

.attorney-grid {
    display: grid;
    grid-template-columns: 400px 1fr;
    gap: 60px;
    align-items: start;
}

.attorney-image {
    position: relative;
}

.attorney-image img {
    width: 100%;
    aspect-ratio: 3/4;
    object-fit: cover;
    object-position: top;
    border-radius: 8px;
    box-shadow: 0 15px 40px rgba(0,0,0,0.15);
}

.attorney-placeholder {
    width: 100%;
    aspect-ratio: 3/4;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 14px;
    opacity: 0.9;
}

.attorney-content h2 {
    font-size: 38px;
    margin-bottom: 8px;
}

.attorney-title {
    font-size: 16px;
    color: var(--accent-color);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 20px;
}

.gold-line-left {
    width: 60px;
    height: 3px;
    background-color: var(--accent-color);
    margin-bottom: 25px;
}

.attorney-content p {
    font-size: 17px;
    line-height: 1.9;
    color: var(--text-light);
    margin-bottom: 20px;
}

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

/* ===================
   About Page - Philosophy Section
   =================== */
.philosophy-section {
    padding: 100px 20px;
    background-color: var(--bg-light);
}

.philosophy-content {
    text-align: center;
}

.philosophy-content h2 {
    margin-bottom: 15px;
}

.philosophy-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
    margin-top: 50px;
    text-align: left;
}

.philosophy-item {
    background-color: var(--white);
    padding: 40px 35px;
}

.philosophy-item h3 {
    font-size: 22px;
    margin-bottom: 15px;
    color: var(--primary-color);
}

.philosophy-item p {
    font-size: 15px;
    line-height: 1.8;
    color: var(--text-light);
}

/* ===================
   About Page - Credentials Section
   =================== */
.credentials-section {
    padding: 100px 20px;
    background-color: var(--white);
}

.credentials-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
    margin-top: 50px;
}

.credential-item {
    text-align: center;
    padding: 40px 25px;
    border: 1px solid rgba(0,0,0,0.08);
}

.credential-item h4 {
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--accent-color);
    margin-bottom: 15px;
    font-family: var(--font-body);
    font-weight: 600;
}

.credential-item p {
    font-size: 15px;
    line-height: 1.7;
    color: var(--text-color);
}

.credential-item em {
    color: var(--text-light);
}

/* ===================
   Services Page - Intro
   =================== */
.services-intro {
    padding: 100px 20px;
    background-color: var(--white);
}

/* ===================
   Services Page - Service Details
   =================== */
.service-detail {
    padding: 100px 20px;
    background-color: var(--white);
}

.service-detail.alt-bg {
    background-color: var(--bg-light);
}

.service-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
}

.service-detail-grid.reverse {
    direction: rtl;
}

.service-detail-grid.reverse > * {
    direction: ltr;
}

.service-detail-content h2 {
    font-size: 36px;
    margin-bottom: 10px;
}

.service-detail-content > p {
    font-size: 17px;
    line-height: 1.9;
    color: var(--text-light);
    margin-bottom: 25px;
}

.service-features {
    list-style: none;
    margin-bottom: 30px;
}

.service-features li {
    position: relative;
    padding-left: 28px;
    margin-bottom: 12px;
    font-size: 15px;
    color: var(--text-color);
}

.service-features li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 8px;
    width: 8px;
    height: 8px;
    background-color: var(--accent-color);
}

.service-note {
    margin-top: 25px;
    padding: 20px;
    background-color: var(--bg-light);
    border-left: 3px solid var(--accent-color);
    font-size: 15px;
    line-height: 1.7;
    color: var(--text-color);
}

.service-detail-image img {
    width: 100%;
    aspect-ratio: 4/3;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}

.service-placeholder {
    width: 100%;
    aspect-ratio: 4/3;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 14px;
    opacity: 0.9;
}

/* ===================
   Services Page - Process Section
   =================== */
.process-section {
    padding: 100px 20px;
    background-color: var(--primary-color);
}

.process-section .section-header h2 {
    color: var(--white);
}

.process-section .section-header p {
    color: var(--white);
    opacity: 0.9;
}

.process-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
    margin-top: 50px;
}

.process-step {
    text-align: center;
    padding: 30px 20px;
}

.process-number {
    width: 60px;
    height: 60px;
    margin: 0 auto 25px;
    background-color: var(--accent-color);
    color: var(--white);
    font-family: var(--font-heading);
    font-size: 24px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.process-step h3 {
    color: var(--white);
    font-size: 20px;
    margin-bottom: 15px;
}

.process-step p {
    color: var(--white);
    opacity: 0.85;
    font-size: 15px;
    line-height: 1.7;
}

/* ===================
   Resources Page - Intro
   =================== */
.resources-intro {
    padding: 100px 20px;
    background-color: var(--white);
}

/* ===================
   Resources Page - FAQ Section
   =================== */
.faq-section {
    padding: 100px 20px;
    background-color: var(--bg-light);
}

.faq-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
    margin-top: 50px;
}

.faq-item {
    background-color: var(--white);
    padding: 35px;
}

.faq-item h3 {
    font-size: 20px;
    margin-bottom: 15px;
    color: var(--primary-color);
}

.faq-item p {
    font-size: 15px;
    line-height: 1.8;
    color: var(--text-light);
}

/* ===================
   Resources Page - Guides Section
   =================== */
.guides-section {
    padding: 100px 20px;
    background-color: var(--white);
}

.guides-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    margin-top: 50px;
}

.guide-card {
    background-color: var(--bg-light);
    padding: 45px 35px;
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.guide-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.1);
}

.guide-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 25px;
    background-color: var(--accent-color);
    color: var(--white);
    font-family: var(--font-heading);
    font-size: 24px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.guide-card h3 {
    font-size: 20px;
    margin-bottom: 15px;
    color: var(--primary-color);
}

.guide-card p {
    font-size: 15px;
    line-height: 1.7;
    color: var(--text-light);
    margin-bottom: 25px;
}

/* ===================
   Resources Page - Glossary Section
   =================== */
.glossary-section {
    padding: 100px 20px;
    background-color: var(--bg-light);
}

.glossary-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 25px;
    margin-top: 50px;
}

.glossary-item {
    background-color: var(--white);
    padding: 30px 25px;
}

.glossary-item h4 {
    font-family: var(--font-heading);
    font-size: 18px;
    color: var(--primary-color);
    margin-bottom: 10px;
}

.glossary-item p {
    font-size: 14px;
    line-height: 1.7;
    color: var(--text-light);
}

/* ===================
   Contact Page
   =================== */
.contact-section {
    padding: 100px 20px;
    background-color: var(--white);
}

.contact-grid {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 60px;
    align-items: start;
}

.contact-form-wrapper h2 {
    font-size: 32px;
    margin-bottom: 10px;
}

.contact-form-wrapper > p {
    font-size: 16px;
    color: var(--text-light);
    margin-bottom: 35px;
    line-height: 1.7;
}

.contact-form {
    margin-top: 30px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 8px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 14px 16px;
    font-family: var(--font-body);
    font-size: 15px;
    color: var(--text-color);
    background-color: var(--bg-light);
    border: 1px solid transparent;
    transition: border-color 0.3s ease, background-color 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent-color);
    background-color: var(--white);
}

.form-group select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b6b6b' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

.contact-info-wrapper {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.contact-info-card {
    background-color: var(--bg-light);
    padding: 40px 35px;
}

.contact-info-card.accent {
    background-color: var(--primary-color);
    color: var(--white);
}

.contact-info-card h3 {
    font-size: 22px;
    margin-bottom: 25px;
}

.contact-info-card.accent h3 {
    color: var(--white);
}

.contact-info-card.accent p {
    color: var(--white);
    opacity: 0.9;
    font-size: 15px;
    line-height: 1.8;
    margin-bottom: 15px;
}

.contact-info-card.accent p:last-child {
    margin-bottom: 0;
}

.contact-info-item {
    margin-bottom: 25px;
}

.contact-info-item:last-child {
    margin-bottom: 0;
}

.contact-info-item h4 {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--accent-color);
    margin-bottom: 8px;
    font-family: var(--font-body);
    font-weight: 600;
}

.contact-info-item p {
    font-size: 16px;
    color: var(--text-color);
    line-height: 1.6;
}

.contact-info-item a {
    color: var(--text-color);
    transition: color 0.3s ease;
}

.contact-info-item a:hover {
    color: var(--accent-color);
}

/* ===================
   Responsive
   =================== */
@media (max-width: 1024px) {
    .hero .container {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .hero-content {
        max-width: 600px;
        margin: 0 auto;
    }

    .hero p {
        margin-left: auto;
        margin-right: auto;
    }

    .hero-buttons {
        justify-content: center;
    }

    .hero-image {
        display: none;
    }

    .why-grid {
        grid-template-columns: 1fr;
        gap: 50px;
    }

    .footer-grid {
        grid-template-columns: 1fr 1fr;
    }

    .attorney-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .attorney-image {
        max-width: 350px;
        margin: 0 auto;
    }

    .credentials-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .service-detail-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .service-detail-grid.reverse {
        direction: ltr;
    }

    .process-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .guides-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .glossary-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .contact-grid {
        grid-template-columns: 1fr;
        gap: 50px;
    }
}

@media (max-width: 768px) {
    /* Prevent horizontal scroll */
    html, body {
        overflow-x: hidden;
        max-width: 100vw;
    }

    h1 { font-size: 38px; }
    h2 { font-size: 32px; }

    .main-header {
        padding: 15px 0;
    }

    .main-header .container {
        flex-wrap: wrap;
        gap: 15px;
        padding: 0 15px;
    }

    .main-nav {
        width: 100%;
        overflow-x: hidden;
    }

    .main-nav ul {
        gap: 15px;
        flex-wrap: wrap;
        justify-content: center;
    }

    .main-nav a {
        font-size: 14px;
        padding: 5px 8px;
    }

    .btn-primary {
        padding: 10px 20px;
        font-size: 13px;
    }

    .hero {
        min-height: 70vh;
    }

    .hero h1 {
        font-size: 36px;
    }

    .services-grid {
        grid-template-columns: 1fr;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .footer-bottom {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    .philosophy-grid {
        grid-template-columns: 1fr;
    }

    .credentials-grid {
        grid-template-columns: 1fr;
    }

    .page-hero {
        padding: 80px 20px 60px;
    }

    .page-hero h1 {
        font-size: 36px;
    }

    .attorney-section,
    .philosophy-section,
    .credentials-section,
    .service-detail,
    .process-section,
    .services-intro {
        padding: 60px 20px;
    }

    .process-grid {
        grid-template-columns: 1fr;
    }

    .service-detail-content h2 {
        font-size: 28px;
    }

    .faq-grid {
        grid-template-columns: 1fr;
    }

    .guides-grid {
        grid-template-columns: 1fr;
    }

    .glossary-grid {
        grid-template-columns: 1fr;
    }

    .faq-section,
    .guides-section,
    .glossary-section,
    .resources-intro,
    .contact-section {
        padding: 60px 20px;
    }

    .form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }

    /* Prevent any element from causing overflow */
    .hero-content,
    .container,
    section {
        max-width: 100%;
        overflow-x: hidden;
    }
}
