/* =============================================
   Panhandle Land Management - Styles
   ============================================= */

/* CSS Variables for easy theme management */
:root {
    --plm-green: #2e3d26;
    --plm-green-light: #5a7847;
    --plm-green-dark: #25311b;
    --plm-bg-light: #faf8f5;
    --plm-text: #f9f4f9;
    --plm-text-muted: rgba(249, 244, 249, 0.7);
    --transition-speed: 0.3s;
}

/* =============================================
   Base Styles
   ============================================= */

body {
    font-family: 'Source Sans Pro', sans-serif;
    font-weight: 300;
    color: var(--plm-text);
    background-color: var(--plm-green);
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Raleway', sans-serif;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

/* =============================================
   Header
   ============================================= */

#header {
    background-color: rgba(37, 49, 27, 1.0);
    position: fixed;
    top: 0;
    width: 100%;
    height: 5rem;
    z-index: 1000;
    transition: all var(--transition-speed) ease;
    padding: 0 3rem;
}

#header.scrolled {
    background-color: var(--plm-green-dark);
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.2);
    height: 4.5rem;
}

.header-container {
    display: flex;
    align-items: center;
    height: 100%;
    max-width: 1400px;
    margin: 0 auto;
    position: relative;
}

/* Logo - Always visible */
#header .logo-link {
    display: flex;
    align-items: center;
    height: 100%;
    text-decoration: none;
    position: relative;
    z-index: 2;
    flex-shrink: 0;
}

#header .logo {
    height: 50px;
    width: auto;
    display: block;
    transition: all var(--transition-speed) ease;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}

#header.scrolled .logo {
    height: 45px;
}

/* Desktop Navigation - Centered */
.desktop-nav {
    display: none;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1;
}

.desktop-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2.5rem;
}

.desktop-nav li {
    position: relative;
}

.desktop-nav a {
    color: var(--plm-text);
    text-decoration: none;
    font-family: 'Raleway', sans-serif;
    font-weight: 600;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.5rem 0;
    transition: color var(--transition-speed) ease;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.desktop-nav a:hover {
    color: var(--plm-green-light);
}

/* Header CTA Section */
.header-cta {
    display: none;
    align-items: center;
    gap: 1.5rem;
    margin-left: auto;
    position: relative;
    z-index: 2;
}

.phone-link {
    color: var(--plm-text);
    text-decoration: none;
    font-family: 'Source Sans Pro', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    transition: color var(--transition-speed) ease;
    white-space: nowrap;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.phone-link i {
    margin-right: 0.3rem;
    color: var(--plm-green-light);
}

.phone-link:hover {
    color: var(--plm-green-light);
}

.cta-button {
    background-color: var(--plm-green-light);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 4px;
    text-decoration: none;
    font-family: 'Raleway', sans-serif;
    font-weight: 700;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: all var(--transition-speed) ease;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.cta-button:hover {
    background-color: #4a6339;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Mobile Menu Button - Hamburger Style */
#header .menu-btn {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: transparent;
    border: none;
    padding: 0.5rem;
    cursor: pointer;
    width: 40px;
    height: 40px;
    margin-left: auto;
    position: relative;
    z-index: 2;
}

#header .menu-btn span {
    display: block;
    width: 25px;
    height: 3px;
    background-color: var(--plm-text);
    margin: 3px 0;
    transition: all var(--transition-speed) ease;
    box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.5);
}

#header .menu-btn:hover span {
    background-color: var(--plm-green-light);
}

/* Hamburger animation when menu is open */
#header .menu-btn.active span:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

#header .menu-btn.active span:nth-child(2) {
    opacity: 0;
}

#header .menu-btn.active span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

/* Desktop styles - Show navigation, hide mobile button */
@media (min-width: 992px) {
    .desktop-nav {
        display: flex;
    }
    
    .header-cta {
        display: flex;
    }
    
    #header .menu-btn {
        display: none;
    }
}

/* Adjust spacing for medium screens */
@media (min-width: 992px) and (max-width: 1200px) {
    .desktop-nav ul {
        gap: 1.5rem;
    }
    
    .desktop-nav a {
        font-size: 0.9rem;
    }
    
    .header-cta {
        gap: 1rem;
    }
    
    .cta-button {
        padding: 0.65rem 1.2rem;
        font-size: 0.8rem;
    }
    
    .phone-link {
        font-size: 0.95rem;
    }
}

/* =============================================
   Mobile Menu
   ============================================= */

.mobile-menu {
    position: fixed;
    top: 0;
    right: -300px;
    width: 300px;
    height: 100vh;
    background-color: var(--plm-green-dark);
    transition: right var(--transition-speed) ease;
    z-index: 1001;
    padding: 2rem;
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.2);
}

.mobile-menu.active {
    right: 0;
}

.mobile-menu h2 {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    border-bottom: 2px solid rgba(255, 255, 255, 0.125);
    padding-bottom: 1rem;
}

.mobile-menu ul {
    list-style: none;
    padding: 0;
}

.mobile-menu li {
    margin-bottom: 1rem;
}

.mobile-menu a {
    color: var(--plm-text);
    text-decoration: none;
    font-family: 'Raleway', sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-size: 0.9rem;
    transition: color var(--transition-speed) ease;
}

.mobile-menu a:hover {
    color: var(--plm-green-light);
}

.mobile-menu .close-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    color: var(--plm-text);
    font-size: 1.5rem;
    cursor: pointer;
    transition: transform var(--transition-speed) ease;
}

.mobile-menu .close-btn:hover {
    transform: rotate(90deg);
}

/* =============================================
   Banner Section with Hero Headline
   ============================================= */

#banner {
    background-image: 
        linear-gradient(to top, rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.3)),
        url('../images/bg.jpg');
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center center;
    background-attachment: scroll;
    min-height: 70vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 6rem 1rem 4rem;
    position: relative;
    background-color: #1a1a1a;
    margin-top: 5rem;
}

/* WebP background support with fallback */
.webp #banner {
    background-image: 
        linear-gradient(to top, rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.3)),
        url('../images/bg.webp');
}

/* Hero Container */
.hero-container {
    max-width: 1200px;
    margin: 0 auto;
    animation: fadeInUp 1s ease-out;
}

/* Hero Headline Styling */
.hero-headline {
    font-family: 'Oswald', sans-serif;
    font-size: clamp(2.5rem, 7vw, 5rem);
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: var(--plm-text);
    margin-bottom: 1rem;
    text-shadow: 3px 3px 8px rgba(0, 0, 0, 0.7);
    position: relative;
}

/* Split the headline for better mobile display */
.headline-line {
    display: block;
    margin: 0.2em 0;
}

.headline-line:first-child {
    color: var(--plm-text);
}

.headline-line:last-child {
    color: var(--plm-green-light);
    font-weight: 900;
}

/* Hero Tagline */
.hero-tagline {
    font-family: 'Raleway', sans-serif;
    font-size: clamp(1rem, 2vw, 1.3rem);
    font-weight: 300;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--plm-text-muted);
    animation: fadeInUp 1s ease-out 0.3s both;
    text-shadow: 2px 2px 5px rgba(0, 0, 0, 0.6);
    margin-top: 1.5rem;
}

/* Decorative line under headline */
.hero-headline::after {
    content: '';
    display: block;
    width: 100px;
    height: 3px;
    background: var(--plm-green-light);
    margin: 1.5rem auto 0;
    opacity: 0.8;
}

/* =============================================
   Middle Banner Section
   ============================================= */

#midbanner {
    background-color: var(--plm-green-dark);
    padding: 4rem 0;
    text-align: center;
}

#midbanner h2 {
    font-size: 2rem;
    margin-bottom: 1.5rem;
    color: var(--plm-text);
    letter-spacing: 0.15em;
}

#midbanner .intro-text {
    color: var(--plm-text-muted);
    font-size: 1.2rem;
    line-height: 1.8;
    max-width: 800px;
    margin: 0 auto;
}

/* Responsive - Mobile */
@media (max-width: 767px) {
    #midbanner {
        padding: 3rem 1rem;
    }
    
    #midbanner h2 {
        font-size: 1.5rem;
    }
    
    #midbanner .intro-text {
        font-size: 1rem;
    }
}

/* =============================================
   Services Section
   ============================================= */

#services {
    background-color: var(--plm-bg-light);
    padding: 5rem 0;
}

#services h2 {
    font-size: 1.75rem;
    margin-bottom: 1rem;
    border-bottom: 2px solid rgba(255, 255, 255, 0.125);
    padding-bottom: 1rem;
    color: var(--plm-green-dark);
}

#services .intro-text {
    color: var(--plm-green);
    margin-bottom: 3rem;
    font-size: 1.1rem;
    line-height: 1.6;
}

.service-card {
    background-color: var(--plm-bg-light);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: transform var(--transition-speed) ease, 
                box-shadow var(--transition-speed) ease;
    margin-bottom: 2rem;
    height: 100%;
    display: flex;
    flex-direction: column;
}

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

/* Image container with aspect ratio for better responsive behavior */
.service-card picture {
    display: block;
    width: 100%;
    aspect-ratio: 3 / 2;  /* Maintains a 3:2 aspect ratio */
    overflow: hidden;
}

.service-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;  /* Focus on top/center of images */
    transition: transform 0.5s ease;  /* Smooth zoom on hover */
}

/* Subtle zoom effect on card hover */
.service-card:hover img {
    transform: scale(1.05);
}

/* Fallback for browsers that don't support aspect-ratio */
@supports not (aspect-ratio: 3 / 2) {
    .service-card img {
        height: 350px;  /* Fallback to fixed height */
    }
}

/* Optional utility classes for specific image positioning needs */
.service-card.focus-center img {
    object-position: center center;
}

.service-card.focus-bottom img {
    object-position: center bottom;
}

.service-card.focus-faces img {
    object-position: center 25%;  /* Good for images with people/faces */
}

.service-card .card-content {
    padding: 1.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.service-card h3 {
    font-size: 1.2rem;
    color: var(--plm-green-dark);
    margin-bottom: 1rem;
}

.service-card p {
    color: #666;
    line-height: 1.6;
    font-size: 0.95rem;
    flex-grow: 1;
}

/* View All Services Button Container */
.services-cta-container {
    display: flex;
    justify-content: flex-start;
    padding-left: 0;
}

/* View All Services Button */
.btn-services-cta {
    display: inline-block;
    background-color: var(--plm-green-light);
    color: white;
    padding: 0.875rem 2rem;
    border-radius: 5px;
    text-decoration: none;
    font-family: 'Raleway', sans-serif;
    font-weight: 700;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: all var(--transition-speed) ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.btn-services-cta:hover {
    background-color: var(--plm-green);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.btn-services-cta i {
    transition: transform var(--transition-speed) ease;
}

.btn-services-cta:hover i {
    transform: translateX(3px);
}

/* =============================================
   Footer
   ============================================= */

#footer {
    background-image: 
        linear-gradient(to top, rgba(46, 61, 38, 0.8), rgba(46, 61, 38, 0.8)), 
        url('../images/bg.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    padding: 5rem 0 3rem;
    border-top: 3px solid rgba(255, 255, 255, 0.1);
}

/* WebP background support with fallback */
.webp #footer {
    background-image: 
        linear-gradient(to top, rgba(46, 61, 38, 0.8), rgba(46, 61, 38, 0.8)), 
        url('../images/bg.webp');
}

#footer h2 {
    font-size: 1.75rem;
    margin-bottom: 2rem;
}

#footer .form-control {
    background-color: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.125);
    color: var(--plm-text);
    border-radius: 5px;
    padding: 0.75rem;
    margin-bottom: 1rem;
    transition: all var(--transition-speed) ease;
}

#footer .form-control:focus {
    background-color: rgba(255, 255, 255, 0.15);
    border-color: var(--plm-green-light);
    color: var(--plm-text);
    box-shadow: 0 0 0 0.2rem rgba(90, 120, 71, 0.25);
    outline: none;
}

#footer .form-control::placeholder {
    color: var(--plm-text-muted);
}

#footer textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

#footer .btn-submit {
    background-color: var(--plm-green-light);
    border: none;
    color: white;
    padding: 0.875rem 2.25rem;
    font-family: 'Raleway', sans-serif;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-size: 0.8rem;
    border-radius: 5px;
    transition: all var(--transition-speed) ease;
    cursor: pointer;
}

#footer .btn-submit:hover {
    background-color: #4a6339;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

#footer .btn-submit:active {
    transform: translateY(0);
}

#footer .contact-info {
    margin-top: 4rem;
    padding-left: 4rem;
}

/* On mobile, reset to normal spacing */
@media (max-width: 991px) {
    #footer .contact-info {
        margin-top: 3rem;
        padding-left: 0;
    }
}

#footer .contact-info p {
    margin-bottom: 1rem;
    color: var(--plm-text);
    line-height: 1.6;
}

#footer .contact-info a {
    color: var(--plm-text);
    text-decoration: none;
    transition: color var(--transition-speed) ease;
}

#footer .contact-info a:hover {
    color: var(--plm-green-light);
    text-decoration: underline;
}

#footer .copyright {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 2px solid rgba(255, 255, 255, 0.125);
    text-align: center;
    color: var(--plm-text-muted);
    font-size: 0.9rem;
}

/* Footer Icons */
#footer .icon-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1rem;
}

#footer .icon-item i {
    color: var(--plm-green-light);
    width: 20px;
    min-width: 20px;
    text-align: center;
    margin-top: 0.25rem;
    font-size: 1.1rem;
}

#footer .icon-item span,
#footer .icon-item a {
    flex: 1;
    line-height: 1.6;
}

#footer .icon-item a {
    color: var(--plm-text);
    text-decoration: none;
    transition: color var(--transition-speed) ease;
}

#footer .icon-item a:hover {
    color: var(--plm-green-light);
    text-decoration: underline;
}

/* =============================================
   Animations
   ============================================= */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* =============================================
   Responsive - Tablet (768px - 991px)
   ============================================= */

@media (max-width: 991px) {
    .service-card picture {
        aspect-ratio: 16 / 10;  /* Wider aspect ratio for tablets */
    }
    
    /* Fallback for browsers that don't support aspect-ratio */
    @supports not (aspect-ratio: 16 / 10) {
        .service-card img {
            height: 250px;
        }
    }
    
    #services {
        padding: 4rem 0;
    }
    
    #footer {
        padding: 4rem 0 2.5rem;
    }
}

/* =============================================
   Responsive - Mobile (max 767px)
   ============================================= */

@media (max-width: 767px) {
    /* Header adjustments */
    #header {
        padding: 0 1rem;
    }
    
    #header .logo {
        height: 40px;
    }
    
    #header.scrolled .logo {
        height: 35px;
    }
    
    /* Banner adjustments */
    #banner {
        min-height: 60vh;
        background-attachment: scroll;
        padding: 4rem 1rem 3rem;
        margin-top: 4rem;
    }
    
    /* Hero headline mobile adjustments */
    .hero-headline {
        font-size: 2rem;
    }
    
    .hero-tagline {
        font-size: 0.9rem;
    }

    /* Services adjustments */
    #services {
        padding: 3rem 0;
    }

    #services h2 {
        font-size: 1.5rem;
    }
    
    #services .intro-text {
        font-size: 1rem;
    }

    .service-card {
        margin-bottom: 1.5rem;
    }
    
    /* Service card image adjustments for mobile */
    .service-card picture {
        aspect-ratio: 16 / 9;  /* Even wider aspect ratio for mobile to show more content */
    }
    
    /* Fallback for browsers that don't support aspect-ratio */
    @supports not (aspect-ratio: 16 / 9) {
        .service-card img {
            height: 220px;
        }
    }
    
    /* Disable zoom effect on mobile for better performance */
    .service-card:hover img {
        transform: none;
    }
    
    .service-card h3 {
        font-size: 1.1rem;
    }
    
    .service-card p {
        font-size: 0.9rem;
    }
    
    /* Center the View All Services button on mobile */
    .services-cta-container {
        justify-content: center;
        padding: 0 1rem;
    }

    /* Footer adjustments */
    #footer {
        padding: 3rem 0 2rem;
        background-attachment: scroll;
    }

    #footer h2 {
        font-size: 1.5rem;
        margin-bottom: 1.5rem;
    }
    
    #footer .contact-info {
        margin-top: 2rem;
    }
    
    #footer .btn-submit {
        width: 100%;
        padding: 1rem;
    }

    /* Mobile menu adjustments */
    .mobile-menu {
        width: 280px;
        right: -280px;
    }
}

/* =============================================
   Performance Optimizations
   ============================================= */

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Print styles */
@media print {
    #header,
    .mobile-menu,
    #footer form {
        display: none;
    }
    
    body {
        background: white;
        color: black;
    }
    
    .service-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
    }
}
